From 477e1dece9166fb13825c4ae416b030d8f70ccb9 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Mon, 9 Sep 2024 03:26:52 +0200 Subject: [PATCH 001/201] mixin computed vars should only be applied to highest level state (#3833) --- reflex/state.py | 5 ++++- tests/test_state.py | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/reflex/state.py b/reflex/state.py index c94adb39d..01c1bb7c9 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -431,8 +431,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): return [ v for mixin in cls._mixins() + [cls] - for v in mixin.__dict__.values() + for name, v in mixin.__dict__.items() if isinstance(v, (ComputedVar, ImmutableComputedVar)) + and name not in cls.inherited_vars ] @classmethod @@ -560,6 +561,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for mixin in cls._mixins(): for name, value in mixin.__dict__.items(): + if name in cls.inherited_vars: + continue if isinstance(value, (ComputedVar, ImmutableComputedVar)): fget = cls._copy_fn(value.fget) newcv = value._replace( diff --git a/tests/test_state.py b/tests/test_state.py index ba8fc592f..9efda3454 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -3161,6 +3161,15 @@ class MixinState(State, mixin=True): num: int = 0 _backend: int = 0 + @rx.var(cache=True) + def computed(self) -> str: + """A computed var on mixin state. + + Returns: + A computed value. + """ + return "" + class UsesMixinState(MixinState, State): """A state that uses the mixin state.""" @@ -3168,8 +3177,26 @@ class UsesMixinState(MixinState, State): pass +class ChildUsesMixinState(UsesMixinState): + """A child state that uses the mixin state.""" + + pass + + def test_mixin_state() -> None: """Test that a mixin state works correctly.""" assert "num" in UsesMixinState.base_vars assert "num" in UsesMixinState.vars assert UsesMixinState.backend_vars == {"_backend": 0} + + assert "computed" in UsesMixinState.computed_vars + assert "computed" in UsesMixinState.vars + + +def test_child_mixin_state() -> None: + """Test that mixin vars are only applied to the highest state in the hierarchy.""" + assert "num" in ChildUsesMixinState.inherited_vars + assert "num" not in ChildUsesMixinState.base_vars + + assert "computed" in ChildUsesMixinState.inherited_vars + assert "computed" not in ChildUsesMixinState.computed_vars From fd13e559c6eb18d08ece079fe544bff3f35b39d8 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Mon, 9 Sep 2024 03:29:37 +0200 Subject: [PATCH 002/201] improve state hierarchy validation, drop old testing special case (#3894) --- reflex/app.py | 7 +++---- reflex/state.py | 20 +++++--------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index a3094885d..9e5c2541a 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -269,13 +269,12 @@ class App(MiddlewareMixin, LifespanMixin, Base): "`connect_error_component` is deprecated, use `overlay_component` instead" ) super().__init__(**kwargs) - base_state_subclasses = BaseState.__subclasses__() # Special case to allow test cases have multiple subclasses of rx.BaseState. - if not is_testing_env() and len(base_state_subclasses) > 1: - # Only one Base State class is allowed. + if not is_testing_env() and BaseState.__subclasses__() != [State]: + # Only rx.State is allowed as Base State subclass. raise ValueError( - "rx.BaseState cannot be subclassed multiple times. use rx.State instead" + "rx.BaseState cannot be subclassed directly. Use rx.State instead" ) if "breakpoints" in self.style: diff --git a/reflex/state.py b/reflex/state.py index 01c1bb7c9..5dfdf3d8d 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -495,21 +495,11 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if cls.get_name() in set( c.get_name() for c in parent_state.class_subclasses ): - if is_testing_env(): - # Clear existing subclass with same name when app is reloaded via - # utils.prerequisites.get_app(reload=True) - parent_state.class_subclasses = set( - c - for c in parent_state.class_subclasses - if c.get_name() != cls.get_name() - ) - else: - # During normal operation, subclasses cannot have the same name, even if they are - # defined in different modules. - raise StateValueError( - f"The substate class '{cls.get_name()}' has been defined multiple times. " - "Shadowing substate classes is not allowed." - ) + # This should not happen, since we have added module prefix to state names in #3214 + raise StateValueError( + f"The substate class '{cls.get_name()}' has been defined multiple times. " + "Shadowing substate classes is not allowed." + ) # Track this new subclass in the parent state's subclasses set. parent_state.class_subclasses.add(cls) From 99ffbc8c399dc1b03d927c048a7b12ae70bf3003 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Mon, 9 Sep 2024 03:35:47 +0200 Subject: [PATCH 003/201] fix var dependency dicts (#3842) --- reflex/state.py | 23 ++++++++++---------- tests/test_app.py | 11 +--------- tests/test_state.py | 52 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 22 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 5dfdf3d8d..abf585513 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -584,6 +584,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): cls.event_handlers[name] = handler setattr(cls, name, handler) + # Initialize per-class var dependency tracking. + cls._computed_var_dependencies = defaultdict(set) + cls._substate_var_dependencies = defaultdict(set) cls._init_var_dependency_dicts() @staticmethod @@ -653,10 +656,6 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Additional updates tracking dicts for vars and substates that always need to be recomputed. """ - # Initialize per-class var dependency tracking. - cls._computed_var_dependencies = defaultdict(set) - cls._substate_var_dependencies = defaultdict(set) - inherited_vars = set(cls.inherited_vars).union( set(cls.inherited_backend_vars), ) @@ -1006,20 +1005,20 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Args: args: a dict of args """ + if not args: + return def argsingle_factory(param): - @ComputedVar def inner_func(self) -> str: return self.router.page.params.get(param, "") - return inner_func + return ComputedVar(fget=inner_func, cache=True) def arglist_factory(param): - @ComputedVar def inner_func(self) -> List: return self.router.page.params.get(param, []) - return inner_func + return ComputedVar(fget=inner_func, cache=True) for param, value in args.items(): if value == constants.RouteArgType.SINGLE: @@ -1033,8 +1032,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore setattr(cls, param, func) - # Reinitialize dependency tracking dicts. - cls._init_var_dependency_dicts() + # Reinitialize dependency tracking dicts. + cls._init_var_dependency_dicts() def __getattribute__(self, name: str) -> Any: """Get the state var. @@ -3600,5 +3599,7 @@ def reload_state_module( if subclass.__module__ == module and module is not None: state.class_subclasses.remove(subclass) state._always_dirty_substates.discard(subclass.get_name()) - state._init_var_dependency_dicts() + state._computed_var_dependencies = defaultdict(set) + state._substate_var_dependencies = defaultdict(set) + state._init_var_dependency_dicts() state.get_class_substate.cache_clear() diff --git a/tests/test_app.py b/tests/test_app.py index f933149f1..ab7b50bdf 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -906,7 +906,7 @@ class DynamicState(BaseState): """Increment the counter var.""" self.counter = self.counter + 1 - @computed_var + @computed_var(cache=True) def comp_dynamic(self) -> str: """A computed var that depends on the dynamic var. @@ -1049,9 +1049,6 @@ async def test_dynamic_route_var_route_change_completed_on_load( assert on_load_update == StateUpdate( delta={ state.get_name(): { - # These computed vars _shouldn't_ be here, because they didn't change - arg_name: exp_val, - f"comp_{arg_name}": exp_val, "loaded": exp_index + 1, }, }, @@ -1073,9 +1070,6 @@ async def test_dynamic_route_var_route_change_completed_on_load( assert on_set_is_hydrated_update == StateUpdate( delta={ state.get_name(): { - # These computed vars _shouldn't_ be here, because they didn't change - arg_name: exp_val, - f"comp_{arg_name}": exp_val, "is_hydrated": True, }, }, @@ -1097,9 +1091,6 @@ async def test_dynamic_route_var_route_change_completed_on_load( assert update == StateUpdate( delta={ state.get_name(): { - # These computed vars _shouldn't_ be here, because they didn't change - f"comp_{arg_name}": exp_val, - arg_name: exp_val, "counter": exp_index + 1, } }, diff --git a/tests/test_state.py b/tests/test_state.py index 9efda3454..0344ea052 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -649,7 +649,12 @@ def test_set_dirty_var(test_state): assert test_state.dirty_vars == set() -def test_set_dirty_substate(test_state, child_state, child_state2, grandchild_state): +def test_set_dirty_substate( + test_state: TestState, + child_state: ChildState, + child_state2: ChildState2, + grandchild_state: GrandchildState, +): """Test changing substate vars marks the value as dirty. Args: @@ -3077,6 +3082,51 @@ def test_potentially_dirty_substates(): assert C1._potentially_dirty_substates() == set() +def test_router_var_dep() -> None: + """Test that router var dependencies are correctly tracked.""" + + class RouterVarParentState(State): + """A parent state for testing router var dependency.""" + + pass + + class RouterVarDepState(RouterVarParentState): + """A state with a router var dependency.""" + + @rx.var(cache=True) + def foo(self) -> str: + return self.router.page.params.get("foo", "") + + foo = RouterVarDepState.computed_vars["foo"] + State._init_var_dependency_dicts() + + assert foo._deps(objclass=RouterVarDepState) == {"router"} + assert RouterVarParentState._potentially_dirty_substates() == {RouterVarDepState} + assert RouterVarParentState._substate_var_dependencies == { + "router": {RouterVarDepState.get_name()} + } + assert RouterVarDepState._computed_var_dependencies == { + "router": {"foo"}, + } + + rx_state = State() + parent_state = RouterVarParentState() + state = RouterVarDepState() + + # link states + rx_state.substates = {RouterVarParentState.get_name(): parent_state} + parent_state.parent_state = rx_state + state.parent_state = parent_state + parent_state.substates = {RouterVarDepState.get_name(): state} + + assert state.dirty_vars == set() + + # Reassign router var + state.router = state.router + assert state.dirty_vars == {"foo", "router"} + assert parent_state.dirty_substates == {RouterVarDepState.get_name()} + + @pytest.mark.asyncio async def test_setvar(mock_app: rx.App, token: str): """Test that setvar works correctly. From 21585867b992012d6e9604a432319cc50c694836 Mon Sep 17 00:00:00 2001 From: abulvenz Date: Mon, 9 Sep 2024 03:36:47 +0200 Subject: [PATCH 004/201] Adding array to array pluck operation. (#3868) --- integration/test_var_operations.py | 6 ++++++ reflex/ivars/sequence.py | 31 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/integration/test_var_operations.py b/integration/test_var_operations.py index 7a8f5473a..bd9db2d8a 100644 --- a/integration/test_var_operations.py +++ b/integration/test_var_operations.py @@ -20,6 +20,9 @@ def VarOperations(): from reflex.ivars.base import LiteralVar from reflex.ivars.sequence import ArrayVar + class Object(rx.Base): + str: str = "hello" + class VarOperationState(rx.State): int_var1: int = 10 int_var2: int = 5 @@ -29,6 +32,7 @@ def VarOperations(): list1: List = [1, 2] list2: List = [3, 4] list3: List = ["first", "second", "third"] + list4: List = [Object(name="obj_1"), Object(name="obj_2")] str_var1: str = "first" str_var2: str = "second" str_var3: str = "ThIrD" @@ -474,6 +478,7 @@ def VarOperations(): rx.text( VarOperationState.list1.contains(1).to_string(), id="list_contains" ), + rx.text(VarOperationState.list4.pluck("name").to_string(), id="list_pluck"), rx.text(VarOperationState.list1.reverse().to_string(), id="list_reverse"), # LIST, INT rx.text( @@ -749,6 +754,7 @@ def test_var_operations(driver, var_operations: AppHarness): ("list_and_list", "[3,4]"), ("list_or_list", "[1,2]"), ("list_contains", "true"), + ("list_pluck", '["obj_1","obj_2"]'), ("list_reverse", "[2,1]"), ("list_join", "firstsecondthird"), ("list_join_comma", "first,second,third"), diff --git a/reflex/ivars/sequence.py b/reflex/ivars/sequence.py index 25586e4df..8081cf442 100644 --- a/reflex/ivars/sequence.py +++ b/reflex/ivars/sequence.py @@ -707,6 +707,17 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): """ return array_contains_operation(self, other) + def pluck(self, field: StringVar | str) -> ArrayVar: + """Pluck a field from the array. + + Args: + field: The field to pluck from the array. + + Returns: + The array pluck operation. + """ + return array_pluck_operation(self, field) + def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]: """Multiply the sequence by a number or integer. @@ -915,6 +926,26 @@ class ArraySliceOperation(CachedVarOperation, ArrayVar): ) +@var_operation +def array_pluck_operation( + array: ArrayVar[ARRAY_VAR_TYPE], + field: StringVar | str, +) -> CustomVarOperationReturn[ARRAY_VAR_TYPE]: + """Pluck a field from an array of objects. + + Args: + array: The array to pluck from. + field: The field to pluck from the objects in the array. + + Returns: + The reversed array. + """ + return var_operation_return( + js_expression=f"{array}.map(e=>e?.[{field}])", + var_type=array._var_type, + ) + + @var_operation def array_reverse_operation( array: ArrayVar[ARRAY_VAR_TYPE], From b7c7197f1dd4f6f258127ae9f357be8780d21cb6 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Mon, 9 Sep 2024 04:10:46 +0200 Subject: [PATCH 005/201] fix initial state without cv fallback (#3670) --- reflex/compiler/utils.py | 4 +++- reflex/state.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 1b69539ac..cbb402047 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -152,7 +152,9 @@ def compile_state(state: Type[BaseState]) -> dict: console.warn( f"Failed to compile initial state with computed vars, excluding them: {e}" ) - initial_state = state(_reflex_internal_init=True).dict(include_computed=False) + initial_state = state(_reflex_internal_init=True).dict( + initial=True, include_computed=False + ) return format.format_state(initial_state) diff --git a/reflex/state.py b/reflex/state.py index abf585513..cb18825c8 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1784,7 +1784,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): prop_name: self.get_value(getattr(self, prop_name)) for prop_name in self.base_vars } - if initial: + if initial and include_computed: computed_vars = { # Include initial computed vars. prop_name: ( From c70cba1e7c56d817270f6987b50650427e2749c4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sun, 8 Sep 2024 19:14:56 -0700 Subject: [PATCH 006/201] add fragment to foreach (#3877) --- integration/test_var_operations.py | 12 ++++++++++++ reflex/.templates/jinja/web/pages/utils.js.jinja2 | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/integration/test_var_operations.py b/integration/test_var_operations.py index bd9db2d8a..2feb80ae0 100644 --- a/integration/test_var_operations.py +++ b/integration/test_var_operations.py @@ -593,6 +593,16 @@ def VarOperations(): int_var2=VarOperationState.int_var2, id="memo_comp_nested", ), + # foreach in a match + rx.box( + rx.match( + VarOperationState.list3.length(), + (0, rx.text("No choices")), + (1, rx.text("One choice")), + rx.foreach(VarOperationState.list3, lambda choice: rx.text(choice)), + ), + id="foreach_in_match", + ), ) @@ -790,6 +800,8 @@ def test_var_operations(driver, var_operations: AppHarness): # rx.memo component with state ("memo_comp", "1210"), ("memo_comp_nested", "345"), + # foreach in a match + ("foreach_in_match", "first\nsecond\nthird"), ] for tag, expected in tests: diff --git a/reflex/.templates/jinja/web/pages/utils.js.jinja2 b/reflex/.templates/jinja/web/pages/utils.js.jinja2 index 8e9808fbb..4e3546070 100644 --- a/reflex/.templates/jinja/web/pages/utils.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/utils.js.jinja2 @@ -64,11 +64,11 @@ {# Args: #} {# component: component dictionary #} {% macro render_iterable_tag(component) %} -{ {%- if component.iterable_type == 'dict' -%}Object.entries({{- component.iterable_state }}){%- else -%}{{- component.iterable_state }}{%- endif -%}.map(({{ component.arg_name }}, {{ component.arg_index }}) => ( +<>{ {%- if component.iterable_type == 'dict' -%}Object.entries({{- component.iterable_state }}){%- else -%}{{- component.iterable_state }}{%- endif -%}.map(({{ component.arg_name }}, {{ component.arg_index }}) => ( {% for child in component.children %} {{ render(child) }} {% endfor %} -))} +))} {%- endmacro %} From fa894289d4f7c4d66f888b7bd5944555ca61ca87 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Sun, 8 Sep 2024 19:21:05 -0700 Subject: [PATCH 007/201] Update docker-example (#3324) --- docker-example/README.md | 143 +++--------------- .../production-app-platform/.dockerignore | 5 + .../production-app-platform/Dockerfile | 65 ++++++++ .../production-app-platform/README.md | 113 ++++++++++++++ .../{ => production-compose}/.dockerignore | 0 .../{ => production-compose}/Caddy.Dockerfile | 0 .../{ => production-compose}/Caddyfile | 0 .../Dockerfile} | 5 +- docker-example/production-compose/README.md | 75 +++++++++ .../compose.prod.yaml | 0 .../compose.tools.yaml | 0 .../{ => production-compose}/compose.yaml | 1 - docker-example/requirements.txt | 1 - docker-example/simple-one-port/.dockerignore | 5 + docker-example/simple-one-port/Caddyfile | 14 ++ .../Dockerfile} | 28 +--- docker-example/simple-one-port/README.md | 36 +++++ docker-example/simple-two-port/.dockerignore | 5 + .../{ => simple-two-port}/Dockerfile | 9 +- docker-example/simple-two-port/README.md | 44 ++++++ 20 files changed, 398 insertions(+), 151 deletions(-) create mode 100644 docker-example/production-app-platform/.dockerignore create mode 100644 docker-example/production-app-platform/Dockerfile create mode 100644 docker-example/production-app-platform/README.md rename docker-example/{ => production-compose}/.dockerignore (100%) rename docker-example/{ => production-compose}/Caddy.Dockerfile (100%) rename docker-example/{ => production-compose}/Caddyfile (100%) rename docker-example/{prod.Dockerfile => production-compose/Dockerfile} (91%) create mode 100644 docker-example/production-compose/README.md rename docker-example/{ => production-compose}/compose.prod.yaml (100%) rename docker-example/{ => production-compose}/compose.tools.yaml (100%) rename docker-example/{ => production-compose}/compose.yaml (96%) delete mode 100644 docker-example/requirements.txt create mode 100644 docker-example/simple-one-port/.dockerignore create mode 100644 docker-example/simple-one-port/Caddyfile rename docker-example/{app.Dockerfile => simple-one-port/Dockerfile} (67%) create mode 100644 docker-example/simple-one-port/README.md create mode 100644 docker-example/simple-two-port/.dockerignore rename docker-example/{ => simple-two-port}/Dockerfile (67%) create mode 100644 docker-example/simple-two-port/README.md diff --git a/docker-example/README.md b/docker-example/README.md index 8ac32421d..552dba950 100644 --- a/docker-example/README.md +++ b/docker-example/README.md @@ -1,133 +1,30 @@ -# Reflex Docker Container +# Reflex Docker Examples -This example describes how to create and use a container image for Reflex with your own code. +This directory contains several examples of how to deploy Reflex apps using docker. -## Update Requirements +In all cases, ensure that your `requirements.txt` file is up to date and +includes the `reflex` package. -The `requirements.txt` includes the reflex package which is needed to install -Reflex framework. If you use additional packages in your project you have to add -this in the `requirements.txt` first. Copy the `Dockerfile`, `.dockerignore` and -the `requirements.txt` file in your project folder. +## `simple-two-port` -## Build Simple Reflex Container Image +The most basic production deployment exposes two HTTP ports and relies on an +existing load balancer to forward the traffic appropriately. -The main `Dockerfile` is intended to build a very simple, single container deployment that runs -the Reflex frontend and backend together, exposing ports 3000 and 8000. +## `simple-one-port` -To build your container image run the following command: +This deployment exports the frontend statically and serves it via a single HTTP +port using Caddy. This is useful for platforms that only support a single port +or where running a node server in the container is undesirable. -```bash -docker build -t reflex-app:latest . -``` +## `production-compose` -## Start Container Service +This deployment is intended for use with a standalone VPS that is only hosting a +single Reflex app. It provides the entire stack in a single `compose.yaml` +including a webserver, one or more backend instances, redis, and a postgres +database. -Finally, you can start your Reflex container service as follows: +## `production-app-platform` -```bash -docker run -it --rm -p 3000:3000 -p 8000:8000 --name app reflex-app:latest -``` - -It may take a few seconds for the service to become available. - -Access your app at http://localhost:3000. - -Note that this container has _no persistence_ and will lose all data when -stopped. You can use bind mounts or named volumes to persist the database and -uploaded_files directories as needed. - -# Production Service with Docker Compose and Caddy - -An example production deployment uses automatic TLS with Caddy serving static files -for the frontend and proxying requests to both the frontend and backend. - -Copy the following files to your project directory: - * `compose.yaml` - * `compose.prod.yaml` - * `compose.tools.yaml` - * `prod.Dockerfile` - * `Caddy.Dockerfile` - * `Caddyfile` - -The production app container, based on `prod.Dockerfile`, builds and exports the -frontend statically (to be served by Caddy). The resulting image only runs the -backend service. - -The `webserver` service, based on `Caddy.Dockerfile`, copies the static frontend -and `Caddyfile` into the container to configure the reverse proxy routes that will -forward requests to the backend service. Caddy will automatically provision TLS -for localhost or the domain specified in the environment variable `DOMAIN`. - -This type of deployment should use less memory and be more performant since -nodejs is not required at runtime. - -## Customize `Caddyfile` (optional) - -If the app uses additional backend API routes, those should be added to the -`@backend_routes` path matcher to ensure they are forwarded to the backend. - -## Build Reflex Production Service - -During build, set `DOMAIN` environment variable to the domain where the app will -be hosted! (Do not include http or https, it will always use https). - -**If `DOMAIN` is not provided, the service will default to `localhost`.** - -```bash -DOMAIN=example.com docker compose build -``` - -This will build both the `app` service from the `prod.Dockerfile` and the `webserver` -service via `Caddy.Dockerfile`. - -## Run Reflex Production Service - -```bash -DOMAIN=example.com docker compose up -``` - -The app should be available at the specified domain via HTTPS. Certificate -provisioning will occur automatically and may take a few minutes. - -### Data Persistence - -Named docker volumes are used to persist the app database (`db-data`), -uploaded_files (`upload-data`), and caddy TLS keys and certificates -(`caddy-data`). - -## More Robust Deployment - -For a more robust deployment, consider bringing the service up with -`compose.prod.yaml` which includes postgres database and redis cache, allowing -the backend to run with multiple workers and service more requests. - -```bash -DOMAIN=example.com docker compose -f compose.yaml -f compose.prod.yaml up -d -``` - -Postgres uses its own named docker volume for data persistence. - -## Admin Tools - -When needed, the services in `compose.tools.yaml` can be brought up, providing -graphical database administration (Adminer on http://localhost:8080) and a -redis cache browser (redis-commander on http://localhost:8081). It is not recommended -to deploy these services if they are not in active use. - -```bash -DOMAIN=example.com docker compose -f compose.yaml -f compose.prod.yaml -f compose.tools.yaml up -d -``` - -# Container Hosting - -Most container hosting services automatically terminate TLS and expect the app -to be listening on a single port (typically `$PORT`). - -To host a Reflex app on one of these platforms, like Google Cloud Run, Render, -Railway, etc, use `app.Dockerfile` to build a single image containing a reverse -proxy that will serve that frontend as static files and proxy requests to the -backend for specific endpoints. - -If the chosen platform does not support buildx and thus heredoc, you can copy -the Caddyfile configuration into a separate Caddyfile in the root of the -project. +This example deployment is intended for use with App hosting platforms, like +Azure, AWS, or Google Cloud Run. It is the backend of the deployment, which +depends on a separately hosted redis instance and static frontend deployment. \ No newline at end of file diff --git a/docker-example/production-app-platform/.dockerignore b/docker-example/production-app-platform/.dockerignore new file mode 100644 index 000000000..ea66a51f5 --- /dev/null +++ b/docker-example/production-app-platform/.dockerignore @@ -0,0 +1,5 @@ +.web +.git +__pycache__/* +Dockerfile +uploaded_files diff --git a/docker-example/production-app-platform/Dockerfile b/docker-example/production-app-platform/Dockerfile new file mode 100644 index 000000000..b0f6c69fc --- /dev/null +++ b/docker-example/production-app-platform/Dockerfile @@ -0,0 +1,65 @@ +# This docker file is intended to be used with container hosting services +# +# After deploying this image, get the URL pointing to the backend service +# and run API_URL=https://path-to-my-container.example.com reflex export frontend +# then copy the contents of `frontend.zip` to your static file server (github pages, s3, etc). +# +# Azure Static Web App example: +# npx @azure/static-web-apps-cli deploy --env production --app-location .web/_static +# +# For dynamic routes to function properly, ensure that 404s are redirected to /404 on the +# static file host (for github pages, this works out of the box; remember to create .nojekyll). +# +# For azure static web apps, add `staticwebapp.config.json` to to `.web/_static` with the following: +# { +# "responseOverrides": { +# "404": { +# "rewrite": "/404.html" +# } +# } +# } +# +# Note: many container hosting platforms require amd64 images, so when building on an M1 Mac +# for example, pass `docker build --platform=linux/amd64 ...` + +# Stage 1: init +FROM python:3.11 as init + +ARG uv=/root/.cargo/bin/uv + +# Install `uv` for faster package boostrapping +ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh +RUN /install.sh && rm /install.sh + +# Copy local context to `/app` inside container (see .dockerignore) +WORKDIR /app +COPY . . +RUN mkdir -p /app/data /app/uploaded_files + +# Create virtualenv which will be copied into final container +ENV VIRTUAL_ENV=/app/.venv +ENV PATH="$VIRTUAL_ENV/bin:$PATH" +RUN $uv venv + +# Install app requirements and reflex inside virtualenv +RUN $uv pip install -r requirements.txt + +# Deploy templates and prepare app +RUN reflex init + +# Stage 2: copy artifacts into slim image +FROM python:3.11-slim +WORKDIR /app +RUN adduser --disabled-password --home /app reflex +COPY --chown=reflex --from=init /app /app +# Install libpq-dev for psycopg2 (skip if not using postgres). +RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/* +USER reflex +ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1 + +# Needed until Reflex properly passes SIGTERM on backend. +STOPSIGNAL SIGKILL + +# Always apply migrations before starting the backend. +CMD [ -d alembic ] && reflex db migrate; \ + exec reflex run --env prod --backend-only --backend-port ${PORT:-8000} diff --git a/docker-example/production-app-platform/README.md b/docker-example/production-app-platform/README.md new file mode 100644 index 000000000..ad54f814f --- /dev/null +++ b/docker-example/production-app-platform/README.md @@ -0,0 +1,113 @@ +# production-app-platform + +This example deployment is intended for use with App hosting platforms, like +Azure, AWS, or Google Cloud Run. + +## Architecture + +The production deployment consists of a few pieces: + * Backend container - built by `Dockerfile` Runs the Reflex backend + service on port 8000 and is scalable to multiple instances. + * Redis container - A single instance the standard `redis` docker image should + share private networking with the backend + * Static frontend - HTML/CSS/JS files that are hosted via a CDN or static file + server. This is not included in the docker image. + +## Deployment + +These general steps do not cover the specifics of each platform, but all platforms should +support the concepts described here. + +### Vnet + +All containers in the deployment should be hooked up to the same virtual private +network so they can access the redis service and optionally the database server. +The vnet should not be exposed to the internet, use an ingress rule to terminate +TLS at the load balancer and forward the traffic to a backend service replica. + +### Redis + +Deploy a `redis` instance on the vnet. + +### Backend + +The backend is built by the `Dockerfile` in this directory. When deploying the +backend, be sure to set REDIS_URL=redis://internal-redis-hostname to connect to +the redis service. + +### Ingress + +Configure the load balancer for the app to forward traffic to port 8000 on the +backend service replicas. Most platforms will generate an ingress hostname +automatically. Make sure when you access the ingress endpoint on `/ping` that it +returns "pong", indicating that the backend is up an available. + +### Frontend + +The frontend should be hosted on a static file server or CDN. + +**Important**: when exporting the frontend, set the API_URL environment variable +to the ingress hostname of the backend service. + +If you will host the frontend from a path other than the root, set the +`FRONTEND_PATH` environment variable appropriately when exporting the frontend. + +Most static hosts will automatically use the `/404.html` file to handle 404 +errors. _This is essential for dynamic routes to work correctly._ Ensure that +missing routes return the `/404.html` content to the user if this is not the +default behavior. + +_For Github Pages_: ensure the file `.nojekyll` is present in the root of the repo +to avoid special processing of underscore-prefix directories, like `_next`. + +## Platform Notes + +The following sections are currently a work in progress and may be incomplete. + +### Azure + +In the Azure load balancer, per-message deflate is not supported. Add the following +to your `rxconfig.py` to workaround this issue. + +```python +import uvicorn.workers + +import reflex as rx + + +class NoWSPerMessageDeflate(uvicorn.workers.UvicornH11Worker): + CONFIG_KWARGS = { + **uvicorn.workers.UvicornH11Worker.CONFIG_KWARGS, + "ws_per_message_deflate": False, + } + + +config = rx.Config( + app_name="my_app", + gunicorn_worker_class="rxconfig.NoWSPerMessageDeflate", +) +``` + +#### Persistent Storage + +If you need to use a database or upload files, you cannot save them to the +container volume. Use Azure Files and mount it into the container at /app/uploaded_files. + +#### Resource Types + +* Create a new vnet with 10.0.0.0/16 + * Create a new subnet for redis, database, and containers +* Deploy redis as a Container Instances +* Deploy database server as "Azure Database for PostgreSQL" + * Create a new database for the app + * Set db-url as a secret containing the db user/password connection string +* Deploy Storage account for uploaded files + * Enable access from the vnet and container subnet + * Create a new file share + * In the environment, create a new files share (get the storage key) +* Deploy the backend as a Container App + * Create a custom Container App Environment linked up to the same vnet as the redis container. + * Set REDIS_URL and DB_URL environment variables + * Add the volume from the environment + * Add the volume mount to the container +* Deploy the frontend as a Static Web App \ No newline at end of file diff --git a/docker-example/.dockerignore b/docker-example/production-compose/.dockerignore similarity index 100% rename from docker-example/.dockerignore rename to docker-example/production-compose/.dockerignore diff --git a/docker-example/Caddy.Dockerfile b/docker-example/production-compose/Caddy.Dockerfile similarity index 100% rename from docker-example/Caddy.Dockerfile rename to docker-example/production-compose/Caddy.Dockerfile diff --git a/docker-example/Caddyfile b/docker-example/production-compose/Caddyfile similarity index 100% rename from docker-example/Caddyfile rename to docker-example/production-compose/Caddyfile diff --git a/docker-example/prod.Dockerfile b/docker-example/production-compose/Dockerfile similarity index 91% rename from docker-example/prod.Dockerfile rename to docker-example/production-compose/Dockerfile index 2cde12ca0..f73473df7 100644 --- a/docker-example/prod.Dockerfile +++ b/docker-example/production-compose/Dockerfile @@ -42,10 +42,11 @@ COPY --chown=reflex --from=init /app /app # Install libpq-dev for psycopg2 (skip if not using postgres). RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/* USER reflex -ENV PATH="/app/.venv/bin:$PATH" +ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1 # Needed until Reflex properly passes SIGTERM on backend. STOPSIGNAL SIGKILL # Always apply migrations before starting the backend. -CMD reflex db migrate && reflex run --env prod --backend-only +CMD [ -d alembic ] && reflex db migrate; \ + exec reflex run --env prod --backend-only diff --git a/docker-example/production-compose/README.md b/docker-example/production-compose/README.md new file mode 100644 index 000000000..87222327e --- /dev/null +++ b/docker-example/production-compose/README.md @@ -0,0 +1,75 @@ +# production-compose + +This example production deployment uses automatic TLS with Caddy serving static +files for the frontend and proxying requests to both the frontend and backend. +It is intended for use with a standalone VPS that is only hosting a single +Reflex app. + +The production app container (`Dockerfile`), builds and exports the frontend +statically (to be served by Caddy). The resulting image only runs the backend +service. + +The `webserver` service, based on `Caddy.Dockerfile`, copies the static frontend +and `Caddyfile` into the container to configure the reverse proxy routes that will +forward requests to the backend service. Caddy will automatically provision TLS +for localhost or the domain specified in the environment variable `DOMAIN`. + +This type of deployment should use less memory and be more performant since +nodejs is not required at runtime. + +## Customize `Caddyfile` (optional) + +If the app uses additional backend API routes, those should be added to the +`@backend_routes` path matcher to ensure they are forwarded to the backend. + +## Build Reflex Production Service + +During build, set `DOMAIN` environment variable to the domain where the app will +be hosted! (Do not include http or https, it will always use https). + +**If `DOMAIN` is not provided, the service will default to `localhost`.** + +```bash +DOMAIN=example.com docker compose build +``` + +This will build both the `app` service from the `prod.Dockerfile` and the `webserver` +service via `Caddy.Dockerfile`. + +## Run Reflex Production Service + +```bash +DOMAIN=example.com docker compose up +``` + +The app should be available at the specified domain via HTTPS. Certificate +provisioning will occur automatically and may take a few minutes. + +### Data Persistence + +Named docker volumes are used to persist the app database (`db-data`), +uploaded_files (`upload-data`), and caddy TLS keys and certificates +(`caddy-data`). + +## More Robust Deployment + +For a more robust deployment, consider bringing the service up with +`compose.prod.yaml` which includes postgres database and redis cache, allowing +the backend to run with multiple workers and service more requests. + +```bash +DOMAIN=example.com docker compose -f compose.yaml -f compose.prod.yaml up -d +``` + +Postgres uses its own named docker volume for data persistence. + +## Admin Tools + +When needed, the services in `compose.tools.yaml` can be brought up, providing +graphical database administration (Adminer on http://localhost:8080) and a +redis cache browser (redis-commander on http://localhost:8081). It is not recommended +to deploy these services if they are not in active use. + +```bash +DOMAIN=example.com docker compose -f compose.yaml -f compose.prod.yaml -f compose.tools.yaml up -d +``` \ No newline at end of file diff --git a/docker-example/compose.prod.yaml b/docker-example/production-compose/compose.prod.yaml similarity index 100% rename from docker-example/compose.prod.yaml rename to docker-example/production-compose/compose.prod.yaml diff --git a/docker-example/compose.tools.yaml b/docker-example/production-compose/compose.tools.yaml similarity index 100% rename from docker-example/compose.tools.yaml rename to docker-example/production-compose/compose.tools.yaml diff --git a/docker-example/compose.yaml b/docker-example/production-compose/compose.yaml similarity index 96% rename from docker-example/compose.yaml rename to docker-example/production-compose/compose.yaml index 8c2f97ba6..de79c0778 100644 --- a/docker-example/compose.yaml +++ b/docker-example/production-compose/compose.yaml @@ -12,7 +12,6 @@ services: DB_URL: sqlite:///data/reflex.db build: context: . - dockerfile: prod.Dockerfile volumes: - db-data:/app/data - upload-data:/app/uploaded_files diff --git a/docker-example/requirements.txt b/docker-example/requirements.txt deleted file mode 100644 index fc29504eb..000000000 --- a/docker-example/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -reflex diff --git a/docker-example/simple-one-port/.dockerignore b/docker-example/simple-one-port/.dockerignore new file mode 100644 index 000000000..ea66a51f5 --- /dev/null +++ b/docker-example/simple-one-port/.dockerignore @@ -0,0 +1,5 @@ +.web +.git +__pycache__/* +Dockerfile +uploaded_files diff --git a/docker-example/simple-one-port/Caddyfile b/docker-example/simple-one-port/Caddyfile new file mode 100644 index 000000000..13d94ce8e --- /dev/null +++ b/docker-example/simple-one-port/Caddyfile @@ -0,0 +1,14 @@ +:{$PORT} + +encode gzip + +@backend_routes path /_event/* /ping /_upload /_upload/* +handle @backend_routes { + reverse_proxy localhost:8000 +} + +root * /srv +route { + try_files {path} {path}/ /404.html + file_server +} \ No newline at end of file diff --git a/docker-example/app.Dockerfile b/docker-example/simple-one-port/Dockerfile similarity index 67% rename from docker-example/app.Dockerfile rename to docker-example/simple-one-port/Dockerfile index 4aae2f31d..4cd7e9a18 100644 --- a/docker-example/app.Dockerfile +++ b/docker-example/simple-one-port/Dockerfile @@ -10,31 +10,13 @@ FROM python:3.11 ARG PORT=8080 # Only set for local/direct access. When TLS is used, the API_URL is assumed to be the same as the frontend. ARG API_URL -ENV PORT=$PORT API_URL=${API_URL:-http://localhost:$PORT} +ENV PORT=$PORT API_URL=${API_URL:-http://localhost:$PORT} REDIS_URL=redis://localhost PYTHONUNBUFFERED=1 -# Install Caddy server inside image -RUN apt-get update -y && apt-get install -y caddy && rm -rf /var/lib/apt/lists/* +# Install Caddy and redis server inside image +RUN apt-get update -y && apt-get install -y caddy redis-server && rm -rf /var/lib/apt/lists/* WORKDIR /app -# Create a simple Caddyfile to serve as reverse proxy -RUN cat > Caddyfile < Date: Tue, 10 Sep 2024 00:50:40 +0200 Subject: [PATCH 008/201] simplify ImmutableComputedVar.__get__ (#3902) * simplify ImmutableComputedVar.__get__ * ruff it --- reflex/ivars/base.py | 43 +++++-------------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 4cd3550dd..50453544d 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -22,7 +22,6 @@ from typing import ( Literal, NoReturn, Optional, - Sequence, Set, Tuple, Type, @@ -1507,47 +1506,15 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): The value of the var for the given instance. """ if instance is None: - from reflex.state import BaseState - - path_to_function = self.fget.__qualname__.split(".") - class_name_where_defined = ( - path_to_function[-2] if len(path_to_function) > 1 else owner.__name__ - ) - - def contains_class_name(states: Sequence[Type]) -> bool: - return any(c.__name__ == class_name_where_defined for c in states) - - def is_not_mixin(state: Type[BaseState]) -> bool: - return not state._mixin - - def length_of_state(state: Type[BaseState]) -> int: - return len(inspect.getmro(state)) - - class_where_defined = cast( - Type[BaseState], - min( - filter( - lambda state: state.__module__ == self.fget.__module__, - filter( - is_not_mixin, - filter( - lambda state: contains_class_name( - inspect.getmro(state) - ), - inspect.getmro(owner), - ), - ), - ), - default=owner, - key=length_of_state, - ), - ) + state_where_defined = owner + while self.fget.__name__ in state_where_defined.inherited_vars: + state_where_defined = state_where_defined.get_parent_state() return self._replace( - _var_name=format_state_name(class_where_defined.get_full_name()) + _var_name=format_state_name(state_where_defined.get_full_name()) + "." + self._var_name, - merge_var_data=ImmutableVarData.from_state(class_where_defined), + merge_var_data=ImmutableVarData.from_state(state_where_defined), ).guess_type() if not self._cache: From fb721e1d1263283667293bde29661974b56a8d67 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 9 Sep 2024 17:59:40 -0700 Subject: [PATCH 009/201] delete states if it exists on run (#3901) * delete states if it exists * simplify ImmutableComputedVar.__get__ (#3902) * simplify ImmutableComputedVar.__get__ * ruff it --------- Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> --- reflex/reflex.py | 4 ++++ reflex/state.py | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/reflex/reflex.py b/reflex/reflex.py index 741873f4e..c90e328e4 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -16,6 +16,7 @@ from reflex_cli.utils import dependency from reflex import constants from reflex.config import get_config from reflex.custom_components.custom_components import custom_components_cli +from reflex.state import reset_disk_state_manager from reflex.utils import console, redir, telemetry # Disable typer+rich integration for help panels @@ -180,6 +181,9 @@ def _run( if prerequisites.needs_reinit(frontend=frontend): _init(name=config.app_name, loglevel=loglevel) + # Delete the states folder if it exists. + reset_disk_state_manager() + # Find the next available open port if applicable. if frontend: frontend_port = processes.handle_port( diff --git a/reflex/state.py b/reflex/state.py index cb18825c8..1bd4cc946 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -2499,6 +2499,14 @@ def state_to_schema( ) +def reset_disk_state_manager(): + """Reset the disk state manager.""" + states_directory = prerequisites.get_web_dir() / constants.Dirs.STATES + if states_directory.exists(): + for path in states_directory.iterdir(): + path.unlink() + + class StateManagerDisk(StateManager): """A state manager that stores states in memory.""" From a5c73ad8e51ceb97a2a5c639b6a1941edb3f74d2 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 10 Sep 2024 11:43:37 -0700 Subject: [PATCH 010/201] Use old serializer system in LiteralVar (#3875) * use serializer system * add checks for unsupported operands * and and or are now supported * format * remove unnecessary call to JSON * put base before rest * fix failing testcase * add hinting to get static analysis to complain * damn * big changes * get typeguard from extensions * please darglint * dangit darglint * remove one from vars * add without data and use it in plotly * DARGLINT * change format for special props * add pyi * delete instances of Var.create * modify client state to work * fixed so much * remove every Var.create * delete all basevar stuff * checkpoint * fix pyi * get older python to work * dangit darglint * add simple fix to last failing testcase * remove var name unwrapped and put client state on immutable var * fix older python * fox event issues * change forms pyi * make test less strict * use rx state directly * add typeignore to page_id * implement foreach * delete .web states folder silly * update reflex chakra * fix issue when on mount or on unmount is not set * nuke Var * run pyi * import immutablevar in critical location * delete unwrap vars * bring back array ref * fix style props in app * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * Update find_replace (#3886) * [REF-3592]Promote `rx.progress` from radix themes (#3878) * Promote `rx.progress` from radix themes * fix pyi * add warning when accessing `rx._x.progress` * Use correct flexgen backend URL (#3891) * Remove demo template (#3888) * gitignore .web (#3885) * update overflowY in AUTO_HEIGHT_JS from hidden to scroll (#3882) * Retain mutability inside `async with self` block (#3884) When emitting a state update, restore `_self_mutable` to the value it had previously so that `yield` in the middle of `async with self` does not result in an immutable StateProxy. Fix #3869 * Include child imports in markdown component_map (#3883) If a component in the markdown component_map contains children components, use `_get_all_imports` to recursively enumerate them. Fix #3880 * [REF-3570] Remove deprecated REDIS_URL syntax (#3892) * mixin computed vars should only be applied to highest level state (#3833) * improve state hierarchy validation, drop old testing special case (#3894) * fix var dependency dicts (#3842) * Adding array to array pluck operation. (#3868) * fix initial state without cv fallback (#3670) * add fragment to foreach (#3877) * Update docker-example (#3324) * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * Merge branch 'main' into use-old-serializer-in-literalvar * [REF-3570] Remove deprecated REDIS_URL syntax (#3892) * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * [REF-3570] Remove deprecated REDIS_URL syntax (#3892) * remove extra var Co-authored-by: Masen Furer * resolve typo * write better doc for var.create * return var value when we know it's literal var * fix unit test * less bloat for ToOperations * simplify ImmutableComputedVar.__get__ (#3902) * simplify ImmutableComputedVar.__get__ * ruff it --------- Co-authored-by: Samarth Bhadane Co-authored-by: Elijah Ahianyo Co-authored-by: Masen Furer Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Co-authored-by: Vishnu Deva Co-authored-by: abulvenz --- integration/test_dynamic_routes.py | 5 +- integration/test_tailwind.py | 2 +- poetry.lock | 632 ++--- .../jinja/web/pages/utils.js.jinja2 | 4 +- .../jinja/web/utils/theme.js.jinja2 | 2 +- reflex/compiler/compiler.py | 9 +- reflex/compiler/utils.py | 4 +- reflex/components/base/app_wrap.pyi | 44 +- reflex/components/base/bare.py | 4 +- reflex/components/base/body.pyi | 44 +- reflex/components/base/document.pyi | 212 +- reflex/components/base/error_boundary.py | 2 +- reflex/components/base/error_boundary.pyi | 49 +- reflex/components/base/fragment.pyi | 44 +- reflex/components/base/head.pyi | 86 +- reflex/components/base/link.pyi | 85 +- reflex/components/base/meta.pyi | 170 +- reflex/components/base/script.pyi | 55 +- reflex/components/component.py | 99 +- reflex/components/core/banner.py | 6 +- reflex/components/core/banner.pyi | 212 +- reflex/components/core/client_side_routing.py | 3 +- .../components/core/client_side_routing.pyi | 85 +- reflex/components/core/clipboard.py | 4 +- reflex/components/core/clipboard.pyi | 47 +- reflex/components/core/cond.py | 13 +- reflex/components/core/debounce.py | 14 +- reflex/components/core/debounce.pyi | 47 +- reflex/components/core/foreach.py | 6 +- reflex/components/core/html.pyi | 43 +- reflex/components/core/match.py | 37 +- reflex/components/core/upload.py | 29 +- reflex/components/core/upload.pyi | 192 +- reflex/components/datadisplay/code.py | 6 +- reflex/components/datadisplay/code.pyi | 43 +- reflex/components/datadisplay/dataeditor.py | 23 +- reflex/components/datadisplay/dataeditor.pyi | 77 +- reflex/components/el/element.pyi | 44 +- reflex/components/el/elements/base.pyi | 43 +- reflex/components/el/elements/forms.py | 23 +- reflex/components/el/elements/forms.pyi | 618 +++-- reflex/components/el/elements/inline.pyi | 1177 +++++---- reflex/components/el/elements/media.pyi | 883 ++++--- reflex/components/el/elements/metadata.py | 5 +- reflex/components/el/elements/metadata.pyi | 253 +- reflex/components/el/elements/other.pyi | 295 ++- reflex/components/el/elements/scripts.pyi | 127 +- reflex/components/el/elements/sectioning.pyi | 631 +++-- reflex/components/el/elements/tables.pyi | 421 +-- reflex/components/el/elements/typography.pyi | 631 +++-- reflex/components/gridjs/datatable.py | 25 +- reflex/components/gridjs/datatable.pyi | 85 +- reflex/components/lucide/icon.pyi | 85 +- reflex/components/markdown/markdown.py | 27 +- reflex/components/markdown/markdown.pyi | 46 +- reflex/components/moment/moment.pyi | 47 +- reflex/components/next/base.pyi | 44 +- reflex/components/next/image.pyi | 51 +- reflex/components/next/link.pyi | 43 +- reflex/components/next/video.pyi | 43 +- reflex/components/plotly/plotly.py | 44 +- reflex/components/plotly/plotly.pyi | 83 +- reflex/components/props.py | 14 +- .../components/radix/primitives/accordion.py | 6 +- .../components/radix/primitives/accordion.pyi | 301 ++- reflex/components/radix/primitives/base.pyi | 85 +- reflex/components/radix/primitives/drawer.pyi | 435 ++-- reflex/components/radix/primitives/form.pyi | 445 ++-- .../components/radix/primitives/progress.pyi | 211 +- reflex/components/radix/primitives/slider.pyi | 215 +- reflex/components/radix/themes/base.pyi | 295 ++- reflex/components/radix/themes/color_mode.py | 14 +- reflex/components/radix/themes/color_mode.pyi | 151 +- .../radix/themes/components/alert_dialog.pyi | 303 ++- .../radix/themes/components/aspect_ratio.pyi | 43 +- .../radix/themes/components/avatar.pyi | 43 +- .../radix/themes/components/badge.pyi | 43 +- .../radix/themes/components/button.pyi | 43 +- .../radix/themes/components/callout.pyi | 211 +- .../radix/themes/components/card.pyi | 43 +- .../radix/themes/components/checkbox.pyi | 139 +- .../themes/components/checkbox_cards.pyi | 85 +- .../themes/components/checkbox_group.pyi | 85 +- .../radix/themes/components/context_menu.pyi | 357 ++- .../radix/themes/components/data_list.pyi | 169 +- .../radix/themes/components/dialog.pyi | 309 ++- .../radix/themes/components/dropdown_menu.pyi | 363 ++- .../radix/themes/components/hover_card.pyi | 173 +- .../radix/themes/components/icon_button.py | 3 +- .../radix/themes/components/icon_button.pyi | 43 +- .../radix/themes/components/inset.pyi | 43 +- .../radix/themes/components/popover.pyi | 183 +- .../radix/themes/components/progress.pyi | 43 +- .../radix/themes/components/radio.pyi | 43 +- .../radix/themes/components/radio_cards.pyi | 87 +- .../radix/themes/components/radio_group.py | 14 +- .../radix/themes/components/radio_group.pyi | 173 +- .../radix/themes/components/scroll_area.pyi | 43 +- .../themes/components/segmented_control.pyi | 89 +- .../radix/themes/components/select.py | 3 +- .../radix/themes/components/select.pyi | 403 +-- .../radix/themes/components/separator.pyi | 43 +- .../radix/themes/components/skeleton.pyi | 43 +- .../radix/themes/components/slider.py | 3 +- .../radix/themes/components/slider.pyi | 49 +- .../radix/themes/components/spinner.pyi | 43 +- .../radix/themes/components/switch.pyi | 47 +- .../radix/themes/components/table.pyi | 295 ++- .../radix/themes/components/tabs.pyi | 219 +- .../radix/themes/components/text_area.pyi | 53 +- .../radix/themes/components/text_field.pyi | 147 +- .../radix/themes/components/tooltip.pyi | 49 +- .../components/radix/themes/layout/base.pyi | 43 +- reflex/components/radix/themes/layout/box.pyi | 43 +- .../components/radix/themes/layout/center.pyi | 43 +- .../radix/themes/layout/container.pyi | 43 +- .../components/radix/themes/layout/flex.pyi | 43 +- .../components/radix/themes/layout/grid.pyi | 43 +- reflex/components/radix/themes/layout/list.py | 9 +- .../components/radix/themes/layout/list.pyi | 219 +- .../radix/themes/layout/section.pyi | 43 +- .../components/radix/themes/layout/spacer.pyi | 43 +- .../components/radix/themes/layout/stack.pyi | 127 +- .../radix/themes/typography/blockquote.pyi | 43 +- .../radix/themes/typography/code.pyi | 43 +- .../radix/themes/typography/heading.pyi | 43 +- .../radix/themes/typography/link.pyi | 43 +- .../radix/themes/typography/text.pyi | 295 ++- reflex/components/react_player/audio.pyi | 93 +- .../components/react_player/react_player.pyi | 93 +- reflex/components/react_player/video.pyi | 93 +- reflex/components/recharts/cartesian.py | 4 +- reflex/components/recharts/cartesian.pyi | 773 +++--- reflex/components/recharts/charts.py | 8 +- reflex/components/recharts/charts.pyi | 459 ++-- reflex/components/recharts/general.pyi | 211 +- reflex/components/recharts/polar.py | 8 +- reflex/components/recharts/polar.pyi | 185 +- reflex/components/recharts/recharts.pyi | 86 +- reflex/components/sonner/toast.py | 33 +- reflex/components/sonner/toast.pyi | 53 +- reflex/components/suneditor/editor.py | 3 +- reflex/components/suneditor/editor.pyi | 73 +- reflex/components/tags/iter_tag.py | 11 +- reflex/components/tags/tag.py | 7 +- reflex/event.py | 34 +- reflex/experimental/client_state.py | 64 +- reflex/experimental/hooks.py | 31 +- reflex/experimental/layout.py | 10 +- reflex/experimental/layout.pyi | 215 +- reflex/ivars/base.py | 699 +++-- reflex/ivars/function.py | 73 +- reflex/ivars/number.py | 422 +-- reflex/ivars/object.py | 88 +- reflex/ivars/sequence.py | 705 +++-- reflex/state.py | 46 +- reflex/style.py | 34 +- reflex/utils/format.py | 259 +- reflex/utils/pyi_generator.py | 9 +- reflex/utils/serializers.py | 44 +- reflex/utils/types.py | 14 +- reflex/vars.py | 2278 +---------------- reflex/vars.pyi | 221 -- tests/components/core/test_banner.py | 28 +- tests/components/core/test_colors.py | 4 +- tests/components/core/test_cond.py | 13 +- tests/components/core/test_debounce.py | 4 +- tests/components/core/test_foreach.py | 8 +- tests/components/core/test_match.py | 8 +- tests/components/core/test_upload.py | 6 +- tests/components/forms/test_form.py | 4 +- tests/components/radix/test_icon_button.py | 4 +- tests/components/test_component.py | 72 +- tests/components/test_tag.py | 9 +- tests/test_app.py | 10 +- tests/test_event.py | 51 +- tests/test_state.py | 20 +- tests/test_style.py | 6 +- tests/test_var.py | 783 +++--- tests/utils/test_format.py | 242 +- tests/utils/test_serializers.py | 59 +- tests/utils/test_utils.py | 10 +- 182 files changed, 13591 insertions(+), 11310 deletions(-) delete mode 100644 reflex/vars.pyi diff --git a/integration/test_dynamic_routes.py b/integration/test_dynamic_routes.py index 0ce4ef2c9..235232461 100644 --- a/integration/test_dynamic_routes.py +++ b/integration/test_dynamic_routes.py @@ -23,7 +23,6 @@ def DynamicRoute(): class DynamicState(rx.State): order: List[str] = [] - page_id: str = "" def on_load(self): self.order.append(f"{self.router.page.path}-{self.page_id or 'no page id'}") @@ -47,7 +46,7 @@ def DynamicRoute(): is_read_only=True, id="token", ), - rc.input(value=DynamicState.page_id, is_read_only=True, id="page_id"), + rc.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore rc.input( value=DynamicState.router.page.raw_path, is_read_only=True, @@ -74,9 +73,9 @@ def DynamicRoute(): return rx.fragment(rx.text("redirecting...")) app = rx.App(state=rx.State) - app.add_page(index) app.add_page(index, route="/page/[page_id]", on_load=DynamicState.on_load) # type: ignore app.add_page(index, route="/static/x", on_load=DynamicState.on_load) # type: ignore + app.add_page(index) app.add_custom_404_page(on_load=DynamicState.on_load) # type: ignore diff --git a/integration/test_tailwind.py b/integration/test_tailwind.py index a3d90e645..491eba538 100644 --- a/integration/test_tailwind.py +++ b/integration/test_tailwind.py @@ -109,7 +109,7 @@ def test_tailwind_app(tailwind_app: AppHarness, tailwind_disabled: bool): assert len(paragraphs) == 3 for p in paragraphs: assert tailwind_app.poll_for_content(p, exp_not_equal="") == PARAGRAPH_TEXT - assert p.value_of_css_property("font-family") == '"monospace"' + assert p.value_of_css_property("font-family") == "monospace" if tailwind_disabled: # expect default color, not "text-red-500" from tailwind utility class assert p.value_of_css_property("color") not in TEXT_RED_500_COLOR diff --git a/poetry.lock b/poetry.lock index 0ef22ebd4..6604a361a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -126,13 +126,13 @@ files = [ [[package]] name = "build" -version = "1.2.1" +version = "1.2.2" description = "A simple, correct Python build frontend" optional = false python-versions = ">=3.8" files = [ - {file = "build-1.2.1-py3-none-any.whl", hash = "sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4"}, - {file = "build-1.2.1.tar.gz", hash = "sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d"}, + {file = "build-1.2.2-py3-none-any.whl", hash = "sha256:277ccc71619d98afdd841a0e96ac9fe1593b823af481d3b0cea748e8894e0613"}, + {file = "build-1.2.2.tar.gz", hash = "sha256:119b2fb462adef986483438377a13b2f42064a2a3a4161f24a0cca698a07ac8c"}, ] [package.dependencies] @@ -162,78 +162,78 @@ files = [ [[package]] name = "cffi" -version = "1.17.0" +version = "1.17.1" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" files = [ - {file = "cffi-1.17.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f9338cc05451f1942d0d8203ec2c346c830f8e86469903d5126c1f0a13a2bcbb"}, - {file = "cffi-1.17.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0ce71725cacc9ebf839630772b07eeec220cbb5f03be1399e0457a1464f8e1a"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c815270206f983309915a6844fe994b2fa47e5d05c4c4cef267c3b30e34dbe42"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6bdcd415ba87846fd317bee0774e412e8792832e7805938987e4ede1d13046d"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a98748ed1a1df4ee1d6f927e151ed6c1a09d5ec21684de879c7ea6aa96f58f2"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0a048d4f6630113e54bb4b77e315e1ba32a5a31512c31a273807d0027a7e69ab"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24aa705a5f5bd3a8bcfa4d123f03413de5d86e497435693b638cbffb7d5d8a1b"}, - {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:856bf0924d24e7f93b8aee12a3a1095c34085600aa805693fb7f5d1962393206"}, - {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:4304d4416ff032ed50ad6bb87416d802e67139e31c0bde4628f36a47a3164bfa"}, - {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:331ad15c39c9fe9186ceaf87203a9ecf5ae0ba2538c9e898e3a6967e8ad3db6f"}, - {file = "cffi-1.17.0-cp310-cp310-win32.whl", hash = "sha256:669b29a9eca6146465cc574659058ed949748f0809a2582d1f1a324eb91054dc"}, - {file = "cffi-1.17.0-cp310-cp310-win_amd64.whl", hash = "sha256:48b389b1fd5144603d61d752afd7167dfd205973a43151ae5045b35793232aa2"}, - {file = "cffi-1.17.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5d97162c196ce54af6700949ddf9409e9833ef1003b4741c2b39ef46f1d9720"}, - {file = "cffi-1.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5ba5c243f4004c750836f81606a9fcb7841f8874ad8f3bf204ff5e56332b72b9"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bb9333f58fc3a2296fb1d54576138d4cf5d496a2cc118422bd77835e6ae0b9cb"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:435a22d00ec7d7ea533db494da8581b05977f9c37338c80bc86314bec2619424"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d1df34588123fcc88c872f5acb6f74ae59e9d182a2707097f9e28275ec26a12d"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:df8bb0010fdd0a743b7542589223a2816bdde4d94bb5ad67884348fa2c1c67e8"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8b5b9712783415695663bd463990e2f00c6750562e6ad1d28e072a611c5f2a6"}, - {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ffef8fd58a36fb5f1196919638f73dd3ae0db1a878982b27a9a5a176ede4ba91"}, - {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4e67d26532bfd8b7f7c05d5a766d6f437b362c1bf203a3a5ce3593a645e870b8"}, - {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:45f7cd36186db767d803b1473b3c659d57a23b5fa491ad83c6d40f2af58e4dbb"}, - {file = "cffi-1.17.0-cp311-cp311-win32.whl", hash = "sha256:a9015f5b8af1bb6837a3fcb0cdf3b874fe3385ff6274e8b7925d81ccaec3c5c9"}, - {file = "cffi-1.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:b50aaac7d05c2c26dfd50c3321199f019ba76bb650e346a6ef3616306eed67b0"}, - {file = "cffi-1.17.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aec510255ce690d240f7cb23d7114f6b351c733a74c279a84def763660a2c3bc"}, - {file = "cffi-1.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2770bb0d5e3cc0e31e7318db06efcbcdb7b31bcb1a70086d3177692a02256f59"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:db9a30ec064129d605d0f1aedc93e00894b9334ec74ba9c6bdd08147434b33eb"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a47eef975d2b8b721775a0fa286f50eab535b9d56c70a6e62842134cf7841195"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f3e0992f23bbb0be00a921eae5363329253c3b86287db27092461c887b791e5e"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6107e445faf057c118d5050560695e46d272e5301feffda3c41849641222a828"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb862356ee9391dc5a0b3cbc00f416b48c1b9a52d252d898e5b7696a5f9fe150"}, - {file = "cffi-1.17.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c1c13185b90bbd3f8b5963cd8ce7ad4ff441924c31e23c975cb150e27c2bf67a"}, - {file = "cffi-1.17.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:17c6d6d3260c7f2d94f657e6872591fe8733872a86ed1345bda872cfc8c74885"}, - {file = "cffi-1.17.0-cp312-cp312-win32.whl", hash = "sha256:c3b8bd3133cd50f6b637bb4322822c94c5ce4bf0d724ed5ae70afce62187c492"}, - {file = "cffi-1.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:dca802c8db0720ce1c49cce1149ff7b06e91ba15fa84b1d59144fef1a1bc7ac2"}, - {file = "cffi-1.17.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6ce01337d23884b21c03869d2f68c5523d43174d4fc405490eb0091057943118"}, - {file = "cffi-1.17.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cab2eba3830bf4f6d91e2d6718e0e1c14a2f5ad1af68a89d24ace0c6b17cced7"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:14b9cbc8f7ac98a739558eb86fabc283d4d564dafed50216e7f7ee62d0d25377"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b00e7bcd71caa0282cbe3c90966f738e2db91e64092a877c3ff7f19a1628fdcb"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:41f4915e09218744d8bae14759f983e466ab69b178de38066f7579892ff2a555"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4760a68cab57bfaa628938e9c2971137e05ce48e762a9cb53b76c9b569f1204"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:011aff3524d578a9412c8b3cfaa50f2c0bd78e03eb7af7aa5e0df59b158efb2f"}, - {file = "cffi-1.17.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:a003ac9edc22d99ae1286b0875c460351f4e101f8c9d9d2576e78d7e048f64e0"}, - {file = "cffi-1.17.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ef9528915df81b8f4c7612b19b8628214c65c9b7f74db2e34a646a0a2a0da2d4"}, - {file = "cffi-1.17.0-cp313-cp313-win32.whl", hash = "sha256:70d2aa9fb00cf52034feac4b913181a6e10356019b18ef89bc7c12a283bf5f5a"}, - {file = "cffi-1.17.0-cp313-cp313-win_amd64.whl", hash = "sha256:b7b6ea9e36d32582cda3465f54c4b454f62f23cb083ebc7a94e2ca6ef011c3a7"}, - {file = "cffi-1.17.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:964823b2fc77b55355999ade496c54dde161c621cb1f6eac61dc30ed1b63cd4c"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:516a405f174fd3b88829eabfe4bb296ac602d6a0f68e0d64d5ac9456194a5b7e"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dec6b307ce928e8e112a6bb9921a1cb00a0e14979bf28b98e084a4b8a742bd9b"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e4094c7b464cf0a858e75cd14b03509e84789abf7b79f8537e6a72152109c76e"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2404f3de742f47cb62d023f0ba7c5a916c9c653d5b368cc966382ae4e57da401"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3aa9d43b02a0c681f0bfbc12d476d47b2b2b6a3f9287f11ee42989a268a1833c"}, - {file = "cffi-1.17.0-cp38-cp38-win32.whl", hash = "sha256:0bb15e7acf8ab35ca8b24b90af52c8b391690ef5c4aec3d31f38f0d37d2cc499"}, - {file = "cffi-1.17.0-cp38-cp38-win_amd64.whl", hash = "sha256:93a7350f6706b31f457c1457d3a3259ff9071a66f312ae64dc024f049055f72c"}, - {file = "cffi-1.17.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a2ddbac59dc3716bc79f27906c010406155031a1c801410f1bafff17ea304d2"}, - {file = "cffi-1.17.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6327b572f5770293fc062a7ec04160e89741e8552bf1c358d1a23eba68166759"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbc183e7bef690c9abe5ea67b7b60fdbca81aa8da43468287dae7b5c046107d4"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bdc0f1f610d067c70aa3737ed06e2726fd9d6f7bfee4a351f4c40b6831f4e82"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6d872186c1617d143969defeadac5a904e6e374183e07977eedef9c07c8953bf"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0d46ee4764b88b91f16661a8befc6bfb24806d885e27436fdc292ed7e6f6d058"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f76a90c345796c01d85e6332e81cab6d70de83b829cf1d9762d0a3da59c7932"}, - {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0e60821d312f99d3e1569202518dddf10ae547e799d75aef3bca3a2d9e8ee693"}, - {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:eb09b82377233b902d4c3fbeeb7ad731cdab579c6c6fda1f763cd779139e47c3"}, - {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:24658baf6224d8f280e827f0a50c46ad819ec8ba380a42448e24459daf809cf4"}, - {file = "cffi-1.17.0-cp39-cp39-win32.whl", hash = "sha256:0fdacad9e0d9fc23e519efd5ea24a70348305e8d7d85ecbb1a5fa66dc834e7fb"}, - {file = "cffi-1.17.0-cp39-cp39-win_amd64.whl", hash = "sha256:7cbc78dc018596315d4e7841c8c3a7ae31cc4d638c9b627f87d52e8abaaf2d29"}, - {file = "cffi-1.17.0.tar.gz", hash = "sha256:f3157624b7558b914cb039fd1af735e5e8049a87c817cc215109ad1c8779df76"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be"}, + {file = "cffi-1.17.1-cp310-cp310-win32.whl", hash = "sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c"}, + {file = "cffi-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b"}, + {file = "cffi-1.17.1-cp311-cp311-win32.whl", hash = "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655"}, + {file = "cffi-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8"}, + {file = "cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65"}, + {file = "cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9"}, + {file = "cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d"}, + {file = "cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a"}, + {file = "cffi-1.17.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1"}, + {file = "cffi-1.17.1-cp38-cp38-win32.whl", hash = "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8"}, + {file = "cffi-1.17.1-cp38-cp38-win_amd64.whl", hash = "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e"}, + {file = "cffi-1.17.1-cp39-cp39-win32.whl", hash = "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7"}, + {file = "cffi-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662"}, + {file = "cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"}, ] [package.dependencies] @@ -463,38 +463,38 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "43.0.0" +version = "43.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-43.0.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:64c3f16e2a4fc51c0d06af28441881f98c5d91009b8caaff40cf3548089e9c74"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3dcdedae5c7710b9f97ac6bba7e1052b95c7083c9d0e9df96e02a1932e777895"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d9a1eca329405219b605fac09ecfc09ac09e595d6def650a437523fcd08dd22"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ea9e57f8ea880eeea38ab5abf9fbe39f923544d7884228ec67d666abd60f5a47"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9a8d6802e0825767476f62aafed40532bd435e8a5f7d23bd8b4f5fd04cc80ecf"}, - {file = "cryptography-43.0.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:cc70b4b581f28d0a254d006f26949245e3657d40d8857066c2ae22a61222ef55"}, - {file = "cryptography-43.0.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4a997df8c1c2aae1e1e5ac49c2e4f610ad037fc5a3aadc7b64e39dea42249431"}, - {file = "cryptography-43.0.0-cp37-abi3-win32.whl", hash = "sha256:6e2b11c55d260d03a8cf29ac9b5e0608d35f08077d8c087be96287f43af3ccdc"}, - {file = "cryptography-43.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:31e44a986ceccec3d0498e16f3d27b2ee5fdf69ce2ab89b52eaad1d2f33d8778"}, - {file = "cryptography-43.0.0-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:7b3f5fe74a5ca32d4d0f302ffe6680fcc5c28f8ef0dc0ae8f40c0f3a1b4fca66"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac1955ce000cb29ab40def14fd1bbfa7af2017cca696ee696925615cafd0dce5"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:299d3da8e00b7e2b54bb02ef58d73cd5f55fb31f33ebbf33bd00d9aa6807df7e"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ee0c405832ade84d4de74b9029bedb7b31200600fa524d218fc29bfa371e97f5"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:cb013933d4c127349b3948aa8aaf2f12c0353ad0eccd715ca789c8a0f671646f"}, - {file = "cryptography-43.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fdcb265de28585de5b859ae13e3846a8e805268a823a12a4da2597f1f5afc9f0"}, - {file = "cryptography-43.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2905ccf93a8a2a416f3ec01b1a7911c3fe4073ef35640e7ee5296754e30b762b"}, - {file = "cryptography-43.0.0-cp39-abi3-win32.whl", hash = "sha256:47ca71115e545954e6c1d207dd13461ab81f4eccfcb1345eac874828b5e3eaaf"}, - {file = "cryptography-43.0.0-cp39-abi3-win_amd64.whl", hash = "sha256:0663585d02f76929792470451a5ba64424acc3cd5227b03921dab0e2f27b1709"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2c6d112bf61c5ef44042c253e4859b3cbbb50df2f78fa8fae6747a7814484a70"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:844b6d608374e7d08f4f6e6f9f7b951f9256db41421917dfb2d003dde4cd6b66"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:51956cf8730665e2bdf8ddb8da0056f699c1a5715648c1b0144670c1ba00b48f"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:aae4d918f6b180a8ab8bf6511a419473d107df4dbb4225c7b48c5c9602c38c7f"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:232ce02943a579095a339ac4b390fbbe97f5b5d5d107f8a08260ea2768be8cc2"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5bcb8a5620008a8034d39bce21dc3e23735dfdb6a33a06974739bfa04f853947"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:08a24a7070b2b6804c1940ff0f910ff728932a9d0e80e7814234269f9d46d069"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:e9c5266c432a1e23738d178e51c2c7a5e2ddf790f248be939448c0ba2021f9d1"}, - {file = "cryptography-43.0.0.tar.gz", hash = "sha256:b88075ada2d51aa9f18283532c9f60e72170041bba88d7f37e49cbb10275299e"}, + {file = "cryptography-43.0.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:8385d98f6a3bf8bb2d65a73e17ed87a3ba84f6991c155691c51112075f9ffc5d"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27e613d7077ac613e399270253259d9d53872aaf657471473ebfc9a52935c062"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:68aaecc4178e90719e95298515979814bda0cbada1256a4485414860bd7ab962"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:de41fd81a41e53267cb020bb3a7212861da53a7d39f863585d13ea11049cf277"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f98bf604c82c416bc829e490c700ca1553eafdf2912a91e23a79d97d9801372a"}, + {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:61ec41068b7b74268fa86e3e9e12b9f0c21fcf65434571dbb13d954bceb08042"}, + {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:014f58110f53237ace6a408b5beb6c427b64e084eb451ef25a28308270086494"}, + {file = "cryptography-43.0.1-cp37-abi3-win32.whl", hash = "sha256:2bd51274dcd59f09dd952afb696bf9c61a7a49dfc764c04dd33ef7a6b502a1e2"}, + {file = "cryptography-43.0.1-cp37-abi3-win_amd64.whl", hash = "sha256:666ae11966643886c2987b3b721899d250855718d6d9ce41b521252a17985f4d"}, + {file = "cryptography-43.0.1-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:ac119bb76b9faa00f48128b7f5679e1d8d437365c5d26f1c2c3f0da4ce1b553d"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bbcce1a551e262dfbafb6e6252f1ae36a248e615ca44ba302df077a846a8806"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58d4e9129985185a06d849aa6df265bdd5a74ca6e1b736a77959b498e0505b85"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d03a475165f3134f773d1388aeb19c2d25ba88b6a9733c5c590b9ff7bbfa2e0c"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:511f4273808ab590912a93ddb4e3914dfd8a388fed883361b02dea3791f292e1"}, + {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:80eda8b3e173f0f247f711eef62be51b599b5d425c429b5d4ca6a05e9e856baa"}, + {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:38926c50cff6f533f8a2dae3d7f19541432610d114a70808f0926d5aaa7121e4"}, + {file = "cryptography-43.0.1-cp39-abi3-win32.whl", hash = "sha256:a575913fb06e05e6b4b814d7f7468c2c660e8bb16d8d5a1faf9b33ccc569dd47"}, + {file = "cryptography-43.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:d75601ad10b059ec832e78823b348bfa1a59f6b8d545db3a24fd44362a1564cb"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ea25acb556320250756e53f9e20a4177515f012c9eaea17eb7587a8c4d8ae034"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c1332724be35d23a854994ff0b66530119500b6053d0bd3363265f7e5e77288d"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fba1007b3ef89946dbbb515aeeb41e30203b004f0b4b00e5e16078b518563289"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5b43d1ea6b378b54a1dc99dd8a2b5be47658fe9a7ce0a58ff0b55f4b43ef2b84"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:88cce104c36870d70c49c7c8fd22885875d950d9ee6ab54df2745f83ba0dc365"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:9d3cdb25fa98afdd3d0892d132b8d7139e2c087da1712041f6b762e4f807cc96"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e710bf40870f4db63c3d7d929aa9e09e4e7ee219e703f949ec4073b4294f6172"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7c05650fe8023c5ed0d46793d4b7d7e6cd9c04e68eabe5b0aeea836e37bdcec2"}, + {file = "cryptography-43.0.1.tar.gz", hash = "sha256:203e92a75716d8cfb491dc47c79e17d0d9207ccffcbcb35f598fbe463ae3444d"}, ] [package.dependencies] @@ -507,7 +507,7 @@ nox = ["nox"] pep8test = ["check-sdist", "click", "mypy", "ruff"] sdist = ["build"] ssh = ["bcrypt (>=3.1.5)"] -test = ["certifi", "cryptography-vectors (==43.0.0)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test = ["certifi", "cryptography-vectors (==43.0.1)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] [[package]] @@ -582,13 +582,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.112.2" +version = "0.114.0" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.112.2-py3-none-any.whl", hash = "sha256:db84b470bd0e2b1075942231e90e3577e12a903c4dc8696f0d206a7904a7af1c"}, - {file = "fastapi-0.112.2.tar.gz", hash = "sha256:3d4729c038414d5193840706907a41839d839523da6ed0c2811f1168cac1798c"}, + {file = "fastapi-0.114.0-py3-none-any.whl", hash = "sha256:fee75aa1b1d3d73f79851c432497e4394e413e1dece6234f68d3ce250d12760a"}, + {file = "fastapi-0.114.0.tar.gz", hash = "sha256:9908f2a5cc733004de6ca5e1412698f35085cefcbfd41d539245b9edf87b73c1"}, ] [package.dependencies] @@ -1098,13 +1098,13 @@ files = [ [[package]] name = "more-itertools" -version = "10.4.0" +version = "10.5.0" description = "More routines for operating on iterables, beyond itertools" optional = false python-versions = ">=3.8" files = [ - {file = "more-itertools-10.4.0.tar.gz", hash = "sha256:fe0e63c4ab068eac62410ab05cccca2dc71ec44ba8ef29916a0090df061cf923"}, - {file = "more_itertools-10.4.0-py3-none-any.whl", hash = "sha256:0f7d9f83a0a8dcfa8a2694a770590d98a67ea943e3d9f5298309a484758c4e27"}, + {file = "more-itertools-10.5.0.tar.gz", hash = "sha256:5482bfef7849c25dc3c6dd53a6173ae4795da2a41a80faea6700d9f5846c5da6"}, + {file = "more_itertools-10.5.0-py3-none-any.whl", hash = "sha256:037b0d3203ce90cca8ab1defbbdac29d5f993fc20131f3664dc8d6acfa872aef"}, ] [[package]] @@ -1236,63 +1236,64 @@ files = [ [[package]] name = "numpy" -version = "2.1.0" +version = "2.1.1" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.10" files = [ - {file = "numpy-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6326ab99b52fafdcdeccf602d6286191a79fe2fda0ae90573c5814cd2b0bc1b8"}, - {file = "numpy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0937e54c09f7a9a68da6889362ddd2ff584c02d015ec92672c099b61555f8911"}, - {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:30014b234f07b5fec20f4146f69e13cfb1e33ee9a18a1879a0142fbb00d47673"}, - {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:899da829b362ade41e1e7eccad2cf274035e1cb36ba73034946fccd4afd8606b"}, - {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08801848a40aea24ce16c2ecde3b756f9ad756586fb2d13210939eb69b023f5b"}, - {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:398049e237d1aae53d82a416dade04defed1a47f87d18d5bd615b6e7d7e41d1f"}, - {file = "numpy-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0abb3916a35d9090088a748636b2c06dc9a6542f99cd476979fb156a18192b84"}, - {file = "numpy-2.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:10e2350aea18d04832319aac0f887d5fcec1b36abd485d14f173e3e900b83e33"}, - {file = "numpy-2.1.0-cp310-cp310-win32.whl", hash = "sha256:f6b26e6c3b98adb648243670fddc8cab6ae17473f9dc58c51574af3e64d61211"}, - {file = "numpy-2.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:f505264735ee074250a9c78247ee8618292091d9d1fcc023290e9ac67e8f1afa"}, - {file = "numpy-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:76368c788ccb4f4782cf9c842b316140142b4cbf22ff8db82724e82fe1205dce"}, - {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f8e93a01a35be08d31ae33021e5268f157a2d60ebd643cfc15de6ab8e4722eb1"}, - {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:9523f8b46485db6939bd069b28b642fec86c30909cea90ef550373787f79530e"}, - {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54139e0eb219f52f60656d163cbe67c31ede51d13236c950145473504fa208cb"}, - {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5ebbf9fbdabed208d4ecd2e1dfd2c0741af2f876e7ae522c2537d404ca895c3"}, - {file = "numpy-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:378cb4f24c7d93066ee4103204f73ed046eb88f9ad5bb2275bb9fa0f6a02bd36"}, - {file = "numpy-2.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8f699a709120b220dfe173f79c73cb2a2cab2c0b88dd59d7b49407d032b8ebd"}, - {file = "numpy-2.1.0-cp311-cp311-win32.whl", hash = "sha256:ffbd6faeb190aaf2b5e9024bac9622d2ee549b7ec89ef3a9373fa35313d44e0e"}, - {file = "numpy-2.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:0af3a5987f59d9c529c022c8c2a64805b339b7ef506509fba7d0556649b9714b"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fe76d75b345dc045acdbc006adcb197cc680754afd6c259de60d358d60c93736"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f358ea9e47eb3c2d6eba121ab512dfff38a88db719c38d1e67349af210bc7529"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:dd94ce596bda40a9618324547cfaaf6650b1a24f5390350142499aa4e34e53d1"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:b47c551c6724960479cefd7353656498b86e7232429e3a41ab83be4da1b109e8"}, - {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0756a179afa766ad7cb6f036de622e8a8f16ffdd55aa31f296c870b5679d745"}, - {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24003ba8ff22ea29a8c306e61d316ac74111cebf942afbf692df65509a05f111"}, - {file = "numpy-2.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b34fa5e3b5d6dc7e0a4243fa0f81367027cb6f4a7215a17852979634b5544ee0"}, - {file = "numpy-2.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c4f982715e65036c34897eb598d64aef15150c447be2cfc6643ec7a11af06574"}, - {file = "numpy-2.1.0-cp312-cp312-win32.whl", hash = "sha256:c4cd94dfefbefec3f8b544f61286584292d740e6e9d4677769bc76b8f41deb02"}, - {file = "numpy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0cdef204199278f5c461a0bed6ed2e052998276e6d8ab2963d5b5c39a0500bc"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8ab81ccd753859ab89e67199b9da62c543850f819993761c1e94a75a814ed667"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:442596f01913656d579309edcd179a2a2f9977d9a14ff41d042475280fc7f34e"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:848c6b5cad9898e4b9ef251b6f934fa34630371f2e916261070a4eb9092ffd33"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:54c6a63e9d81efe64bfb7bcb0ec64332a87d0b87575f6009c8ba67ea6374770b"}, - {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:652e92fc409e278abdd61e9505649e3938f6d04ce7ef1953f2ec598a50e7c195"}, - {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ab32eb9170bf8ffcbb14f11613f4a0b108d3ffee0832457c5d4808233ba8977"}, - {file = "numpy-2.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:8fb49a0ba4d8f41198ae2d52118b050fd34dace4b8f3fb0ee34e23eb4ae775b1"}, - {file = "numpy-2.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44e44973262dc3ae79e9063a1284a73e09d01b894b534a769732ccd46c28cc62"}, - {file = "numpy-2.1.0-cp313-cp313-win32.whl", hash = "sha256:ab83adc099ec62e044b1fbb3a05499fa1e99f6d53a1dde102b2d85eff66ed324"}, - {file = "numpy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:de844aaa4815b78f6023832590d77da0e3b6805c644c33ce94a1e449f16d6ab5"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:343e3e152bf5a087511cd325e3b7ecfd5b92d369e80e74c12cd87826e263ec06"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f07fa2f15dabe91259828ce7d71b5ca9e2eb7c8c26baa822c825ce43552f4883"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5474dad8c86ee9ba9bb776f4b99ef2d41b3b8f4e0d199d4f7304728ed34d0300"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:1f817c71683fd1bb5cff1529a1d085a57f02ccd2ebc5cd2c566f9a01118e3b7d"}, - {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a3336fbfa0d38d3deacd3fe7f3d07e13597f29c13abf4d15c3b6dc2291cbbdd"}, - {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a894c51fd8c4e834f00ac742abad73fc485df1062f1b875661a3c1e1fb1c2f6"}, - {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:9156ca1f79fc4acc226696e95bfcc2b486f165a6a59ebe22b2c1f82ab190384a"}, - {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:624884b572dff8ca8f60fab591413f077471de64e376b17d291b19f56504b2bb"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:15ef8b2177eeb7e37dd5ef4016f30b7659c57c2c0b57a779f1d537ff33a72c7b"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:e5f0642cdf4636198a4990de7a71b693d824c56a757862230454629cf62e323d"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15976718c004466406342789f31b6673776360f3b1e3c575f25302d7e789575"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:6c1de77ded79fef664d5098a66810d4d27ca0224e9051906e634b3f7ead134c2"}, - {file = "numpy-2.1.0.tar.gz", hash = "sha256:7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8a0e34993b510fc19b9a2ce7f31cb8e94ecf6e924a40c0c9dd4f62d0aac47d9"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7dd86dfaf7c900c0bbdcb8b16e2f6ddf1eb1fe39c6c8cca6e94844ed3152a8fd"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:5889dd24f03ca5a5b1e8a90a33b5a0846d8977565e4ae003a63d22ecddf6782f"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:59ca673ad11d4b84ceb385290ed0ebe60266e356641428c845b39cd9df6713ab"}, + {file = "numpy-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:13ce49a34c44b6de5241f0b38b07e44c1b2dcacd9e36c30f9c2fcb1bb5135db7"}, + {file = "numpy-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:913cc1d311060b1d409e609947fa1b9753701dac96e6581b58afc36b7ee35af6"}, + {file = "numpy-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:caf5d284ddea7462c32b8d4a6b8af030b6c9fd5332afb70e7414d7fdded4bfd0"}, + {file = "numpy-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:57eb525e7c2a8fdee02d731f647146ff54ea8c973364f3b850069ffb42799647"}, + {file = "numpy-2.1.1-cp310-cp310-win32.whl", hash = "sha256:9a8e06c7a980869ea67bbf551283bbed2856915f0a792dc32dd0f9dd2fb56728"}, + {file = "numpy-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:d10c39947a2d351d6d466b4ae83dad4c37cd6c3cdd6d5d0fa797da56f710a6ae"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0d07841fd284718feffe7dd17a63a2e6c78679b2d386d3e82f44f0108c905550"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b5613cfeb1adfe791e8e681128f5f49f22f3fcaa942255a6124d58ca59d9528f"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:0b8cc2715a84b7c3b161f9ebbd942740aaed913584cae9cdc7f8ad5ad41943d0"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:b49742cdb85f1f81e4dc1b39dcf328244f4d8d1ded95dea725b316bd2cf18c95"}, + {file = "numpy-2.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8d5f8a8e3bc87334f025194c6193e408903d21ebaeb10952264943a985066ca"}, + {file = "numpy-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d51fc141ddbe3f919e91a096ec739f49d686df8af254b2053ba21a910ae518bf"}, + {file = "numpy-2.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:98ce7fb5b8063cfdd86596b9c762bf2b5e35a2cdd7e967494ab78a1fa7f8b86e"}, + {file = "numpy-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:24c2ad697bd8593887b019817ddd9974a7f429c14a5469d7fad413f28340a6d2"}, + {file = "numpy-2.1.1-cp311-cp311-win32.whl", hash = "sha256:397bc5ce62d3fb73f304bec332171535c187e0643e176a6e9421a6e3eacef06d"}, + {file = "numpy-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:ae8ce252404cdd4de56dcfce8b11eac3c594a9c16c231d081fb705cf23bd4d9e"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c803b7934a7f59563db459292e6aa078bb38b7ab1446ca38dd138646a38203e"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6435c48250c12f001920f0751fe50c0348f5f240852cfddc5e2f97e007544cbe"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3269c9eb8745e8d975980b3a7411a98976824e1fdef11f0aacf76147f662b15f"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:fac6e277a41163d27dfab5f4ec1f7a83fac94e170665a4a50191b545721c6521"}, + {file = "numpy-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fcd8f556cdc8cfe35e70efb92463082b7f43dd7e547eb071ffc36abc0ca4699b"}, + {file = "numpy-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b9cd92c8f8e7b313b80e93cedc12c0112088541dcedd9197b5dee3738c1201"}, + {file = "numpy-2.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:afd9c680df4de71cd58582b51e88a61feed4abcc7530bcd3d48483f20fc76f2a"}, + {file = "numpy-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8661c94e3aad18e1ea17a11f60f843a4933ccaf1a25a7c6a9182af70610b2313"}, + {file = "numpy-2.1.1-cp312-cp312-win32.whl", hash = "sha256:950802d17a33c07cba7fd7c3dcfa7d64705509206be1606f196d179e539111ed"}, + {file = "numpy-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:3fc5eabfc720db95d68e6646e88f8b399bfedd235994016351b1d9e062c4b270"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:046356b19d7ad1890c751b99acad5e82dc4a02232013bd9a9a712fddf8eb60f5"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:6e5a9cb2be39350ae6c8f79410744e80154df658d5bea06e06e0ac5bb75480d5"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:d4c57b68c8ef5e1ebf47238e99bf27657511ec3f071c465f6b1bccbef12d4136"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:8ae0fd135e0b157365ac7cc31fff27f07a5572bdfc38f9c2d43b2aff416cc8b0"}, + {file = "numpy-2.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:981707f6b31b59c0c24bcda52e5605f9701cb46da4b86c2e8023656ad3e833cb"}, + {file = "numpy-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ca4b53e1e0b279142113b8c5eb7d7a877e967c306edc34f3b58e9be12fda8df"}, + {file = "numpy-2.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e097507396c0be4e547ff15b13dc3866f45f3680f789c1a1301b07dadd3fbc78"}, + {file = "numpy-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7506387e191fe8cdb267f912469a3cccc538ab108471291636a96a54e599556"}, + {file = "numpy-2.1.1-cp313-cp313-win32.whl", hash = "sha256:251105b7c42abe40e3a689881e1793370cc9724ad50d64b30b358bbb3a97553b"}, + {file = "numpy-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:f212d4f46b67ff604d11fff7cc62d36b3e8714edf68e44e9760e19be38c03eb0"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:920b0911bb2e4414c50e55bd658baeb78281a47feeb064ab40c2b66ecba85553"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:bab7c09454460a487e631ffc0c42057e3d8f2a9ddccd1e60c7bb8ed774992480"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:cea427d1350f3fd0d2818ce7350095c1a2ee33e30961d2f0fef48576ddbbe90f"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:e30356d530528a42eeba51420ae8bf6c6c09559051887196599d96ee5f536468"}, + {file = "numpy-2.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8dfa9e94fc127c40979c3eacbae1e61fda4fe71d84869cc129e2721973231ef"}, + {file = "numpy-2.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:910b47a6d0635ec1bd53b88f86120a52bf56dcc27b51f18c7b4a2e2224c29f0f"}, + {file = "numpy-2.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:13cc11c00000848702322af4de0147ced365c81d66053a67c2e962a485b3717c"}, + {file = "numpy-2.1.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:53e27293b3a2b661c03f79aa51c3987492bd4641ef933e366e0f9f6c9bf257ec"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7be6a07520b88214ea85d8ac8b7d6d8a1839b0b5cb87412ac9f49fa934eb15d5"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:52ac2e48f5ad847cd43c4755520a2317f3380213493b9d8a4c5e37f3b87df504"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50a95ca3560a6058d6ea91d4629a83a897ee27c00630aed9d933dff191f170cd"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:99f4a9ee60eed1385a86e82288971a51e71df052ed0b2900ed30bc840c0f2e39"}, + {file = "numpy-2.1.1.tar.gz", hash = "sha256:d0cf7d55b1051387807405b3898efafa862997b4cba8aa5dbe657be794afeafd"}, ] [[package]] @@ -1694,122 +1695,123 @@ files = [ [[package]] name = "pydantic" -version = "2.8.2" +version = "2.9.0" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.8.2-py3-none-any.whl", hash = "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8"}, - {file = "pydantic-2.8.2.tar.gz", hash = "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a"}, + {file = "pydantic-2.9.0-py3-none-any.whl", hash = "sha256:f66a7073abd93214a20c5f7b32d56843137a7a2e70d02111f3be287035c45370"}, + {file = "pydantic-2.9.0.tar.gz", hash = "sha256:c7a8a9fdf7d100afa49647eae340e2d23efa382466a8d177efcd1381e9be5598"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.20.1" +pydantic-core = "2.23.2" typing-extensions = [ {version = ">=4.6.1", markers = "python_version < \"3.13\""}, {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] +tzdata = {version = "*", markers = "python_version >= \"3.9\""} [package.extras] email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.20.1" +version = "2.23.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.20.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3"}, - {file = "pydantic_core-2.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f239eb799a2081495ea659d8d4a43a8f42cd1fe9ff2e7e436295c38a10c286a"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53e431da3fc53360db73eedf6f7124d1076e1b4ee4276b36fb25514544ceb4a3"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1f62b2413c3a0e846c3b838b2ecd6c7a19ec6793b2a522745b0869e37ab5bc1"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5d41e6daee2813ecceea8eda38062d69e280b39df793f5a942fa515b8ed67953"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d482efec8b7dc6bfaedc0f166b2ce349df0011f5d2f1f25537ced4cfc34fd98"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e93e1a4b4b33daed65d781a57a522ff153dcf748dee70b40c7258c5861e1768a"}, - {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e7c4ea22b6739b162c9ecaaa41d718dfad48a244909fe7ef4b54c0b530effc5a"}, - {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4f2790949cf385d985a31984907fecb3896999329103df4e4983a4a41e13e840"}, - {file = "pydantic_core-2.20.1-cp310-none-win32.whl", hash = "sha256:5e999ba8dd90e93d57410c5e67ebb67ffcaadcea0ad973240fdfd3a135506250"}, - {file = "pydantic_core-2.20.1-cp310-none-win_amd64.whl", hash = "sha256:512ecfbefef6dac7bc5eaaf46177b2de58cdf7acac8793fe033b24ece0b9566c"}, - {file = "pydantic_core-2.20.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:d2a8fa9d6d6f891f3deec72f5cc668e6f66b188ab14bb1ab52422fe8e644f312"}, - {file = "pydantic_core-2.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:175873691124f3d0da55aeea1d90660a6ea7a3cfea137c38afa0a5ffabe37b88"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37eee5b638f0e0dcd18d21f59b679686bbd18917b87db0193ae36f9c23c355fc"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25e9185e2d06c16ee438ed39bf62935ec436474a6ac4f9358524220f1b236e43"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:150906b40ff188a3260cbee25380e7494ee85048584998c1e66df0c7a11c17a6"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ad4aeb3e9a97286573c03df758fc7627aecdd02f1da04516a86dc159bf70121"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3f3ed29cd9f978c604708511a1f9c2fdcb6c38b9aae36a51905b8811ee5cbf1"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b0dae11d8f5ded51699c74d9548dcc5938e0804cc8298ec0aa0da95c21fff57b"}, - {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27"}, - {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9dc1b507c12eb0481d071f3c1808f0529ad41dc415d0ca11f7ebfc666e66a18b"}, - {file = "pydantic_core-2.20.1-cp311-none-win32.whl", hash = "sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a"}, - {file = "pydantic_core-2.20.1-cp311-none-win_amd64.whl", hash = "sha256:40a783fb7ee353c50bd3853e626f15677ea527ae556429453685ae32280c19c2"}, - {file = "pydantic_core-2.20.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:595ba5be69b35777474fa07f80fc260ea71255656191adb22a8c53aba4479231"}, - {file = "pydantic_core-2.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a4f55095ad087474999ee28d3398bae183a66be4823f753cd7d67dd0153427c9"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e97fdf088d4b31ff4ba35db26d9cc472ac7ef4a2ff2badeabf8d727b3377fc52"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc633a9fe1eb87e250b5c57d389cf28998e4292336926b0b6cdaee353f89a237"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d573faf8eb7e6b1cbbcb4f5b247c60ca8be39fe2c674495df0eb4318303137fe"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26dc97754b57d2fd00ac2b24dfa341abffc380b823211994c4efac7f13b9e90e"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:33499e85e739a4b60c9dac710c20a08dc73cb3240c9a0e22325e671b27b70d24"}, - {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bebb4d6715c814597f85297c332297c6ce81e29436125ca59d1159b07f423eb1"}, - {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:516d9227919612425c8ef1c9b869bbbee249bc91912c8aaffb66116c0b447ebd"}, - {file = "pydantic_core-2.20.1-cp312-none-win32.whl", hash = "sha256:469f29f9093c9d834432034d33f5fe45699e664f12a13bf38c04967ce233d688"}, - {file = "pydantic_core-2.20.1-cp312-none-win_amd64.whl", hash = "sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d"}, - {file = "pydantic_core-2.20.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686"}, - {file = "pydantic_core-2.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19c0fa39fa154e7e0b7f82f88ef85faa2a4c23cc65aae2f5aea625e3c13c735a"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa223cd1e36b642092c326d694d8bf59b71ddddc94cdb752bbbb1c5c91d833b"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c336a6d235522a62fef872c6295a42ecb0c4e1d0f1a3e500fe949415761b8a19"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7eb6a0587eded33aeefea9f916899d42b1799b7b14b8f8ff2753c0ac1741edac"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:70c8daf4faca8da5a6d655f9af86faf6ec2e1768f4b8b9d0226c02f3d6209703"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9fa4c9bf273ca41f940bceb86922a7667cd5bf90e95dbb157cbb8441008482c"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11b71d67b4725e7e2a9f6e9c0ac1239bbc0c48cce3dc59f98635efc57d6dac83"}, - {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:270755f15174fb983890c49881e93f8f1b80f0b5e3a3cc1394a255706cabd203"}, - {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c81131869240e3e568916ef4c307f8b99583efaa60a8112ef27a366eefba8ef0"}, - {file = "pydantic_core-2.20.1-cp313-none-win32.whl", hash = "sha256:b91ced227c41aa29c672814f50dbb05ec93536abf8f43cd14ec9521ea09afe4e"}, - {file = "pydantic_core-2.20.1-cp313-none-win_amd64.whl", hash = "sha256:65db0f2eefcaad1a3950f498aabb4875c8890438bc80b19362cf633b87a8ab20"}, - {file = "pydantic_core-2.20.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:4745f4ac52cc6686390c40eaa01d48b18997cb130833154801a442323cc78f91"}, - {file = "pydantic_core-2.20.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a8ad4c766d3f33ba8fd692f9aa297c9058970530a32c728a2c4bfd2616d3358b"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41e81317dd6a0127cabce83c0c9c3fbecceae981c8391e6f1dec88a77c8a569a"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:04024d270cf63f586ad41fff13fde4311c4fc13ea74676962c876d9577bcc78f"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eaad4ff2de1c3823fddf82f41121bdf453d922e9a238642b1dedb33c4e4f98ad"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26ab812fa0c845df815e506be30337e2df27e88399b985d0bb4e3ecfe72df31c"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c5ebac750d9d5f2706654c638c041635c385596caf68f81342011ddfa1e5598"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2aafc5a503855ea5885559eae883978c9b6d8c8993d67766ee73d82e841300dd"}, - {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:4868f6bd7c9d98904b748a2653031fc9c2f85b6237009d475b1008bfaeb0a5aa"}, - {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa2f457b4af386254372dfa78a2eda2563680d982422641a85f271c859df1987"}, - {file = "pydantic_core-2.20.1-cp38-none-win32.whl", hash = "sha256:225b67a1f6d602de0ce7f6c1c3ae89a4aa25d3de9be857999e9124f15dab486a"}, - {file = "pydantic_core-2.20.1-cp38-none-win_amd64.whl", hash = "sha256:6b507132dcfc0dea440cce23ee2182c0ce7aba7054576efc65634f080dbe9434"}, - {file = "pydantic_core-2.20.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:b03f7941783b4c4a26051846dea594628b38f6940a2fdc0df00b221aed39314c"}, - {file = "pydantic_core-2.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1eedfeb6089ed3fad42e81a67755846ad4dcc14d73698c120a82e4ccf0f1f9f6"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:635fee4e041ab9c479e31edda27fcf966ea9614fff1317e280d99eb3e5ab6fe2"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:77bf3ac639c1ff567ae3b47f8d4cc3dc20f9966a2a6dd2311dcc055d3d04fb8a"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ed1b0132f24beeec5a78b67d9388656d03e6a7c837394f99257e2d55b461611"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c6514f963b023aeee506678a1cf821fe31159b925c4b76fe2afa94cc70b3222b"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10d4204d8ca33146e761c79f83cc861df20e7ae9f6487ca290a97702daf56006"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2d036c7187b9422ae5b262badb87a20a49eb6c5238b2004e96d4da1231badef1"}, - {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9ebfef07dbe1d93efb94b4700f2d278494e9162565a54f124c404a5656d7ff09"}, - {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6b9d9bb600328a1ce523ab4f454859e9d439150abb0906c5a1983c146580ebab"}, - {file = "pydantic_core-2.20.1-cp39-none-win32.whl", hash = "sha256:784c1214cb6dd1e3b15dd8b91b9a53852aed16671cc3fbe4786f4f1db07089e2"}, - {file = "pydantic_core-2.20.1-cp39-none-win_amd64.whl", hash = "sha256:d2fe69c5434391727efa54b47a1e7986bb0186e72a41b203df8f5b0a19a4f669"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a45f84b09ac9c3d35dfcf6a27fd0634d30d183205230a0ebe8373a0e8cfa0906"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d02a72df14dfdbaf228424573a07af10637bd490f0901cee872c4f434a735b94"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2b27e6af28f07e2f195552b37d7d66b150adbaa39a6d327766ffd695799780f"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:242b8feb3c493ab78be289c034a1f659e8826e2233786e36f2893a950a719bb6"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:38cf1c40a921d05c5edc61a785c0ddb4bed67827069f535d794ce6bcded919fc"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e0bbdd76ce9aa5d4209d65f2b27fc6e5ef1312ae6c5333c26db3f5ade53a1e99"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:254ec27fdb5b1ee60684f91683be95e5133c994cc54e86a0b0963afa25c8f8a6"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:407653af5617f0757261ae249d3fba09504d7a71ab36ac057c938572d1bc9331"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:c693e916709c2465b02ca0ad7b387c4f8423d1db7b4649c551f27a529181c5ad"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b5ff4911aea936a47d9376fd3ab17e970cc543d1b68921886e7f64bd28308d1"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177f55a886d74f1808763976ac4efd29b7ed15c69f4d838bbd74d9d09cf6fa86"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:964faa8a861d2664f0c7ab0c181af0bea66098b1919439815ca8803ef136fc4e"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:4dd484681c15e6b9a977c785a345d3e378d72678fd5f1f3c0509608da24f2ac0"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f6d6cff3538391e8486a431569b77921adfcdef14eb18fbf19b7c0a5294d4e6a"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a6d511cc297ff0883bc3708b465ff82d7560193169a8b93260f74ecb0a5e08a7"}, - {file = "pydantic_core-2.20.1.tar.gz", hash = "sha256:26ca695eeee5f9f1aeeb211ffc12f10bcb6f71e2989988fda61dabd65db878d4"}, + {file = "pydantic_core-2.23.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:7d0324a35ab436c9d768753cbc3c47a865a2cbc0757066cb864747baa61f6ece"}, + {file = "pydantic_core-2.23.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:276ae78153a94b664e700ac362587c73b84399bd1145e135287513442e7dfbc7"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:964c7aa318da542cdcc60d4a648377ffe1a2ef0eb1e996026c7f74507b720a78"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1cf842265a3a820ebc6388b963ead065f5ce8f2068ac4e1c713ef77a67b71f7c"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae90b9e50fe1bd115b24785e962b51130340408156d34d67b5f8f3fa6540938e"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ae65fdfb8a841556b52935dfd4c3f79132dc5253b12c0061b96415208f4d622"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c8aa40f6ca803f95b1c1c5aeaee6237b9e879e4dfb46ad713229a63651a95fb"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c53100c8ee5a1e102766abde2158077d8c374bee0639201f11d3032e3555dfbc"}, + {file = "pydantic_core-2.23.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d6b9dd6aa03c812017411734e496c44fef29b43dba1e3dd1fa7361bbacfc1354"}, + {file = "pydantic_core-2.23.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b18cf68255a476b927910c6873d9ed00da692bb293c5b10b282bd48a0afe3ae2"}, + {file = "pydantic_core-2.23.2-cp310-none-win32.whl", hash = "sha256:e460475719721d59cd54a350c1f71c797c763212c836bf48585478c5514d2854"}, + {file = "pydantic_core-2.23.2-cp310-none-win_amd64.whl", hash = "sha256:5f3cf3721eaf8741cffaf092487f1ca80831202ce91672776b02b875580e174a"}, + {file = "pydantic_core-2.23.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:7ce8e26b86a91e305858e018afc7a6e932f17428b1eaa60154bd1f7ee888b5f8"}, + {file = "pydantic_core-2.23.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7e9b24cca4037a561422bf5dc52b38d390fb61f7bfff64053ce1b72f6938e6b2"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:753294d42fb072aa1775bfe1a2ba1012427376718fa4c72de52005a3d2a22178"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:257d6a410a0d8aeb50b4283dea39bb79b14303e0fab0f2b9d617701331ed1515"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c8319e0bd6a7b45ad76166cc3d5d6a36c97d0c82a196f478c3ee5346566eebfd"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7a05c0240f6c711eb381ac392de987ee974fa9336071fb697768dfdb151345ce"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d5b0ff3218858859910295df6953d7bafac3a48d5cd18f4e3ed9999efd2245f"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:96ef39add33ff58cd4c112cbac076726b96b98bb8f1e7f7595288dcfb2f10b57"}, + {file = "pydantic_core-2.23.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0102e49ac7d2df3379ef8d658d3bc59d3d769b0bdb17da189b75efa861fc07b4"}, + {file = "pydantic_core-2.23.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a6612c2a844043e4d10a8324c54cdff0042c558eef30bd705770793d70b224aa"}, + {file = "pydantic_core-2.23.2-cp311-none-win32.whl", hash = "sha256:caffda619099cfd4f63d48462f6aadbecee3ad9603b4b88b60cb821c1b258576"}, + {file = "pydantic_core-2.23.2-cp311-none-win_amd64.whl", hash = "sha256:6f80fba4af0cb1d2344869d56430e304a51396b70d46b91a55ed4959993c0589"}, + {file = "pydantic_core-2.23.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:4c83c64d05ffbbe12d4e8498ab72bdb05bcc1026340a4a597dc647a13c1605ec"}, + {file = "pydantic_core-2.23.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6294907eaaccf71c076abdd1c7954e272efa39bb043161b4b8aa1cd76a16ce43"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a801c5e1e13272e0909c520708122496647d1279d252c9e6e07dac216accc41"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cc0c316fba3ce72ac3ab7902a888b9dc4979162d320823679da270c2d9ad0cad"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b06c5d4e8701ac2ba99a2ef835e4e1b187d41095a9c619c5b185c9068ed2a49"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:82764c0bd697159fe9947ad59b6db6d7329e88505c8f98990eb07e84cc0a5d81"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b1a195efd347ede8bcf723e932300292eb13a9d2a3c1f84eb8f37cbbc905b7f"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b7efb12e5071ad8d5b547487bdad489fbd4a5a35a0fc36a1941517a6ad7f23e0"}, + {file = "pydantic_core-2.23.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:5dd0ec5f514ed40e49bf961d49cf1bc2c72e9b50f29a163b2cc9030c6742aa73"}, + {file = "pydantic_core-2.23.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:820f6ee5c06bc868335e3b6e42d7ef41f50dfb3ea32fbd523ab679d10d8741c0"}, + {file = "pydantic_core-2.23.2-cp312-none-win32.whl", hash = "sha256:3713dc093d5048bfaedbba7a8dbc53e74c44a140d45ede020dc347dda18daf3f"}, + {file = "pydantic_core-2.23.2-cp312-none-win_amd64.whl", hash = "sha256:e1895e949f8849bc2757c0dbac28422a04be031204df46a56ab34bcf98507342"}, + {file = "pydantic_core-2.23.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:da43cbe593e3c87d07108d0ebd73771dc414488f1f91ed2e204b0370b94b37ac"}, + {file = "pydantic_core-2.23.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:64d094ea1aa97c6ded4748d40886076a931a8bf6f61b6e43e4a1041769c39dd2"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:084414ffe9a85a52940b49631321d636dadf3576c30259607b75516d131fecd0"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:043ef8469f72609c4c3a5e06a07a1f713d53df4d53112c6d49207c0bd3c3bd9b"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3649bd3ae6a8ebea7dc381afb7f3c6db237fc7cebd05c8ac36ca8a4187b03b30"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6db09153d8438425e98cdc9a289c5fade04a5d2128faff8f227c459da21b9703"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5668b3173bb0b2e65020b60d83f5910a7224027232c9f5dc05a71a1deac9f960"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1c7b81beaf7c7ebde978377dc53679c6cba0e946426fc7ade54251dfe24a7604"}, + {file = "pydantic_core-2.23.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:ae579143826c6f05a361d9546446c432a165ecf1c0b720bbfd81152645cb897d"}, + {file = "pydantic_core-2.23.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:19f1352fe4b248cae22a89268720fc74e83f008057a652894f08fa931e77dced"}, + {file = "pydantic_core-2.23.2-cp313-none-win32.whl", hash = "sha256:e1a79ad49f346aa1a2921f31e8dbbab4d64484823e813a002679eaa46cba39e1"}, + {file = "pydantic_core-2.23.2-cp313-none-win_amd64.whl", hash = "sha256:582871902e1902b3c8e9b2c347f32a792a07094110c1bca6c2ea89b90150caac"}, + {file = "pydantic_core-2.23.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:743e5811b0c377eb830150d675b0847a74a44d4ad5ab8845923d5b3a756d8100"}, + {file = "pydantic_core-2.23.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6650a7bbe17a2717167e3e23c186849bae5cef35d38949549f1c116031b2b3aa"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:56e6a12ec8d7679f41b3750ffa426d22b44ef97be226a9bab00a03365f217b2b"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:810ca06cca91de9107718dc83d9ac4d2e86efd6c02cba49a190abcaf33fb0472"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:785e7f517ebb9890813d31cb5d328fa5eda825bb205065cde760b3150e4de1f7"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ef71ec876fcc4d3bbf2ae81961959e8d62f8d74a83d116668409c224012e3af"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d50ac34835c6a4a0d456b5db559b82047403c4317b3bc73b3455fefdbdc54b0a"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16b25a4a120a2bb7dab51b81e3d9f3cde4f9a4456566c403ed29ac81bf49744f"}, + {file = "pydantic_core-2.23.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:41ae8537ad371ec018e3c5da0eb3f3e40ee1011eb9be1da7f965357c4623c501"}, + {file = "pydantic_core-2.23.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07049ec9306ec64e955b2e7c40c8d77dd78ea89adb97a2013d0b6e055c5ee4c5"}, + {file = "pydantic_core-2.23.2-cp38-none-win32.whl", hash = "sha256:086c5db95157dc84c63ff9d96ebb8856f47ce113c86b61065a066f8efbe80acf"}, + {file = "pydantic_core-2.23.2-cp38-none-win_amd64.whl", hash = "sha256:67b6655311b00581914aba481729971b88bb8bc7996206590700a3ac85e457b8"}, + {file = "pydantic_core-2.23.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:358331e21a897151e54d58e08d0219acf98ebb14c567267a87e971f3d2a3be59"}, + {file = "pydantic_core-2.23.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c4d9f15ffe68bcd3898b0ad7233af01b15c57d91cd1667f8d868e0eacbfe3f87"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0123655fedacf035ab10c23450163c2f65a4174f2bb034b188240a6cf06bb123"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e6e3ccebdbd6e53474b0bb7ab8b88e83c0cfe91484b25e058e581348ee5a01a5"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc535cb898ef88333cf317777ecdfe0faac1c2a3187ef7eb061b6f7ecf7e6bae"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aab9e522efff3993a9e98ab14263d4e20211e62da088298089a03056980a3e69"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05b366fb8fe3d8683b11ac35fa08947d7b92be78ec64e3277d03bd7f9b7cda79"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7568f682c06f10f30ef643a1e8eec4afeecdafde5c4af1b574c6df079e96f96c"}, + {file = "pydantic_core-2.23.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:cdd02a08205dc90238669f082747612cb3c82bd2c717adc60f9b9ecadb540f80"}, + {file = "pydantic_core-2.23.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1a2ab4f410f4b886de53b6bddf5dd6f337915a29dd9f22f20f3099659536b2f6"}, + {file = "pydantic_core-2.23.2-cp39-none-win32.whl", hash = "sha256:0448b81c3dfcde439551bb04a9f41d7627f676b12701865c8a2574bcea034437"}, + {file = "pydantic_core-2.23.2-cp39-none-win_amd64.whl", hash = "sha256:4cebb9794f67266d65e7e4cbe5dcf063e29fc7b81c79dc9475bd476d9534150e"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e758d271ed0286d146cf7c04c539a5169a888dd0b57026be621547e756af55bc"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:f477d26183e94eaafc60b983ab25af2a809a1b48ce4debb57b343f671b7a90b6"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da3131ef2b940b99106f29dfbc30d9505643f766704e14c5d5e504e6a480c35e"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329a721253c7e4cbd7aad4a377745fbcc0607f9d72a3cc2102dd40519be75ed2"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7706e15cdbf42f8fab1e6425247dfa98f4a6f8c63746c995d6a2017f78e619ae"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:e64ffaf8f6e17ca15eb48344d86a7a741454526f3a3fa56bc493ad9d7ec63936"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dd59638025160056687d598b054b64a79183f8065eae0d3f5ca523cde9943940"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:12625e69b1199e94b0ae1c9a95d000484ce9f0182f9965a26572f054b1537e44"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5d813fd871b3d5c3005157622ee102e8908ad6011ec915a18bd8fde673c4360e"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:1eb37f7d6a8001c0f86dc8ff2ee8d08291a536d76e49e78cda8587bb54d8b329"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ce7eaf9a98680b4312b7cebcdd9352531c43db00fca586115845df388f3c465"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f087879f1ffde024dd2788a30d55acd67959dcf6c431e9d3682d1c491a0eb474"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6ce883906810b4c3bd90e0ada1f9e808d9ecf1c5f0b60c6b8831d6100bcc7dd6"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a8031074a397a5925d06b590121f8339d34a5a74cfe6970f8a1124eb8b83f4ac"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:23af245b8f2f4ee9e2c99cb3f93d0e22fb5c16df3f2f643f5a8da5caff12a653"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c57e493a0faea1e4c38f860d6862ba6832723396c884fbf938ff5e9b224200e2"}, + {file = "pydantic_core-2.23.2.tar.gz", hash = "sha256:95d6bf449a1ac81de562d65d180af5d8c19672793c81877a2eda8fde5d08f2fd"}, ] [package.dependencies] @@ -2014,13 +2016,13 @@ dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatc [[package]] name = "python-socketio" -version = "5.11.3" +version = "5.11.4" description = "Socket.IO server and client for Python" optional = false python-versions = ">=3.8" files = [ - {file = "python_socketio-5.11.3-py3-none-any.whl", hash = "sha256:2a923a831ff70664b7c502df093c423eb6aa93c1ce68b8319e840227a26d8b69"}, - {file = "python_socketio-5.11.3.tar.gz", hash = "sha256:194af8cdbb7b0768c2e807ba76c7abc288eb5bb85559b7cddee51a6bc7a65737"}, + {file = "python_socketio-5.11.4-py3-none-any.whl", hash = "sha256:42efaa3e3e0b166fc72a527488a13caaac2cefc76174252486503bd496284945"}, + {file = "python_socketio-5.11.4.tar.gz", hash = "sha256:8b0b8ff2964b2957c865835e936310190639c00310a47d77321a594d1665355e"}, ] [package.dependencies] @@ -2155,13 +2157,13 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "reflex-chakra" -version = "0.6.0a1" +version = "0.6.0a5" description = "reflex using chakra components" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_chakra-0.6.0a1-py3-none-any.whl", hash = "sha256:68c22e00591530c38acedb20ee9c192109a3591f3e58fb3a51c9e939b13c66ad"}, - {file = "reflex_chakra-0.6.0a1.tar.gz", hash = "sha256:9061790bb59134cf2200461de45f582987cef29032f82864165a3c5badb86cf5"}, + {file = "reflex_chakra-0.6.0a5-py3-none-any.whl", hash = "sha256:9d502ddf3bd606baef4f0ff6453dcefb5e19dab4cfaf7c23df069fab70687a63"}, + {file = "reflex_chakra-0.6.0a5.tar.gz", hash = "sha256:b44e73478462052f09c9677d3fd7726891b4af87711b4b6a2171f010049308c9"}, ] [package.dependencies] @@ -2396,60 +2398,60 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.32" +version = "2.0.34" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0c9045ecc2e4db59bfc97b20516dfdf8e41d910ac6fb667ebd3a79ea54084619"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1467940318e4a860afd546ef61fefb98a14d935cd6817ed07a228c7f7c62f389"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5954463675cb15db8d4b521f3566a017c8789222b8316b1e6934c811018ee08b"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167e7497035c303ae50651b351c28dc22a40bb98fbdb8468cdc971821b1ae533"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b27dfb676ac02529fb6e343b3a482303f16e6bc3a4d868b73935b8792edb52d0"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bf2360a5e0f7bd75fa80431bf8ebcfb920c9f885e7956c7efde89031695cafb8"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-win32.whl", hash = "sha256:306fe44e754a91cd9d600a6b070c1f2fadbb4a1a257b8781ccf33c7067fd3e4d"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-win_amd64.whl", hash = "sha256:99db65e6f3ab42e06c318f15c98f59a436f1c78179e6a6f40f529c8cc7100b22"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:21b053be28a8a414f2ddd401f1be8361e41032d2ef5884b2f31d31cb723e559f"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b178e875a7a25b5938b53b006598ee7645172fccafe1c291a706e93f48499ff5"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723a40ee2cc7ea653645bd4cf024326dea2076673fc9d3d33f20f6c81db83e1d"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:295ff8689544f7ee7e819529633d058bd458c1fd7f7e3eebd0f9268ebc56c2a0"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:49496b68cd190a147118af585173ee624114dfb2e0297558c460ad7495f9dfe2"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:acd9b73c5c15f0ec5ce18128b1fe9157ddd0044abc373e6ecd5ba376a7e5d961"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-win32.whl", hash = "sha256:9365a3da32dabd3e69e06b972b1ffb0c89668994c7e8e75ce21d3e5e69ddef28"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-win_amd64.whl", hash = "sha256:8bd63d051f4f313b102a2af1cbc8b80f061bf78f3d5bd0843ff70b5859e27924"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6bab3db192a0c35e3c9d1560eb8332463e29e5507dbd822e29a0a3c48c0a8d92"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:19d98f4f58b13900d8dec4ed09dd09ef292208ee44cc9c2fe01c1f0a2fe440e9"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cd33c61513cb1b7371fd40cf221256456d26a56284e7d19d1f0b9f1eb7dd7e8"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d6ba0497c1d066dd004e0f02a92426ca2df20fac08728d03f67f6960271feec"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2b6be53e4fde0065524f1a0a7929b10e9280987b320716c1509478b712a7688c"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:916a798f62f410c0b80b63683c8061f5ebe237b0f4ad778739304253353bc1cb"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-win32.whl", hash = "sha256:31983018b74908ebc6c996a16ad3690301a23befb643093fcfe85efd292e384d"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-win_amd64.whl", hash = "sha256:4363ed245a6231f2e2957cccdda3c776265a75851f4753c60f3004b90e69bfeb"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b8afd5b26570bf41c35c0121801479958b4446751a3971fb9a480c1afd85558e"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c750987fc876813f27b60d619b987b057eb4896b81117f73bb8d9918c14f1cad"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ada0102afff4890f651ed91120c1120065663506b760da4e7823913ebd3258be"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:78c03d0f8a5ab4f3034c0e8482cfcc415a3ec6193491cfa1c643ed707d476f16"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:3bd1cae7519283ff525e64645ebd7a3e0283f3c038f461ecc1c7b040a0c932a1"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-win32.whl", hash = "sha256:01438ebcdc566d58c93af0171c74ec28efe6a29184b773e378a385e6215389da"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-win_amd64.whl", hash = "sha256:4979dc80fbbc9d2ef569e71e0896990bc94df2b9fdbd878290bd129b65ab579c"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c742be912f57586ac43af38b3848f7688863a403dfb220193a882ea60e1ec3a"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:62e23d0ac103bcf1c5555b6c88c114089587bc64d048fef5bbdb58dfd26f96da"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:251f0d1108aab8ea7b9aadbd07fb47fb8e3a5838dde34aa95a3349876b5a1f1d"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ef18a84e5116340e38eca3e7f9eeaaef62738891422e7c2a0b80feab165905f"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3eb6a97a1d39976f360b10ff208c73afb6a4de86dd2a6212ddf65c4a6a2347d5"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0c1c9b673d21477cec17ab10bc4decb1322843ba35b481585facd88203754fc5"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-win32.whl", hash = "sha256:c41a2b9ca80ee555decc605bd3c4520cc6fef9abde8fd66b1cf65126a6922d65"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-win_amd64.whl", hash = "sha256:8a37e4d265033c897892279e8adf505c8b6b4075f2b40d77afb31f7185cd6ecd"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:52fec964fba2ef46476312a03ec8c425956b05c20220a1a03703537824b5e8e1"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:328429aecaba2aee3d71e11f2477c14eec5990fb6d0e884107935f7fb6001632"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85a01b5599e790e76ac3fe3aa2f26e1feba56270023d6afd5550ed63c68552b3"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aaf04784797dcdf4c0aa952c8d234fa01974c4729db55c45732520ce12dd95b4"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4488120becf9b71b3ac718f4138269a6be99a42fe023ec457896ba4f80749525"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:14e09e083a5796d513918a66f3d6aedbc131e39e80875afe81d98a03312889e6"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-win32.whl", hash = "sha256:0d322cc9c9b2154ba7e82f7bf25ecc7c36fbe2d82e2933b3642fc095a52cfc78"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-win_amd64.whl", hash = "sha256:7dd8583df2f98dea28b5cd53a1beac963f4f9d087888d75f22fcc93a07cf8d84"}, - {file = "SQLAlchemy-2.0.32-py3-none-any.whl", hash = "sha256:e567a8793a692451f706b363ccf3c45e056b67d90ead58c3bc9471af5d212202"}, - {file = "SQLAlchemy-2.0.32.tar.gz", hash = "sha256:c1b88cc8b02b6a5f0efb0345a03672d4c897dc7d92585176f88c67346f565ea8"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:95d0b2cf8791ab5fb9e3aa3d9a79a0d5d51f55b6357eecf532a120ba3b5524db"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:243f92596f4fd4c8bd30ab8e8dd5965afe226363d75cab2468f2c707f64cd83b"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9ea54f7300553af0a2a7235e9b85f4204e1fc21848f917a3213b0e0818de9a24"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:173f5f122d2e1bff8fbd9f7811b7942bead1f5e9f371cdf9e670b327e6703ebd"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:196958cde924a00488e3e83ff917be3b73cd4ed8352bbc0f2989333176d1c54d"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bd90c221ed4e60ac9d476db967f436cfcecbd4ef744537c0f2d5291439848768"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-win32.whl", hash = "sha256:3166dfff2d16fe9be3241ee60ece6fcb01cf8e74dd7c5e0b64f8e19fab44911b"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-win_amd64.whl", hash = "sha256:6831a78bbd3c40f909b3e5233f87341f12d0b34a58f14115c9e94b4cdaf726d3"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7db3db284a0edaebe87f8f6642c2b2c27ed85c3e70064b84d1c9e4ec06d5d84"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:430093fce0efc7941d911d34f75a70084f12f6ca5c15d19595c18753edb7c33b"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79cb400c360c7c210097b147c16a9e4c14688a6402445ac848f296ade6283bbc"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb1b30f31a36c7f3fee848391ff77eebdd3af5750bf95fbf9b8b5323edfdb4ec"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fddde2368e777ea2a4891a3fb4341e910a056be0bb15303bf1b92f073b80c02"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:80bd73ea335203b125cf1d8e50fef06be709619eb6ab9e7b891ea34b5baa2287"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-win32.whl", hash = "sha256:6daeb8382d0df526372abd9cb795c992e18eed25ef2c43afe518c73f8cccb721"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-win_amd64.whl", hash = "sha256:5bc08e75ed11693ecb648b7a0a4ed80da6d10845e44be0c98c03f2f880b68ff4"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:53e68b091492c8ed2bd0141e00ad3089bcc6bf0e6ec4142ad6505b4afe64163e"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bcd18441a49499bf5528deaa9dee1f5c01ca491fc2791b13604e8f972877f812"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:165bbe0b376541092bf49542bd9827b048357f4623486096fc9aaa6d4e7c59a2"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3330415cd387d2b88600e8e26b510d0370db9b7eaf984354a43e19c40df2e2b"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:97b850f73f8abbffb66ccbab6e55a195a0eb655e5dc74624d15cff4bfb35bd74"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7cee4c6917857fd6121ed84f56d1dc78eb1d0e87f845ab5a568aba73e78adf83"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-win32.whl", hash = "sha256:fbb034f565ecbe6c530dff948239377ba859420d146d5f62f0271407ffb8c580"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-win_amd64.whl", hash = "sha256:707c8f44931a4facd4149b52b75b80544a8d824162602b8cd2fe788207307f9a"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:24af3dc43568f3780b7e1e57c49b41d98b2d940c1fd2e62d65d3928b6f95f021"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e60ed6ef0a35c6b76b7640fe452d0e47acc832ccbb8475de549a5cc5f90c2c06"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413c85cd0177c23e32dee6898c67a5f49296640041d98fddb2c40888fe4daa2e"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:25691f4adfb9d5e796fd48bf1432272f95f4bbe5f89c475a788f31232ea6afba"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:526ce723265643dbc4c7efb54f56648cc30e7abe20f387d763364b3ce7506c82"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-win32.whl", hash = "sha256:13be2cc683b76977a700948411a94c67ad8faf542fa7da2a4b167f2244781cf3"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-win_amd64.whl", hash = "sha256:e54ef33ea80d464c3dcfe881eb00ad5921b60f8115ea1a30d781653edc2fd6a2"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:43f28005141165edd11fbbf1541c920bd29e167b8bbc1fb410d4fe2269c1667a"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b68094b165a9e930aedef90725a8fcfafe9ef95370cbb54abc0464062dbf808f"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a1e03db964e9d32f112bae36f0cc1dcd1988d096cfd75d6a588a3c3def9ab2b"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:203d46bddeaa7982f9c3cc693e5bc93db476ab5de9d4b4640d5c99ff219bee8c"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ae92bebca3b1e6bd203494e5ef919a60fb6dfe4d9a47ed2453211d3bd451b9f5"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:9661268415f450c95f72f0ac1217cc6f10256f860eed85c2ae32e75b60278ad8"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-win32.whl", hash = "sha256:895184dfef8708e15f7516bd930bda7e50ead069280d2ce09ba11781b630a434"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-win_amd64.whl", hash = "sha256:6e7cde3a2221aa89247944cafb1b26616380e30c63e37ed19ff0bba5e968688d"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dbcdf987f3aceef9763b6d7b1fd3e4ee210ddd26cac421d78b3c206d07b2700b"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ce119fc4ce0d64124d37f66a6f2a584fddc3c5001755f8a49f1ca0a177ef9796"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a17d8fac6df9835d8e2b4c5523666e7051d0897a93756518a1fe101c7f47f2f0"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ebc11c54c6ecdd07bb4efbfa1554538982f5432dfb8456958b6d46b9f834bb7"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2e6965346fc1491a566e019a4a1d3dfc081ce7ac1a736536367ca305da6472a8"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:220574e78ad986aea8e81ac68821e47ea9202b7e44f251b7ed8c66d9ae3f4278"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-win32.whl", hash = "sha256:b75b00083e7fe6621ce13cfce9d4469c4774e55e8e9d38c305b37f13cf1e874c"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-win_amd64.whl", hash = "sha256:c29d03e0adf3cc1a8c3ec62d176824972ae29b67a66cbb18daff3062acc6faa8"}, + {file = "SQLAlchemy-2.0.34-py3-none-any.whl", hash = "sha256:7286c353ee6475613d8beff83167374006c6b3e3f0e6491bfe8ca610eb1dec0f"}, + {file = "sqlalchemy-2.0.34.tar.gz", hash = "sha256:10d8f36990dd929690666679b0f42235c159a7051534adb135728ee52828dd22"}, ] [package.dependencies] @@ -2483,13 +2485,13 @@ sqlcipher = ["sqlcipher3_binary"] [[package]] name = "sqlmodel" -version = "0.0.21" +version = "0.0.22" description = "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness." optional = false python-versions = ">=3.7" files = [ - {file = "sqlmodel-0.0.21-py3-none-any.whl", hash = "sha256:eca104afe8a643f0764076b29f02e51d19d6b35c458f4c119942960362a4b52a"}, - {file = "sqlmodel-0.0.21.tar.gz", hash = "sha256:b2034c23d930f66d2091b17a4280a9c23a7ea540a71e7fcf9c746d262f06f74a"}, + {file = "sqlmodel-0.0.22-py3-none-any.whl", hash = "sha256:a1ed13e28a1f4057cbf4ff6cdb4fc09e85702621d3259ba17b3c230bfb2f941b"}, + {file = "sqlmodel-0.0.22.tar.gz", hash = "sha256:7d37c882a30c43464d143e35e9ecaf945d88035e20117bf5ec2834a23cbe505e"}, ] [package.dependencies] @@ -2498,13 +2500,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.38.2" +version = "0.38.4" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.38.2-py3-none-any.whl", hash = "sha256:4ec6a59df6bbafdab5f567754481657f7ed90dc9d69b0c9ff017907dd54faeff"}, - {file = "starlette-0.38.2.tar.gz", hash = "sha256:c7c0441065252160993a1a37cf2a73bb64d271b17303e0b0c1eb7191cfb12d75"}, + {file = "starlette-0.38.4-py3-none-any.whl", hash = "sha256:526f53a77f0e43b85f583438aee1a940fd84f8fd610353e8b0c1a77ad8a87e76"}, + {file = "starlette-0.38.4.tar.gz", hash = "sha256:53a7439060304a208fea17ed407e998f46da5e5d9b1addfea3040094512a6379"}, ] [package.dependencies] diff --git a/reflex/.templates/jinja/web/pages/utils.js.jinja2 b/reflex/.templates/jinja/web/pages/utils.js.jinja2 index 4e3546070..e0311a79a 100644 --- a/reflex/.templates/jinja/web/pages/utils.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/utils.js.jinja2 @@ -85,10 +85,10 @@ {% macro render_match_tag(component) %} { (() => { - switch (JSON.stringify({{ component.cond._var_name_unwrapped }})) { + switch (JSON.stringify({{ component.cond._var_name }})) { {% for case in component.match_cases %} {% for condition in case[:-1] %} - case JSON.stringify({{ condition._var_name_unwrapped }}): + case JSON.stringify({{ condition._var_name }}): {% endfor %} return {{ case[-1] }}; break; diff --git a/reflex/.templates/jinja/web/utils/theme.js.jinja2 b/reflex/.templates/jinja/web/utils/theme.js.jinja2 index a647a35b3..819abd232 100644 --- a/reflex/.templates/jinja/web/utils/theme.js.jinja2 +++ b/reflex/.templates/jinja/web/utils/theme.js.jinja2 @@ -1 +1 @@ -export default {{ theme|json_dumps }} \ No newline at end of file +export default {{ theme }} \ No newline at end of file diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index 00d4acc22..55602d2b2 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -17,13 +17,12 @@ from reflex.components.component import ( StatefulComponent, ) from reflex.config import get_config -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.style import SYSTEM_COLOR_MODE from reflex.utils.exec import is_prod_mode from reflex.utils.imports import ImportVar from reflex.utils.prerequisites import get_web_dir -from reflex.vars import Var def _compile_document_root(root: Component) -> str: @@ -58,7 +57,7 @@ def _compile_app(app_root: Component) -> str: ) -def _compile_theme(theme: dict) -> str: +def _compile_theme(theme: str) -> str: """Compile the theme. Args: @@ -321,7 +320,7 @@ def _compile_tailwind( def compile_document_root( head_components: list[Component], html_lang: Optional[str] = None, - html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, ) -> tuple[str, str]: """Compile the document root. @@ -378,7 +377,7 @@ def compile_theme(style: ComponentStyle) -> tuple[str, str]: theme = utils.create_theme(style) # Compile the theme. - code = _compile_theme(theme) + code = _compile_theme(str(LiteralVar.create(theme))) return output_path, code diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index cbb402047..942faa058 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -7,6 +7,7 @@ from pathlib import Path from typing import Any, Callable, Dict, Optional, Type, Union from urllib.parse import urlparse +from reflex.ivars.base import ImmutableVar from reflex.utils.prerequisites import get_web_dir try: @@ -32,7 +33,6 @@ from reflex.state import BaseState, Cookie, LocalStorage, SessionStorage from reflex.style import Style from reflex.utils import console, format, imports, path_ops from reflex.utils.imports import ImportVar, ParsedImportDict -from reflex.vars import Var # To re-export this function. merge_imports = imports.merge_imports @@ -286,7 +286,7 @@ def compile_custom_component( def create_document_root( head_components: list[Component] | None = None, html_lang: Optional[str] = None, - html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, ) -> Component: """Create the document root. diff --git a/reflex/components/base/app_wrap.pyi b/reflex/components/base/app_wrap.pyi index 576f8cd69..90fc646e8 100644 --- a/reflex/components/base/app_wrap.pyi +++ b/reflex/components/base/app_wrap.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.base.fragment import Fragment from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class AppWrap(Fragment): @overload @@ -21,41 +21,51 @@ class AppWrap(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AppWrap": diff --git a/reflex/components/base/bare.py b/reflex/components/base/bare.py index 2ed0cb590..8fa053a5b 100644 --- a/reflex/components/base/bare.py +++ b/reflex/components/base/bare.py @@ -28,8 +28,6 @@ class Bare(Component): """ if isinstance(contents, ImmutableVar): return cls(contents=contents) - if isinstance(contents, Var): - contents = contents.to(str) else: contents = str(contents) if contents is not None else "" return cls(contents=contents) # type: ignore @@ -39,7 +37,7 @@ class Bare(Component): return Tagless(contents=f"{{{str(self.contents)}}}") return Tagless(contents=str(self.contents)) - def _get_vars(self, include_children: bool = False) -> Iterator[Var]: + def _get_vars(self, include_children: bool = False) -> Iterator[ImmutableVar]: """Walk all Vars used in this component. Args: diff --git a/reflex/components/base/body.pyi b/reflex/components/base/body.pyi index 57ff1b7b7..b0b514674 100644 --- a/reflex/components/base/body.pyi +++ b/reflex/components/base/body.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Body(Component): @overload @@ -21,41 +21,51 @@ class Body(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Body": diff --git a/reflex/components/base/document.pyi b/reflex/components/base/document.pyi index 77065d845..db736e0b7 100644 --- a/reflex/components/base/document.pyi +++ b/reflex/components/base/document.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class NextDocumentLib(Component): @overload @@ -21,41 +21,51 @@ class NextDocumentLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextDocumentLib": @@ -88,41 +98,51 @@ class Html(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Html": @@ -154,41 +174,51 @@ class DocumentHead(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DocumentHead": @@ -220,41 +250,51 @@ class Main(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Main": @@ -286,41 +326,51 @@ class NextScript(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextScript": diff --git a/reflex/components/base/error_boundary.py b/reflex/components/base/error_boundary.py index 058976498..a532b682f 100644 --- a/reflex/components/base/error_boundary.py +++ b/reflex/components/base/error_boundary.py @@ -39,7 +39,7 @@ class ErrorBoundary(Component): """ return Imports.EVENTS - def add_hooks(self) -> List[str | Var]: + def add_hooks(self) -> List[str | ImmutableVar]: """Add hooks for the component. Returns: diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index 4777b09e9..0fecd063a 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -7,13 +7,14 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar from reflex.vars import Var class ErrorBoundary(Component): def add_imports(self) -> dict[str, list[ImportVar]]: ... - def add_hooks(self) -> List[str | Var]: ... + def add_hooks(self) -> List[str | ImmutableVar]: ... def add_custom_code(self) -> List[str]: ... @overload @classmethod @@ -26,42 +27,54 @@ class ErrorBoundary(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ErrorBoundary": diff --git a/reflex/components/base/fragment.pyi b/reflex/components/base/fragment.pyi index fae72cc9c..08cc28ea8 100644 --- a/reflex/components/base/fragment.pyi +++ b/reflex/components/base/fragment.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Fragment(Component): @overload @@ -21,41 +21,51 @@ class Fragment(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Fragment": diff --git a/reflex/components/base/head.pyi b/reflex/components/base/head.pyi index 041457137..eff4427b2 100644 --- a/reflex/components/base/head.pyi +++ b/reflex/components/base/head.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class NextHeadLib(Component): @overload @@ -21,41 +21,51 @@ class NextHeadLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextHeadLib": @@ -87,41 +97,51 @@ class Head(NextHeadLib, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Head": diff --git a/reflex/components/base/link.pyi b/reflex/components/base/link.pyi index 80388a327..0889a06b1 100644 --- a/reflex/components/base/link.pyi +++ b/reflex/components/base/link.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class RawLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RawLink": @@ -98,41 +109,51 @@ class ScriptTag(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ScriptTag": diff --git a/reflex/components/base/meta.pyi b/reflex/components/base/meta.pyi index 372d202f9..185425ff1 100644 --- a/reflex/components/base/meta.pyi +++ b/reflex/components/base/meta.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Title(Component): def render(self) -> dict: ... @@ -22,41 +22,51 @@ class Title(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Title": @@ -93,41 +103,51 @@ class Meta(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Meta": @@ -169,41 +189,51 @@ class Description(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Description": @@ -245,41 +275,51 @@ class Image(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Image": diff --git a/reflex/components/base/script.pyi b/reflex/components/base/script.pyi index 311485b66..6a1033f7d 100644 --- a/reflex/components/base/script.pyi +++ b/reflex/components/base/script.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -28,44 +29,60 @@ class Script(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_load: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Script": diff --git a/reflex/components/component.py b/reflex/components/component.py index 6d4fdded1..e838c86d1 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -46,9 +46,15 @@ from reflex.event import ( from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style, format_as_emotion from reflex.utils import format, imports, types -from reflex.utils.imports import ImportDict, ImportVar, ParsedImportDict, parse_imports +from reflex.utils.imports import ( + ImmutableParsedImportDict, + ImportDict, + ImportVar, + ParsedImportDict, + parse_imports, +) from reflex.utils.serializers import serializer -from reflex.vars import BaseVar, ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData class BaseComponent(Base, ABC): @@ -171,7 +177,7 @@ class Component(BaseComponent, ABC): style: Style = Style() # A mapping from event triggers to event chains. - event_triggers: Dict[str, Union[EventChain, Var]] = {} + event_triggers: Dict[str, Union[EventChain, ImmutableVar]] = {} # The alias for the tag. alias: Optional[str] = None @@ -189,7 +195,7 @@ class Component(BaseComponent, ABC): class_name: Any = None # Special component props. - special_props: Set[Var] = set() + special_props: Set[ImmutableVar] = set() # Whether the component should take the focus once the page is loaded autofocus: bool = False @@ -207,7 +213,7 @@ class Component(BaseComponent, ABC): _rename_props: Dict[str, str] = {} # custom attribute - custom_attrs: Dict[str, Union[Var, str]] = {} + custom_attrs: Dict[str, Union[ImmutableVar, str]] = {} # When to memoize this component and its children. _memoization_mode: MemoizationMode = MemoizationMode() @@ -243,7 +249,7 @@ class Component(BaseComponent, ABC): """ return {} - def add_hooks(self) -> list[str | Var]: + def add_hooks(self) -> list[str | ImmutableVar]: """Add hooks inside the component function. Hooks are pieces of literal Javascript code that is inserted inside the @@ -398,7 +404,7 @@ class Component(BaseComponent, ABC): passed_types = None try: # Try to create a var from the value. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): kwargs[key] = value else: kwargs[key] = LiteralVar.create(value) @@ -441,7 +447,9 @@ class Component(BaseComponent, ABC): not passed_types and not types._issubclass(passed_type, expected_type, value) ): - value_name = value._var_name if isinstance(value, Var) else value + value_name = ( + value._var_name if isinstance(value, ImmutableVar) else value + ) raise TypeError( f"Invalid var passed for prop {type(self).__name__}.{key}, expected type {expected_type}, got value {value_name} of type {passed_types or passed_type}." ) @@ -493,7 +501,7 @@ class Component(BaseComponent, ABC): value: Union[ Var, EventHandler, EventSpec, List[Union[EventHandler, EventSpec]], Callable ], - ) -> Union[EventChain, Var]: + ) -> Union[EventChain, ImmutableVar]: """Create an event chain from a variety of input types. Args: @@ -507,7 +515,7 @@ class Component(BaseComponent, ABC): ValueError: If the value is not a valid event chain. """ # If it's an event chain var, return it. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): if value._var_type is not EventChain: raise ValueError( f"Invalid event chain: {repr(value)} of type {type(value)}" @@ -531,7 +539,7 @@ class Component(BaseComponent, ABC): elif isinstance(v, Callable): # Call the lambda to get the event chain. result = call_event_fn(v, args_spec) - if isinstance(result, Var): + if isinstance(result, ImmutableVar): raise ValueError( f"Invalid event chain: {v}. Cannot use a Var-returning " "lambda inside an EventChain list." @@ -543,7 +551,7 @@ class Component(BaseComponent, ABC): # If the input is a callable, create an event chain. elif isinstance(value, Callable): result = call_event_fn(value, args_spec) - if isinstance(result, Var): + if isinstance(result, ImmutableVar): # Recursively call this function if the lambda returned an EventChain Var. return self._create_event_chain(args_spec, result) events = result @@ -561,7 +569,7 @@ class Component(BaseComponent, ABC): event_actions.update(e.event_actions) # Return the event chain. - if isinstance(args_spec, Var): + if isinstance(args_spec, ImmutableVar): return EventChain( events=events, args_spec=None, @@ -874,7 +882,7 @@ class Component(BaseComponent, ABC): Returns: The dictionary of the component style as value and the style notation as key. """ - if isinstance(self.style, Var): + if isinstance(self.style, ImmutableVar): return {"css": self.style} emotion_style = format_as_emotion(self.style) return ( @@ -990,8 +998,8 @@ class Component(BaseComponent, ABC): @staticmethod def _get_vars_from_event_triggers( - event_triggers: dict[str, EventChain | Var], - ) -> Iterator[tuple[str, list[Var]]]: + event_triggers: dict[str, EventChain | ImmutableVar], + ) -> Iterator[tuple[str, list[ImmutableVar]]]: """Get the Vars associated with each event trigger. Args: @@ -1001,7 +1009,7 @@ class Component(BaseComponent, ABC): tuple of (event_name, event_vars) """ for event_trigger, event in event_triggers.items(): - if isinstance(event, Var): + if isinstance(event, ImmutableVar): yield event_trigger, [event] elif isinstance(event, EventChain): event_args = [] @@ -1010,7 +1018,7 @@ class Component(BaseComponent, ABC): event_args.extend(args) yield event_trigger, event_args - def _get_vars(self, include_children: bool = False) -> list[Var]: + def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: """Walk all Vars used in this component. Args: @@ -1030,16 +1038,20 @@ class Component(BaseComponent, ABC): # Get Vars associated with component props. for prop in self.get_props(): prop_var = getattr(self, prop) - if isinstance(prop_var, Var): + if isinstance(prop_var, ImmutableVar): vars.append(prop_var) # Style keeps track of its own VarData instance, so embed in a temp Var that is yielded. - if isinstance(self.style, dict) and self.style or isinstance(self.style, Var): + if ( + isinstance(self.style, dict) + and self.style + or isinstance(self.style, ImmutableVar) + ): vars.append( ImmutableVar( _var_name="style", _var_type=str, - _var_data=ImmutableVarData.merge(self.style._var_data), + _var_data=VarData.merge(self.style._var_data), ) ) @@ -1054,7 +1066,7 @@ class Component(BaseComponent, ABC): self.autofocus, *self.custom_attrs.values(), ): - if isinstance(comp_prop, Var): + if isinstance(comp_prop, ImmutableVar): vars.append(comp_prop) elif isinstance(comp_prop, str): # Collapse VarData encoded in f-strings. @@ -1083,7 +1095,7 @@ class Component(BaseComponent, ABC): for event in trigger.events: if event.handler.state_full_name: return True - elif isinstance(trigger, Var) and trigger._var_state: + elif isinstance(trigger, ImmutableVar) and trigger._var_state: return True return False @@ -1275,7 +1287,7 @@ class Component(BaseComponent, ABC): user_hooks = self._get_hooks() user_hooks_data = ( VarData.merge(user_hooks._get_all_var_data()) - if user_hooks is not None and isinstance(user_hooks, Var) + if user_hooks is not None and isinstance(user_hooks, ImmutableVar) else None ) if user_hooks_data is not None: @@ -1303,9 +1315,15 @@ class Component(BaseComponent, ABC): # Collect imports from Vars used directly by this component. var_datas = [var._get_all_var_data() for var in self._get_vars()] - var_imports = [ - var_data.imports for var_data in var_datas if var_data is not None - ] + var_imports: List[ImmutableParsedImportDict] = list( + map( + lambda var_data: var_data.imports, + filter( + None, + var_datas, + ), + ) + ) added_import_dicts: list[ParsedImportDict] = [] for clz in self._iter_parent_classes_with_method("add_imports"): @@ -1352,9 +1370,9 @@ class Component(BaseComponent, ABC): on_mount = self.event_triggers.get(EventTriggers.ON_MOUNT, None) on_unmount = self.event_triggers.get(EventTriggers.ON_UNMOUNT, None) if on_mount is not None: - on_mount = format.format_event_chain(on_mount) + on_mount = str(LiteralVar.create(on_mount)) + "()" if on_unmount is not None: - on_unmount = format.format_event_chain(on_unmount) + on_unmount = str(LiteralVar.create(on_unmount)) + "()" if on_mount is not None or on_unmount is not None: return f""" useEffect(() => {{ @@ -1435,7 +1453,7 @@ class Component(BaseComponent, ABC): """ code = {} - def extract_var_hooks(hook: Var): + def extract_var_hooks(hook: ImmutableVar): _imports = {} var_data = VarData.merge(hook._get_all_var_data()) if var_data is not None: @@ -1452,7 +1470,7 @@ class Component(BaseComponent, ABC): # the order of the hooks in the final output) for clz in reversed(tuple(self._iter_parent_classes_with_method("add_hooks"))): for hook in clz.add_hooks(self): - if isinstance(hook, Var): + if isinstance(hook, ImmutableVar): extract_var_hooks(hook) else: code[hook] = {} @@ -1513,7 +1531,7 @@ class Component(BaseComponent, ABC): The ref name. """ # do not create a ref if the id is dynamic or unspecified - if self.id is None or isinstance(self.id, (BaseVar, ImmutableVar)): + if self.id is None or isinstance(self.id, ImmutableVar): return None return format.format_ref(self.id) @@ -1768,7 +1786,7 @@ class CustomComponent(Component): for name, prop in self.props.items() ] - def _get_vars(self, include_children: bool = False) -> list[Var]: + def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: """Walk all Vars used in this component. Args: @@ -1779,7 +1797,7 @@ class CustomComponent(Component): """ return ( super()._get_vars(include_children=include_children) - + [prop for prop in self.props.values() if isinstance(prop, Var)] + + [prop for prop in self.props.values() if isinstance(prop, ImmutableVar)] + self.get_component(self)._get_vars(include_children=include_children) ) @@ -1950,7 +1968,7 @@ class StatefulComponent(BaseComponent): should_memoize = True break child = cls._child_var(child) - if isinstance(child, Var) and child._get_all_var_data(): + if isinstance(child, ImmutableVar) and child._get_all_var_data(): should_memoize = True break @@ -2106,7 +2124,7 @@ class StatefulComponent(BaseComponent): def _get_memoized_event_triggers( cls, component: Component, - ) -> dict[str, tuple[Var, str]]: + ) -> dict[str, tuple[ImmutableVar, str]]: """Memoize event handler functions with useCallback to avoid unnecessary re-renders. Args: @@ -2130,9 +2148,7 @@ class StatefulComponent(BaseComponent): # Get the actual EventSpec and render it. event = component.event_triggers[event_trigger] - rendered_chain = format.format_prop(event) - if isinstance(rendered_chain, str): - rendered_chain = rendered_chain.strip("{}") + rendered_chain = str(LiteralVar.create(event)) # Hash the rendered EventChain to get a deterministic function name. chain_hash = md5(str(rendered_chain).encode("utf-8")).hexdigest() @@ -2141,9 +2157,10 @@ class StatefulComponent(BaseComponent): # Calculate Var dependencies accessed by the handler for useCallback dep array. var_deps = ["addEvents", "Event"] for arg in event_args: - if arg._get_all_var_data() is None: + var_data = arg._get_all_var_data() + if var_data is None: continue - for hook in arg._get_all_var_data().hooks: + for hook in var_data.hooks: var_deps.extend(cls._get_hook_deps(hook)) memo_var_data = VarData.merge( *[var._get_all_var_data() for var in event_args], diff --git a/reflex/components/core/banner.py b/reflex/components/core/banner.py index 4c4f587ee..834d59a83 100644 --- a/reflex/components/core/banner.py +++ b/reflex/components/core/banner.py @@ -23,7 +23,7 @@ from reflex.ivars.function import FunctionStringVar from reflex.ivars.number import BooleanVar from reflex.ivars.sequence import LiteralArrayVar from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData connect_error_var_data: VarData = VarData( # type: ignore imports=Imports.EVENTS, @@ -68,7 +68,7 @@ class WebsocketTargetURL(ImmutableVar): """ return ImmutableVar( _var_name="getBackendURL(env.EVENT).href", - _var_data=ImmutableVarData( + _var_data=VarData( imports={ "/env.json": [ImportVar(tag="env", is_default=True)], f"/{Dirs.STATE_PATH}": [ImportVar(tag="getBackendURL")], @@ -95,7 +95,7 @@ def default_connection_error() -> list[str | Var | Component]: class ConnectionToaster(Toaster): """A connection toaster component.""" - def add_hooks(self) -> list[str | Var]: + def add_hooks(self) -> list[str | ImmutableVar]: """Add the hooks for the connection toaster. Returns: diff --git a/reflex/components/core/banner.pyi b/reflex/components/core/banner.pyi index 6327afe0b..0a4072c31 100644 --- a/reflex/components/core/banner.pyi +++ b/reflex/components/core/banner.pyi @@ -29,7 +29,7 @@ class WebsocketTargetURL(ImmutableVar): def default_connection_error() -> list[str | Var | Component]: ... class ConnectionToaster(Toaster): - def add_hooks(self) -> list[str | Var]: ... + def add_hooks(self) -> list[str | ImmutableVar]: ... @overload @classmethod def create( # type: ignore @@ -75,41 +75,51 @@ class ConnectionToaster(Toaster): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionToaster": @@ -155,41 +165,51 @@ class ConnectionBanner(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionBanner": @@ -214,41 +234,51 @@ class ConnectionModal(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionModal": @@ -274,41 +304,51 @@ class WifiOffPulse(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "WifiOffPulse": @@ -367,41 +407,51 @@ class ConnectionPulser(Div): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionPulser": diff --git a/reflex/components/core/client_side_routing.py b/reflex/components/core/client_side_routing.py index 618467f39..33e54f227 100644 --- a/reflex/components/core/client_side_routing.py +++ b/reflex/components/core/client_side_routing.py @@ -13,9 +13,10 @@ from __future__ import annotations from reflex import constants from reflex.components.component import Component from reflex.components.core.cond import cond +from reflex.ivars.base import ImmutableVar from reflex.vars import Var -route_not_found: Var = Var.create_safe(constants.ROUTE_NOT_FOUND, _var_is_string=False) +route_not_found: Var = ImmutableVar.create_safe(constants.ROUTE_NOT_FOUND) class ClientSideRouting(Component): diff --git a/reflex/components/core/client_side_routing.pyi b/reflex/components/core/client_side_routing.pyi index 605293ee8..57d1e1ae4 100644 --- a/reflex/components/core/client_side_routing.pyi +++ b/reflex/components/core/client_side_routing.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,41 +26,51 @@ class ClientSideRouting(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ClientSideRouting": @@ -94,41 +105,51 @@ class Default404Page(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Default404Page": diff --git a/reflex/components/core/clipboard.py b/reflex/components/core/clipboard.py index 9b0edcc29..abc1b5b4a 100644 --- a/reflex/components/core/clipboard.py +++ b/reflex/components/core/clipboard.py @@ -85,8 +85,8 @@ class Clipboard(Fragment): return [ "usePasteHandler(%s, %s, %s)" % ( - self.targets._var_name_unwrapped, - self.on_paste_event_actions._var_name_unwrapped, + str(self.targets), + str(self.on_paste_event_actions), on_paste, ) ] diff --git a/reflex/components/core/clipboard.pyi b/reflex/components/core/clipboard.pyi index aaeac985c..3ffaad293 100644 --- a/reflex/components/core/clipboard.pyi +++ b/reflex/components/core/clipboard.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.base.fragment import Fragment from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar from reflex.vars import Var @@ -26,42 +27,54 @@ class Clipboard(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_paste: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Clipboard": diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py index 6e6272665..33e145f41 100644 --- a/reflex/components/core/cond.py +++ b/reflex/components/core/cond.py @@ -94,7 +94,7 @@ class Cond(MemoizationLeaf): ).set( props=tag.format_props(), ), - cond_state=f"isTrue({self.cond._var_full_name})", + cond_state=f"isTrue({str(self.cond)})", ) def add_imports(self) -> ImportDict: @@ -103,10 +103,11 @@ class Cond(MemoizationLeaf): Returns: The import dict for the component. """ - cond_imports: dict[str, str | ImportVar | list[str | ImportVar]] = getattr( - VarData.merge(self.cond._get_all_var_data()), "imports", {} - ) - return {**cond_imports, **_IS_TRUE_IMPORT} + var_data = VarData.merge(self.cond._get_all_var_data()) + + imports = var_data.old_school_imports() if var_data else {} + + return {**imports, **_IS_TRUE_IMPORT} @overload @@ -135,8 +136,6 @@ def cond(condition: Any, c1: Any, c2: Any = None) -> Component | ImmutableVar: Raises: ValueError: If the arguments are invalid. """ - if isinstance(condition, Var) and not isinstance(condition, ImmutableVar): - condition._var_is_local = True # Convert the condition to a Var. cond_var = LiteralVar.create(condition) assert cond_var is not None, "The condition must be set." diff --git a/reflex/components/core/debounce.py b/reflex/components/core/debounce.py index 4dc7c14a1..b11bb120b 100644 --- a/reflex/components/core/debounce.py +++ b/reflex/components/core/debounce.py @@ -7,6 +7,7 @@ from typing import Any, Type, Union from reflex.components.component import Component from reflex.constants import EventTriggers from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar from reflex.vars import Var, VarData DEFAULT_DEBOUNCE_TIMEOUT = 300 @@ -106,23 +107,20 @@ class DebounceInput(Component): props[field] = getattr(child, field) child_ref = child.get_ref() if props.get("input_ref") is None and child_ref: - props["input_ref"] = Var.create_safe( - child_ref, _var_is_local=False, _var_is_string=False - ) + props["input_ref"] = ImmutableVar.create_safe(child_ref) props["id"] = child.id # Set the child element to wrap, including any imports/hooks from the child. props.setdefault( "element", - Var.create_safe( - "{%s}" % (child.alias or child.tag), - _var_is_local=False, - _var_is_string=False, + ImmutableVar( + _var_name=str(child.alias or child.tag), + _var_type=Type[Component], _var_data=VarData( imports=child._get_imports(), hooks=child._get_hooks_internal(), ), - ).to(Type[Component]), + ), ) component = super().create(**props) diff --git a/reflex/components/core/debounce.pyi b/reflex/components/core/debounce.pyi index 486fcc284..ca740f85d 100644 --- a/reflex/components/core/debounce.pyi +++ b/reflex/components/core/debounce.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Type, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -30,42 +31,54 @@ class DebounceInput(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DebounceInput": diff --git a/reflex/components/core/foreach.py b/reflex/components/core/foreach.py index 78e8933d9..a87e0022d 100644 --- a/reflex/components/core/foreach.py +++ b/reflex/components/core/foreach.py @@ -55,7 +55,7 @@ class Foreach(Component): iterable = ImmutableVar.create_safe(iterable) if iterable._var_type == Any: raise ForeachVarError( - f"Could not foreach over var `{iterable._var_full_name}` of type Any. " + f"Could not foreach over var `{str(iterable)}` of type Any. " "(If you are trying to foreach over a state var, add a type annotation to the var). " "See https://reflex.dev/docs/library/dynamic-rendering/foreach/" ) @@ -127,10 +127,10 @@ class Foreach(Component): return dict( tag, - iterable_state=tag.iterable._var_full_name, + iterable_state=str(tag.iterable), arg_name=tag.arg_var_name, arg_index=tag.get_index_var_arg(), - iterable_type=tag.iterable._var_type.mro()[0].__name__, + iterable_type=tag.iterable.upcast()._var_type.mro()[0].__name__, ) diff --git a/reflex/components/core/html.pyi b/reflex/components/core/html.pyi index c3d2ed06f..ab4cfecc8 100644 --- a/reflex/components/core/html.pyi +++ b/reflex/components/core/html.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.elements.typography import Div from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -48,41 +49,51 @@ class Html(Div): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Html": diff --git a/reflex/components/core/match.py b/reflex/components/core/match.py index 3ddef38c6..38d56f862 100644 --- a/reflex/components/core/match.py +++ b/reflex/components/core/match.py @@ -11,7 +11,7 @@ from reflex.style import Style from reflex.utils import format, types from reflex.utils.exceptions import MatchTypeError from reflex.utils.imports import ImportDict -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData class Match(MemoizationLeaf): @@ -27,7 +27,7 @@ class Match(MemoizationLeaf): default: Any @classmethod - def create(cls, cond: Any, *cases) -> Union[Component, Var]: + def create(cls, cond: Any, *cases) -> Union[Component, ImmutableVar]: """Create a Match Component. Args: @@ -56,7 +56,7 @@ class Match(MemoizationLeaf): ) @classmethod - def _create_condition_var(cls, cond: Any) -> Var: + def _create_condition_var(cls, cond: Any) -> ImmutableVar: """Convert the condition to a Var. Args: @@ -77,7 +77,7 @@ class Match(MemoizationLeaf): @classmethod def _process_cases( cls, cases: List - ) -> Tuple[List, Optional[Union[Var, BaseComponent]]]: + ) -> Tuple[List, Optional[Union[ImmutableVar, BaseComponent]]]: """Process the list of match cases and the catchall default case. Args: @@ -125,7 +125,7 @@ class Match(MemoizationLeaf): return case_element @classmethod - def _process_match_cases(cls, cases: List) -> List[List[Var]]: + def _process_match_cases(cls, cases: List) -> List[List[ImmutableVar]]: """Process the individual match cases. Args: @@ -157,7 +157,7 @@ class Match(MemoizationLeaf): if not isinstance(element, BaseComponent) else element ) - if not isinstance(el, (Var, BaseComponent)): + if not isinstance(el, (ImmutableVar, BaseComponent)): raise ValueError("Case element must be a var or component") case_list.append(el) @@ -166,7 +166,7 @@ class Match(MemoizationLeaf): return match_cases @classmethod - def _validate_return_types(cls, match_cases: List[List[Var]]) -> None: + def _validate_return_types(cls, match_cases: List[List[ImmutableVar]]) -> None: """Validate that match cases have the same return types. Args: @@ -180,24 +180,24 @@ class Match(MemoizationLeaf): if types._isinstance(first_case_return, BaseComponent): return_type = BaseComponent - elif types._isinstance(first_case_return, Var): - return_type = Var + elif types._isinstance(first_case_return, ImmutableVar): + return_type = ImmutableVar for index, case in enumerate(match_cases): if not types._issubclass(type(case[-1]), return_type): raise MatchTypeError( f"Match cases should have the same return types. Case {index} with return " - f"value `{case[-1]._var_name if isinstance(case[-1], Var) else textwrap.shorten(str(case[-1]), width=250)}`" + f"value `{case[-1]._var_name if isinstance(case[-1], ImmutableVar) else textwrap.shorten(str(case[-1]), width=250)}`" f" of type {type(case[-1])!r} is not {return_type}" ) @classmethod def _create_match_cond_var_or_component( cls, - match_cond_var: Var, - match_cases: List[List[Var]], - default: Optional[Union[Var, BaseComponent]], - ) -> Union[Component, Var]: + match_cond_var: ImmutableVar, + match_cases: List[List[ImmutableVar]], + default: Optional[Union[ImmutableVar, BaseComponent]], + ) -> Union[Component, ImmutableVar]: """Create and return the match condition var or component. Args: @@ -234,12 +234,12 @@ class Match(MemoizationLeaf): return ImmutableVar( _var_name=format.format_match( - cond=match_cond_var._var_name_unwrapped, - match_cases=match_cases, # type: ignore + cond=str(match_cond_var), + match_cases=match_cases, default=default, # type: ignore ), _var_type=default._var_type, # type: ignore - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( match_cond_var._get_all_var_data(), *[el._get_all_var_data() for case in match_cases for el in case], default._get_all_var_data(), # type: ignore @@ -267,7 +267,8 @@ class Match(MemoizationLeaf): Returns: The import dict. """ - return getattr(VarData.merge(self.cond._get_all_var_data()), "imports", {}) + var_data = VarData.merge(self.cond._get_all_var_data()) + return var_data.old_school_imports() if var_data else {} match = Match.create diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index df9146c4d..b6fe1024a 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -19,10 +19,10 @@ from reflex.event import ( call_script, parse_args_spec, ) -from reflex.ivars.base import ImmutableCallableVar, ImmutableVar +from reflex.ivars.base import ImmutableCallableVar, ImmutableVar, LiteralVar from reflex.ivars.sequence import LiteralStringVar from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData DEFAULT_UPLOAD_ID: str = "default" @@ -61,7 +61,7 @@ def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: return ImmutableVar( _var_name=var_name, _var_type=EventChain, - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( upload_files_context_var_data, id_var._get_all_var_data() ), ) @@ -81,7 +81,7 @@ def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: return ImmutableVar( _var_name=f"(filesById[{str(id_var)}] ? filesById[{str(id_var)}].map((f) => (f.path || f.name)) : [])", _var_type=List[str], - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( upload_files_context_var_data, id_var._get_all_var_data() ), ).guess_type() @@ -113,7 +113,7 @@ def cancel_upload(upload_id: str) -> EventSpec: An event spec that cancels the upload when triggered. """ return call_script( - f"upload_controllers[{Var.create_safe(upload_id, _var_is_string=True)._var_name_unwrapped}]?.abort()" + f"upload_controllers[{str(LiteralVar.create(upload_id))}]?.abort()" ) @@ -132,16 +132,15 @@ def get_upload_dir() -> Path: return uploaded_files_dir -uploaded_files_url_prefix: Var = Var.create_safe( - "${getBackendURL(env.UPLOAD)}", - _var_is_string=False, +uploaded_files_url_prefix = ImmutableVar( + _var_name="getBackendURL(env.UPLOAD)", _var_data=VarData( imports={ f"/{Dirs.STATE_PATH}": "getBackendURL", "/env.json": ImportVar(tag="env", is_default=True), } ), -) +).to(str) def get_upload_url(file_path: str) -> Var[str]: @@ -155,9 +154,7 @@ def get_upload_url(file_path: str) -> Var[str]: """ Upload.is_used = True - return Var.create_safe( - f"{uploaded_files_url_prefix}/{file_path}", _var_is_string=True - ) + return uploaded_files_url_prefix + "/" + file_path def _on_drop_spec(files: Var): @@ -251,7 +248,7 @@ class Upload(MemoizationLeaf): # The file input to use. upload = Input.create(type="file") upload.special_props = { - ImmutableVar(_var_name="...getInputProps()", _var_type=None) + ImmutableVar(_var_name="{...getInputProps()}", _var_type=None) } # The dropzone to use. @@ -261,7 +258,7 @@ class Upload(MemoizationLeaf): **{k: v for k, v in props.items() if k not in supported_props}, ) zone.special_props = { - ImmutableVar(_var_name="...getRootProps()", _var_type=None) + ImmutableVar(_var_name="{...getRootProps()}", _var_type=None) } # Create the component. @@ -290,7 +287,9 @@ class Upload(MemoizationLeaf): ) @classmethod - def _update_arg_tuple_for_on_drop(cls, arg_value: tuple[Var, Var]): + def _update_arg_tuple_for_on_drop( + cls, arg_value: tuple[ImmutableVar, ImmutableVar] + ): """Helper to update caller-provided EventSpec args for direct use with on_drop. Args: diff --git a/reflex/components/core/upload.pyi b/reflex/components/core/upload.pyi index ff5085514..67b350c8d 100644 --- a/reflex/components/core/upload.pyi +++ b/reflex/components/core/upload.pyi @@ -7,6 +7,7 @@ from pathlib import Path from typing import Any, Callable, ClassVar, Dict, List, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf +from reflex.constants import Dirs from reflex.event import ( CallableEventSpec, EventHandler, @@ -14,6 +15,7 @@ from reflex.event import ( ) from reflex.ivars.base import ImmutableCallableVar, ImmutableVar from reflex.style import Style +from reflex.utils.imports import ImportVar from reflex.vars import Var, VarData DEFAULT_UPLOAD_ID: str @@ -28,7 +30,15 @@ def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec: ... def cancel_upload(upload_id: str) -> EventSpec: ... def get_upload_dir() -> Path: ... -uploaded_files_url_prefix: Var +uploaded_files_url_prefix = ImmutableVar( + _var_name="getBackendURL(env.UPLOAD)", + _var_data=VarData( + imports={ + f"/{Dirs.STATE_PATH}": "getBackendURL", + "/env.json": ImportVar(tag="env", is_default=True), + } + ), +).to(str) def get_upload_url(file_path: str) -> Var[str]: ... @@ -43,41 +53,51 @@ class UploadFilesProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "UploadFilesProvider": @@ -120,42 +140,54 @@ class Upload(MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_drop: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Upload": @@ -205,42 +237,54 @@ class StyledUpload(Upload): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_drop: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "StyledUpload": @@ -290,42 +334,54 @@ class UploadNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_drop: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "StyledUpload": diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index 779d4c5d3..96f91a36e 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -487,7 +487,7 @@ class CodeBlock(Component): # react-syntax-highlighter doesnt have an explicit "light" or "dark" theme so we use one-light and one-dark # themes respectively to ensure code compatibility. - if "theme" in props and not isinstance(props["theme"], Var): + if "theme" in props and not isinstance(props["theme"], ImmutableVar): props["theme"] = cls.convert_theme_name(props["theme"]) if can_copy: @@ -513,7 +513,7 @@ class CodeBlock(Component): # Carry the children (code) via props if children: props["code"] = children[0] - if not isinstance(props["code"], Var): + if not isinstance(props["code"], ImmutableVar): props["code"] = LiteralVar.create(props["code"]) # Create the component. @@ -534,7 +534,7 @@ class CodeBlock(Component): def _render(self): out = super()._render() - theme = self.theme._replace( + theme = self.theme.upcast()._replace( _var_name=replace_quotes_with_camel_case(str(self.theme)) ) diff --git a/reflex/components/datadisplay/code.pyi b/reflex/components/datadisplay/code.pyi index 015cc0708..63209ec8a 100644 --- a/reflex/components/datadisplay/code.pyi +++ b/reflex/components/datadisplay/code.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -1031,41 +1032,51 @@ class CodeBlock(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CodeBlock": diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index f3296e0b7..006a2472f 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -10,6 +10,7 @@ from reflex.components.component import Component, NoSSRComponent from reflex.components.literals import LiteralRowMarker from reflex.event import EventHandler from reflex.ivars.base import ImmutableVar +from reflex.ivars.sequence import ArrayVar from reflex.utils import console, format, types from reflex.utils.imports import ImportDict, ImportVar from reflex.utils.serializers import serializer @@ -298,8 +299,8 @@ class DataEditor(NoSSRComponent): code = [f"function {data_callback}([col, row])" "{"] - columns_path = f"{self.columns._var_full_name}" - data_path = f"{self.data._var_full_name}" + columns_path = str(self.columns) + data_path = str(self.data) code.extend( [ @@ -332,12 +333,18 @@ class DataEditor(NoSSRComponent): # If rows is not provided, determine from data. if rows is None: - props["rows"] = data.length() if isinstance(data, Var) else len(data) + if isinstance(data, ImmutableVar) and not isinstance(data, ArrayVar): + raise ValueError( + "DataEditor data must be an ArrayVar if rows is not provided." + ) + props["rows"] = ( + data.length() if isinstance(data, ImmutableVar) else len(data) + ) - if not isinstance(columns, Var) and len(columns): + if not isinstance(columns, ImmutableVar) and len(columns): if ( types.is_dataframe(type(data)) - or isinstance(data, Var) + or isinstance(data, ImmutableVar) and types.is_dataframe(data._var_type) ): raise ValueError( @@ -402,9 +409,9 @@ def serialize_dataeditortheme(theme: DataEditorTheme): Returns: The serialized theme. """ - return format.json_dumps( - {format.to_camel_case(k): v for k, v in theme.__dict__.items() if v is not None} - ) + return { + format.to_camel_case(k): v for k, v in theme.__dict__.items() if v is not None + } data_editor = DataEditor.create diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index b40890b73..66452ffae 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -9,6 +9,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.utils.serializers import serializer @@ -134,87 +135,99 @@ class DataEditor(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_cell_activated: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_cell_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_cell_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_cell_edited: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_column_resize: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_delete: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_delete: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_finished_editing: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_group_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_group_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_group_header_renamed: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_header_menu_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_item_hovered: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_row_appended: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selection_cleared: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataEditor": diff --git a/reflex/components/el/element.pyi b/reflex/components/el/element.pyi index f18d9008c..576941618 100644 --- a/reflex/components/el/element.pyi +++ b/reflex/components/el/element.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Element(Component): @overload @@ -21,41 +21,51 @@ class Element(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Element": diff --git a/reflex/components/el/elements/base.pyi b/reflex/components/el/elements/base.pyi index d802cc2ee..4cc1c397c 100644 --- a/reflex/components/el/elements/base.pyi +++ b/reflex/components/el/elements/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.element import Element from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -45,41 +46,51 @@ class BaseHTML(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BaseHTML": diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index f6ad10162..f2a6a42f5 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -12,7 +12,6 @@ from reflex.components.tags.tag import Tag from reflex.constants import Dirs, EventTriggers from reflex.event import EventChain, EventHandler from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.utils.format import format_event_chain from reflex.utils.imports import ImportDict from reflex.vars import Var, VarData @@ -24,9 +23,9 @@ HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string( const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => { const $form = ev.target ev.preventDefault() - const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}} + const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}}; - {{ on_submit_event_chain }} + ({{ on_submit_event_chain }}()); if ({{ reset_on_submit }}) { $form.reset() @@ -186,8 +185,8 @@ class Form(BaseHTML): handle_submit_unique_name=self.handle_submit_unique_name, form_data=FORM_DATA, field_ref_mapping=str(LiteralVar.create(self._get_form_refs())), - on_submit_event_chain=format_event_chain( - self.event_triggers[EventTriggers.ON_SUBMIT] + on_submit_event_chain=str( + LiteralVar.create(self.event_triggers[EventTriggers.ON_SUBMIT]) ), reset_on_submit=self.reset_on_submit, ) @@ -227,7 +226,7 @@ class Form(BaseHTML): # print(repr(form_refs)) return form_refs - def _get_vars(self, include_children: bool = True) -> Iterator[Var]: + def _get_vars(self, include_children: bool = True) -> Iterator[ImmutableVar]: yield from super()._get_vars(include_children=include_children) yield from self._get_form_refs().values() @@ -625,19 +624,15 @@ class Textarea(BaseHTML): "Cannot combine `enter_key_submit` with `on_key_down`.", ) tag.add_props( - on_key_down=Var.create_safe( - f"(e) => enterKeySubmitOnKeyDown(e, {self.enter_key_submit._var_name_unwrapped})", - _var_is_local=False, - _var_is_string=False, + on_key_down=ImmutableVar.create_safe( + f"(e) => enterKeySubmitOnKeyDown(e, {str(self.enter_key_submit)})", _var_data=VarData.merge(self.enter_key_submit._get_all_var_data()), ) ) if self.auto_height is not None: tag.add_props( - on_input=Var.create_safe( - f"(e) => autoHeightOnInput(e, {self.auto_height._var_name_unwrapped})", - _var_is_local=False, - _var_is_string=False, + on_input=ImmutableVar.create_safe( + f"(e) => autoHeightOnInput(e, {str(self.auto_height)})", _var_data=VarData.merge(self.auto_height._get_all_var_data()), ) ) diff --git a/reflex/components/el/elements/forms.pyi b/reflex/components/el/elements/forms.pyi index 7eca3f854..0b2f42754 100644 --- a/reflex/components/el/elements/forms.pyi +++ b/reflex/components/el/elements/forms.pyi @@ -18,7 +18,7 @@ from .base import BaseHTML FORM_DATA = ImmutableVar.create("form_data") HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string( - "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}}\n\n {{ on_submit_event_chain }}\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n " + "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}};\n\n ({{ on_submit_event_chain }}());\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n " ) class Button(BaseHTML): @@ -71,41 +71,51 @@ class Button(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Button": @@ -188,41 +198,51 @@ class Datalist(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Datalist": @@ -273,41 +293,51 @@ class Fieldset(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Fieldset": @@ -381,42 +411,54 @@ class Form(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Form": @@ -541,46 +583,60 @@ class Input(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Input": @@ -687,41 +743,51 @@ class Label(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Label": @@ -795,41 +861,51 @@ class Legend(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Legend": @@ -908,41 +984,51 @@ class Meter(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Meter": @@ -1023,41 +1109,51 @@ class Optgroup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Optgroup": @@ -1135,41 +1231,51 @@ class Option(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Option": @@ -1248,41 +1354,51 @@ class Output(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Output": @@ -1360,41 +1476,51 @@ class Progress(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": @@ -1479,42 +1605,54 @@ class Select(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Select": @@ -1616,46 +1754,60 @@ class Textarea(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Textarea": diff --git a/reflex/components/el/elements/inline.pyi b/reflex/components/el/elements/inline.pyi index dfddf5f10..0c1b81d1f 100644 --- a/reflex/components/el/elements/inline.pyi +++ b/reflex/components/el/elements/inline.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -57,41 +58,51 @@ class A(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "A": @@ -172,41 +183,51 @@ class Abbr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Abbr": @@ -278,41 +299,51 @@ class B(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "B": @@ -384,41 +415,51 @@ class Bdi(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Bdi": @@ -490,41 +531,51 @@ class Bdo(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Bdo": @@ -596,41 +647,51 @@ class Br(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Br": @@ -702,41 +763,51 @@ class Cite(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Cite": @@ -808,41 +879,51 @@ class Code(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Code": @@ -915,41 +996,51 @@ class Data(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Data": @@ -1022,41 +1113,51 @@ class Dfn(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dfn": @@ -1128,41 +1229,51 @@ class Em(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Em": @@ -1234,41 +1345,51 @@ class I(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "I": @@ -1340,41 +1461,51 @@ class Kbd(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Kbd": @@ -1446,41 +1577,51 @@ class Mark(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Mark": @@ -1553,41 +1694,51 @@ class Q(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Q": @@ -1660,41 +1811,51 @@ class Rp(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Rp": @@ -1766,41 +1927,51 @@ class Rt(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Rt": @@ -1872,41 +2043,51 @@ class Ruby(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ruby": @@ -1978,41 +2159,51 @@ class S(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "S": @@ -2084,41 +2275,51 @@ class Samp(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Samp": @@ -2190,41 +2391,51 @@ class Small(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Small": @@ -2296,41 +2507,51 @@ class Span(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Span": @@ -2402,41 +2623,51 @@ class Strong(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Strong": @@ -2508,41 +2739,51 @@ class Sub(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Sub": @@ -2614,41 +2855,51 @@ class Sup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Sup": @@ -2721,41 +2972,51 @@ class Time(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Time": @@ -2828,41 +3089,51 @@ class U(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "U": @@ -2934,41 +3205,51 @@ class Wbr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Wbr": diff --git a/reflex/components/el/elements/media.pyi b/reflex/components/el/elements/media.pyi index cf673ddf9..08b2be719 100644 --- a/reflex/components/el/elements/media.pyi +++ b/reflex/components/el/elements/media.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex import ComponentNamespace from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -61,41 +62,51 @@ class Area(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Area": @@ -188,41 +199,51 @@ class Audio(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Audio": @@ -320,41 +341,51 @@ class Img(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Img": @@ -440,41 +471,51 @@ class Map(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Map": @@ -552,41 +593,51 @@ class Track(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Track": @@ -677,41 +728,51 @@ class Video(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Video": @@ -795,41 +856,51 @@ class Embed(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Embed": @@ -914,41 +985,51 @@ class Iframe(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Iframe": @@ -1034,41 +1115,51 @@ class Object(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Object": @@ -1145,41 +1236,51 @@ class Picture(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Picture": @@ -1251,41 +1352,51 @@ class Portal(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Portal": @@ -1362,41 +1473,51 @@ class Source(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Source": @@ -1476,41 +1597,51 @@ class Svg(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Svg": @@ -1589,41 +1720,51 @@ class Circle(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Circle": @@ -1706,41 +1847,51 @@ class Rect(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Rect": @@ -1821,41 +1972,51 @@ class Polygon(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Polygon": @@ -1929,41 +2090,51 @@ class Defs(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Defs": @@ -2042,41 +2213,51 @@ class LinearGradient(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LinearGradient": @@ -2162,41 +2343,51 @@ class Stop(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Stop": @@ -2272,41 +2463,51 @@ class Path(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Path": @@ -2388,41 +2589,51 @@ class SVG(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Svg": diff --git a/reflex/components/el/elements/metadata.py b/reflex/components/el/elements/metadata.py index 9a4d18b73..fc8e1d9d6 100644 --- a/reflex/components/el/elements/metadata.py +++ b/reflex/components/el/elements/metadata.py @@ -3,6 +3,7 @@ from typing import Set, Union from reflex.components.el.element import Element +from reflex.ivars.base import ImmutableVar from reflex.vars import Var as Var from .base import BaseHTML @@ -89,8 +90,8 @@ class StyleEl(Element): # noqa: E742 media: Var[Union[str, int, bool]] - special_props: Set[Var] = { - Var.create_safe("suppressHydrationWarning", _var_is_string=False) + special_props: Set[ImmutableVar] = { + ImmutableVar.create_safe("suppressHydrationWarning") } diff --git a/reflex/components/el/elements/metadata.pyi b/reflex/components/el/elements/metadata.pyi index cb7e1dca9..26e12d0e4 100644 --- a/reflex/components/el/elements/metadata.pyi +++ b/reflex/components/el/elements/metadata.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.element import Element from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -49,41 +50,51 @@ class Base(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Base": @@ -155,41 +166,51 @@ class Head(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Head": @@ -274,41 +295,51 @@ class Link(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Link": @@ -393,41 +424,51 @@ class Meta(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Meta": @@ -479,41 +520,51 @@ class Title(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Title": @@ -546,41 +597,51 @@ class StyleEl(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "StyleEl": diff --git a/reflex/components/el/elements/other.pyi b/reflex/components/el/elements/other.pyi index 89b50b085..4a106344b 100644 --- a/reflex/components/el/elements/other.pyi +++ b/reflex/components/el/elements/other.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Details(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Details": @@ -155,41 +166,51 @@ class Dialog(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dialog": @@ -262,41 +283,51 @@ class Summary(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Summary": @@ -368,41 +399,51 @@ class Slot(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Slot": @@ -474,41 +515,51 @@ class Template(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Template": @@ -580,41 +631,51 @@ class Math(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Math": @@ -687,41 +748,51 @@ class Html(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Html": diff --git a/reflex/components/el/elements/scripts.pyi b/reflex/components/el/elements/scripts.pyi index 9923d8c6b..f5e9f6795 100644 --- a/reflex/components/el/elements/scripts.pyi +++ b/reflex/components/el/elements/scripts.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -46,41 +47,51 @@ class Canvas(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Canvas": @@ -152,41 +163,51 @@ class Noscript(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Noscript": @@ -271,41 +292,51 @@ class Script(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Script": diff --git a/reflex/components/el/elements/sectioning.pyi b/reflex/components/el/elements/sectioning.pyi index 2d1cc457d..5bca34ac6 100644 --- a/reflex/components/el/elements/sectioning.pyi +++ b/reflex/components/el/elements/sectioning.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -46,41 +47,51 @@ class Body(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Body": @@ -152,41 +163,51 @@ class Address(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Address": @@ -258,41 +279,51 @@ class Article(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Article": @@ -364,41 +395,51 @@ class Aside(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Aside": @@ -470,41 +511,51 @@ class Footer(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Footer": @@ -576,41 +627,51 @@ class Header(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Header": @@ -682,41 +743,51 @@ class H1(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H1": @@ -788,41 +859,51 @@ class H2(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H2": @@ -894,41 +975,51 @@ class H3(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H3": @@ -1000,41 +1091,51 @@ class H4(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H4": @@ -1106,41 +1207,51 @@ class H5(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H5": @@ -1212,41 +1323,51 @@ class H6(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H6": @@ -1318,41 +1439,51 @@ class Main(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Main": @@ -1424,41 +1555,51 @@ class Nav(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Nav": @@ -1530,41 +1671,51 @@ class Section(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Section": diff --git a/reflex/components/el/elements/tables.pyi b/reflex/components/el/elements/tables.pyi index 39ca144b8..0cf41c515 100644 --- a/reflex/components/el/elements/tables.pyi +++ b/reflex/components/el/elements/tables.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Caption(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Caption": @@ -156,41 +167,51 @@ class Col(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Col": @@ -266,41 +287,51 @@ class Colgroup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Colgroup": @@ -376,41 +407,51 @@ class Table(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Table": @@ -485,41 +526,51 @@ class Tbody(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tbody": @@ -596,41 +647,51 @@ class Td(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Td": @@ -707,41 +768,51 @@ class Tfoot(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tfoot": @@ -819,41 +890,51 @@ class Th(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Th": @@ -931,41 +1012,51 @@ class Thead(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Thead": @@ -1039,41 +1130,51 @@ class Tr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tr": diff --git a/reflex/components/el/elements/typography.pyi b/reflex/components/el/elements/typography.pyi index 926376441..28c8c041e 100644 --- a/reflex/components/el/elements/typography.pyi +++ b/reflex/components/el/elements/typography.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Blockquote(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Blockquote": @@ -154,41 +165,51 @@ class Dd(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dd": @@ -260,41 +281,51 @@ class Div(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Div": @@ -366,41 +397,51 @@ class Dl(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dl": @@ -472,41 +513,51 @@ class Dt(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dt": @@ -578,41 +629,51 @@ class Figcaption(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Figcaption": @@ -685,41 +746,51 @@ class Hr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Hr": @@ -792,41 +863,51 @@ class Li(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Li": @@ -899,41 +980,51 @@ class Menu(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Menu": @@ -1009,41 +1100,51 @@ class Ol(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ol": @@ -1118,41 +1219,51 @@ class P(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "P": @@ -1224,41 +1335,51 @@ class Pre(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Pre": @@ -1330,41 +1451,51 @@ class Ul(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ul": @@ -1438,41 +1569,51 @@ class Ins(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ins": @@ -1548,41 +1689,51 @@ class Del(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Del": diff --git a/reflex/components/gridjs/datatable.py b/reflex/components/gridjs/datatable.py index 47069843b..cd1acf100 100644 --- a/reflex/components/gridjs/datatable.py +++ b/reflex/components/gridjs/datatable.py @@ -6,11 +6,11 @@ from typing import Any, Dict, List, Union from reflex.components.component import Component from reflex.components.tags import Tag -from reflex.ivars.base import ImmutableComputedVar +from reflex.ivars.base import ImmutableVar, LiteralVar, is_computed_var from reflex.utils import types from reflex.utils.imports import ImportDict from reflex.utils.serializers import serialize -from reflex.vars import ComputedVar, Var +from reflex.vars import Var class Gridjs(Component): @@ -66,17 +66,14 @@ class DataTable(Gridjs): # The annotation should be provided if data is a computed var. We need this to know how to # render pandas dataframes. - if ( - isinstance(data, (ComputedVar, ImmutableComputedVar)) - and data._var_type == Any - ): + if is_computed_var(data) and data._var_type == Any: raise ValueError( "Annotation of the computed var assigned to the data field should be provided." ) if ( columns is not None - and isinstance(columns, (ComputedVar, ImmutableComputedVar)) + and is_computed_var(columns) and columns._var_type == Any ): raise ValueError( @@ -86,7 +83,7 @@ class DataTable(Gridjs): # If data is a pandas dataframe and columns are provided throw an error. if ( types.is_dataframe(type(data)) - or (isinstance(data, Var) and types.is_dataframe(data._var_type)) + or (isinstance(data, ImmutableVar) and types.is_dataframe(data._var_type)) ) and columns is not None: raise ValueError( "Cannot pass in both a pandas dataframe and columns to the data_table component." @@ -94,15 +91,13 @@ class DataTable(Gridjs): # If data is a list and columns are not provided, throw an error if ( - (isinstance(data, Var) and types._issubclass(data._var_type, List)) + (isinstance(data, ImmutableVar) and types._issubclass(data._var_type, List)) or issubclass(type(data), List) ) and columns is None: raise ValueError( "column field should be specified when the data field is a list type" ) - print("props", props) - # Create the component. return super().create( *children, @@ -118,7 +113,9 @@ class DataTable(Gridjs): return {"": "gridjs/dist/theme/mermaid.css"} def _render(self) -> Tag: - if isinstance(self.data, Var) and types.is_dataframe(self.data._var_type): + if isinstance(self.data, ImmutableVar) and types.is_dataframe( + self.data._var_type + ): self.columns = self.data._replace( _var_name=f"{self.data._var_name}.columns", _var_type=List[Any], @@ -131,8 +128,8 @@ class DataTable(Gridjs): # If given a pandas df break up the data and columns data = serialize(self.data) assert isinstance(data, dict), "Serialized dataframe should be a dict." - self.columns = Var.create_safe(data["columns"]) - self.data = Var.create_safe(data["data"]) + self.columns = LiteralVar.create(data["columns"]) + self.data = LiteralVar.create(data["data"]) # Render the table. return super()._render() diff --git a/reflex/components/gridjs/datatable.pyi b/reflex/components/gridjs/datatable.pyi index 8f0a427b1..c80cacd85 100644 --- a/reflex/components/gridjs/datatable.pyi +++ b/reflex/components/gridjs/datatable.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -22,41 +23,51 @@ class Gridjs(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Gridjs": @@ -94,41 +105,51 @@ class DataTable(Gridjs): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataTable": diff --git a/reflex/components/lucide/icon.pyi b/reflex/components/lucide/icon.pyi index 325322b45..1e25ac002 100644 --- a/reflex/components/lucide/icon.pyi +++ b/reflex/components/lucide/icon.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -21,41 +22,51 @@ class LucideIconComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LucideIconComponent": @@ -88,41 +99,51 @@ class Icon(LucideIconComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Icon": diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index cd560d00b..b44ca25dd 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -20,11 +20,11 @@ from reflex.components.tags.tag import Tag from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import types from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars import Var # Special vars used in the component map. _CHILDREN = ImmutableVar.create_safe("children") _PROPS = ImmutableVar.create_safe("...props") +_PROPS_IN_TAG = ImmutableVar.create_safe("{...props}") _MOCK_ARG = ImmutableVar.create_safe("") # Special remark plugins. @@ -99,7 +99,8 @@ class Markdown(Component): The markdown component. """ assert ( - len(children) == 1 and types._isinstance(children[0], Union[str, Var]) + len(children) == 1 + and types._isinstance(children[0], Union[str, ImmutableVar]) ), "Markdown component must have exactly one child containing the markdown source." # Update the base component map with the custom component map. @@ -194,7 +195,7 @@ class Markdown(Component): if tag not in self.component_map: raise ValueError(f"No markdown component found for tag: {tag}.") - special_props = {_PROPS} + special_props = {_PROPS_IN_TAG} children = [_CHILDREN] # For certain tags, the props from the markdown renderer are not actually valid for the component. @@ -205,9 +206,7 @@ class Markdown(Component): children_prop = props.pop("children", None) if children_prop is not None: special_props.add( - Var.create_safe( - f"children={{{str(children_prop)}}}", _var_is_string=False - ) + ImmutableVar.create_safe(f"children={{{str(children_prop)}}}") ) children = [] # Get the component. @@ -228,21 +227,22 @@ class Markdown(Component): """ return str(self.get_component(tag, **props)).replace("\n", "") - def format_component_map(self) -> dict[str, str]: + def format_component_map(self) -> dict[str, ImmutableVar]: """Format the component map for rendering. Returns: The formatted component map. """ components = { - tag: f"{{({{node, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => ({self.format_component(tag)})}}" + tag: ImmutableVar.create_safe( + f"(({{node, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => ({self.format_component(tag)}))" + ) for tag in self.component_map } # Separate out inline code and code blocks. - components[ - "code" - ] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{ + components["code"] = ImmutableVar.create_safe( + f"""(({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{ const match = (className || '').match(/language-(?.*)/); const language = match ? match[1] : ''; if (language) {{ @@ -260,7 +260,8 @@ class Markdown(Component): ) : ( {self.format_component("codeblock", language=ImmutableVar.create_safe("language"))} ); - }}}}""".replace("\n", " ") + }})""".replace("\n", " ") + ) return components @@ -285,7 +286,7 @@ class Markdown(Component): function {self._get_component_map_name()} () {{ {formatted_hooks} return ( - {str(ImmutableVar.create_safe(self.format_component_map()))} + {str(LiteralVar.create(self.format_component_map()))} ) }} """ diff --git a/reflex/components/markdown/markdown.pyi b/reflex/components/markdown/markdown.pyi index 299cb99ff..e5f660b6c 100644 --- a/reflex/components/markdown/markdown.pyi +++ b/reflex/components/markdown/markdown.pyi @@ -11,10 +11,10 @@ from reflex.event import EventHandler, EventSpec from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var _CHILDREN = ImmutableVar.create_safe("children") _PROPS = ImmutableVar.create_safe("...props") +_PROPS_IN_TAG = ImmutableVar.create_safe("{...props}") _MOCK_ARG = ImmutableVar.create_safe("") _REMARK_MATH = ImmutableVar.create_safe("remarkMath") _REMARK_GFM = ImmutableVar.create_safe("remarkGfm") @@ -41,41 +41,51 @@ class Markdown(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Markdown": @@ -101,4 +111,4 @@ class Markdown(Component): def add_imports(self) -> ImportDict | list[ImportDict]: ... def get_component(self, tag: str, **props) -> Component: ... def format_component(self, tag: str, **props) -> str: ... - def format_component_map(self) -> dict[str, str]: ... + def format_component_map(self) -> dict[str, ImmutableVar]: ... diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index 05c7ffc96..168a239d7 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -55,42 +56,54 @@ class Moment(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Moment": diff --git a/reflex/components/next/base.pyi b/reflex/components/next/base.pyi index c8b9934d8..996ed41e8 100644 --- a/reflex/components/next/base.pyi +++ b/reflex/components/next/base.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class NextComponent(Component): ... @@ -23,41 +23,51 @@ class NextComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextComponent": diff --git a/reflex/components/next/image.pyi b/reflex/components/next/image.pyi index e6b902cb0..695a8d80e 100644 --- a/reflex/components/next/image.pyi +++ b/reflex/components/next/image.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -36,43 +37,57 @@ class Image(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_load: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Image": diff --git a/reflex/components/next/link.pyi b/reflex/components/next/link.pyi index c25ca8258..0aa6e4127 100644 --- a/reflex/components/next/link.pyi +++ b/reflex/components/next/link.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class NextLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextLink": diff --git a/reflex/components/next/video.pyi b/reflex/components/next/video.pyi index 13b39a4f8..f1f1b94de 100644 --- a/reflex/components/next/video.pyi +++ b/reflex/components/next/video.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,41 +26,51 @@ class Video(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Video": diff --git a/reflex/components/plotly/plotly.py b/reflex/components/plotly/plotly.py index a2393fdca..ed7040d1c 100644 --- a/reflex/components/plotly/plotly.py +++ b/reflex/components/plotly/plotly.py @@ -8,6 +8,7 @@ from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.components.core.cond import color_mode_cond from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import console from reflex.vars import Var @@ -30,7 +31,7 @@ def _event_data_signature(e0: Var) -> List[Any]: Returns: The event key extracted from the event data (if defined). """ - return [Var.create_safe(f"{e0}?.event", _var_is_string=False)] + return [ImmutableVar.create_safe(f"{e0}?.event")] def _event_points_data_signature(e0: Var) -> List[Any]: @@ -43,11 +44,8 @@ def _event_points_data_signature(e0: Var) -> List[Any]: The event data and the extracted points. """ return [ - Var.create_safe(f"{e0}?.event", _var_is_string=False), - Var.create_safe( - f"extractPoints({e0}?.points)", - _var_is_string=False, - ), + ImmutableVar.create_safe(f"{e0}?.event"), + ImmutableVar.create_safe(f"extractPoints({e0}?.points)"), ] @@ -116,7 +114,7 @@ class Plotly(NoSSRComponent): config: Var[Dict] # If true, the graph will resize when the window is resized. - use_resize_handler: Var[bool] = Var.create_safe(True) + use_resize_handler: Var[bool] = LiteralVar.create(True) # Fired after the plot is redrawn. on_after_plot: EventHandler[_passthrough_signature] @@ -242,10 +240,10 @@ const extractPoints = (points) => { from plotly.io import templates responsive_template = color_mode_cond( - light=Var.create_safe(templates["plotly"]).to(dict), - dark=Var.create_safe(templates["plotly_dark"]).to(dict), + light=LiteralVar.create(templates["plotly"]), + dark=LiteralVar.create(templates["plotly_dark"]), ) - if isinstance(responsive_template, Var): + if isinstance(responsive_template, ImmutableVar): # Mark the conditional Var as a Template to avoid type mismatch responsive_template = responsive_template.to(Template) props.setdefault("template", responsive_template) @@ -257,36 +255,26 @@ const extractPoints = (points) => { def _render(self): tag = super()._render() - figure = self.data.to(dict) + figure = self.data.upcast().to(dict) merge_dicts = [] # Data will be merged and spread from these dict Vars if self.layout is not None: # Why is this not a literal dict? Great question... it didn't work # reliably because of how _var_name_unwrapped strips the outer curly # brackets if any of the contained Vars depend on state. - layout_dict = Var.create_safe( - f"{{'layout': {self.layout.to(dict)._var_name_unwrapped}}}" - ).to(dict) + layout_dict = LiteralVar.create({"layout": self.layout}) merge_dicts.append(layout_dict) if self.template is not None: - template_dict = Var.create_safe( - {"layout": {"template": self.template.to(dict)}} - ) - template_dict._var_data = None # To avoid stripping outer curly brackets - merge_dicts.append(template_dict) + template_dict = LiteralVar.create({"layout": {"template": self.template}}) + merge_dicts.append(template_dict.without_data()) if merge_dicts: tag.special_props.add( # Merge all dictionaries and spread the result over props. - Var.create_safe( - f"{{...mergician({figure._var_name_unwrapped}," - f"{','.join(md._var_name_unwrapped for md in merge_dicts)})}}", - _var_is_string=False, + ImmutableVar.create_safe( + f"{{...mergician({str(figure)}," + f"{','.join(str(md) for md in merge_dicts)})}}", ), ) else: # Spread the figure dict over props, nothing to merge. - tag.special_props.add( - Var.create_safe( - f"{{...{figure._var_name_unwrapped}}}", _var_is_string=False - ) - ) + tag.special_props.add(ImmutableVar.create_safe(f"{{...{str(figure)}}}")) return tag diff --git a/reflex/components/plotly/plotly.pyi b/reflex/components/plotly/plotly.pyi index c308e160f..48797a7ef 100644 --- a/reflex/components/plotly/plotly.pyi +++ b/reflex/components/plotly/plotly.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils import console from reflex.vars import Var @@ -44,91 +45,105 @@ class Plotly(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_after_plot: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animated: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animating_frame: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_autosize: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_before_hover: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_button_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_deselect: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_hover: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_hover: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_redraw: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_redraw: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_relayout: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_relayouting: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_restyle: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selected: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_selecting: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_transition_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_transitioning: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_unhover: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Plotly": diff --git a/reflex/components/props.py b/reflex/components/props.py index a66ba7f2f..2966e9727 100644 --- a/reflex/components/props.py +++ b/reflex/components/props.py @@ -3,8 +3,8 @@ from __future__ import annotations from reflex.base import Base +from reflex.ivars.object import LiteralObjectVar from reflex.utils import format -from reflex.utils.serializers import serialize class PropsBase(Base): @@ -20,12 +20,6 @@ class PropsBase(Base): Returns: The object as a Javascript Object literal. """ - return format.unwrap_vars( - self.__config__.json_dumps( - { - format.to_camel_case(key): value - for key, value in self.dict().items() - }, - default=serialize, - ) - ) + return LiteralObjectVar.create( + {format.to_camel_case(key): value for key, value in self.dict().items()} + ).json() diff --git a/reflex/components/radix/primitives/accordion.py b/reflex/components/radix/primitives/accordion.py index da32d747b..cfd5808a6 100644 --- a/reflex/components/radix/primitives/accordion.py +++ b/reflex/components/radix/primitives/accordion.py @@ -11,7 +11,7 @@ from reflex.components.lucide.icon import Icon from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import LiteralAccentColor, LiteralRadius from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.vars import Var, get_uuid_string_var @@ -193,8 +193,8 @@ class AccordionItem(AccordionComponent): def create( cls, *children, - header: Optional[Component | Var] = None, - content: Optional[Component | Var] = None, + header: Optional[Component | ImmutableVar] = None, + content: Optional[Component | ImmutableVar] = None, **props, ) -> Component: """Create an accordion item. diff --git a/reflex/components/radix/primitives/accordion.pyi b/reflex/components/radix/primitives/accordion.pyi index edf011183..651e16b34 100644 --- a/reflex/components/radix/primitives/accordion.pyi +++ b/reflex/components/radix/primitives/accordion.pyi @@ -9,6 +9,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -100,41 +101,51 @@ class AccordionComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionComponent": @@ -264,44 +275,54 @@ class AccordionRoot(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionRoot": @@ -342,8 +363,8 @@ class AccordionItem(AccordionComponent): def create( # type: ignore cls, *children, - header: Optional[Union[Component, Var]] = None, - content: Optional[Union[Component, Var]] = None, + header: Optional[Union[Component, ImmutableVar]] = None, + content: Optional[Union[Component, ImmutableVar]] = None, value: Optional[Union[Var[str], str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, color_scheme: Optional[ @@ -420,41 +441,51 @@ class AccordionItem(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionItem": @@ -564,41 +595,51 @@ class AccordionHeader(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionHeader": @@ -704,41 +745,51 @@ class AccordionTrigger(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionTrigger": @@ -776,41 +827,51 @@ class AccordionIcon(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionIcon": @@ -913,41 +974,51 @@ class AccordionContent(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionContent": diff --git a/reflex/components/radix/primitives/base.pyi b/reflex/components/radix/primitives/base.pyi index a94b2263c..1241044d2 100644 --- a/reflex/components/radix/primitives/base.pyi +++ b/reflex/components/radix/primitives/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -22,41 +23,51 @@ class RadixPrimitiveComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixPrimitiveComponent": @@ -90,41 +101,51 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixPrimitiveComponentWithClassName": diff --git a/reflex/components/radix/primitives/drawer.pyi b/reflex/components/radix/primitives/drawer.pyi index c40bdf53d..ddb770b36 100644 --- a/reflex/components/radix/primitives/drawer.pyi +++ b/reflex/components/radix/primitives/drawer.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class DrawerComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerComponent": @@ -107,44 +118,54 @@ class DrawerRoot(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerRoot": @@ -187,41 +208,51 @@ class DrawerTrigger(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerTrigger": @@ -248,41 +279,51 @@ class DrawerPortal(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerPortal": @@ -316,56 +357,66 @@ class DrawerContent(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerContent": @@ -403,41 +454,51 @@ class DrawerOverlay(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerOverlay": @@ -471,41 +532,51 @@ class DrawerClose(DrawerTrigger): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerClose": @@ -532,41 +603,51 @@ class DrawerTitle(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerTitle": @@ -600,41 +681,51 @@ class DrawerDescription(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerDescription": @@ -689,44 +780,54 @@ class Drawer(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerRoot": diff --git a/reflex/components/radix/primitives/form.pyi b/reflex/components/radix/primitives/form.pyi index 758630c4a..20df4b85a 100644 --- a/reflex/components/radix/primitives/form.pyi +++ b/reflex/components/radix/primitives/form.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.el.elements.forms import Form as HTMLForm from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,41 +26,51 @@ class FormComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormComponent": @@ -133,45 +144,57 @@ class FormRoot(FormComponent, HTMLForm): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_clear_server_errors: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormRoot": @@ -235,41 +258,51 @@ class FormField(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormField": @@ -306,41 +339,51 @@ class FormLabel(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormLabel": @@ -374,41 +417,51 @@ class FormControl(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormControl": @@ -492,41 +545,51 @@ class FormMessage(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormMessage": @@ -563,41 +626,51 @@ class FormValidityState(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormValidityState": @@ -631,41 +704,51 @@ class FormSubmit(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormSubmit": @@ -740,45 +823,57 @@ class Form(FormRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_clear_server_errors: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Form": @@ -884,45 +979,57 @@ class FormNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_clear_server_errors: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Form": diff --git a/reflex/components/radix/primitives/progress.pyi b/reflex/components/radix/primitives/progress.pyi index f1c817587..630432aba 100644 --- a/reflex/components/radix/primitives/progress.pyi +++ b/reflex/components/radix/primitives/progress.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class ProgressComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ProgressComponent": @@ -98,41 +109,51 @@ class ProgressRoot(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ProgressRoot": @@ -232,41 +253,51 @@ class ProgressIndicator(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ProgressIndicator": @@ -373,41 +404,51 @@ class Progress(ProgressRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": @@ -515,41 +556,51 @@ class ProgressNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/primitives/slider.pyi b/reflex/components/radix/primitives/slider.pyi index 9ce737df4..e3bd27805 100644 --- a/reflex/components/radix/primitives/slider.pyi +++ b/reflex/components/radix/primitives/slider.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -26,41 +27,51 @@ class SliderComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderComponent": @@ -111,47 +122,57 @@ class SliderRoot(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderRoot": @@ -186,41 +207,51 @@ class SliderTrack(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderTrack": @@ -255,41 +286,51 @@ class SliderRange(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderRange": @@ -324,41 +365,51 @@ class SliderThumb(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderThumb": diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index 5aea55d90..c79557024 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -102,41 +103,51 @@ class CommonMarginProps(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CommonMarginProps": @@ -176,41 +187,51 @@ class RadixLoadingProp(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixLoadingProp": @@ -243,41 +264,51 @@ class RadixThemesComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixThemesComponent": @@ -312,41 +343,51 @@ class RadixThemesTriggerComponent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixThemesTriggerComponent": @@ -464,41 +505,51 @@ class Theme(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Theme": @@ -544,41 +595,51 @@ class ThemePanel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ThemePanel": @@ -614,41 +675,51 @@ class RadixThemesColorModeProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixThemesColorModeProvider": diff --git a/reflex/components/radix/themes/color_mode.py b/reflex/components/radix/themes/color_mode.py index 0331d7184..2e6707d01 100644 --- a/reflex/components/radix/themes/color_mode.py +++ b/reflex/components/radix/themes/color_mode.py @@ -17,7 +17,7 @@ rx.text( from __future__ import annotations -from typing import Literal, get_args +from typing import Dict, List, Literal, get_args from reflex.components.component import BaseComponent from reflex.components.core.cond import Cond, color_mode_cond, cond @@ -25,6 +25,7 @@ from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.dropdown_menu import dropdown_menu from reflex.components.radix.themes.components.switch import Switch from reflex.ivars.base import ImmutableVar +from reflex.ivars.sequence import LiteralArrayVar from reflex.style import ( LIGHT_COLOR_MODE, color_mode, @@ -32,7 +33,6 @@ from reflex.style import ( set_color_mode, toggle_color_mode, ) -from reflex.vars import Var from .components.icon_button import IconButton @@ -66,9 +66,9 @@ class ColorModeIcon(Cond): LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"] -position_values = get_args(LiteralPosition) +position_values: List[str] = list(get_args(LiteralPosition)) -position_map = { +position_map: Dict[str, List[str]] = { "position": position_values, "left": ["top-left", "bottom-left"], "right": ["top-right", "bottom-right"], @@ -78,8 +78,8 @@ position_map = { # needed to inverse contains for find -def _find(const, var): - return Var.create_safe(const, _var_is_string=False).contains(var) +def _find(const: List[str], var): + return LiteralArrayVar.create(const).contains(var) def _set_var_default(props, position, prop, default1, default2=""): @@ -114,7 +114,7 @@ class ColorModeIconButton(IconButton): The button component. """ # position is used to set nice defaults for positioning the icon button - if isinstance(position, Var): + if isinstance(position, ImmutableVar): _set_var_default(props, position, "position", "fixed", position) _set_var_default(props, position, "bottom", "2rem") _set_var_default(props, position, "top", "2rem") diff --git a/reflex/components/radix/themes/color_mode.pyi b/reflex/components/radix/themes/color_mode.pyi index a746068c3..8712e526b 100644 --- a/reflex/components/radix/themes/color_mode.pyi +++ b/reflex/components/radix/themes/color_mode.pyi @@ -3,7 +3,16 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, get_args, overload +from typing import ( + Any, + Callable, + Dict, + List, + Literal, + Optional, + Union, + overload, +) from reflex.components.component import BaseComponent from reflex.components.core.breakpoints import Breakpoints @@ -37,41 +46,51 @@ class ColorModeIcon(Cond): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ColorModeIcon": @@ -87,14 +106,8 @@ class ColorModeIcon(Cond): ... LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"] -position_values = get_args(LiteralPosition) -position_map = { - "position": position_values, - "left": ["top-left", "bottom-left"], - "right": ["top-right", "bottom-right"], - "top": ["top-left", "top-right"], - "bottom": ["bottom-left", "bottom-right"], -} +position_values: List[str] +position_map: Dict[str, List[str]] class ColorModeIconButton(IconButton): @overload @@ -235,41 +248,51 @@ class ColorModeIconButton(IconButton): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ColorModeIconButton": @@ -428,42 +451,54 @@ class ColorModeSwitch(Switch): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ColorModeSwitch": diff --git a/reflex/components/radix/themes/components/alert_dialog.pyi b/reflex/components/radix/themes/components/alert_dialog.pyi index 4cb9e966c..8d135e6f8 100644 --- a/reflex/components/radix/themes/components/alert_dialog.pyi +++ b/reflex/components/radix/themes/components/alert_dialog.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -28,44 +29,54 @@ class AlertDialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogRoot": @@ -101,41 +112,51 @@ class AlertDialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogTrigger": @@ -198,50 +219,60 @@ class AlertDialogContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogContent": @@ -294,41 +325,51 @@ class AlertDialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogTitle": @@ -363,41 +404,51 @@ class AlertDialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogDescription": @@ -432,41 +483,51 @@ class AlertDialogAction(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogAction": @@ -492,41 +553,51 @@ class AlertDialogCancel(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogCancel": diff --git a/reflex/components/radix/themes/components/aspect_ratio.pyi b/reflex/components/radix/themes/components/aspect_ratio.pyi index 612c67a29..6ca61f67c 100644 --- a/reflex/components/radix/themes/components/aspect_ratio.pyi +++ b/reflex/components/radix/themes/components/aspect_ratio.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class AspectRatio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AspectRatio": diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi index c0476d543..9a92c73f5 100644 --- a/reflex/components/radix/themes/components/avatar.pyi +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -113,41 +114,51 @@ class Avatar(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Avatar": diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi index 327fe2b90..c2936210a 100644 --- a/reflex/components/radix/themes/components/badge.pyi +++ b/reflex/components/radix/themes/components/badge.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -134,41 +135,51 @@ class Badge(elements.Span, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Badge": diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi index 95a80c84e..145de6452 100644 --- a/reflex/components/radix/themes/components/button.pyi +++ b/reflex/components/radix/themes/components/button.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -157,41 +158,51 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Button": diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi index 04e1d1317..4bd7a54a3 100644 --- a/reflex/components/radix/themes/components/callout.pyi +++ b/reflex/components/radix/themes/components/callout.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -132,41 +133,51 @@ class CalloutRoot(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CalloutRoot": @@ -246,41 +257,51 @@ class CalloutIcon(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CalloutIcon": @@ -355,41 +376,51 @@ class CalloutText(elements.P, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CalloutText": @@ -547,41 +578,51 @@ class Callout(CalloutRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Callout": @@ -745,41 +786,51 @@ class CalloutNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Callout": diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi index 142cc7448..ed4399ecc 100644 --- a/reflex/components/radix/themes/components/card.pyi +++ b/reflex/components/radix/themes/components/card.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -67,41 +68,51 @@ class Card(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Card": diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index 52441eef4..0498f5a90 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -114,42 +115,54 @@ class Checkbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Checkbox": @@ -281,42 +294,54 @@ class HighLevelCheckbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelCheckbox": @@ -445,42 +470,54 @@ class CheckboxNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelCheckbox": diff --git a/reflex/components/radix/themes/components/checkbox_cards.pyi b/reflex/components/radix/themes/components/checkbox_cards.pyi index d7be8a056..519a5587d 100644 --- a/reflex/components/radix/themes/components/checkbox_cards.pyi +++ b/reflex/components/radix/themes/components/checkbox_cards.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -147,41 +148,51 @@ class CheckboxCardsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxCardsRoot": @@ -222,41 +233,51 @@ class CheckboxCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxCardsItem": diff --git a/reflex/components/radix/themes/components/checkbox_group.pyi b/reflex/components/radix/themes/components/checkbox_group.pyi index 8a730b870..080125f00 100644 --- a/reflex/components/radix/themes/components/checkbox_group.pyi +++ b/reflex/components/radix/themes/components/checkbox_group.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -106,41 +107,51 @@ class CheckboxGroupRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxGroupRoot": @@ -183,41 +194,51 @@ class CheckboxGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxGroupItem": diff --git a/reflex/components/radix/themes/components/context_menu.pyi b/reflex/components/radix/themes/components/context_menu.pyi index e2f9d01e2..49d703d13 100644 --- a/reflex/components/radix/themes/components/context_menu.pyi +++ b/reflex/components/radix/themes/components/context_menu.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,44 +26,54 @@ class ContextMenuRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuRoot": @@ -99,41 +110,51 @@ class ContextMenuTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuTrigger": @@ -244,56 +265,66 @@ class ContextMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuContent": @@ -334,41 +365,51 @@ class ContextMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSub": @@ -404,41 +445,51 @@ class ContextMenuSubTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSubTrigger": @@ -475,53 +526,63 @@ class ContextMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSubContent": @@ -620,41 +681,51 @@ class ContextMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuItem": @@ -691,41 +762,51 @@ class ContextMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSeparator": diff --git a/reflex/components/radix/themes/components/data_list.pyi b/reflex/components/radix/themes/components/data_list.pyi index 93d00c86b..a73a9264a 100644 --- a/reflex/components/radix/themes/components/data_list.pyi +++ b/reflex/components/radix/themes/components/data_list.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -59,41 +60,51 @@ class DataListRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListRoot": @@ -148,41 +159,51 @@ class DataListItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListItem": @@ -289,41 +310,51 @@ class DataListLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListLabel": @@ -362,41 +393,51 @@ class DataListValue(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListValue": diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index 02b1a6c9f..eaae1bfee 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -26,44 +27,54 @@ class DialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogRoot": @@ -99,41 +110,51 @@ class DialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogTrigger": @@ -159,41 +180,51 @@ class DialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogTitle": @@ -264,56 +295,66 @@ class DialogContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogContent": @@ -365,41 +406,51 @@ class DialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogDescription": @@ -434,41 +485,51 @@ class DialogClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogClose": @@ -500,44 +561,54 @@ class Dialog(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogRoot": diff --git a/reflex/components/radix/themes/components/dropdown_menu.pyi b/reflex/components/radix/themes/components/dropdown_menu.pyi index df7b23589..2f324fa9a 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.pyi +++ b/reflex/components/radix/themes/components/dropdown_menu.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -35,44 +36,54 @@ class DropdownMenuRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuRoot": @@ -112,41 +123,51 @@ class DropdownMenuTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuTrigger": @@ -276,56 +297,66 @@ class DropdownMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuContent": @@ -379,41 +410,51 @@ class DropdownMenuSubTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSubTrigger": @@ -441,44 +482,54 @@ class DropdownMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSub": @@ -534,53 +585,63 @@ class DropdownMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSubContent": @@ -691,42 +752,54 @@ class DropdownMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_select: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_select: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuItem": @@ -766,41 +839,51 @@ class DropdownMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSeparator": diff --git a/reflex/components/radix/themes/components/hover_card.pyi b/reflex/components/radix/themes/components/hover_card.pyi index ad56a8302..dd575898d 100644 --- a/reflex/components/radix/themes/components/hover_card.pyi +++ b/reflex/components/radix/themes/components/hover_card.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -29,44 +30,54 @@ class HoverCardRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardRoot": @@ -105,41 +116,51 @@ class HoverCardTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardTrigger": @@ -209,41 +230,51 @@ class HoverCardContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardContent": @@ -304,44 +335,54 @@ class HoverCard(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardRoot": diff --git a/reflex/components/radix/themes/components/icon_button.py b/reflex/components/radix/themes/components/icon_button.py index 76077057e..8a39af0a7 100644 --- a/reflex/components/radix/themes/components/icon_button.py +++ b/reflex/components/radix/themes/components/icon_button.py @@ -9,6 +9,7 @@ from reflex.components.core.breakpoints import Responsive from reflex.components.core.match import Match from reflex.components.el import elements from reflex.components.lucide import Icon +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -82,7 +83,7 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): *[(size, px) for size, px in RADIX_TO_LUCIDE_SIZE.items()], 12, ) - if not isinstance(size_map_var, Var): + if not isinstance(size_map_var, ImmutableVar): raise ValueError(f"Match did not return a Var: {size_map_var}") children[0].size = size_map_var return super().create(*children, **props) diff --git a/reflex/components/radix/themes/components/icon_button.pyi b/reflex/components/radix/themes/components/icon_button.pyi index b5c75a9b6..e8a2295b4 100644 --- a/reflex/components/radix/themes/components/icon_button.pyi +++ b/reflex/components/radix/themes/components/icon_button.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -157,41 +158,51 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "IconButton": diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi index 3671d2a5c..cefda619b 100644 --- a/reflex/components/radix/themes/components/inset.pyi +++ b/reflex/components/radix/themes/components/inset.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -132,41 +133,51 @@ class Inset(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Inset": diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index d8bd9d1d6..4339a8c43 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -27,44 +28,54 @@ class PopoverRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverRoot": @@ -101,41 +112,51 @@ class PopoverTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverTrigger": @@ -212,59 +233,69 @@ class PopoverContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverContent": @@ -321,41 +352,51 @@ class PopoverClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverClose": diff --git a/reflex/components/radix/themes/components/progress.pyi b/reflex/components/radix/themes/components/progress.pyi index a647e94e6..b3a4ce89d 100644 --- a/reflex/components/radix/themes/components/progress.pyi +++ b/reflex/components/radix/themes/components/progress.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -112,41 +113,51 @@ class Progress(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/themes/components/radio.pyi b/reflex/components/radix/themes/components/radio.pyi index 5c1b303fa..06cb6bef3 100644 --- a/reflex/components/radix/themes/components/radio.pyi +++ b/reflex/components/radix/themes/components/radio.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -103,41 +104,51 @@ class Radio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Radio": diff --git a/reflex/components/radix/themes/components/radio_cards.pyi b/reflex/components/radix/themes/components/radio_cards.pyi index 2c0bf002b..fac079ca9 100644 --- a/reflex/components/radix/themes/components/radio_cards.pyi +++ b/reflex/components/radix/themes/components/radio_cards.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -161,44 +162,54 @@ class RadioCardsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioCardsRoot": @@ -251,41 +262,51 @@ class RadioCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioCardsItem": diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index 174abbac6..563f5d2dc 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -146,11 +146,13 @@ class HighLevelRadioGroup(RadixThemesComponent): default_value = props.pop("default_value", "") if ( - not isinstance(items, (list, Var)) - or isinstance(items, Var) + not isinstance(items, (list, ImmutableVar)) + or isinstance(items, ImmutableVar) and not types._issubclass(items._var_type, list) ): - items_type = type(items) if not isinstance(items, Var) else items._var_type + items_type = ( + type(items) if not isinstance(items, ImmutableVar) else items._var_type + ) raise TypeError( f"The radio group component takes in a list, got {items_type} instead" ) @@ -160,15 +162,15 @@ class HighLevelRadioGroup(RadixThemesComponent): # convert only non-strings to json(JSON.stringify) so quotes are not rendered # for string literal types. if isinstance(default_value, str) or ( - isinstance(default_value, Var) and default_value._var_type is str + isinstance(default_value, ImmutableVar) and default_value._var_type is str ): default_value = LiteralVar.create(default_value) # type: ignore else: default_value = ImmutableVar.create_safe(default_value).to_string() - def radio_group_item(value: Var) -> Component: + def radio_group_item(value: ImmutableVar) -> Component: item_value = rx.cond( - value._type() == "string", + value.js_type() == "string", value, value.to_string(), ).to(StringVar) diff --git a/reflex/components/radix/themes/components/radio_group.pyi b/reflex/components/radix/themes/components/radio_group.pyi index 559607ae5..c8f8317ac 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -111,42 +112,54 @@ class RadioGroupRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioGroupRoot": @@ -193,41 +206,51 @@ class RadioGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioGroupItem": @@ -355,41 +378,51 @@ class HighLevelRadioGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelRadioGroup": @@ -527,41 +560,51 @@ class RadioGroup(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelRadioGroup": diff --git a/reflex/components/radix/themes/components/scroll_area.pyi b/reflex/components/radix/themes/components/scroll_area.pyi index 8b4e44df5..20c9c35af 100644 --- a/reflex/components/radix/themes/components/scroll_area.pyi +++ b/reflex/components/radix/themes/components/scroll_area.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -35,41 +36,51 @@ class ScrollArea(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ScrollArea": diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index f284dab77..b7511196f 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -113,42 +114,54 @@ class SegmentedControlRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SegmentedControlRoot": @@ -189,41 +202,51 @@ class SegmentedControlItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SegmentedControlItem": diff --git a/reflex/components/radix/themes/components/select.py b/reflex/components/radix/themes/components/select.py index fc10d00de..b2bd69e9a 100644 --- a/reflex/components/radix/themes/components/select.py +++ b/reflex/components/radix/themes/components/select.py @@ -5,6 +5,7 @@ from typing import List, Literal, Union import reflex as rx from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive +from reflex.ivars.base import ImmutableVar from reflex.vars import Var from ..base import ( @@ -216,7 +217,7 @@ class HighLevelSelect(SelectRoot): label = props.pop("label", None) - if isinstance(items, Var): + if isinstance(items, ImmutableVar): child = [ rx.foreach(items, lambda item: SelectItem.create(item, value=item)) ] diff --git a/reflex/components/radix/themes/components/select.pyi b/reflex/components/radix/themes/components/select.pyi index e2657b7ce..fa6149d0e 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -42,45 +43,57 @@ class SelectRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectRoot": @@ -198,41 +211,51 @@ class SelectTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectTrigger": @@ -357,50 +380,60 @@ class SelectContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectContent": @@ -443,41 +476,51 @@ class SelectGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectGroup": @@ -514,41 +557,51 @@ class SelectItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectItem": @@ -585,41 +638,51 @@ class SelectLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectLabel": @@ -654,41 +717,51 @@ class SelectSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectSeparator": @@ -826,45 +899,57 @@ class HighLevelSelect(SelectRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelSelect": @@ -1022,45 +1107,57 @@ class Select(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelSelect": diff --git a/reflex/components/radix/themes/components/separator.pyi b/reflex/components/radix/themes/components/separator.pyi index 15670f51a..13b3276d2 100644 --- a/reflex/components/radix/themes/components/separator.pyi +++ b/reflex/components/radix/themes/components/separator.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -112,41 +113,51 @@ class Separator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Separator": diff --git a/reflex/components/radix/themes/components/skeleton.pyi b/reflex/components/radix/themes/components/skeleton.pyi index d6c6bbb03..dcf0bd3c5 100644 --- a/reflex/components/radix/themes/components/skeleton.pyi +++ b/reflex/components/radix/themes/components/skeleton.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -42,41 +43,51 @@ class Skeleton(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Skeleton": diff --git a/reflex/components/radix/themes/components/slider.py b/reflex/components/radix/themes/components/slider.py index c03fffe7b..55b13a386 100644 --- a/reflex/components/radix/themes/components/slider.py +++ b/reflex/components/radix/themes/components/slider.py @@ -5,6 +5,7 @@ from typing import List, Literal, Optional, Union from reflex.components.component import Component from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar from reflex.vars import Var from ..base import ( @@ -88,7 +89,7 @@ class Slider(RadixThemesComponent): """ default_value = props.pop("default_value", [50]) - if isinstance(default_value, Var): + if isinstance(default_value, ImmutableVar): if issubclass(default_value._var_type, (int, float)): default_value = [default_value] diff --git a/reflex/components/radix/themes/components/slider.pyi b/reflex/components/radix/themes/components/slider.pyi index 362451bfe..23e886f35 100644 --- a/reflex/components/radix/themes/components/slider.pyi +++ b/reflex/components/radix/themes/components/slider.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -132,45 +133,57 @@ class Slider(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Slider": diff --git a/reflex/components/radix/themes/components/spinner.pyi b/reflex/components/radix/themes/components/spinner.pyi index 7fa62734a..5ae959339 100644 --- a/reflex/components/radix/themes/components/spinner.pyi +++ b/reflex/components/radix/themes/components/spinner.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -37,41 +38,51 @@ class Spinner(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Spinner": diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index a0f85dbac..5e4b0b47e 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -117,42 +118,54 @@ class Switch(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Switch": diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index 9cac240f2..5a872c7c8 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -65,41 +66,51 @@ class TableRoot(elements.Table, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableRoot": @@ -179,41 +190,51 @@ class TableHeader(elements.Thead, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableHeader": @@ -295,41 +316,51 @@ class TableRow(elements.Tr, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableRow": @@ -416,41 +447,51 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableColumnHeaderCell": @@ -532,41 +573,51 @@ class TableBody(elements.Tbody, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableBody": @@ -652,41 +703,51 @@ class TableCell(elements.Td, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableCell": @@ -777,41 +838,51 @@ class TableRowHeaderCell(elements.Th, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableRowHeaderCell": diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index 0fb33b16d..000eb05d9 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -39,42 +40,54 @@ class TabsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsRoot": @@ -123,41 +136,51 @@ class TabsList(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsList": @@ -258,41 +281,51 @@ class TabsTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsTrigger": @@ -332,41 +365,51 @@ class TabsContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsContent": @@ -418,42 +461,54 @@ class Tabs(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsRoot": diff --git a/reflex/components/radix/themes/components/text_area.pyi b/reflex/components/radix/themes/components/text_area.pyi index 9a8a47873..561f041ab 100644 --- a/reflex/components/radix/themes/components/text_area.pyi +++ b/reflex/components/radix/themes/components/text_area.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -167,46 +168,60 @@ class TextArea(RadixThemesComponent, elements.Textarea): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextArea": diff --git a/reflex/components/radix/themes/components/text_field.pyi b/reflex/components/radix/themes/components/text_field.pyi index be58b8e7f..9dbaa9692 100644 --- a/reflex/components/radix/themes/components/text_field.pyi +++ b/reflex/components/radix/themes/components/text_field.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -148,46 +149,60 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextFieldRoot": @@ -312,41 +327,51 @@ class TextFieldSlot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextFieldSlot": @@ -502,46 +527,60 @@ class TextField(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextFieldRoot": diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index a2344958f..80f483183 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -61,50 +62,60 @@ class Tooltip(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tooltip": diff --git a/reflex/components/radix/themes/layout/base.pyi b/reflex/components/radix/themes/layout/base.pyi index 21fed38ef..dc557b5ee 100644 --- a/reflex/components/radix/themes/layout/base.pyi +++ b/reflex/components/radix/themes/layout/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -200,41 +201,51 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LayoutComponent": diff --git a/reflex/components/radix/themes/layout/box.pyi b/reflex/components/radix/themes/layout/box.pyi index 6bcd75cad..4d7404af1 100644 --- a/reflex/components/radix/themes/layout/box.pyi +++ b/reflex/components/radix/themes/layout/box.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Box(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Box": diff --git a/reflex/components/radix/themes/layout/center.pyi b/reflex/components/radix/themes/layout/center.pyi index 93f884898..a015ab46c 100644 --- a/reflex/components/radix/themes/layout/center.pyi +++ b/reflex/components/radix/themes/layout/center.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -124,41 +125,51 @@ class Center(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Center": diff --git a/reflex/components/radix/themes/layout/container.pyi b/reflex/components/radix/themes/layout/container.pyi index 3c2013b8e..269af2e43 100644 --- a/reflex/components/radix/themes/layout/container.pyi +++ b/reflex/components/radix/themes/layout/container.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -64,41 +65,51 @@ class Container(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Container": diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi index a49f08262..1de96b339 100644 --- a/reflex/components/radix/themes/layout/flex.pyi +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -127,41 +128,51 @@ class Flex(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Flex": diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi index c11d1dfcd..6ab8e7c60 100644 --- a/reflex/components/radix/themes/layout/grid.pyi +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -156,41 +157,51 @@ class Grid(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Grid": diff --git a/reflex/components/radix/themes/layout/list.py b/reflex/components/radix/themes/layout/list.py index fb77b223d..cacba70db 100644 --- a/reflex/components/radix/themes/layout/list.py +++ b/reflex/components/radix/themes/layout/list.py @@ -9,6 +9,7 @@ from reflex.components.core.foreach import Foreach from reflex.components.el.elements.typography import Li, Ol, Ul from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.typography.text import Text +from reflex.ivars.base import ImmutableVar from reflex.vars import Var LiteralListStyleTypeUnordered = Literal[ @@ -50,7 +51,7 @@ class BaseList(Component): def create( cls, *children, - items: Optional[Var[Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, **props, ): """Create a list component. @@ -66,7 +67,7 @@ class BaseList(Component): """ list_style_type = props.pop("list_style_type", "none") if not children and items is not None: - if isinstance(items, Var): + if isinstance(items, ImmutableVar): children = [Foreach.create(items, ListItem.create)] else: children = [ListItem.create(item) for item in items] # type: ignore @@ -97,7 +98,7 @@ class UnorderedList(BaseList, Ul): def create( cls, *children, - items: Optional[Var[Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: LiteralListStyleTypeUnordered = "disc", **props, ): @@ -128,7 +129,7 @@ class OrderedList(BaseList, Ol): def create( cls, *children, - items: Optional[Var[Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: LiteralListStyleTypeOrdered = "decimal", **props, ): diff --git a/reflex/components/radix/themes/layout/list.pyi b/reflex/components/radix/themes/layout/list.pyi index bf8da641c..c670608e7 100644 --- a/reflex/components/radix/themes/layout/list.pyi +++ b/reflex/components/radix/themes/layout/list.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Iterable, Literal, Optional, Union, over from reflex.components.component import Component, ComponentNamespace from reflex.components.el.elements.typography import Li, Ol, Ul from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -35,7 +36,7 @@ class BaseList(Component): def create( # type: ignore cls, *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[ Union[ Var[ @@ -83,41 +84,51 @@ class BaseList(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BaseList": @@ -149,7 +160,7 @@ class UnorderedList(BaseList, Ul): def create( # type: ignore cls, *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[LiteralListStyleTypeUnordered] = "disc", access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, auto_capitalize: Optional[ @@ -180,41 +191,51 @@ class UnorderedList(BaseList, Ul): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "UnorderedList": @@ -260,7 +281,7 @@ class OrderedList(BaseList, Ol): def create( # type: ignore cls, *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[LiteralListStyleTypeOrdered] = "decimal", reversed: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, start: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, @@ -294,41 +315,51 @@ class OrderedList(BaseList, Ol): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "OrderedList": @@ -406,41 +437,51 @@ class ListItem(Li): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ListItem": @@ -486,7 +527,7 @@ class List(ComponentNamespace): @staticmethod def __call__( *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[ Union[ Var[ @@ -534,41 +575,51 @@ class List(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BaseList": diff --git a/reflex/components/radix/themes/layout/section.pyi b/reflex/components/radix/themes/layout/section.pyi index b4e1050d8..8556e079b 100644 --- a/reflex/components/radix/themes/layout/section.pyi +++ b/reflex/components/radix/themes/layout/section.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -61,41 +62,51 @@ class Section(elements.Section, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Section": diff --git a/reflex/components/radix/themes/layout/spacer.pyi b/reflex/components/radix/themes/layout/spacer.pyi index 652c1a0b0..dfd469b05 100644 --- a/reflex/components/radix/themes/layout/spacer.pyi +++ b/reflex/components/radix/themes/layout/spacer.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -124,41 +125,51 @@ class Spacer(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Spacer": diff --git a/reflex/components/radix/themes/layout/stack.pyi b/reflex/components/radix/themes/layout/stack.pyi index 4ba630fc2..8f0ad2a17 100644 --- a/reflex/components/radix/themes/layout/stack.pyi +++ b/reflex/components/radix/themes/layout/stack.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -92,41 +93,51 @@ class Stack(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Stack": @@ -237,41 +248,51 @@ class VStack(Stack): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "VStack": @@ -382,41 +403,51 @@ class HStack(Stack): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HStack": diff --git a/reflex/components/radix/themes/typography/blockquote.pyi b/reflex/components/radix/themes/typography/blockquote.pyi index 3ab3c829b..f367906be 100644 --- a/reflex/components/radix/themes/typography/blockquote.pyi +++ b/reflex/components/radix/themes/typography/blockquote.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -138,41 +139,51 @@ class Blockquote(elements.Blockquote, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Blockquote": diff --git a/reflex/components/radix/themes/typography/code.pyi b/reflex/components/radix/themes/typography/code.pyi index f30a39f9a..25f30d072 100644 --- a/reflex/components/radix/themes/typography/code.pyi +++ b/reflex/components/radix/themes/typography/code.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -143,41 +144,51 @@ class Code(elements.Code, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Code": diff --git a/reflex/components/radix/themes/typography/heading.pyi b/reflex/components/radix/themes/typography/heading.pyi index d1fe26218..4dc44c1af 100644 --- a/reflex/components/radix/themes/typography/heading.pyi +++ b/reflex/components/radix/themes/typography/heading.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -163,41 +164,51 @@ class Heading(elements.H1, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Heading": diff --git a/reflex/components/radix/themes/typography/link.pyi b/reflex/components/radix/themes/typography/link.pyi index 54cebee64..12e698773 100644 --- a/reflex/components/radix/themes/typography/link.pyi +++ b/reflex/components/radix/themes/typography/link.pyi @@ -10,6 +10,7 @@ from reflex.components.core.breakpoints import Breakpoints from reflex.components.el.elements.inline import A from reflex.components.next.link import NextLink from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -175,41 +176,51 @@ class Link(RadixThemesComponent, A, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Link": diff --git a/reflex/components/radix/themes/typography/text.pyi b/reflex/components/radix/themes/typography/text.pyi index 919ed17e0..572922b5b 100644 --- a/reflex/components/radix/themes/typography/text.pyi +++ b/reflex/components/radix/themes/typography/text.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -230,41 +231,51 @@ class Text(elements.Span, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Text": @@ -507,41 +518,51 @@ class Span(Text): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Span": @@ -624,41 +645,51 @@ class Em(elements.Em, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Em": @@ -739,41 +770,51 @@ class Kbd(elements.Kbd, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Kbd": @@ -850,41 +891,51 @@ class Quote(elements.Q, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Quote": @@ -960,41 +1011,51 @@ class Strong(elements.Strong, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Strong": @@ -1233,41 +1294,51 @@ class TextNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Text": diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index f84122403..d9d27be71 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -32,73 +33,99 @@ class Audio(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ended: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Audio": diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index c9e8ba569..7991cadd7 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -30,73 +31,99 @@ class ReactPlayer(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ended: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReactPlayer": diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index 7f7c1fda1..2e6fd3aed 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -32,73 +33,99 @@ class Video(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ended: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Video": diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 4c76e82ea..a909ac6e7 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Union from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.vars import Var from .recharts import ( @@ -235,7 +235,7 @@ class Brush(Recharts): # The stroke color of brush stroke: Var[Union[str, Color]] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 0ffbd6c53..eead7204c 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -93,41 +94,51 @@ class Axis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Axis": @@ -256,41 +267,51 @@ class XAxis(Axis): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "XAxis": @@ -422,41 +443,51 @@ class YAxis(Axis): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "YAxis": @@ -558,41 +589,51 @@ class ZAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ZAxis": @@ -619,7 +660,7 @@ class ZAxis(Recharts): ... class Brush(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -642,8 +683,10 @@ class Brush(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, **props, ) -> "Brush": """Create the component. @@ -727,41 +770,51 @@ class Cartesian(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Cartesian": @@ -892,41 +945,51 @@ class Area(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Area": @@ -1034,47 +1097,57 @@ class Bar(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Bar": @@ -1220,41 +1293,51 @@ class Line(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Line": @@ -1370,41 +1453,51 @@ class Scatter(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Scatter": @@ -1495,47 +1588,57 @@ class Funnel(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Funnel": @@ -1583,41 +1686,51 @@ class ErrorBar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ErrorBar": @@ -1664,41 +1777,51 @@ class Reference(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Reference": @@ -1750,41 +1873,51 @@ class ReferenceLine(Reference): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReferenceLine": @@ -1841,41 +1974,51 @@ class ReferenceDot(Reference): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReferenceDot": @@ -1933,41 +2076,51 @@ class ReferenceArea(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReferenceArea": @@ -2014,41 +2167,51 @@ class Grid(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Grid": @@ -2100,41 +2263,51 @@ class CartesianGrid(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CartesianGrid": @@ -2201,41 +2374,51 @@ class CartesianAxis(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CartesianAxis": diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 37b865b1d..ac46336f7 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -9,7 +9,7 @@ from reflex.components.recharts.general import ResponsiveContainer from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.vars import Var from .recharts import ( @@ -62,7 +62,7 @@ class ChartBase(RechartsCharts): return if isinstance(value, str) and value.endswith("%"): return - if isinstance(value, Var) and issubclass(value._var_type, int): + if isinstance(value, ImmutableVar) and issubclass(value._var_type, int): return raise ValueError( f"Chart {name} must be specified as int pixels or percentage, not {value!r}. " @@ -324,7 +324,7 @@ class RadarChart(ChartBase): "Radar", ] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -413,7 +413,7 @@ class ScatterChart(ChartBase): "Scatter", ] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 48bde7483..57ed0c407 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -27,41 +28,51 @@ class ChartBase(RechartsCharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ChartBase": @@ -115,41 +126,51 @@ class CategoricalChartBase(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CategoricalChartBase": @@ -216,41 +237,51 @@ class AreaChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AreaChart": @@ -316,41 +347,51 @@ class BarChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BarChart": @@ -415,41 +456,51 @@ class LineChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LineChart": @@ -520,41 +571,51 @@ class ComposedChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ComposedChart": @@ -602,41 +663,51 @@ class PieChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PieChart": @@ -661,7 +732,7 @@ class PieChart(ChartBase): ... class RadarChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -682,13 +753,15 @@ class RadarChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadarChart": @@ -743,41 +816,51 @@ class RadialBarChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadialBarChart": @@ -812,7 +895,7 @@ class RadialBarChart(ChartBase): ... class ScatterChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -826,28 +909,30 @@ class ScatterChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ScatterChart": @@ -887,41 +972,51 @@ class FunnelChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FunnelChart": @@ -972,47 +1067,57 @@ class Treemap(RechartsCharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Treemap": diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index be6a0d42f..2c4361ef7 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -32,41 +33,51 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ResponsiveContainer": @@ -158,41 +169,51 @@ class Legend(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Legend": @@ -259,41 +280,51 @@ class GraphingTooltip(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "GraphingTooltip": @@ -390,41 +421,51 @@ class Label(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Label": @@ -510,41 +551,51 @@ class LabelList(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LabelList": diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 76347352b..3333a41be 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Union from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.vars import Var from .recharts import ( @@ -78,7 +78,7 @@ class Pie(Recharts): # Fill color fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 3)) - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -175,7 +175,7 @@ class RadialBar(Recharts): # Valid children components _valid_children: List[str] = ["Cell", "LabelList"] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -348,7 +348,7 @@ class PolarRadiusAxis(Recharts): # The stroke color of axis stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 81fb74b27..1b10758ed 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -15,7 +16,7 @@ from .recharts import ( ) class Pie(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -73,22 +74,24 @@ class Pie(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Pie": @@ -152,41 +155,51 @@ class Radar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Radar": @@ -219,7 +232,7 @@ class Radar(Recharts): ... class RadialBar(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -248,28 +261,30 @@ class RadialBar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadialBar": @@ -326,41 +341,51 @@ class PolarAngleAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PolarAngleAxis": @@ -414,41 +439,51 @@ class PolarGrid(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PolarGrid": @@ -478,7 +513,7 @@ class PolarGrid(Recharts): ... class PolarRadiusAxis(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -545,22 +580,24 @@ class PolarRadiusAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PolarRadiusAxis": diff --git a/reflex/components/recharts/recharts.pyi b/reflex/components/recharts/recharts.pyi index 695ecab48..7ca618918 100644 --- a/reflex/components/recharts/recharts.pyi +++ b/reflex/components/recharts/recharts.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Recharts(Component): def render(self) -> Dict: ... @@ -22,41 +22,51 @@ class Recharts(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Recharts": @@ -88,41 +98,51 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RechartsCharts": diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index c7ec5ca60..c58b4a106 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -14,7 +14,7 @@ from reflex.event import ( EventSpec, call_script, ) -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style, resolved_color_mode from reflex.utils import format from reflex.utils.imports import ImportVar @@ -30,7 +30,7 @@ LiteralPosition = Literal[ "bottom-right", ] -toast_ref = Var.create_safe("refs['__toast']", _var_is_string=False) +toast_ref = ImmutableVar.create_safe("refs['__toast']") class ToastAction(Base): @@ -56,7 +56,7 @@ def serialize_action(action: ToastAction) -> dict: } -def _toast_callback_signature(toast: Var) -> list[Var]: +def _toast_callback_signature(toast: Var) -> list[ImmutableVar]: """The signature for the toast callback, stripping out unserializable keys. Args: @@ -66,9 +66,8 @@ def _toast_callback_signature(toast: Var) -> list[Var]: A function call stripping non-serializable members of the toast object. """ return [ - Var.create_safe( - f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {toast}; return rest}})()", - _var_is_string=False, + ImmutableVar.create_safe( + f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {str(toast)}; return rest}})()" ) ] @@ -77,10 +76,10 @@ class ToastProps(PropsBase): """Props for the toast component.""" # Toast's title, renders above the description. - title: Optional[Union[str, Var]] + title: Optional[Union[str, ImmutableVar]] # Toast's description, renders underneath the title. - description: Optional[Union[str, Var]] + description: Optional[Union[str, ImmutableVar]] # Whether to show the close button. close_button: Optional[bool] @@ -112,7 +111,7 @@ class ToastProps(PropsBase): cancel: Optional[ToastAction] # Custom id for the toast. - id: Optional[Union[str, Var]] + id: Optional[Union[str, ImmutableVar]] # Removes the default styling, which allows for easier customization. unstyled: Optional[bool] @@ -242,16 +241,14 @@ class Toaster(Component): # Marked True when any Toast component is created. is_used: ClassVar[bool] = False - def add_hooks(self) -> list[Var | str]: + def add_hooks(self) -> list[ImmutableVar | str]: """Add hooks for the toaster component. Returns: The hooks for the toaster component. """ - hook = Var.create_safe( + hook = ImmutableVar.create_safe( f"{toast_ref} = toast", - _var_is_local=True, - _var_is_string=False, _var_data=VarData( imports={ "/utils/state": [ImportVar(tag="refs")], @@ -289,7 +286,7 @@ class Toaster(Component): else: toast = f"{toast_command}(`{message}`)" - toast_action = Var.create_safe(toast, _var_is_string=False, _var_is_local=True) + toast_action = ImmutableVar.create_safe(toast) return call_script(toast_action) @staticmethod @@ -356,17 +353,15 @@ class Toaster(Component): """ dismiss_var_data = None - if isinstance(id, Var): - dismiss = f"{toast_ref}.dismiss({id._var_name_unwrapped})" + if isinstance(id, ImmutableVar): + dismiss = f"{toast_ref}.dismiss({str(id)})" dismiss_var_data = id._get_all_var_data() elif isinstance(id, str): dismiss = f"{toast_ref}.dismiss('{id}')" else: dismiss = f"{toast_ref}.dismiss()" - dismiss_action = Var.create_safe( + dismiss_action = ImmutableVar.create_safe( dismiss, - _var_is_string=False, - _var_is_local=True, _var_data=VarData.merge(dismiss_var_data), ) return call_script(dismiss_action) diff --git a/reflex/components/sonner/toast.pyi b/reflex/components/sonner/toast.pyi index bb7191eb8..d18f5a3a9 100644 --- a/reflex/components/sonner/toast.pyi +++ b/reflex/components/sonner/toast.pyi @@ -10,6 +10,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.props import PropsBase from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.serializers import serializer from reflex.vars import Var @@ -22,7 +23,7 @@ LiteralPosition = Literal[ "bottom-center", "bottom-right", ] -toast_ref = Var.create_safe("refs['__toast']", _var_is_string=False) +toast_ref = ImmutableVar.create_safe("refs['__toast']") class ToastAction(Base): label: str @@ -32,8 +33,8 @@ class ToastAction(Base): def serialize_action(action: ToastAction) -> dict: ... class ToastProps(PropsBase): - title: Optional[Union[str, Var]] - description: Optional[Union[str, Var]] + title: Optional[Union[str, ImmutableVar]] + description: Optional[Union[str, ImmutableVar]] close_button: Optional[bool] invert: Optional[bool] important: Optional[bool] @@ -42,7 +43,7 @@ class ToastProps(PropsBase): dismissible: Optional[bool] action: Optional[ToastAction] cancel: Optional[ToastAction] - id: Optional[Union[str, Var]] + id: Optional[Union[str, ImmutableVar]] unstyled: Optional[bool] style: Optional[Style] action_button_styles: Optional[Style] @@ -60,7 +61,7 @@ class ToastProps(PropsBase): class Toaster(Component): is_used: ClassVar[bool] = False - def add_hooks(self) -> list[Var | str]: ... + def add_hooks(self) -> list[ImmutableVar | str]: ... @staticmethod def send_toast( message: str = "", level: str | None = None, **props @@ -120,41 +121,51 @@ class Toaster(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Toaster": diff --git a/reflex/components/suneditor/editor.py b/reflex/components/suneditor/editor.py index 6e28b396a..d768d79f8 100644 --- a/reflex/components/suneditor/editor.py +++ b/reflex/components/suneditor/editor.py @@ -8,6 +8,7 @@ from typing import Dict, List, Literal, Optional, Union from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar from reflex.utils.format import to_camel_case from reflex.utils.imports import ImportDict, ImportVar from reflex.vars import Var @@ -234,7 +235,7 @@ class Editor(NoSSRComponent): ValueError: If set_options is a state Var. """ if set_options is not None: - if isinstance(set_options, Var): + if isinstance(set_options, ImmutableVar): raise ValueError("EditorOptions cannot be a state Var") props["set_options"] = { to_camel_case(k): v diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index b1bc8a830..63a8032b9 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -9,6 +9,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -121,56 +122,78 @@ class Editor(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_copy: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_cut: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_copy: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_cut: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_input: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_load: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_input: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_paste: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_resize_editor: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, toggle_code_view: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, toggle_full_screen: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Editor": diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index 0828f8b10..ee7a63628 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -34,15 +34,16 @@ class IterTag(Tag): Returns: The type of the iterable var. """ + iterable = self.iterable.upcast() try: - if self.iterable._var_type.mro()[0] == dict: + if iterable._var_type.mro()[0] == dict: # Arg is a tuple of (key, value). - return Tuple[get_args(self.iterable._var_type)] # type: ignore - elif self.iterable._var_type.mro()[0] == tuple: + return Tuple[get_args(iterable._var_type)] # type: ignore + elif iterable._var_type.mro()[0] == tuple: # Arg is a union of any possible values in the tuple. - return Union[get_args(self.iterable._var_type)] # type: ignore + return Union[get_args(iterable._var_type)] # type: ignore else: - return get_args(self.iterable._var_type)[0] + return get_args(iterable._var_type)[0] except Exception: return Any diff --git a/reflex/components/tags/tag.py b/reflex/components/tags/tag.py index 9a8cca11f..810da30f9 100644 --- a/reflex/components/tags/tag.py +++ b/reflex/components/tags/tag.py @@ -6,9 +6,8 @@ from typing import Any, Dict, List, Optional, Set, Tuple, Union from reflex.base import Base from reflex.event import EventChain -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import format, types -from reflex.vars import Var class Tag(Base): @@ -27,7 +26,7 @@ class Tag(Base): args: Optional[Tuple[str, ...]] = None # Special props that aren't key value pairs. - special_props: Set[Var] = set() + special_props: Set[ImmutableVar] = set() # The children components. children: List[Any] = [] @@ -93,7 +92,7 @@ class Tag(Base): return self @staticmethod - def is_valid_prop(prop: Optional[Var]) -> bool: + def is_valid_prop(prop: Optional[ImmutableVar]) -> bool: """Check if the prop is valid. Args: diff --git a/reflex/event.py b/reflex/event.py index b8fed5708..8384f06a8 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -25,7 +25,7 @@ from reflex.ivars.object import ObjectVar from reflex.utils import format from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.types import ArgsSpec -from reflex.vars import ImmutableVarData, Var +from reflex.vars import Var, VarData try: from typing import Annotated @@ -229,7 +229,7 @@ class EventSpec(EventActionsMixin): client_handler_name: str = "" # The arguments to pass to the function. - args: Tuple[Tuple[Var, Var], ...] = () + args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] = () class Config: """The Pydantic config.""" @@ -237,7 +237,9 @@ class EventSpec(EventActionsMixin): # Required to allow tuple fields. frozen = True - def with_args(self, args: Tuple[Tuple[Var, Var], ...]) -> EventSpec: + def with_args( + self, args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] + ) -> EventSpec: """Copy the event spec, with updated args. Args: @@ -253,7 +255,7 @@ class EventSpec(EventActionsMixin): event_actions=self.event_actions.copy(), ) - def add_args(self, *args: Var) -> EventSpec: + def add_args(self, *args: ImmutableVar) -> EventSpec: """Add arguments to the event spec. Args: @@ -397,7 +399,7 @@ class FileUpload(Base): ImmutableVar( _var_name="filesById", _var_type=Dict[str, Any], - _var_data=ImmutableVarData.merge(upload_files_context_var_data), + _var_data=VarData.merge(upload_files_context_var_data), ).to(ObjectVar)[LiteralVar.create(upload_id)], ), ( @@ -421,7 +423,7 @@ class FileUpload(Base): ) # type: ignore else: raise ValueError(f"{on_upload_progress} is not a valid event handler.") - if isinstance(events, Var): + if isinstance(events, ImmutableVar): raise ValueError(f"{on_upload_progress} cannot return a var {events}.") on_upload_progress_chain = EventChain( events=events, @@ -676,9 +678,9 @@ def set_clipboard(content: str) -> EventSpec: def download( - url: str | Var | None = None, - filename: Optional[str | Var] = None, - data: str | bytes | Var | None = None, + url: str | ImmutableVar | None = None, + filename: Optional[str | ImmutableVar] = None, + data: str | bytes | ImmutableVar | None = None, ) -> EventSpec: """Download the file at a given path or with the specified data. @@ -714,17 +716,17 @@ def download( if isinstance(data, str): # Caller provided a plain text string to download. url = "data:text/plain," + urllib.parse.quote(data) - elif isinstance(data, Var): + elif isinstance(data, ImmutableVar): # Need to check on the frontend if the Var already looks like a data: URI. - is_data_url = (data._type() == "string") & ( + is_data_url = (data.js_type() == "string") & ( data.to(str).startswith("data:") ) # type: ignore # If it's a data: URI, use it as is, otherwise convert the Var to JSON in a data: URI. url = cond( # type: ignore is_data_url, - data, + data.to(str), "data:text/plain," + data.to_string(), # type: ignore ) elif isinstance(data, bytes): @@ -879,7 +881,7 @@ def parse_args_spec(arg_spec: ArgsSpec): ) -def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: +def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | ImmutableVar: """Call a function to a list of event specs. The function should return a single EventSpec, a list of EventSpecs, or a @@ -920,7 +922,7 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: out = fn(*parsed_args) # If the function returns a Var, assume it's an EventChain and render it directly. - if isinstance(out, Var): + if isinstance(out, ImmutableVar): return out # Convert the output to a list. @@ -947,7 +949,9 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: return events -def get_handler_args(event_spec: EventSpec) -> tuple[tuple[Var, Var], ...]: +def get_handler_args( + event_spec: EventSpec, +) -> tuple[tuple[ImmutableVar, ImmutableVar], ...]: """Get the handler args for the given event spec. Args: diff --git a/reflex/experimental/client_state.py b/reflex/experimental/client_state.py index af3056c4d..db5a21600 100644 --- a/reflex/experimental/client_state.py +++ b/reflex/experimental/client_state.py @@ -4,14 +4,17 @@ from __future__ import annotations import dataclasses import sys -from typing import Any, Callable, Optional, Type, Union +from typing import Any, Callable, Union from reflex import constants from reflex.event import EventChain, EventHandler, EventSpec, call_script from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.ivars.function import FunctionVar from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData, get_unique_variable_name +from reflex.vars import ( + VarData, + get_unique_variable_name, +) NoValue = object() @@ -35,36 +38,19 @@ def _client_state_ref(var_name: str) -> str: @dataclasses.dataclass( eq=False, + frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ClientStateVar(Var): +class ClientStateVar(ImmutableVar): """A Var that exists on the client via useState.""" - # The name of the var. - _var_name: str = dataclasses.field() - # Track the names of the getters and setters - _setter_name: str = dataclasses.field() - _getter_name: str = dataclasses.field() + _setter_name: str = dataclasses.field(default="") + _getter_name: str = dataclasses.field(default="") # Whether to add the var and setter to the global `refs` object for use in any Component. _global_ref: bool = dataclasses.field(default=True) - # The type of the var. - _var_type: Type = dataclasses.field(default=Any) - - # Whether this is a local javascript variable. - _var_is_local: bool = dataclasses.field(default=False) - - # Whether the var is a string literal. - _var_is_string: bool = dataclasses.field(default=False) - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool = dataclasses.field(default=False) - - # Extra metadata associated with the Var - _var_data: Optional[VarData] = dataclasses.field(default=None) - def __hash__(self) -> int: """Define a hash function for a var. @@ -114,13 +100,13 @@ class ClientStateVar(Var): default_var = ImmutableVar.create_safe( "", _var_is_local=False, _var_is_string=False ) - elif not isinstance(default, Var): + elif not isinstance(default, ImmutableVar): default_var = LiteralVar.create(default) else: default_var = default setter_name = f"set{var_name.capitalize()}" hooks = { - f"const [{var_name}, {setter_name}] = useState({default_var._var_name_unwrapped})": None, + f"const [{var_name}, {setter_name}] = useState({str(default_var)})": None, } imports = { "react": [ImportVar(tag="useState")], @@ -134,12 +120,10 @@ class ClientStateVar(Var): _setter_name=setter_name, _getter_name=var_name, _global_ref=global_ref, - _var_is_local=False, - _var_is_string=False, _var_type=default_var._var_type, _var_data=VarData.merge( default_var._var_data, - VarData( # type: ignore + VarData( hooks=hooks, imports=imports, ), @@ -147,7 +131,7 @@ class ClientStateVar(Var): ) @property - def value(self) -> Var: + def value(self) -> ImmutableVar: """Get a placeholder for the Var. This property can only be rendered on the frontend. @@ -171,7 +155,7 @@ class ClientStateVar(Var): ) ) - def set_value(self, value: Any = NoValue) -> Var: + def set_value(self, value: Any = NoValue) -> ImmutableVar: """Set the value of the client state variable. This property can only be attached to a frontend event trigger. @@ -190,22 +174,22 @@ class ClientStateVar(Var): else self._setter_name ) if value is not NoValue: + import re + # This is a hack to make it work like an EventSpec taking an arg - value = LiteralVar.create(value) - if not value._var_is_string and value._var_full_name.startswith("_"): - arg = value._var_name_unwrapped.partition(".")[0] - else: - arg = "" - setter = f"({arg}) => {setter}({value._var_name_unwrapped})" + value_str = str(LiteralVar.create(value)) + + # remove patterns of ["*"] from the value_str using regex + arg = re.sub(r"\[\".*\"\]", "", value_str) + + setter = f"({arg}) => {setter}({str(value)})" return ImmutableVar( _var_name=setter, - _var_data=ImmutableVarData( - imports=_refs_import if self._global_ref else {} - ), + _var_data=VarData(imports=_refs_import if self._global_ref else {}), ).to(FunctionVar, EventChain) @property - def set(self) -> Var: + def set(self) -> ImmutableVar: """Set the value of the client state variable. This property can only be attached to a frontend event trigger. diff --git a/reflex/experimental/hooks.py b/reflex/experimental/hooks.py index 848ad7fb7..b977e85b7 100644 --- a/reflex/experimental/hooks.py +++ b/reflex/experimental/hooks.py @@ -2,15 +2,16 @@ from __future__ import annotations +from reflex.ivars.base import ImmutableVar from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData def _compose_react_imports(tags: list[str]) -> dict[str, list[ImportVar]]: return {"react": [ImportVar(tag=tag) for tag in tags]} -def const(name, value) -> Var: +def const(name, value) -> ImmutableVar: """Create a constant Var. Args: @@ -21,13 +22,11 @@ def const(name, value) -> Var: The constant Var. """ if isinstance(name, list): - return Var.create_safe( - f"const [{', '.join(name)}] = {value}", _var_is_string=False - ) - return Var.create_safe(f"const {name} = {value}", _var_is_string=False) + return ImmutableVar.create_safe(f"const [{', '.join(name)}] = {value}") + return ImmutableVar.create_safe(f"const {name} = {value}") -def useCallback(func, deps) -> Var: +def useCallback(func, deps) -> ImmutableVar: """Create a useCallback hook with a function and dependencies. Args: @@ -37,14 +36,13 @@ def useCallback(func, deps) -> Var: Returns: The useCallback hook. """ - return Var.create_safe( + return ImmutableVar.create_safe( f"useCallback({func}, {deps})" if deps else f"useCallback({func})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useCallback"])), ) -def useContext(context) -> Var: +def useContext(context) -> ImmutableVar: """Create a useContext hook with a context. Args: @@ -53,14 +51,13 @@ def useContext(context) -> Var: Returns: The useContext hook. """ - return Var.create_safe( + return ImmutableVar.create_safe( f"useContext({context})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useContext"])), ) -def useRef(default) -> Var: +def useRef(default) -> ImmutableVar: """Create a useRef hook with a default value. Args: @@ -69,14 +66,13 @@ def useRef(default) -> Var: Returns: The useRef hook. """ - return Var.create_safe( + return ImmutableVar.create_safe( f"useRef({default})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useRef"])), ) -def useState(var_name, default=None) -> Var: +def useState(var_name, default=None) -> ImmutableVar: """Create a useState hook with a variable name and setter name. Args: @@ -88,9 +84,8 @@ def useState(var_name, default=None) -> Var: """ return const( [var_name, f"set{var_name.capitalize()}"], - Var.create_safe( + ImmutableVar.create_safe( f"useState({default})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useState"])), ), ) diff --git a/reflex/experimental/layout.py b/reflex/experimental/layout.py index cf39ccb6c..abe871fa4 100644 --- a/reflex/experimental/layout.py +++ b/reflex/experimental/layout.py @@ -14,9 +14,9 @@ from reflex.components.radix.themes.layout.container import Container from reflex.components.radix.themes.layout.stack import HStack from reflex.event import call_script from reflex.experimental import hooks +from reflex.ivars.base import ImmutableVar from reflex.state import ComponentState from reflex.style import Style -from reflex.vars import Var class Sidebar(Box, MemoizationLeaf): @@ -55,7 +55,7 @@ class Sidebar(Box, MemoizationLeaf): open = ( self.State.open # type: ignore if self.State - else Var.create_safe("open", _var_is_string=False) + else ImmutableVar.create_safe("open") ) sidebar.style["display"] = spacer.style["display"] = cond(open, "block", "none") @@ -69,7 +69,7 @@ class Sidebar(Box, MemoizationLeaf): } ) - def add_hooks(self) -> List[Var]: + def add_hooks(self) -> List[ImmutableVar]: """Get the hooks to render. Returns: @@ -172,8 +172,8 @@ class SidebarTrigger(Fragment): open, toggle = sidebar.State.open, sidebar.State.toggle # type: ignore else: open, toggle = ( - Var.create_safe("open", _var_is_string=False), - call_script(Var.create_safe("setOpen(!open)", _var_is_string=False)), + ImmutableVar.create_safe("open"), + call_script(ImmutableVar.create_safe("setOpen(!open)")), ) trigger_props["left"] = cond(open, f"calc({sidebar_width} - 32px)", "0") diff --git a/reflex/experimental/layout.pyi b/reflex/experimental/layout.pyi index 8799b4961..58ff2fa8b 100644 --- a/reflex/experimental/layout.pyi +++ b/reflex/experimental/layout.pyi @@ -11,6 +11,7 @@ from reflex.components.component import Component, ComponentNamespace, Memoizati from reflex.components.radix.primitives.drawer import DrawerRoot from reflex.components.radix.themes.layout.box import Box from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.state import ComponentState from reflex.style import Style from reflex.vars import Var @@ -50,41 +51,51 @@ class Sidebar(Box, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Sidebar": @@ -100,7 +111,7 @@ class Sidebar(Box, MemoizationLeaf): ... def add_style(self) -> dict[str, Any] | None: ... - def add_hooks(self) -> List[Var]: ... + def add_hooks(self) -> List[ImmutableVar]: ... class StatefulSidebar(ComponentState): open: bool @@ -135,44 +146,54 @@ class DrawerSidebar(DrawerRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerSidebar": @@ -206,41 +227,51 @@ class SidebarTrigger(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SidebarTrigger": @@ -291,41 +322,51 @@ class Layout(Box): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Layout": @@ -379,41 +420,51 @@ class LayoutNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Layout": diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 50453544d..27c4828af 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -10,7 +10,6 @@ import functools import inspect import json import sys -import warnings from types import CodeType, FunctionType from typing import ( TYPE_CHECKING, @@ -32,18 +31,21 @@ from typing import ( overload, ) -from typing_extensions import ParamSpec, get_type_hints, override +from typing_extensions import ParamSpec, TypeGuard, deprecated, get_type_hints, override from reflex import constants from reflex.base import Base -from reflex.constants.colors import Color from reflex.utils import console, imports, serializers, types -from reflex.utils.exceptions import VarDependencyError, VarTypeError, VarValueError +from reflex.utils.exceptions import ( + VarAttributeError, + VarDependencyError, + VarTypeError, + VarValueError, +) from reflex.utils.format import format_state_name -from reflex.utils.types import get_origin +from reflex.utils.types import GenericType, get_origin from reflex.vars import ( - ComputedVar, - ImmutableVarData, + REPLACED_NAMES, Var, VarData, _decode_var_immutable, @@ -83,7 +85,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _var_type: types.GenericType = dataclasses.field(default=Any) # Extra metadata associated with the Var - _var_data: Optional[ImmutableVarData] = dataclasses.field(default=None) + _var_data: Optional[VarData] = dataclasses.field(default=None) def __str__(self) -> str: """String representation of the var. Guaranteed to be a valid Javascript expression. @@ -111,15 +113,6 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return False - @property - def _var_full_name_needs_state_prefix(self) -> bool: - """Whether the full name of the var needs a _var_state prefix. - - Returns: - False - """ - return False - def __post_init__(self): """Post-initialize the var.""" # Decode any inline Var markup and apply it to the instance @@ -129,7 +122,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): self.__init__( _var_name=_var_name, _var_type=self._var_type, - _var_data=ImmutableVarData.merge(self._var_data, _var_data), + _var_data=VarData.merge(self._var_data, _var_data), ) def __hash__(self) -> int: @@ -140,7 +133,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return hash((self._var_name, self._var_type, self._var_data)) - def _get_all_var_data(self) -> ImmutableVarData | None: + def _get_all_var_data(self) -> VarData | None: """Get all VarData associated with the Var. Returns: @@ -148,6 +141,21 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return self._var_data + def equals(self, other: ImmutableVar) -> bool: + """Check if two vars are equal. + + Args: + other: The other var to compare. + + Returns: + Whether the vars are equal. + """ + return ( + self._var_name == other._var_name + and self._var_type == other._var_type + and self._get_all_var_data() == other._get_all_var_data() + ) + def _replace(self, merge_var_data=None, **kwargs: Any): """Make a copy of this Var with updated fields. @@ -178,7 +186,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return dataclasses.replace( self, - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( kwargs.get("_var_data", self._var_data), merge_var_data ), **kwargs, @@ -191,7 +199,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _var_is_local: bool | None = None, _var_is_string: bool | None = None, _var_data: VarData | None = None, - ) -> ImmutableVar | Var | None: + ) -> ImmutableVar | None: """Create a var from a value. Args: @@ -224,7 +232,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return None # If the value is already a var, do nothing. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return value # Try to pull the imports and hooks from contained values. @@ -246,15 +254,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return cls( _var_name=name, _var_type=type_, - _var_data=( - ImmutableVarData( - state=_var_data.state, - imports=_var_data.imports, - hooks=_var_data.hooks, - ) - if _var_data - else None - ), + _var_data=_var_data, ) @classmethod @@ -264,7 +264,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _var_is_local: bool | None = None, _var_is_string: bool | None = None, _var_data: VarData | None = None, - ) -> Var | ImmutableVar: + ) -> ImmutableVar: """Create a var from a value, asserting that it is not None. Args: @@ -302,13 +302,19 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return f"{constants.REFLEX_VAR_OPENING_TAG}{hashed_var}{constants.REFLEX_VAR_CLOSING_TAG}{self._var_name}" @overload - def to( - self, output: Type[NumberVar], var_type: type[int] | type[float] = float - ) -> ToNumberVarOperation: ... + def to(self, output: Type[StringVar]) -> ToStringOperation: ... + + @overload + def to(self, output: Type[str]) -> ToStringOperation: ... @overload def to(self, output: Type[BooleanVar]) -> ToBooleanVarOperation: ... + @overload + def to( + self, output: Type[NumberVar], var_type: type[int] | type[float] = float + ) -> ToNumberVarOperation: ... + @overload def to( self, @@ -316,9 +322,6 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): var_type: type[list] | type[tuple] | type[set] = list, ) -> ToArrayOperation: ... - @overload - def to(self, output: Type[StringVar]) -> ToStringOperation: ... - @overload def to( self, output: Type[ObjectVar], var_type: types.GenericType = dict @@ -340,7 +343,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): self, output: Type[OUTPUT] | types.GenericType, var_type: types.GenericType | None = None, - ) -> Var: + ) -> ImmutableVar: """Convert the var to a different type. Args: @@ -382,6 +385,11 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return self.to(StringVar, output) if fixed_output_type is bool: return self.to(BooleanVar, output) + if fixed_output_type is None: + return ToNoneOperation.create(self) + + if issubclass(output, BooleanVar): + return ToBooleanVarOperation.create(self) if issubclass(output, NumberVar): if fixed_type is not None: @@ -398,9 +406,6 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): ) return ToNumberVarOperation.create(self, var_type or float) - if issubclass(output, BooleanVar): - return ToBooleanVarOperation.create(self) - if issubclass(output, ArrayVar): if fixed_type is not None and not issubclass( fixed_type, (list, tuple, set) @@ -423,6 +428,9 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): # ) return ToFunctionOperation.create(self, var_type or Callable) + if issubclass(output, NoneVar): + return ToNoneOperation.create(self) + # If we can't determine the first argument, we just replace the _var_type. if not issubclass(output, Var) or var_type is None: return dataclasses.replace( @@ -453,6 +461,8 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): from .sequence import ArrayVar, StringVar var_type = self._var_type + if var_type is None: + return self.to(None) if types.is_optional(var_type): var_type = types.get_args(var_type)[0] @@ -463,8 +473,15 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): if fixed_type is Union: inner_types = get_args(var_type) - if int in inner_types and float in inner_types: + + if all( + inspect.isclass(t) and issubclass(t, (int, float)) for t in inner_types + ): return self.to(NumberVar, self._var_type) + + if all(inspect.isclass(t) and issubclass(t, Base) for t in inner_types): + return self.to(ObjectVar, self._var_type) + return self if not inspect.isclass(fixed_type): @@ -538,11 +555,12 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ var_name_parts = self._var_name.split(".") setter = constants.SETTER_PREFIX + var_name_parts[-1] - if self._var_data is None: + var_data = self._get_all_var_data() + if var_data is None: return setter - if not include_state or self._var_data.state == "": + if not include_state or var_data.state == "": return setter - return ".".join((self._var_data.state, setter)) + return ".".join((var_data.state, setter)) def get_setter(self) -> Callable[[BaseState, Any], None]: """Get the var's setter function. @@ -574,11 +592,32 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return setter - def __eq__(self, other: Var | Any) -> BooleanVar: + def _var_set_state(self, state: type[BaseState] | str): + """Set the state of the var. + + Args: + state: The state to set. + + Returns: + The var with the state set. + """ + formatted_state_name = ( + state + if isinstance(state, str) + else format_state_name(state.get_full_name()) + ) + + return StateOperation.create( + formatted_state_name, + self, + _var_data=VarData.merge(VarData.from_state(state), self._var_data), + ).guess_type() + + def __eq__(self, other: ImmutableVar | Any) -> BooleanVar: """Check if the current variable is equal to the given variable. Args: - other (Var | Any): The variable to compare with. + other (ImmutableVar | Any): The variable to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the equality check. @@ -587,11 +626,11 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return equal_operation(self, other) - def __ne__(self, other: Var | Any) -> BooleanVar: + def __ne__(self, other: ImmutableVar | Any) -> BooleanVar: """Check if the current object is not equal to the given object. Parameters: - other (Var | Any): The object to compare with. + other (ImmutableVar | Any): The object to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the comparison. @@ -600,58 +639,6 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return ~equal_operation(self, other) - def __gt__(self, other: Var | Any) -> BooleanVar: - """Compare the current instance with another variable and return a BooleanVar representing the result of the greater than operation. - - Args: - other (Var | Any): The variable to compare with. - - Returns: - BooleanVar: A BooleanVar representing the result of the greater than operation. - """ - from .number import greater_than_operation - - return greater_than_operation(self, other) - - def __ge__(self, other: Var | Any) -> BooleanVar: - """Check if the value of this variable is greater than or equal to the value of another variable or object. - - Args: - other (Var | Any): The variable or object to compare with. - - Returns: - BooleanVar: A BooleanVar object representing the result of the comparison. - """ - from .number import greater_than_or_equal_operation - - return greater_than_or_equal_operation(self, other) - - def __lt__(self, other: Var | Any) -> BooleanVar: - """Compare the current instance with another variable using the less than (<) operator. - - Args: - other: The variable to compare with. - - Returns: - A `BooleanVar` object representing the result of the comparison. - """ - from .number import less_than_operation - - return less_than_operation(self, other) - - def __le__(self, other: Var | Any) -> BooleanVar: - """Compare if the current instance is less than or equal to the given value. - - Args: - other: The value to compare with. - - Returns: - A BooleanVar object representing the result of the comparison. - """ - from .number import less_than_or_equal_operation - - return less_than_or_equal_operation(self, other) - def bool(self) -> BooleanVar: """Convert the var to a boolean. @@ -662,7 +649,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return boolify(self) - def __and__(self, other: Var | Any) -> ImmutableVar: + def __and__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical AND operation on the current instance and another variable. Args: @@ -673,7 +660,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return and_operation(self, other) - def __rand__(self, other: Var | Any) -> ImmutableVar: + def __rand__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical AND operation on the current instance and another variable. Args: @@ -684,7 +671,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return and_operation(other, self) - def __or__(self, other: Var | Any) -> ImmutableVar: + def __or__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical OR operation on the current instance and another variable. Args: @@ -695,7 +682,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return or_operation(self, other) - def __ror__(self, other: Var | Any) -> ImmutableVar: + def __ror__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical OR operation on the current instance and another variable. Args: @@ -714,7 +701,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return ~self.bool() - def to_string(self) -> ImmutableVar: + def to_string(self): """Convert the var to a string. Returns: @@ -735,7 +722,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): refs = ImmutableVar( _var_name="refs", - _var_data=ImmutableVarData( + _var_data=VarData( imports={ f"/{constants.Dirs.STATE_PATH}": [imports.ImportVar(tag="refs")] } @@ -743,12 +730,24 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): ).to(ObjectVar) return refs[LiteralVar.create(str(self))] + @deprecated("Use `.js_type()` instead.") def _type(self) -> StringVar: """Returns the type of the object. This method uses the `typeof` function from the `FunctionStringVar` class to determine the type of the object. + Returns: + StringVar: A string variable representing the type of the object. + """ + return self.js_type() + + def js_type(self) -> StringVar: + """Returns the javascript type of the object. + + This method uses the `typeof` function from the `FunctionStringVar` class + to determine the type of the object. + Returns: StringVar: A string variable representing the type of the object. """ @@ -758,10 +757,125 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): type_of = FunctionStringVar("typeof") return type_of.call(self).to(StringVar) + def without_data(self): + """Create a copy of the var without the data. + + Returns: + The var without the data. + """ + return dataclasses.replace(self, _var_data=None) + + def contains(self, value: Any = None, field: Any = None): + """Get an attribute of the var. + + Args: + value: The value to check for. + field: The field to check for. + + Raises: + TypeError: If the var does not support contains check. + """ + raise TypeError( + f"Var of type {self._var_type} does not support contains check." + ) + + def __get__(self, instance: Any, owner: Any): + """Get the var. + + Args: + instance: The instance to get the var from. + owner: The owner of the var. + + Returns: + The var. + """ + return self + + def reverse(self): + """Reverse the var. + + Raises: + TypeError: If the var does not support reverse. + """ + raise TypeError("Cannot reverse non-list var.") + + def __getattr__(self, name: str): + """Get an attribute of the var. + + Args: + name: The name of the attribute. + + Returns: + The attribute. + + Raises: + VarAttributeError: If the attribute does not exist. + TypeError: If the var type is Any. + """ + if name.startswith("_"): + return super(ImmutableVar, self).__getattribute__(name) + if self._var_type is Any: + raise TypeError( + f"You must provide an annotation for the state var `{str(self)}`. Annotation cannot be `{self._var_type}`." + ) + + if name in REPLACED_NAMES: + raise VarAttributeError( + f"Field {name!r} was renamed to {REPLACED_NAMES[name]!r}" + ) + + raise VarAttributeError( + f"The State var has no attribute '{name}' or may have been annotated wrongly.", + ) + + def _decode(self) -> Any: + """Decode Var as a python value. + + Note that Var with state set cannot be decoded python-side and will be + returned as full_name. + + Returns: + The decoded value or the Var name. + """ + if isinstance(self, LiteralVar): + return self._var_value # type: ignore + try: + return json.loads(str(self)) + except ValueError: + try: + return json.loads(self.json()) + except (ValueError, NotImplementedError): + return str(self) + + @property + def _var_state(self) -> str: + """Compat method for getting the state. + + Returns: + The state name associated with the var. + """ + var_data = self._get_all_var_data() + return var_data.state if var_data else "" + OUTPUT = TypeVar("OUTPUT", bound=ImmutableVar) +def _encode_var(value: ImmutableVar) -> str: + """Encode the state name into a formatted var. + + Args: + value: The value to encode the state name into. + + Returns: + The encoded var. + """ + return f"{value}" + + +serializers.serializer(_encode_var) + + class LiteralVar(ImmutableVar): """Base class for immutable literal vars.""" @@ -770,7 +884,7 @@ class LiteralVar(ImmutableVar): cls, value: Any, _var_data: VarData | None = None, - ) -> Var: + ) -> ImmutableVar: """Create a var from a value. Args: @@ -787,7 +901,7 @@ class LiteralVar(ImmutableVar): from .object import LiteralObjectVar from .sequence import LiteralArrayVar, LiteralStringVar - if isinstance(value, Var): + if isinstance(value, ImmutableVar): if _var_data is None: return value return value._replace(merge_var_data=_var_data) @@ -804,14 +918,11 @@ class LiteralVar(ImmutableVar): if isinstance(value, dict): return LiteralObjectVar.create(value, _var_data=_var_data) - if isinstance(value, Color): - return LiteralStringVar.create(f"{value}", _var_data=_var_data) - if isinstance(value, (list, tuple, set)): return LiteralArrayVar.create(value, _var_data=_var_data) if value is None: - return ImmutableVar.create_safe("null", _var_data=_var_data) + return LiteralNoneVar.create(_var_data=_var_data) from reflex.event import EventChain, EventSpec from reflex.utils.format import get_event_handler_parts @@ -857,60 +968,6 @@ class LiteralVar(ImmutableVar): ), ) - try: - from plotly.graph_objects import Figure, layout - from plotly.io import to_json - - if isinstance(value, Figure): - return LiteralObjectVar.create( - json.loads(str(to_json(value))), - _var_type=Figure, - _var_data=_var_data, - ) - - if isinstance(value, layout.Template): - return LiteralObjectVar.create( - { - "data": json.loads(str(to_json(value.data))), - "layout": json.loads(str(to_json(value.layout))), - }, - _var_type=layout.Template, - _var_data=_var_data, - ) - except ImportError: - pass - - try: - import base64 - import io - - from PIL.Image import MIME - from PIL.Image import Image as Img - - if isinstance(value, Img): - with io.BytesIO() as buffer: - image_format = getattr(value, "format", None) or "PNG" - value.save(buffer, format=image_format) - try: - # Newer method to get the mime type, but does not always work. - mimetype = value.get_format_mimetype() # type: ignore - except AttributeError: - try: - # Fallback method - mimetype = MIME[image_format] - except KeyError: - # Unknown mime_type: warn and return image/png and hope the browser can sort it out. - warnings.warn( # noqa: B028 - f"Unknown mime type for {value} {image_format}. Defaulting to image/png" - ) - mimetype = "image/png" - return LiteralStringVar.create( - f"data:{mimetype};base64,{base64.b64encode(buffer.getvalue()).decode()}", - _var_data=_var_data, - ) - except ImportError: - pass - if isinstance(value, Base): return LiteralObjectVar.create( {k: (None if callable(v) else v) for k, v in value.dict().items()}, @@ -918,6 +975,16 @@ class LiteralVar(ImmutableVar): _var_data=_var_data, ) + serialized_value = serializers.serialize(value) + if serialized_value is not None: + if isinstance(serialized_value, dict): + return LiteralObjectVar.create( + serialized_value, + _var_type=type(value), + _var_data=_var_data, + ) + return LiteralVar.create(serialized_value, _var_data=_var_data) + raise TypeError( f"Unsupported type {type(value)} for LiteralVar. Tried to create a LiteralVar from {value}." ) @@ -1009,11 +1076,15 @@ def var_operation( def wrapper(*args: P.args, **kwargs: P.kwargs) -> ImmutableVar[T]: func_args = list(inspect.signature(func).parameters) args_vars = { - func_args[i]: (LiteralVar.create(arg) if not isinstance(arg, Var) else arg) + func_args[i]: ( + LiteralVar.create(arg) if not isinstance(arg, ImmutableVar) else arg + ) for i, arg in enumerate(args) } kwargs_vars = { - key: LiteralVar.create(value) if not isinstance(value, Var) else value + key: LiteralVar.create(value) + if not isinstance(value, ImmutableVar) + else value for key, value in kwargs.items() } @@ -1062,7 +1133,7 @@ def figure_out_type(value: Any) -> types.GenericType: unionize(*(figure_out_type(k) for k in value)), unionize(*(figure_out_type(v) for v in value.values())), ] - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return value._var_type return type(value) @@ -1101,11 +1172,11 @@ class CachedVarOperation: parent_classes = inspect.getmro(self.__class__) - return parent_classes[parent_classes.index(CachedVarOperation) + 1].__getattr__( # type: ignore - self, name - ) + next_class = parent_classes[parent_classes.index(CachedVarOperation) + 1] - def _get_all_var_data(self) -> ImmutableVarData | None: + return next_class.__getattr__(self, name) # type: ignore + + def _get_all_var_data(self) -> VarData | None: """Get all VarData associated with the Var. Returns: @@ -1114,16 +1185,18 @@ class CachedVarOperation: return self._cached_get_all_var_data @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get the cached VarData. Returns: The cached VarData. """ - return ImmutableVarData.merge( + return VarData.merge( *map( lambda value: ( - value._get_all_var_data() if isinstance(value, Var) else None + value._get_all_var_data() + if isinstance(value, ImmutableVar) + else None ), map( lambda field: getattr(self, field.name), @@ -1151,7 +1224,7 @@ class CachedVarOperation: ) -def and_operation(a: Var | Any, b: Var | Any) -> ImmutableVar: +def and_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: """Perform a logical AND operation on two variables. Args: @@ -1181,7 +1254,7 @@ def _and_operation(a: ImmutableVar, b: ImmutableVar): ) -def or_operation(a: Var | Any, b: Var | Any) -> ImmutableVar: +def or_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: """Perform a logical OR operation on two variables. Args: @@ -1223,14 +1296,14 @@ class ImmutableCallableVar(ImmutableVar): API with functions that return a family of Var. """ - fn: Callable[..., Var] = dataclasses.field( + fn: Callable[..., ImmutableVar] = dataclasses.field( default_factory=lambda: lambda: ImmutableVar(_var_name="undefined") ) - original_var: Var = dataclasses.field( + original_var: ImmutableVar = dataclasses.field( default_factory=lambda: ImmutableVar(_var_name="undefined") ) - def __init__(self, fn: Callable[..., Var]): + def __init__(self, fn: Callable[..., ImmutableVar]): """Initialize a CallableVar. Args: @@ -1240,12 +1313,12 @@ class ImmutableCallableVar(ImmutableVar): super(ImmutableCallableVar, self).__init__( _var_name=original_var._var_name, _var_type=original_var._var_type, - _var_data=ImmutableVarData.merge(original_var._get_all_var_data()), + _var_data=VarData.merge(original_var._get_all_var_data()), ) object.__setattr__(self, "fn", fn) object.__setattr__(self, "original_var", original_var) - def __call__(self, *args, **kwargs) -> Var: + def __call__(self, *args, **kwargs) -> ImmutableVar: """Call the decorated function. Args: @@ -1274,6 +1347,24 @@ DICT_VAL = TypeVar("DICT_VAL") LIST_INSIDE = TypeVar("LIST_INSIDE") +class FakeComputedVarBaseClass(Var, property): + """A fake base class for ComputedVar to avoid inheriting from property.""" + + __pydantic_run_validation__ = False + + +def is_computed_var(obj: Any) -> TypeGuard[ImmutableComputedVar]: + """Check if the object is a ComputedVar. + + Args: + obj: The object to check. + + Returns: + Whether the object is a ComputedVar. + """ + return isinstance(obj, FakeComputedVarBaseClass) + + @dataclasses.dataclass( eq=False, frozen=True, @@ -1309,7 +1400,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): fget: Callable[[BASE_STATE], RETURN_TYPE], initial_value: RETURN_TYPE | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[int, datetime.timedelta]] = None, backend: bool | None = None, @@ -1336,10 +1427,11 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): kwargs["_var_name"] = kwargs.pop("_var_name", fget.__name__) kwargs["_var_type"] = kwargs.pop("_var_type", hint) - super(ImmutableComputedVar, self).__init__( + ImmutableVar.__init__( + self, _var_name=kwargs.pop("_var_name"), _var_type=kwargs.pop("_var_type"), - _var_data=ImmutableVarData.merge(kwargs.pop("_var_data", None)), + _var_data=kwargs.pop("_var_data", None), ) if backend is None: @@ -1358,7 +1450,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): deps = [] else: for dep in deps: - if isinstance(dep, Var): + if isinstance(dep, ImmutableVar): continue if isinstance(dep, str) and dep != "": continue @@ -1368,7 +1460,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): object.__setattr__( self, "_static_deps", - {dep._var_name if isinstance(dep, Var) else dep for dep in deps}, + {dep._var_name if isinstance(dep, ImmutableVar) else dep for dep in deps}, ) object.__setattr__(self, "_auto_deps", auto_deps) @@ -1514,7 +1606,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): _var_name=format_state_name(state_where_defined.get_full_name()) + "." + self._var_name, - merge_var_data=ImmutableVarData.from_state(state_where_defined), + merge_var_data=VarData.from_state(state_where_defined), ).guess_type() if not self._cache: @@ -1601,7 +1693,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): ref_obj = None if instruction.argval in invalid_names: raise VarValueError( - f"Cached var {self._var_full_name} cannot access arbitrary state via `{instruction.argval}`." + f"Cached var {str(self)} cannot access arbitrary state via `{instruction.argval}`." ) if callable(ref_obj): # recurse into callable attributes @@ -1669,7 +1761,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): Returns: The class of the var. """ - return ComputedVar + return FakeComputedVarBaseClass @property def fget(self) -> Callable[[BaseState], RETURN_TYPE]: @@ -1690,7 +1782,7 @@ def immutable_computed_var( fget: None = None, initial_value: Any | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1705,7 +1797,7 @@ def immutable_computed_var( fget: Callable[[BASE_STATE], RETURN_TYPE], initial_value: RETURN_TYPE | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1717,7 +1809,7 @@ def immutable_computed_var( fget: Callable[[BASE_STATE], Any] | None = None, initial_value: Any | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1794,7 +1886,7 @@ class CustomVarOperationReturn(ImmutableVar[RETURN]): return CustomVarOperationReturn( _var_name=js_expression, _var_type=_var_type or Any, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, ) @@ -1822,7 +1914,9 @@ def var_operation_return( class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): """Base class for custom var operations.""" - _args: Tuple[Tuple[str, Var], ...] = dataclasses.field(default_factory=tuple) + _args: Tuple[Tuple[str, ImmutableVar], ...] = dataclasses.field( + default_factory=tuple + ) _return: CustomVarOperationReturn[T] = dataclasses.field( default_factory=lambda: CustomVarOperationReturn.create("") @@ -1838,13 +1932,13 @@ class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): return str(self._return) @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get the cached VarData. Returns: The cached VarData. """ - return ImmutableVarData.merge( + return VarData.merge( *map( lambda arg: arg[1]._get_all_var_data(), self._args, @@ -1856,7 +1950,7 @@ class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): @classmethod def create( cls, - args: Tuple[Tuple[str, Var], ...], + args: Tuple[Tuple[str, ImmutableVar], ...], return_var: CustomVarOperationReturn[T], _var_data: VarData | None = None, ) -> CustomVarOperation[T]: @@ -1873,7 +1967,208 @@ class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): return CustomVarOperation( _var_name="", _var_type=return_var._var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _args=args, _return=return_var, ) + + +class NoneVar(ImmutableVar[None]): + """A var representing None.""" + + +class LiteralNoneVar(LiteralVar, NoneVar): + """A var representing None.""" + + def json(self) -> str: + """Serialize the var to a JSON string. + + Returns: + The JSON string. + """ + return "null" + + @classmethod + def create( + cls, + _var_data: VarData | None = None, + ) -> LiteralNoneVar: + """Create a var from a value. + + Args: + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The var. + """ + return LiteralNoneVar( + _var_name="null", + _var_type=None, + _var_data=_var_data, + ) + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class ToNoneOperation(CachedVarOperation, NoneVar): + """A var operation that converts a var to None.""" + + _original_var: Var = dataclasses.field( + default_factory=lambda: LiteralNoneVar.create() + ) + + @cached_property_no_lock + def _cached_var_name(self) -> str: + """Get the cached var name. + + Returns: + The cached var name. + """ + return str(self._original_var) + + @classmethod + def create( + cls, + var: Var, + _var_data: VarData | None = None, + ) -> ToNoneOperation: + """Create a ToNoneOperation. + + Args: + var: The var to convert to None. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The ToNoneOperation. + """ + return ToNoneOperation( + _var_name="", + _var_type=None, + _var_data=_var_data, + _original_var=var, + ) + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class StateOperation(CachedVarOperation, ImmutableVar): + """A var operation that accesses a field on an object.""" + + _state_name: str = dataclasses.field(default="") + _field: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + + @cached_property_no_lock + def _cached_var_name(self) -> str: + """Get the cached var name. + + Returns: + The cached var name. + """ + return f"{str(self._state_name)}.{str(self._field)}" + + def __getattr__(self, name: str) -> Any: + """Get an attribute of the var. + + Args: + name: The name of the attribute. + + Returns: + The attribute. + """ + if name == "_var_name": + return self._cached_var_name + + return getattr(self._field, name) + + @classmethod + def create( + cls, + state_name: str, + field: ImmutableVar, + _var_data: VarData | None = None, + ) -> StateOperation: + """Create a DotOperation. + + Args: + state_name: The name of the state. + field: The field of the state. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The DotOperation. + """ + return StateOperation( + _var_name="", + _var_type=field._var_type, + _var_data=_var_data, + _state_name=state_name, + _field=field, + ) + + +class ToOperation: + """A var operation that converts a var to another type.""" + + def __getattr__(self, name: str) -> Any: + """Get an attribute of the var. + + Args: + name: The name of the attribute. + + Returns: + The attribute of the var. + """ + return getattr(object.__getattribute__(self, "_original"), name) + + def __post_init__(self): + """Post initialization.""" + object.__delattr__(self, "_var_name") + + def __hash__(self) -> int: + """Calculate the hash value of the object. + + Returns: + int: The hash value of the object. + """ + return hash(object.__getattribute__(self, "_original")) + + def _get_all_var_data(self) -> VarData | None: + """Get all the var data. + + Returns: + The var data. + """ + return VarData.merge( + object.__getattribute__(self, "_original")._get_all_var_data(), + self._var_data, # type: ignore + ) + + @classmethod + def create( + cls, + value: Var, + _var_type: GenericType | None = None, + _var_data: VarData | None = None, + ): + """Create a ToOperation. + + Args: + value: The value of the var. + _var_type: The type of the Var. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The ToOperation. + """ + return cls( + _var_name="", # type: ignore + _var_data=_var_data, # type: ignore + _var_type=_var_type or cls._default_var_type, # type: ignore + _original=value, # type: ignore + ) diff --git a/reflex/ivars/function.py b/reflex/ivars/function.py index 1a987b1cf..4fec96b70 100644 --- a/reflex/ivars/function.py +++ b/reflex/ivars/function.py @@ -4,18 +4,24 @@ from __future__ import annotations import dataclasses import sys -from typing import Any, Callable, Optional, Tuple, Type, Union +from typing import Any, Callable, ClassVar, Optional, Tuple, Type, Union from reflex.utils.types import GenericType -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import VarData -from .base import CachedVarOperation, ImmutableVar, LiteralVar, cached_property_no_lock +from .base import ( + CachedVarOperation, + ImmutableVar, + LiteralVar, + ToOperation, + cached_property_no_lock, +) class FunctionVar(ImmutableVar[Callable]): """Base class for immutable function vars.""" - def __call__(self, *args: Var | Any) -> ArgsFunctionOperation: + def __call__(self, *args: ImmutableVar | Any) -> ArgsFunctionOperation: """Call the function with the given arguments. Args: @@ -29,7 +35,7 @@ class FunctionVar(ImmutableVar[Callable]): VarOperationCall.create(self, *args, ImmutableVar.create_safe("...args")), ) - def call(self, *args: Var | Any) -> VarOperationCall: + def call(self, *args: ImmutableVar | Any) -> VarOperationCall: """Call the function with the given arguments. Args: @@ -63,7 +69,7 @@ class FunctionStringVar(FunctionVar): return cls( _var_name=func, _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, ) @@ -76,7 +82,9 @@ class VarOperationCall(CachedVarOperation, ImmutableVar): """Base class for immutable vars that are the result of a function call.""" _func: Optional[FunctionVar] = dataclasses.field(default=None) - _args: Tuple[Union[Var, Any], ...] = dataclasses.field(default_factory=tuple) + _args: Tuple[Union[ImmutableVar, Any], ...] = dataclasses.field( + default_factory=tuple + ) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -88,13 +96,13 @@ class VarOperationCall(CachedVarOperation, ImmutableVar): return f"({str(self._func)}({', '.join([str(LiteralVar.create(arg)) for arg in self._args])}))" @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get all the var data associated with the var. Returns: All the var data associated with the var. """ - return ImmutableVarData.merge( + return VarData.merge( self._func._get_all_var_data() if self._func is not None else None, *[LiteralVar.create(arg)._get_all_var_data() for arg in self._args], self._var_data, @@ -104,7 +112,7 @@ class VarOperationCall(CachedVarOperation, ImmutableVar): def create( cls, func: FunctionVar, - *args: Var | Any, + *args: ImmutableVar | Any, _var_type: GenericType = Any, _var_data: VarData | None = None, ) -> VarOperationCall: @@ -121,7 +129,7 @@ class VarOperationCall(CachedVarOperation, ImmutableVar): return cls( _var_name="", _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _func=func, _args=args, ) @@ -136,7 +144,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): """Base class for immutable function defined via arguments and return expression.""" _args_names: Tuple[str, ...] = dataclasses.field(default_factory=tuple) - _return_expr: Union[Var, Any] = dataclasses.field(default=None) + _return_expr: Union[ImmutableVar, Any] = dataclasses.field(default=None) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -151,7 +159,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): def create( cls, args_names: Tuple[str, ...], - return_expr: Var | Any, + return_expr: ImmutableVar | Any, _var_type: GenericType = Callable, _var_data: VarData | None = None, ) -> ArgsFunctionOperation: @@ -168,7 +176,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): return cls( _var_name="", _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _args_names=args_names, _return_expr=return_expr, ) @@ -179,45 +187,14 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToFunctionOperation(CachedVarOperation, FunctionVar): +class ToFunctionOperation(ToOperation, FunctionVar): """Base class of converting a var to a function.""" - _original_var: Var = dataclasses.field( + _original: ImmutableVar = dataclasses.field( default_factory=lambda: LiteralVar.create(None) ) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_var) - - @classmethod - def create( - cls, - original_var: Var, - _var_type: GenericType = Callable, - _var_data: VarData | None = None, - ) -> ToFunctionOperation: - """Create a new function var. - - Args: - original_var: The original var to convert to a function. - _var_type: The type of the function. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The function var. - """ - return cls( - _var_name="", - _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + _default_var_type: ClassVar[GenericType] = Callable JSON_STRINGIFY = FunctionStringVar.create("JSON.stringify") diff --git a/reflex/ivars/number.py b/reflex/ivars/number.py index 68c856d18..764aa9e24 100644 --- a/reflex/ivars/number.py +++ b/reflex/ivars/number.py @@ -5,28 +5,65 @@ from __future__ import annotations import dataclasses import json import sys -from typing import Any, Callable, TypeVar, Union +from typing import ( + TYPE_CHECKING, + Any, + Callable, + ClassVar, + NoReturn, + Type, + TypeVar, + Union, + overload, +) -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.utils.exceptions import VarTypeError +from reflex.vars import Var, VarData from .base import ( - CachedVarOperation, CustomVarOperationReturn, ImmutableVar, + LiteralNoneVar, LiteralVar, - cached_property_no_lock, + ToOperation, unionize, var_operation, var_operation_return, ) -NUMBER_T = TypeVar("NUMBER_T", int, float, Union[int, float]) +NUMBER_T = TypeVar("NUMBER_T", int, float, Union[int, float], bool) + +if TYPE_CHECKING: + from .sequence import ArrayVar + + +def raise_unsupported_operand_types( + operator: str, operands_types: tuple[type, ...] +) -> NoReturn: + """Raise an unsupported operand types error. + + Args: + operator: The operator. + operands_types: The types of the operands. + + Raises: + VarTypeError: The operand types are unsupported. + """ + raise VarTypeError( + f"Unsupported Operand type(s) for {operator}: {', '.join(map(lambda t: t.__name__, operands_types))}" + ) class NumberVar(ImmutableVar[NUMBER_T]): """Base class for immutable number vars.""" - def __add__(self, other: number_types | boolean_types): + @overload + def __add__(self, other: number_types) -> NumberVar: ... + + @overload + def __add__(self, other: NoReturn) -> NoReturn: ... + + def __add__(self, other: Any): """Add two numbers. Args: @@ -35,9 +72,17 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number addition operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("+", (type(self), type(other))) return number_add_operation(self, +other) - def __radd__(self, other: number_types | boolean_types): + @overload + def __radd__(self, other: number_types) -> NumberVar: ... + + @overload + def __radd__(self, other: NoReturn) -> NoReturn: ... + + def __radd__(self, other: Any): """Add two numbers. Args: @@ -46,9 +91,17 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number addition operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("+", (type(other), type(self))) return number_add_operation(+other, self) - def __sub__(self, other: number_types | boolean_types): + @overload + def __sub__(self, other: number_types) -> NumberVar: ... + + @overload + def __sub__(self, other: NoReturn) -> NoReturn: ... + + def __sub__(self, other: Any): """Subtract two numbers. Args: @@ -57,9 +110,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number subtraction operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("-", (type(self), type(other))) + return number_subtract_operation(self, +other) - def __rsub__(self, other: number_types | boolean_types): + @overload + def __rsub__(self, other: number_types) -> NumberVar: ... + + @overload + def __rsub__(self, other: NoReturn) -> NoReturn: ... + + def __rsub__(self, other: Any): """Subtract two numbers. Args: @@ -68,6 +130,9 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number subtraction operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("-", (type(other), type(self))) + return number_subtract_operation(+other, self) def __abs__(self): @@ -78,7 +143,13 @@ class NumberVar(ImmutableVar[NUMBER_T]): """ return number_abs_operation(self) - def __mul__(self, other: number_types | boolean_types): + @overload + def __mul__(self, other: number_types | boolean_types) -> NumberVar: ... + + @overload + def __mul__(self, other: list | tuple | set | ArrayVar) -> ArrayVar: ... + + def __mul__(self, other: Any): """Multiply two numbers. Args: @@ -87,9 +158,25 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number multiplication operation. """ + from .sequence import ArrayVar, LiteralArrayVar + + if isinstance(other, (list, tuple, set, ArrayVar)): + if isinstance(other, ArrayVar): + return other * self + return LiteralArrayVar.create(other) * self + + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("*", (type(self), type(other))) + return number_multiply_operation(self, +other) - def __rmul__(self, other: number_types | boolean_types): + @overload + def __rmul__(self, other: number_types | boolean_types) -> NumberVar: ... + + @overload + def __rmul__(self, other: list | tuple | set | ArrayVar) -> ArrayVar: ... + + def __rmul__(self, other: Any): """Multiply two numbers. Args: @@ -98,9 +185,25 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number multiplication operation. """ + from .sequence import ArrayVar, LiteralArrayVar + + if isinstance(other, (list, tuple, set, ArrayVar)): + if isinstance(other, ArrayVar): + return other * self + return LiteralArrayVar.create(other) * self + + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("*", (type(other), type(self))) + return number_multiply_operation(+other, self) - def __truediv__(self, other: number_types | boolean_types): + @overload + def __truediv__(self, other: number_types) -> NumberVar: ... + + @overload + def __truediv__(self, other: NoReturn) -> NoReturn: ... + + def __truediv__(self, other: Any): """Divide two numbers. Args: @@ -109,9 +212,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number true division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("/", (type(self), type(other))) + return number_true_division_operation(self, +other) - def __rtruediv__(self, other: number_types | boolean_types): + @overload + def __rtruediv__(self, other: number_types) -> NumberVar: ... + + @overload + def __rtruediv__(self, other: NoReturn) -> NoReturn: ... + + def __rtruediv__(self, other: Any): """Divide two numbers. Args: @@ -120,9 +232,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number true division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("/", (type(other), type(self))) + return number_true_division_operation(+other, self) - def __floordiv__(self, other: number_types | boolean_types): + @overload + def __floordiv__(self, other: number_types) -> NumberVar: ... + + @overload + def __floordiv__(self, other: NoReturn) -> NoReturn: ... + + def __floordiv__(self, other: Any): """Floor divide two numbers. Args: @@ -131,9 +252,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number floor division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("//", (type(self), type(other))) + return number_floor_division_operation(self, +other) - def __rfloordiv__(self, other: number_types | boolean_types): + @overload + def __rfloordiv__(self, other: number_types) -> NumberVar: ... + + @overload + def __rfloordiv__(self, other: NoReturn) -> NoReturn: ... + + def __rfloordiv__(self, other: Any): """Floor divide two numbers. Args: @@ -142,9 +272,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number floor division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("//", (type(other), type(self))) + return number_floor_division_operation(+other, self) - def __mod__(self, other: number_types | boolean_types): + @overload + def __mod__(self, other: number_types) -> NumberVar: ... + + @overload + def __mod__(self, other: NoReturn) -> NoReturn: ... + + def __mod__(self, other: Any): """Modulo two numbers. Args: @@ -153,9 +292,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number modulo operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("%", (type(self), type(other))) + return number_modulo_operation(self, +other) - def __rmod__(self, other: number_types | boolean_types): + @overload + def __rmod__(self, other: number_types) -> NumberVar: ... + + @overload + def __rmod__(self, other: NoReturn) -> NoReturn: ... + + def __rmod__(self, other: Any): """Modulo two numbers. Args: @@ -164,9 +312,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number modulo operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("%", (type(other), type(self))) + return number_modulo_operation(+other, self) - def __pow__(self, other: number_types | boolean_types): + @overload + def __pow__(self, other: number_types) -> NumberVar: ... + + @overload + def __pow__(self, other: NoReturn) -> NoReturn: ... + + def __pow__(self, other: Any): """Exponentiate two numbers. Args: @@ -175,9 +332,18 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number exponent operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("**", (type(self), type(other))) + return number_exponent_operation(self, +other) - def __rpow__(self, other: number_types | boolean_types): + @overload + def __rpow__(self, other: number_types) -> NumberVar: ... + + @overload + def __rpow__(self, other: NoReturn) -> NoReturn: ... + + def __rpow__(self, other: Any): """Exponentiate two numbers. Args: @@ -186,6 +352,9 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The number exponent operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("**", (type(other), type(self))) + return number_exponent_operation(+other, self) def __neg__(self): @@ -244,6 +413,12 @@ class NumberVar(ImmutableVar[NUMBER_T]): """ return number_trunc_operation(self) + @overload + def __lt__(self, other: number_types) -> BooleanVar: ... + + @overload + def __lt__(self, other: NoReturn) -> NoReturn: ... + def __lt__(self, other: Any): """Less than comparison. @@ -253,9 +428,15 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return less_than_operation(self, +other) - return less_than_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("<", (type(self), type(other))) + return less_than_operation(self, +other) + + @overload + def __le__(self, other: number_types) -> BooleanVar: ... + + @overload + def __le__(self, other: NoReturn) -> NoReturn: ... def __le__(self, other: Any): """Less than or equal comparison. @@ -266,9 +447,9 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return less_than_or_equal_operation(self, +other) - return less_than_or_equal_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("<=", (type(self), type(other))) + return less_than_or_equal_operation(self, +other) def __eq__(self, other: Any): """Equal comparison. @@ -279,7 +460,7 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + if isinstance(other, NUMBER_TYPES): return equal_operation(self, +other) return equal_operation(self, other) @@ -292,10 +473,16 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + if isinstance(other, NUMBER_TYPES): return not_equal_operation(self, +other) return not_equal_operation(self, other) + @overload + def __gt__(self, other: number_types) -> BooleanVar: ... + + @overload + def __gt__(self, other: NoReturn) -> NoReturn: ... + def __gt__(self, other: Any): """Greater than comparison. @@ -305,9 +492,15 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return greater_than_operation(self, +other) - return greater_than_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types(">", (type(self), type(other))) + return greater_than_operation(self, +other) + + @overload + def __ge__(self, other: number_types) -> BooleanVar: ... + + @overload + def __ge__(self, other: NoReturn) -> NoReturn: ... def __ge__(self, other: Any): """Greater than or equal comparison. @@ -318,9 +511,9 @@ class NumberVar(ImmutableVar[NUMBER_T]): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return greater_than_or_equal_operation(self, +other) - return greater_than_or_equal_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types(">=", (type(self), type(other))) + return greater_than_or_equal_operation(self, +other) def bool(self): """Boolean conversion. @@ -330,6 +523,22 @@ class NumberVar(ImmutableVar[NUMBER_T]): """ return self != 0 + def _is_strict_float(self) -> bool: + """Check if the number is a float. + + Returns: + bool: True if the number is a float. + """ + return issubclass(self._var_type, float) + + def _is_strict_int(self) -> bool: + """Check if the number is an int. + + Returns: + bool: True if the number is an int. + """ + return issubclass(self._var_type, int) + def binary_number_operation( func: Callable[[NumberVar, NumberVar], str], @@ -545,7 +754,7 @@ def number_trunc_operation(value: NumberVar): return var_operation_return(js_expression=f"Math.trunc({value})", var_type=int) -class BooleanVar(ImmutableVar[bool]): +class BooleanVar(NumberVar[bool]): """Base class for immutable boolean vars.""" def __invert__(self): @@ -580,7 +789,7 @@ class BooleanVar(ImmutableVar[bool]): """ return self - def __lt__(self, other: boolean_types | number_types): + def __lt__(self, other: Any): """Less than comparison. Args: @@ -589,9 +798,9 @@ class BooleanVar(ImmutableVar[bool]): Returns: The result of the comparison. """ - return less_than_operation(+self, +other) + return +self < other - def __le__(self, other: boolean_types | number_types): + def __le__(self, other: Any): """Less than or equal comparison. Args: @@ -600,31 +809,9 @@ class BooleanVar(ImmutableVar[bool]): Returns: The result of the comparison. """ - return less_than_or_equal_operation(+self, +other) + return +self <= other - def __eq__(self, other: boolean_types | number_types): - """Equal comparison. - - Args: - other: The other boolean. - - Returns: - The result of the comparison. - """ - return equal_operation(+self, +other) - - def __ne__(self, other: boolean_types | number_types): - """Not equal comparison. - - Args: - other: The other boolean. - - Returns: - The result of the comparison. - """ - return not_equal_operation(+self, +other) - - def __gt__(self, other: boolean_types | number_types): + def __gt__(self, other: Any): """Greater than comparison. Args: @@ -633,9 +820,9 @@ class BooleanVar(ImmutableVar[bool]): Returns: The result of the comparison. """ - return greater_than_operation(+self, +other) + return +self > other - def __ge__(self, other: boolean_types | number_types): + def __ge__(self, other: Any): """Greater than or equal comparison. Args: @@ -644,7 +831,7 @@ class BooleanVar(ImmutableVar[bool]): Returns: The result of the comparison. """ - return greater_than_or_equal_operation(+self, +other) + return +self >= other @var_operation @@ -661,8 +848,8 @@ def boolean_to_number_operation(value: BooleanVar): def comparison_operator( - func: Callable[[Var, Var], str], -) -> Callable[[Var | Any, Var | Any], BooleanVar]: + func: Callable[[ImmutableVar, ImmutableVar], str], +) -> Callable[[ImmutableVar | Any, ImmutableVar | Any], BooleanVar]: """Decorator to create a comparison operation. Args: @@ -673,13 +860,13 @@ def comparison_operator( """ @var_operation - def operation(lhs: Var, rhs: Var): + def operation(lhs: ImmutableVar, rhs: ImmutableVar): return var_operation_return( js_expression=func(lhs, rhs), var_type=bool, ) - def wrapper(lhs: Var | Any, rhs: Var | Any) -> BooleanVar: + def wrapper(lhs: ImmutableVar | Any, rhs: ImmutableVar | Any) -> BooleanVar: """Create the comparison operation. Args: @@ -695,7 +882,7 @@ def comparison_operator( @comparison_operator -def greater_than_operation(lhs: Var, rhs: Var): +def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Greater than comparison. Args: @@ -709,7 +896,7 @@ def greater_than_operation(lhs: Var, rhs: Var): @comparison_operator -def greater_than_or_equal_operation(lhs: Var, rhs: Var): +def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Greater than or equal comparison. Args: @@ -723,7 +910,7 @@ def greater_than_or_equal_operation(lhs: Var, rhs: Var): @comparison_operator -def less_than_operation(lhs: Var, rhs: Var): +def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Less than comparison. Args: @@ -737,7 +924,7 @@ def less_than_operation(lhs: Var, rhs: Var): @comparison_operator -def less_than_or_equal_operation(lhs: Var, rhs: Var): +def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Less than or equal comparison. Args: @@ -751,7 +938,7 @@ def less_than_or_equal_operation(lhs: Var, rhs: Var): @comparison_operator -def equal_operation(lhs: Var, rhs: Var): +def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Equal comparison. Args: @@ -765,7 +952,7 @@ def equal_operation(lhs: Var, rhs: Var): @comparison_operator -def not_equal_operation(lhs: Var, rhs: Var): +def not_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Not equal comparison. Args: @@ -831,7 +1018,7 @@ class LiteralBooleanVar(LiteralVar, BooleanVar): return cls( _var_name="true" if value else "false", _var_type=bool, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -876,7 +1063,7 @@ class LiteralNumberVar(LiteralVar, NumberVar): return cls( _var_name=str(value), _var_type=type(value), - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -890,45 +1077,12 @@ boolean_types = Union[BooleanVar, bool] frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToNumberVarOperation(CachedVarOperation, NumberVar): +class ToNumberVarOperation(ToOperation, NumberVar): """Base class for immutable number vars that are the result of a number operation.""" - _original_value: Var = dataclasses.field( - default_factory=lambda: LiteralNumberVar.create(0) - ) + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_value) - - @classmethod - def create( - cls, - value: Var, - _var_type: type[int] | type[float] = float, - _var_data: VarData | None = None, - ): - """Create the number var. - - Args: - value: The value of the var. - _var_type: The type of the Var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The number var. - """ - return cls( - _var_name="", - _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_value=value, - ) + _default_var_type: ClassVar[Type] = float @dataclasses.dataclass( @@ -936,43 +1090,12 @@ class ToNumberVarOperation(CachedVarOperation, NumberVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToBooleanVarOperation(CachedVarOperation, BooleanVar): +class ToBooleanVarOperation(ToOperation, BooleanVar): """Base class for immutable boolean vars that are the result of a boolean operation.""" - _original_value: Var = dataclasses.field( - default_factory=lambda: LiteralBooleanVar.create(False) - ) + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_value) - - @classmethod - def create( - cls, - value: Var, - _var_data: VarData | None = None, - ): - """Create the boolean var. - - Args: - value: The value of the var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The boolean var. - """ - return cls( - _var_name="", - _var_type=bool, - _var_data=ImmutableVarData.merge(_var_data), - _original_value=value, - ) + _default_var_type: ClassVar[Type] = bool @var_operation @@ -992,7 +1115,9 @@ def boolify(value: Var): @var_operation -def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): +def ternary_operation( + condition: BooleanVar, if_true: ImmutableVar, if_false: ImmutableVar +): """Create a ternary operation. Args: @@ -1007,3 +1132,6 @@ def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): js_expression=f"({condition} ? {if_true} : {if_false})", var_type=unionize(if_true._var_type, if_false._var_type), ) + + +NUMBER_TYPES = (int, float, NumberVar) diff --git a/reflex/ivars/object.py b/reflex/ivars/object.py index 49a21226f..687083fcb 100644 --- a/reflex/ivars/object.py +++ b/reflex/ivars/object.py @@ -8,6 +8,7 @@ import typing from inspect import isclass from typing import ( Any, + ClassVar, Dict, List, NoReturn, @@ -22,18 +23,19 @@ from typing import ( from reflex.utils import types from reflex.utils.exceptions import VarAttributeError from reflex.utils.types import GenericType, get_attribute_access_type, get_origin -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import VarData from .base import ( CachedVarOperation, ImmutableVar, LiteralVar, + ToOperation, cached_property_no_lock, figure_out_type, var_operation, var_operation_return, ) -from .number import BooleanVar, NumberVar +from .number import BooleanVar, NumberVar, raise_unsupported_operand_types from .sequence import ArrayVar, StringVar OBJECT_TYPE = TypeVar("OBJECT_TYPE", bound=Dict) @@ -132,7 +134,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, NoReturn]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ImmutableVar: ... @overload @@ -142,40 +144,40 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): | ObjectVar[Dict[KEY_TYPE, float]] | ObjectVar[Dict[KEY_TYPE, int | float]] ), - key: Var | Any, + key: ImmutableVar | Any, ) -> NumberVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, str]], - key: Var | Any, + key: ImmutableVar | Any, ) -> StringVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, list[ARRAY_INNER_TYPE]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ArrayVar[list[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, set[ARRAY_INNER_TYPE]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ArrayVar[set[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, tuple[ARRAY_INNER_TYPE, ...]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ArrayVar[tuple[ARRAY_INNER_TYPE, ...]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, dict[OTHER_KEY_TYPE, VALUE_TYPE]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ObjectVar[dict[OTHER_KEY_TYPE, VALUE_TYPE]]: ... - def __getitem__(self, key: Var | Any) -> ImmutableVar: + def __getitem__(self, key: ImmutableVar | Any) -> ImmutableVar: """Get an item from the object. Args: @@ -184,6 +186,10 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): Returns: The item from the object. """ + if not isinstance(key, (StringVar, str, int, NumberVar)) or ( + isinstance(key, NumberVar) and key._is_strict_float() + ): + raise_unsupported_operand_types("[]", (type(self), type(key))) return ObjectItemOperation.create(self, key).guess_type() # NoReturn is used here to catch when key value is Any @@ -265,7 +271,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): else: return ObjectItemOperation.create(self, name).guess_type() - def contains(self, key: Var | Any) -> BooleanVar: + def contains(self, key: ImmutableVar | Any) -> BooleanVar: """Check if the object contains a key. Args: @@ -285,8 +291,8 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): """Base class for immutable literal object vars.""" - _var_value: Dict[Union[Var, Any], Union[Var, Any]] = dataclasses.field( - default_factory=dict + _var_value: Dict[Union[ImmutableVar, Any], Union[ImmutableVar, Any]] = ( + dataclasses.field(default_factory=dict) ) def _key_type(self) -> Type: @@ -351,13 +357,13 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): return hash((self.__class__.__name__, self._var_name)) @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get all the var data. Returns: The var data. """ - return ImmutableVarData.merge( + return VarData.merge( *[LiteralVar.create(var)._get_all_var_data() for var in self._var_value], *[ LiteralVar.create(var)._get_all_var_data() @@ -386,7 +392,7 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): return LiteralObjectVar( _var_name="", _var_type=(figure_out_type(_var_value) if _var_type is None else _var_type), - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=_var_value, ) @@ -470,7 +476,9 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): _object: ObjectVar = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) - _key: Var | Any = dataclasses.field(default_factory=lambda: LiteralVar.create(None)) + _key: ImmutableVar | Any = dataclasses.field( + default_factory=lambda: LiteralVar.create(None) + ) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -487,7 +495,7 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): def create( cls, object: ObjectVar, - key: Var | Any, + key: ImmutableVar | Any, _var_type: GenericType | None = None, _var_data: VarData | None = None, ) -> ObjectItemOperation: @@ -505,9 +513,9 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): return cls( _var_name="", _var_type=object._value_type() if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _object=object, - _key=key if isinstance(key, Var) else LiteralVar.create(key), + _key=key if isinstance(key, ImmutableVar) else LiteralVar.create(key), ) @@ -516,49 +524,31 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToObjectOperation(CachedVarOperation, ObjectVar): +class ToObjectOperation(ToOperation, ObjectVar): """Operation to convert a var to an object.""" - _original_var: Var = dataclasses.field( + _original: ImmutableVar = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the operation. + _default_var_type: ClassVar[GenericType] = dict - Returns: - The name of the operation. - """ - return str(self._original_var) - - @classmethod - def create( - cls, - original_var: Var, - _var_type: GenericType | None = None, - _var_data: VarData | None = None, - ) -> ToObjectOperation: - """Create the to object operation. + def __getattr__(self, name: str) -> Any: + """Get an attribute of the var. Args: - original_var: The original var to convert. - _var_type: The type of the var. - _var_data: Additional hooks and imports associated with the operation. + name: The name of the attribute. Returns: - The to object operation. + The attribute of the var. """ - return cls( - _var_name="", - _var_type=dict if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + if name == "_var_name": + return self._original._var_name + return ObjectVar.__getattr__(self, name) @var_operation -def object_has_own_property_operation(object: ObjectVar, key: Var): +def object_has_own_property_operation(object: ObjectVar, key: ImmutableVar): """Check if an object has a key. Args: diff --git a/reflex/ivars/sequence.py b/reflex/ivars/sequence.py index 8081cf442..3b6da46c2 100644 --- a/reflex/ivars/sequence.py +++ b/reflex/ivars/sequence.py @@ -11,9 +11,11 @@ import typing from typing import ( TYPE_CHECKING, Any, + ClassVar, Dict, List, Literal, + NoReturn, Set, Tuple, Type, @@ -24,19 +26,22 @@ from typing import ( from reflex import constants from reflex.constants.base import REFLEX_VAR_OPENING_TAG +from reflex.utils.exceptions import VarTypeError from reflex.utils.types import GenericType, get_origin from reflex.vars import ( - ImmutableVarData, Var, VarData, _global_vars, + get_unique_variable_name, ) from .base import ( CachedVarOperation, CustomVarOperationReturn, ImmutableVar, + LiteralNoneVar, LiteralVar, + ToOperation, cached_property_no_lock, figure_out_type, unionize, @@ -47,6 +52,7 @@ from .number import ( BooleanVar, LiteralNumberVar, NumberVar, + raise_unsupported_operand_types, ) if TYPE_CHECKING: @@ -56,7 +62,13 @@ if TYPE_CHECKING: class StringVar(ImmutableVar[str]): """Base class for immutable string vars.""" - def __add__(self, other: StringVar | str) -> ConcatVarOperation: + @overload + def __add__(self, other: StringVar | str) -> ConcatVarOperation: ... + + @overload + def __add__(self, other: NoReturn) -> NoReturn: ... + + def __add__(self, other: Any) -> ConcatVarOperation: """Concatenate two strings. Args: @@ -65,9 +77,18 @@ class StringVar(ImmutableVar[str]): Returns: The string concatenation operation. """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("+", (type(self), type(other))) + return ConcatVarOperation.create(self, other) - def __radd__(self, other: StringVar | str) -> ConcatVarOperation: + @overload + def __radd__(self, other: StringVar | str) -> ConcatVarOperation: ... + + @overload + def __radd__(self, other: NoReturn) -> NoReturn: ... + + def __radd__(self, other: Any) -> ConcatVarOperation: """Concatenate two strings. Args: @@ -76,31 +97,58 @@ class StringVar(ImmutableVar[str]): Returns: The string concatenation operation. """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("+", (type(other), type(self))) + return ConcatVarOperation.create(other, self) - def __mul__(self, other: NumberVar | int) -> StringVar: + @overload + def __mul__(self, other: NumberVar | int) -> StringVar: ... + + @overload + def __mul__(self, other: NoReturn) -> NoReturn: ... + + def __mul__(self, other: Any) -> StringVar: """Multiply the sequence by a number or an integer. Args: - other (NumberVar | int): The number or integer to multiply the sequence by. + other: The number or integer to multiply the sequence by. Returns: StringVar: The resulting sequence after multiplication. """ + if not isinstance(other, (NumberVar, int)): + raise_unsupported_operand_types("*", (type(self), type(other))) + return (self.split() * other).join() - def __rmul__(self, other: NumberVar | int) -> StringVar: + @overload + def __rmul__(self, other: NumberVar | int) -> StringVar: ... + + @overload + def __rmul__(self, other: NoReturn) -> NoReturn: ... + + def __rmul__(self, other: Any) -> StringVar: """Multiply the sequence by a number or an integer. Args: - other (NumberVar | int): The number or integer to multiply the sequence by. + other: The number or integer to multiply the sequence by. Returns: StringVar: The resulting sequence after multiplication. """ + if not isinstance(other, (NumberVar, int)): + raise_unsupported_operand_types("*", (type(other), type(self))) + return (self.split() * other).join() - def __getitem__(self, i: slice | int | NumberVar) -> StringVar: + @overload + def __getitem__(self, i: slice) -> StringVar: ... + + @overload + def __getitem__(self, i: int | NumberVar) -> StringVar: ... + + def __getitem__(self, i: Any) -> StringVar: """Get a slice of the string. Args: @@ -111,6 +159,10 @@ class StringVar(ImmutableVar[str]): """ if isinstance(i, slice): return self.split()[i].join() + if not isinstance(i, (int, NumberVar)) or ( + isinstance(i, NumberVar) and i._is_strict_float() + ): + raise_unsupported_operand_types("[]", (type(self), type(i))) return string_item_operation(self, i) def length(self) -> NumberVar: @@ -161,18 +213,41 @@ class StringVar(ImmutableVar[str]): """ return self.split().reverse().join() - def contains(self, other: StringVar | str) -> BooleanVar: + @overload + def contains( + self, other: StringVar | str, field: StringVar | str | None = None + ) -> BooleanVar: ... + + @overload + def contains( + self, other: NoReturn, field: StringVar | str | None = None + ) -> NoReturn: ... + + def contains(self, other: Any, field: Any = None) -> BooleanVar: """Check if the string contains another string. Args: other: The other string. + field: The field to check. Returns: The string contains operation. """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("contains", (type(self), type(other))) + if field is not None: + if not isinstance(field, (StringVar, str)): + raise_unsupported_operand_types("contains", (type(self), type(field))) + return string_contains_field_operation(self, other, field) return string_contains_operation(self, other) - def split(self, separator: StringVar | str = "") -> ArrayVar[List[str]]: + @overload + def split(self, separator: StringVar | str = "") -> ArrayVar[List[str]]: ... + + @overload + def split(self, separator: NoReturn) -> NoReturn: ... + + def split(self, separator: Any = "") -> ArrayVar[List[str]]: """Split the string. Args: @@ -181,9 +256,17 @@ class StringVar(ImmutableVar[str]): Returns: The string split operation. """ + if not isinstance(separator, (StringVar, str)): + raise_unsupported_operand_types("split", (type(self), type(separator))) return string_split_operation(self, separator) - def startswith(self, prefix: StringVar | str) -> BooleanVar: + @overload + def startswith(self, prefix: StringVar | str) -> BooleanVar: ... + + @overload + def startswith(self, prefix: NoReturn) -> NoReturn: ... + + def startswith(self, prefix: Any) -> BooleanVar: """Check if the string starts with a prefix. Args: @@ -192,8 +275,146 @@ class StringVar(ImmutableVar[str]): Returns: The string starts with operation. """ + if not isinstance(prefix, (StringVar, str)): + raise_unsupported_operand_types("startswith", (type(self), type(prefix))) return string_starts_with_operation(self, prefix) + @overload + def __lt__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __lt__(self, other: NoReturn) -> NoReturn: ... + + def __lt__(self, other: Any): + """Check if the string is less than another string. + + Args: + other: The other string. + + Returns: + The string less than operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("<", (type(self), type(other))) + + return string_lt_operation(self, other) + + @overload + def __gt__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __gt__(self, other: NoReturn) -> NoReturn: ... + + def __gt__(self, other: Any): + """Check if the string is greater than another string. + + Args: + other: The other string. + + Returns: + The string greater than operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types(">", (type(self), type(other))) + + return string_gt_operation(self, other) + + @overload + def __le__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __le__(self, other: NoReturn) -> NoReturn: ... + + def __le__(self, other: Any): + """Check if the string is less than or equal to another string. + + Args: + other: The other string. + + Returns: + The string less than or equal operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("<=", (type(self), type(other))) + + return string_le_operation(self, other) + + @overload + def __ge__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __ge__(self, other: NoReturn) -> NoReturn: ... + + def __ge__(self, other: Any): + """Check if the string is greater than or equal to another string. + + Args: + other: The other string. + + Returns: + The string greater than or equal operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types(">=", (type(self), type(other))) + + return string_ge_operation(self, other) + + +@var_operation +def string_lt_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is less than another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string less than operation. + """ + return var_operation_return(js_expression=f"{lhs} < {rhs}", var_type=bool) + + +@var_operation +def string_gt_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is greater than another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string greater than operation. + """ + return var_operation_return(js_expression=f"{lhs} > {rhs}", var_type=bool) + + +@var_operation +def string_le_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is less than or equal to another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string less than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} <= {rhs}", var_type=bool) + + +@var_operation +def string_ge_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is greater than or equal to another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string greater than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} >= {rhs}", var_type=bool) + @var_operation def string_lower_operation(string: StringVar): @@ -234,6 +455,26 @@ def string_strip_operation(string: StringVar): return var_operation_return(js_expression=f"{string}.trim()", var_type=str) +@var_operation +def string_contains_field_operation( + haystack: StringVar, needle: StringVar | str, field: StringVar | str +): + """Check if a string contains another string. + + Args: + haystack: The haystack. + needle: The needle. + field: The field to check. + + Returns: + The string contains operation. + """ + return var_operation_return( + js_expression=f"{haystack}.some(obj => obj[{field}] === {needle})", + var_type=bool, + ) + + @var_operation def string_contains_operation(haystack: StringVar, needle: StringVar | str): """Check if a string contains another string. @@ -316,7 +557,7 @@ class LiteralStringVar(LiteralVar, StringVar): cls, value: str, _var_data: VarData | None = None, - ) -> LiteralStringVar | ConcatVarOperation: + ) -> StringVar: """Create a var from a string value. Args: @@ -327,20 +568,9 @@ class LiteralStringVar(LiteralVar, StringVar): The var. """ if REFLEX_VAR_OPENING_TAG in value: - strings_and_vals: list[Var | str] = [] + strings_and_vals: list[ImmutableVar | str] = [] offset = 0 - # Initialize some methods for reading json. - var_data_config = VarData().__config__ - - def json_loads(s): - try: - return var_data_config.json_loads(s) - except json.decoder.JSONDecodeError: - return var_data_config.json_loads( - var_data_config.json_loads(f'"{s}"') - ) - # Find all tags while m := _decode_var_pattern.search(value): start, end = m.span() @@ -356,41 +586,17 @@ class LiteralStringVar(LiteralVar, StringVar): var = _global_vars[int(serialized_data)] strings_and_vals.append(var) value = value[(end + len(var._var_name)) :] - else: - data = json_loads(serialized_data) - string_length = data.pop("string_length", None) - var_data = VarData.parse_obj(data) - - # Use string length to compute positions of interpolations. - if string_length is not None: - realstart = start + offset - var_data.interpolations = [ - (realstart, realstart + string_length) - ] - var_content = value[end : (end + string_length)] - if ( - var_content[0] == "{" - and var_content[-1] == "}" - and strings_and_vals - and strings_and_vals[-1][-1] == "$" - ): - strings_and_vals[-1] = strings_and_vals[-1][:-1] - var_content = "(" + var_content[1:-1] + ")" - strings_and_vals.append( - ImmutableVar.create_safe(var_content, _var_data=var_data) - ) - value = value[(end + string_length) :] offset += end - start strings_and_vals.append(value) filtered_strings_and_vals = [ - s for s in strings_and_vals if isinstance(s, Var) or s + s for s in strings_and_vals if isinstance(s, ImmutableVar) or s ] if len(filtered_strings_and_vals) == 1: - return filtered_strings_and_vals[0].to(StringVar) # type: ignore + return LiteralVar.create(filtered_strings_and_vals[0]).to(StringVar) return ConcatVarOperation.create( *filtered_strings_and_vals, @@ -400,7 +606,7 @@ class LiteralStringVar(LiteralVar, StringVar): return LiteralStringVar( _var_name=json.dumps(value), _var_type=str, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -429,7 +635,7 @@ class LiteralStringVar(LiteralVar, StringVar): class ConcatVarOperation(CachedVarOperation, StringVar): """Representing a concatenation of literal string vars.""" - _var_value: Tuple[Var, ...] = dataclasses.field(default_factory=tuple) + _var_value: Tuple[ImmutableVar, ...] = dataclasses.field(default_factory=tuple) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -438,7 +644,7 @@ class ConcatVarOperation(CachedVarOperation, StringVar): Returns: The name of the var. """ - list_of_strs: List[Union[str, Var]] = [] + list_of_strs: List[Union[str, ImmutableVar]] = [] last_string = "" for var in self._var_value: if isinstance(var, LiteralStringVar): @@ -453,7 +659,9 @@ class ConcatVarOperation(CachedVarOperation, StringVar): list_of_strs.append(last_string) list_of_strs_filtered = [ - str(LiteralVar.create(s)) for s in list_of_strs if isinstance(s, Var) or s + str(LiteralVar.create(s)) + for s in list_of_strs + if isinstance(s, ImmutableVar) or s ] if len(list_of_strs_filtered) == 1: @@ -462,17 +670,17 @@ class ConcatVarOperation(CachedVarOperation, StringVar): return "(" + "+".join(list_of_strs_filtered) + ")" @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: - """Get all the VarData associated with the Var. + def _cached_get_all_var_data(self) -> VarData | None: + """Get all the VarData asVarDatae Var. Returns: The VarData associated with the Var. """ - return ImmutableVarData.merge( + return VarData.merge( *[ var._get_all_var_data() for var in self._var_value - if isinstance(var, Var) + if isinstance(var, ImmutableVar) ], self._var_data, ) @@ -495,7 +703,7 @@ class ConcatVarOperation(CachedVarOperation, StringVar): return cls( _var_name="", _var_type=str, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=tuple(map(LiteralVar.create, value)), ) @@ -513,7 +721,13 @@ VALUE_TYPE = TypeVar("VALUE_TYPE") class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): """Base class for immutable array vars.""" - def join(self, sep: StringVar | str = "") -> StringVar: + @overload + def join(self, sep: StringVar | str = "") -> StringVar: ... + + @overload + def join(self, sep: NoReturn) -> NoReturn: ... + + def join(self, sep: Any = "") -> StringVar: """Join the elements of the array. Args: @@ -522,6 +736,8 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): Returns: The joined elements. """ + if not isinstance(sep, (StringVar, str)): + raise_unsupported_operand_types("join", (type(self), type(sep))) return array_join_operation(self, sep) def reverse(self) -> ArrayVar[ARRAY_VAR_TYPE]: @@ -532,15 +748,24 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): """ return array_reverse_operation(self) - def __add__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> ArrayVar[ARRAY_VAR_TYPE]: + @overload + def __add__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> ArrayVar[ARRAY_VAR_TYPE]: ... + + @overload + def __add__(self, other: NoReturn) -> NoReturn: ... + + def __add__(self, other: Any) -> ArrayVar[ARRAY_VAR_TYPE]: """Concatenate two arrays. Parameters: - other (ArrayVar[ARRAY_VAR_TYPE]): The other array to concatenate. + other: The other array to concatenate. Returns: ArrayConcatOperation: The concatenation of the two arrays. """ + if not isinstance(other, ArrayVar): + raise_unsupported_operand_types("+", (type(self), type(other))) + return array_concat_operation(self, other) @overload @@ -633,9 +858,7 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): @overload def __getitem__(self, i: int | NumberVar) -> ImmutableVar: ... - def __getitem__( - self, i: slice | int | NumberVar - ) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: + def __getitem__(self, i: Any) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: """Get a slice of the array. Args: @@ -646,6 +869,10 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): """ if isinstance(i, slice): return ArraySliceOperation.create(self, i) + if not isinstance(i, (int, NumberVar)) or ( + isinstance(i, NumberVar) and i._is_strict_float() + ): + raise_unsupported_operand_types("[]", (type(self), type(i))) return array_item_operation(self, i) def length(self) -> NumberVar: @@ -687,6 +914,14 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): Returns: The range of numbers. """ + if any( + not isinstance(i, (int, NumberVar)) + for i in (first_endpoint, second_endpoint, step) + if i is not None + ): + raise_unsupported_operand_types( + "range", (type(first_endpoint), type(second_endpoint), type(step)) + ) if second_endpoint is None: start = 0 end = first_endpoint @@ -696,15 +931,26 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): return array_range_operation(start, end, step or 1) - def contains(self, other: Any) -> BooleanVar: + @overload + def contains(self, other: Any) -> BooleanVar: ... + + @overload + def contains(self, other: Any, field: StringVar | str) -> BooleanVar: ... + + def contains(self, other: Any, field: Any = None) -> BooleanVar: """Check if the array contains an element. Args: other: The element to check for. + field: The field to check. Returns: The array contains operation. """ + if field is not None: + if not isinstance(field, (StringVar, str)): + raise_unsupported_operand_types("contains", (type(self), type(field))) + return array_contains_field_operation(self, other, field) return array_contains_operation(self, other) def pluck(self, field: StringVar | str) -> ArrayVar: @@ -718,19 +964,154 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): """ return array_pluck_operation(self, field) - def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]: + @overload + def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]: ... + + @overload + def __mul__(self, other: NoReturn) -> NoReturn: ... + + def __mul__(self, other: Any) -> ArrayVar[ARRAY_VAR_TYPE]: """Multiply the sequence by a number or integer. Parameters: - other (NumberVar | int): The number or integer to multiply the sequence by. + other: The number or integer to multiply the sequence by. Returns: ArrayVar[ARRAY_VAR_TYPE]: The result of multiplying the sequence by the given number or integer. """ + if not isinstance(other, (NumberVar, int)) or ( + isinstance(other, NumberVar) and other._is_strict_float() + ): + raise_unsupported_operand_types("*", (type(self), type(other))) + return repeat_array_operation(self, other) __rmul__ = __mul__ # type: ignore + @overload + def __lt__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __lt__(self, other: list | tuple) -> BooleanVar: ... + + def __lt__(self, other: Any): + """Check if the array is less than another array. + + Args: + other: The other array. + + Returns: + The array less than operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types("<", (type(self), type(other))) + + return array_lt_operation(self, other) + + @overload + def __gt__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __gt__(self, other: list | tuple) -> BooleanVar: ... + + def __gt__(self, other: Any): + """Check if the array is greater than another array. + + Args: + other: The other array. + + Returns: + The array greater than operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types(">", (type(self), type(other))) + + return array_gt_operation(self, other) + + @overload + def __le__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __le__(self, other: list | tuple) -> BooleanVar: ... + + def __le__(self, other: Any): + """Check if the array is less than or equal to another array. + + Args: + other: The other array. + + Returns: + The array less than or equal operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types("<=", (type(self), type(other))) + + return array_le_operation(self, other) + + @overload + def __ge__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __ge__(self, other: list | tuple) -> BooleanVar: ... + + def __ge__(self, other: Any): + """Check if the array is greater than or equal to another array. + + Args: + other: The other array. + + Returns: + The array greater than or equal operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types(">=", (type(self), type(other))) + + return array_ge_operation(self, other) + + def foreach(self, fn: Any): + """Apply a function to each element of the array. + + Args: + fn: The function to apply. + + Returns: + The array after applying the function. + + Raises: + VarTypeError: If the function takes more than one argument. + """ + from .function import ArgsFunctionOperation + + if not callable(fn): + raise_unsupported_operand_types("foreach", (type(self), type(fn))) + # get the number of arguments of the function + num_args = len(inspect.signature(fn).parameters) + if num_args > 1: + raise VarTypeError( + "The function passed to foreach should take at most one argument." + ) + + if num_args == 0: + return_value = fn() + function_var = ArgsFunctionOperation.create(tuple(), return_value) + else: + # generic number var + number_var = ImmutableVar("").to(NumberVar) + + first_arg_type = self[number_var]._var_type + + arg_name = get_unique_variable_name() + + # get first argument type + first_arg = ImmutableVar( + _var_name=arg_name, + _var_type=first_arg_type, + ).guess_type() + + function_var = ArgsFunctionOperation.create((arg_name,), fn(first_arg)) + + return map_array_operation(self, function_var) + LIST_ELEMENT = TypeVar("LIST_ELEMENT") @@ -750,7 +1131,9 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): """Base class for immutable literal array vars.""" _var_value: Union[ - List[Union[Var, Any]], Set[Union[Var, Any]], Tuple[Union[Var, Any], ...] + List[Union[ImmutableVar, Any]], + Set[Union[ImmutableVar, Any]], + Tuple[Union[ImmutableVar, Any], ...], ] = dataclasses.field(default_factory=list) @cached_property_no_lock @@ -769,13 +1152,13 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): ) @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get all the VarData associated with the Var. Returns: The VarData associated with the Var. """ - return ImmutableVarData.merge( + return VarData.merge( *[ LiteralVar.create(element)._get_all_var_data() for element in self._var_value @@ -824,7 +1207,7 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): return cls( _var_name="", _var_type=figure_out_type(value) if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -884,7 +1267,7 @@ class ArraySliceOperation(CachedVarOperation, ArrayVar): ) if step is None: return f"{str(self._array)}.slice({str(normalized_start)}, {str(normalized_end)})" - if not isinstance(step, Var): + if not isinstance(step, ImmutableVar): if step < 0: actual_start = end + 1 if end is not None else 0 actual_end = start + 1 if start is not None else self._array.length() @@ -918,7 +1301,7 @@ class ArraySliceOperation(CachedVarOperation, ArrayVar): return cls( _var_name="", _var_type=array._var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _array=array, _start=slice.start, _stop=slice.stop, @@ -964,6 +1347,62 @@ def array_reverse_operation( ) +@var_operation +def array_lt_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is less than another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array less than operation. + """ + return var_operation_return(js_expression=f"{lhs} < {rhs}", var_type=bool) + + +@var_operation +def array_gt_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is greater than another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array greater than operation. + """ + return var_operation_return(js_expression=f"{lhs} > {rhs}", var_type=bool) + + +@var_operation +def array_le_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is less than or equal to another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array less than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} <= {rhs}", var_type=bool) + + +@var_operation +def array_ge_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is greater than or equal to another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array greater than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} >= {rhs}", var_type=bool) + + @var_operation def array_length_operation(array: ArrayVar): """Get the length of an array. @@ -1038,6 +1477,26 @@ def array_range_operation( ) +@var_operation +def array_contains_field_operation( + haystack: ArrayVar, needle: Any | Var, field: StringVar | str +): + """Check if an array contains an element. + + Args: + haystack: The array to check. + needle: The element to check for. + field: The field to check. + + Returns: + The array contains operation. + """ + return var_operation_return( + js_expression=f"{haystack}.some(obj => obj[{field}] === {needle})", + var_type=bool, + ) + + @var_operation def array_contains_operation(haystack: ArrayVar, needle: Any | Var): """Check if an array contains an element. @@ -1060,43 +1519,12 @@ def array_contains_operation(haystack: ArrayVar, needle: Any | Var): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToStringOperation(CachedVarOperation, StringVar): +class ToStringOperation(ToOperation, StringVar): """Base class for immutable string vars that are the result of a to string operation.""" - _original_var: Var = dataclasses.field( - default_factory=lambda: LiteralStringVar.create("") - ) + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_var) - - @classmethod - def create( - cls, - original_var: Var, - _var_data: VarData | None = None, - ) -> ToStringOperation: - """Create a var from a string value. - - Args: - original_var: The original var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The var. - """ - return cls( - _var_name="", - _var_type=str, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + _default_var_type: ClassVar[Type] = str @dataclasses.dataclass( @@ -1104,44 +1532,12 @@ class ToStringOperation(CachedVarOperation, StringVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToArrayOperation(CachedVarOperation, ArrayVar): +class ToArrayOperation(ToOperation, ArrayVar): """Base class for immutable array vars that are the result of a to array operation.""" - _original_var: Var = dataclasses.field( - default_factory=lambda: LiteralArrayVar.create([]) - ) + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_var) - - @classmethod - def create( - cls, - original_var: Var, - _var_type: type[list] | type[set] | type[tuple] | None = None, - _var_data: VarData | None = None, - ) -> ToArrayOperation: - """Create a var from a string value. - - Args: - original_var: The original var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The var. - """ - return cls( - _var_name="", - _var_type=list if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + _default_var_type: ClassVar[Type] = List[Any] @var_operation @@ -1163,6 +1559,29 @@ def repeat_array_operation( ) +if TYPE_CHECKING: + from .function import FunctionVar + + +@var_operation +def map_array_operation( + array: ArrayVar[ARRAY_VAR_TYPE], + function: FunctionVar, +): + """Map a function over an array. + + Args: + array: The array. + function: The function to map. + + Returns: + The mapped array. + """ + return var_operation_return( + js_expression=f"{array}.map({function})", var_type=List[Any] + ) + + @var_operation def array_concat_operation( lhs: ArrayVar[ARRAY_VAR_TYPE], rhs: ArrayVar[ARRAY_VAR_TYPE] diff --git a/reflex/state.py b/reflex/state.py index 1bd4cc946..0ee9dbb37 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -34,7 +34,12 @@ import dill from sqlalchemy.orm import DeclarativeBase from reflex.config import get_config -from reflex.ivars.base import ImmutableComputedVar, ImmutableVar, immutable_computed_var +from reflex.ivars.base import ( + ImmutableComputedVar, + ImmutableVar, + immutable_computed_var, + is_computed_var, +) try: import pydantic.v1 as pydantic @@ -59,11 +64,7 @@ from reflex.utils.exceptions import ImmutableStateError, LockExpiredError from reflex.utils.exec import is_testing_env from reflex.utils.serializers import SerializedType, serialize, serializer from reflex.utils.types import override -from reflex.vars import ( - ComputedVar, - ImmutableVarData, - Var, -) +from reflex.vars import VarData if TYPE_CHECKING: from reflex.components.component import Component @@ -303,16 +304,16 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """The state of the app.""" # A map from the var name to the var. - vars: ClassVar[Dict[str, Var]] = {} + vars: ClassVar[Dict[str, ImmutableVar]] = {} # The base vars of the class. base_vars: ClassVar[Dict[str, ImmutableVar]] = {} # The computed vars of the class. - computed_vars: ClassVar[Dict[str, Union[ComputedVar, ImmutableComputedVar]]] = {} + computed_vars: ClassVar[Dict[str, ImmutableComputedVar]] = {} # Vars inherited by the parent state. - inherited_vars: ClassVar[Dict[str, Var]] = {} + inherited_vars: ClassVar[Dict[str, ImmutableVar]] = {} # Backend base vars that are never sent to the client. backend_vars: ClassVar[Dict[str, Any]] = {} @@ -422,7 +423,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): return f"{self.__class__.__name__}({self.dict()})" @classmethod - def _get_computed_vars(cls) -> list[Union[ComputedVar, ImmutableComputedVar]]: + def _get_computed_vars(cls) -> list[ImmutableComputedVar]: """Helper function to get all computed vars of a instance. Returns: @@ -432,8 +433,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): v for mixin in cls._mixins() + [cls] for name, v in mixin.__dict__.items() - if isinstance(v, (ComputedVar, ImmutableComputedVar)) - and name not in cls.inherited_vars + if is_computed_var(v) and name not in cls.inherited_vars ] @classmethod @@ -522,13 +522,13 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): f.name: ImmutableVar( _var_name=format.format_state_name(cls.get_full_name()) + "." + f.name, _var_type=f.outer_type_, - _var_data=ImmutableVarData.from_state(cls), + _var_data=VarData.from_state(cls), ).guess_type() for f in cls.get_fields().values() if f.name not in cls.get_skip_vars() } cls.computed_vars = { - v._var_name: v._replace(merge_var_data=ImmutableVarData.from_state(cls)) + v._var_name: v._replace(merge_var_data=VarData.from_state(cls)) for v in computed_vars } cls.vars = { @@ -553,11 +553,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for name, value in mixin.__dict__.items(): if name in cls.inherited_vars: continue - if isinstance(value, (ComputedVar, ImmutableComputedVar)): + if is_computed_var(value): fget = cls._copy_fn(value.fget) - newcv = value._replace( - fget=fget, _var_data=ImmutableVarData.from_state(cls) - ) + newcv = value._replace(fget=fget, _var_data=VarData.from_state(cls)) # cleanup refs to mixin cls in var_data setattr(cls, name, newcv) cls.computed_vars[newcv._var_name] = newcv @@ -897,7 +895,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): var = ImmutableVar( _var_name=format.format_state_name(cls.get_full_name()) + "." + name, _var_type=type_, - _var_data=ImmutableVarData.from_state(cls), + _var_data=VarData.from_state(cls), ).guess_type() # add the pydantic field dynamically (must be done before _init_var) @@ -1012,13 +1010,13 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): def inner_func(self) -> str: return self.router.page.params.get(param, "") - return ComputedVar(fget=inner_func, cache=True) + return ImmutableComputedVar(fget=inner_func, cache=True) def arglist_factory(param): def inner_func(self) -> List: return self.router.page.params.get(param, []) - return ComputedVar(fget=inner_func, cache=True) + return ImmutableComputedVar(fget=inner_func, cache=True) for param, value in args.items(): if value == constants.RouteArgType.SINGLE: @@ -1027,8 +1025,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): func = arglist_factory(param) else: continue - # to allow passing as a prop - func._var_name = param + # to allow passing as a prop, evade python frozen rules (bad practice) + object.__setattr__(func, "_var_name", param) cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore setattr(cls, param, func) @@ -1789,7 +1787,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): # Include initial computed vars. prop_name: ( cv._initial_value - if isinstance(cv, (ComputedVar, ImmutableComputedVar)) + if is_computed_var(cv) and not isinstance(cv._initial_value, types.Unset) else self.get_value(getattr(self, prop_name)) ) diff --git a/reflex/style.py b/reflex/style.py index a2083f634..b29160cb2 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -6,14 +6,13 @@ from typing import Any, Literal, Tuple, Type from reflex import constants from reflex.components.core.breakpoints import Breakpoints, breakpoints_values -from reflex.event import EventChain +from reflex.event import EventChain, EventHandler from reflex.ivars.base import ImmutableCallableVar, ImmutableVar, LiteralVar from reflex.ivars.function import FunctionVar from reflex.utils import format +from reflex.utils.exceptions import ReflexError from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData - -VarData.update_forward_refs() # Ensure all type definitions are resolved +from reflex.vars import Var, VarData SYSTEM_COLOR_MODE: str = "system" LIGHT_COLOR_MODE: str = "light" @@ -40,7 +39,7 @@ def _color_mode_var(_var_name: str, _var_type: Type = str) -> ImmutableVar: return ImmutableVar( _var_name=_var_name, _var_type=_var_type, - _var_data=ImmutableVarData( + _var_data=VarData( imports=color_mode_imports, hooks={f"const {{ {_var_name} }} = useContext(ColorModeContext)": None}, ), @@ -50,7 +49,7 @@ def _color_mode_var(_var_name: str, _var_type: Type = str) -> ImmutableVar: @ImmutableCallableVar def set_color_mode( new_color_mode: LiteralColorMode | Var[LiteralColorMode] | None = None, -) -> Var[EventChain]: +) -> ImmutableVar[EventChain]: """Create an EventChain Var that sets the color mode to a specific value. Note: `set_color_mode` is not a real event and cannot be triggered from a @@ -69,15 +68,15 @@ def set_color_mode( if new_color_mode is None: return base_setter - if not isinstance(new_color_mode, Var): + if not isinstance(new_color_mode, ImmutableVar): new_color_mode = LiteralVar.create(new_color_mode) return ImmutableVar( f"() => {str(base_setter)}({str(new_color_mode)})", - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( base_setter._get_all_var_data(), new_color_mode._get_all_var_data() ), - ).to(FunctionVar, EventChain) + ).to(FunctionVar, EventChain) # type: ignore # Var resolves to the current color mode for the app ("light", "dark" or "system") @@ -116,7 +115,7 @@ def media_query(breakpoint_expr: str): def convert_item( style_item: int | str | Var, -) -> tuple[str | Var, VarData | ImmutableVarData | None]: +) -> tuple[str | Var, VarData | VarData | None]: """Format a single value in a style dictionary. Args: @@ -124,8 +123,17 @@ def convert_item( Returns: The formatted style item and any associated VarData. + + Raises: + ReflexError: If an EventHandler is used as a style value """ - if isinstance(style_item, Var): + if isinstance(style_item, EventHandler): + raise ReflexError( + "EventHandlers cannot be used as style values. " + "Please use a Var or a literal value." + ) + + if isinstance(style_item, ImmutableVar): return style_item, style_item._get_all_var_data() # if isinstance(style_item, str) and REFLEX_VAR_OPENING_TAG not in style_item: @@ -138,7 +146,7 @@ def convert_item( def convert_list( - responsive_list: list[str | dict | Var], + responsive_list: list[str | dict | ImmutableVar], ) -> tuple[list[str | dict[str, Var | list | dict]], VarData | None]: """Format a responsive value list. @@ -181,7 +189,7 @@ def convert( for key, value in style_dict.items(): keys = format_style_key(key) - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return_val = value new_var_data = value._get_all_var_data() update_out_dict(return_val, keys) diff --git a/reflex/utils/format.py b/reflex/utils/format.py index e7d85a93e..0e18a8495 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -10,7 +10,7 @@ from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union from reflex import constants from reflex.utils import exceptions, types -from reflex.vars import BaseVar, Var +from reflex.vars import Var if TYPE_CHECKING: from reflex.components.component import ComponentStyle @@ -263,34 +263,6 @@ def format_string(string: str) -> str: return _wrap_js_string(_escape_js_string(string)) -def format_f_string_prop(prop: BaseVar) -> str: - """Format the string in a given prop as an f-string. - - Args: - prop: The prop to format. - - Returns: - The formatted string. - """ - from reflex.ivars.base import VarData - - s = prop._var_full_name - var_data = VarData.merge(prop._get_all_var_data()) - interps = var_data.interpolations if var_data else [] - parts: List[str] = [] - - if interps: - for i, (start, end) in enumerate(interps): - prev_end = interps[i - 1][1] if i > 0 else 0 - parts.append(_escape_js_string(s[prev_end:start])) - parts.append(s[start:end]) - parts.append(_escape_js_string(s[interps[-1][1] :])) - else: - parts.append(_escape_js_string(s)) - - return _wrap_js_string("".join(parts)) - - def format_var(var: Var) -> str: """Format the given Var as a javascript value. @@ -300,13 +272,7 @@ def format_var(var: Var) -> str: Returns: The formatted Var. """ - if not var._var_is_local or var._var_is_string: - return str(var) - if types._issubclass(var._var_type, str): - return format_string(var._var_full_name) - if is_wrapped(var._var_full_name, "{"): - return var._var_full_name - return json_dumps(var._var_full_name) + return str(var) def format_route(route: str, format_case=True) -> str: @@ -331,46 +297,11 @@ def format_route(route: str, format_case=True) -> str: return route -def format_cond( - cond: str | Var, - true_value: str | Var, - false_value: str | Var = '""', - is_prop=False, +def format_match( + cond: str | ImmutableVar, + match_cases: List[List[ImmutableVar]], + default: ImmutableVar, ) -> str: - """Format a conditional expression. - - Args: - cond: The cond. - true_value: The value to return if the cond is true. - false_value: The value to return if the cond is false. - is_prop: Whether the cond is a prop - - Returns: - The formatted conditional expression. - """ - # Use Python truthiness. - cond = f"isTrue({cond})" - - def create_var(cond_part): - return Var.create_safe(cond_part, _var_is_string=isinstance(cond_part, str)) - - # Format prop conds. - if is_prop: - true_value = create_var(true_value) - prop1 = true_value._replace( - _var_is_local=True, - ) - - false_value = create_var(false_value) - prop2 = false_value._replace(_var_is_local=True) - # unwrap '{}' to avoid f-string semantics for Var - return f"{cond} ? {prop1._var_name_unwrapped} : {prop2._var_name_unwrapped}" - - # Format component conds. - return wrap(f"{cond} ? {true_value} : {false_value}", "{") - - -def format_match(cond: str | Var, match_cases: List[BaseVar], default: Var) -> str: """Format a match expression whose return type is a Var. Args: @@ -389,24 +320,19 @@ def format_match(cond: str | Var, match_cases: List[BaseVar], default: Var) -> s return_value = case[-1] case_conditions = " ".join( - [ - f"case JSON.stringify({condition._var_name_unwrapped}):" - for condition in conditions - ] - ) - case_code = ( - f"{case_conditions} return ({return_value._var_name_unwrapped}); break;" + [f"case JSON.stringify({str(condition)}):" for condition in conditions] ) + case_code = f"{case_conditions} return ({str(return_value)}); break;" switch_code += case_code - switch_code += f"default: return ({default._var_name_unwrapped}); break;" + switch_code += f"default: return ({str(default)}); break;" switch_code += "};})()" return switch_code def format_prop( - prop: Union[Var, EventChain, ComponentStyle, str], + prop: Union[ImmutableVar, EventChain, ComponentStyle, str], ) -> Union[int, float, str]: """Format a prop. @@ -422,23 +348,16 @@ def format_prop( """ # import here to avoid circular import. from reflex.event import EventChain + from reflex.ivars import ImmutableVar from reflex.utils import serializers - from reflex.vars import VarData try: # Handle var props. - if isinstance(prop, Var): - if not prop._var_is_local or prop._var_is_string: - return str(prop) - if isinstance(prop, BaseVar) and types._issubclass(prop._var_type, str): - var_data = VarData.merge(prop._get_all_var_data()) - if var_data and var_data.interpolations: - return format_f_string_prop(prop) - return format_string(prop._var_full_name) - prop = prop._var_full_name + if isinstance(prop, ImmutableVar): + return str(prop) # Handle event props. - elif isinstance(prop, EventChain): + if isinstance(prop, EventChain): sig = inspect.signature(prop.args_spec) # type: ignore if sig.parameters: arg_def = ",".join(f"_{p}" for p in sig.parameters) @@ -492,9 +411,9 @@ def format_props(*single_props, **key_value_props) -> list[str]: return [ ( f"{name}={format_prop(prop)}" - if isinstance(prop, Var) and not isinstance(prop, ImmutableVar) + if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) else ( - f"{name}={{{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}}}" + f"{name}={{{format_prop(prop if isinstance(prop, ImmutableVar) else LiteralVar.create(prop))}}}" ) ) for name, prop in sorted(key_value_props.items()) @@ -502,8 +421,8 @@ def format_props(*single_props, **key_value_props) -> list[str]: ] + [ ( str(prop) - if isinstance(prop, Var) and not isinstance(prop, ImmutableVar) - else f"{{{str(LiteralVar.create(prop))}}}" + if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) + else f"{str(LiteralVar.create(prop))}" ) for prop in single_props ] @@ -574,7 +493,7 @@ def format_event(event_spec: EventSpec) -> str: "`", ) if val._var_is_string - else val._var_full_name + else str(val) ), ) ) @@ -591,44 +510,8 @@ def format_event(event_spec: EventSpec) -> str: return f"Event({', '.join(event_args)})" -def format_event_chain( - event_chain: EventChain | Var[EventChain], - event_arg: Var | None = None, -) -> str: - """Format an event chain as a javascript invocation. - - Args: - event_chain: The event chain to queue on the frontend. - event_arg: The browser-native event (only used to preventDefault). - - Returns: - Compiled javascript code to queue the given event chain on the frontend. - - Raises: - ValueError: When the given event chain is not a valid event chain. - """ - if isinstance(event_chain, Var): - from reflex.event import EventChain - - if event_chain._var_type is not EventChain: - raise ValueError(f"Invalid event chain: {event_chain}") - return "".join( - [ - "(() => {", - format_var(event_chain), - f"; preventDefault({format_var(event_arg)})" if event_arg else "", - "})()", - ] - ) - - chain = ",".join([format_event(event) for event in event_chain.events]) - return "".join( - [ - f"addEvents([{chain}]", - f", {format_var(event_arg)}" if event_arg else "", - ")", - ] - ) +if TYPE_CHECKING: + from reflex.ivars import ImmutableVar def format_queue_events( @@ -640,7 +523,7 @@ def format_queue_events( | None ) = None, args_spec: Optional[ArgsSpec] = None, -) -> Var[EventChain]: +) -> ImmutableVar[EventChain]: """Format a list of event handler / event spec as a javascript callback. The resulting code can be passed to interfaces that expect a callback @@ -669,7 +552,7 @@ def format_queue_events( from reflex.ivars import FunctionVar, ImmutableVar if not events: - return ImmutableVar("(() => null)").to(FunctionVar, EventChain) + return ImmutableVar("(() => null)").to(FunctionVar, EventChain) # type: ignore # If no spec is provided, the function will take no arguments. def _default_args_spec(): @@ -694,7 +577,7 @@ def format_queue_events( specs = [call_event_handler(spec, args_spec or _default_args_spec)] elif isinstance(spec, type(lambda: None)): specs = call_event_fn(spec, args_spec or _default_args_spec) # type: ignore - if isinstance(specs, Var): + if isinstance(specs, ImmutableVar): raise ValueError( f"Invalid event spec: {specs}. Expected a list of EventSpecs." ) @@ -705,7 +588,7 @@ def format_queue_events( return ImmutableVar( f"{arg_def} => {{queueEvents([{','.join(payloads)}], {constants.CompileVars.SOCKET}); " f"processEvent({constants.CompileVars.SOCKET})}}", - ).to(FunctionVar, EventChain) + ).to(FunctionVar, EventChain) # type: ignore def format_query_params(router_data: dict[str, Any]) -> dict[str, str]: @@ -792,41 +675,6 @@ def format_ref(ref: str) -> str: return f"ref_{clean_ref}" -def format_array_ref(refs: str, idx: Var | None) -> str: - """Format a ref accessed by array. - - Args: - refs : The ref array to access. - idx : The index of the ref in the array. - - Returns: - The formatted ref. - """ - clean_ref = re.sub(r"[^\w]+", "_", refs) - if idx is not None: - # idx._var_is_local = True - return f"refs_{clean_ref}[{str(idx)}]" - return f"refs_{clean_ref}" - - -def format_breadcrumbs(route: str) -> list[tuple[str, str]]: - """Take a route and return a list of tuple for use in breadcrumb. - - Args: - route: The route to transform. - - Returns: - list[tuple[str, str]]: the list of tuples for the breadcrumb. - """ - route_parts = route.lstrip("/").split("/") - - # create and return breadcrumbs - return [ - (part, "/".join(["", *route_parts[: i + 1]])) - for i, part in enumerate(route_parts) - ] - - def format_library_name(library_fullname: str): """Format the name of a library. @@ -857,42 +705,6 @@ def json_dumps(obj: Any) -> str: return json.dumps(obj, ensure_ascii=False, default=serializers.serialize) -def unwrap_vars(value: str) -> str: - """Unwrap var values from a JSON string. - - For example, "{var}" will be unwrapped to "var". - - Args: - value: The JSON string to unwrap. - - Returns: - The unwrapped JSON string. - """ - - def unescape_double_quotes_in_var(m: re.Match) -> str: - prefix = m.group(1) or "" - # Since the outer quotes are removed, the inner escaped quotes must be unescaped. - return prefix + re.sub('\\\\"', '"', m.group(2)) - - # This substitution is necessary to unwrap var values. - return ( - re.sub( - pattern=r""" - (?.*?)? # Optional encoded VarData (non-greedy) - {(.*?)} # extract the value between curly braces (non-greedy) - " # match must end with an unescaped double quote - """, - repl=unescape_double_quotes_in_var, - string=value, - flags=re.VERBOSE, - ) - .replace('"`', "`") - .replace('`"', "`") - ) - - def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]: """Collapse keys with consecutive suffixes into a single list value. @@ -915,6 +727,23 @@ def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]: return collapsed +def format_array_ref(refs: str, idx: ImmutableVar | None) -> str: + """Format a ref accessed by array. + + Args: + refs : The ref array to access. + idx : The index of the ref in the array. + + Returns: + The formatted ref. + """ + clean_ref = re.sub(r"[^\w]+", "_", refs) + if idx is not None: + # idx._var_is_local = True + return f"refs_{clean_ref}[{str(idx)}]" + return f"refs_{clean_ref}" + + def format_data_editor_column(col: str | dict): """Format a given column into the proper format. @@ -927,6 +756,8 @@ def format_data_editor_column(col: str | dict): Returns: The formatted column. """ + from reflex.ivars import ImmutableVar + if isinstance(col, str): return {"title": col, "id": col.lower(), "type": "str"} @@ -939,7 +770,7 @@ def format_data_editor_column(col: str | dict): col["overlayIcon"] = None return col - if isinstance(col, BaseVar): + if isinstance(col, ImmutableVar): return col raise ValueError( diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index f96a4c046..cc60418a9 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -19,8 +19,8 @@ from types import ModuleType, SimpleNamespace from typing import Any, Callable, Iterable, Type, get_args from reflex.components.component import Component +from reflex.ivars.base import ImmutableVar from reflex.utils import types as rx_types -from reflex.vars import Var logger = logging.getLogger("pyi_generator") @@ -69,10 +69,11 @@ DEFAULT_TYPING_IMPORTS = { # TODO: fix import ordering and unused imports with ruff later DEFAULT_IMPORTS = { "typing": sorted(DEFAULT_TYPING_IMPORTS), - "reflex.vars": ["Var", "BaseVar", "ComputedVar"], + "reflex.vars": ["Var"], "reflex.components.core.breakpoints": ["Breakpoints"], "reflex.event": ["EventChain", "EventHandler", "EventSpec"], "reflex.style": ["Style"], + "reflex.ivars.base": ["ImmutableVar"], } @@ -355,7 +356,7 @@ def _extract_class_props_as_ast_nodes( with contextlib.suppress(AttributeError, KeyError): # Try to get default from pydantic field definition. default = target_class.__fields__[name].default - if isinstance(default, Var): + if isinstance(default, ImmutableVar): default = default._decode() # type: ignore kwargs.append( @@ -433,7 +434,7 @@ def _generate_component_create_functiondef( ast.arg( arg=trigger, annotation=ast.Name( - id="Optional[Union[EventHandler, EventSpec, list, Callable, Var]]" + id="Optional[Union[EventHandler, EventSpec, list, Callable, ImmutableVar]]" ), ), ast.Constant(value=None), diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index 6c36647cc..0b94be511 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -4,7 +4,6 @@ from __future__ import annotations import functools import json -import types as builtin_types import warnings from datetime import date, datetime, time, timedelta from enum import Enum @@ -26,7 +25,7 @@ from typing import ( from reflex.base import Base from reflex.constants.colors import Color, format_color -from reflex.utils import exceptions, types +from reflex.utils import types # Mapping from type to a serializer. # The serializer should convert the type to a JSON object. @@ -250,7 +249,14 @@ def serialize_base(value: Base) -> str: Returns: The serialized Base. """ - return value.json() + from reflex.ivars import LiteralObjectVar + + return str( + LiteralObjectVar.create( + {k: (None if callable(v) else v) for k, v in value.dict().items()}, + _var_type=type(value), + ) + ) @serializer @@ -263,13 +269,9 @@ def serialize_list(value: Union[List, Tuple, Set]) -> str: Returns: The serialized list. """ - from reflex.utils import format + from reflex.ivars import LiteralArrayVar - # Dump the list to a string. - fprop = format.json_dumps(list(value)) - - # Unwrap var values. - return format.unwrap_vars(fprop) + return str(LiteralArrayVar.create(value)) @serializer @@ -281,30 +283,10 @@ def serialize_dict(prop: Dict[str, Any]) -> str: Returns: The serialized dictionary. - - Raises: - InvalidStylePropError: If the style prop is invalid. """ - # Import here to avoid circular imports. - from reflex.event import EventHandler - from reflex.utils import format + from reflex.ivars import LiteralObjectVar - prop_dict = {} - - for key, value in prop.items(): - if types._issubclass(type(value), Callable): - raise exceptions.InvalidStylePropError( - f"The style prop `{format.to_snake_case(key)}` cannot have " # type: ignore - f"`{value.fn.__qualname__ if isinstance(value, EventHandler) else value.__qualname__ if isinstance(value, builtin_types.FunctionType) else value}`, " - f"an event handler or callable as its value" - ) - prop_dict[key] = value - - # Dump the dict to a string. - fprop = format.json_dumps(prop_dict) - - # Unwrap var values. - return format.unwrap_vars(fprop) + return str(LiteralObjectVar.create(prop)) @serializer(to=str) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 6c21aa679..b4b4c1090 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -95,7 +95,7 @@ PrimitiveType = Union[int, float, bool, str, list, dict, set, tuple] StateVar = Union[PrimitiveType, Base, None] StateIterVar = Union[list, set, tuple] -# ArgsSpec = Callable[[Var], list[Var]] +# ArgsSpec = Callable[[ImmutableVar], list[ImmutableVar]] ArgsSpec = Callable @@ -509,14 +509,14 @@ def is_backend_base_variable(name: str, cls: Type) -> bool: if name in cls.inherited_backend_vars: return False + from reflex.ivars.base import is_computed_var + if name in cls.__dict__: value = cls.__dict__[name] if type(value) == classmethod: return False if callable(value): return False - from reflex.ivars.base import ImmutableComputedVar - from reflex.vars import ComputedVar if isinstance( value, @@ -524,10 +524,8 @@ def is_backend_base_variable(name: str, cls: Type) -> bool: types.FunctionType, property, cached_property, - ComputedVar, - ImmutableComputedVar, ), - ): + ) or is_computed_var(value): return False return True @@ -587,11 +585,11 @@ def validate_literal(key: str, value: Any, expected_type: Type, comp_name: str): Raises: ValueError: When the value is not a valid literal. """ - from reflex.vars import Var + from reflex.ivars import ImmutableVar if ( is_literal(expected_type) - and not isinstance(value, Var) # validating vars is not supported yet. + and not isinstance(value, ImmutableVar) # validating vars is not supported yet. and not is_encoded_fstring(value) # f-strings are not supported. and value not in expected_type.__args__ ): diff --git a/reflex/vars.py b/reflex/vars.py index 13481b962..86816433e 100644 --- a/reflex/vars.py +++ b/reflex/vars.py @@ -4,41 +4,24 @@ from __future__ import annotations import contextlib import dataclasses -import datetime -import dis -import inspect -import json import random import re import string -import sys -from types import CodeType, FunctionType from typing import ( TYPE_CHECKING, Any, - Callable, Dict, Iterable, - List, - Literal, Optional, Tuple, Type, - Union, _GenericAlias, # type: ignore - cast, - get_args, - get_type_hints, ) from reflex import constants -from reflex.base import Base -from reflex.utils import console, imports, serializers, types +from reflex.utils import imports from reflex.utils.exceptions import ( - VarAttributeError, - VarDependencyError, VarTypeError, - VarValueError, ) # This module used to export ImportVar itself, so we still import it for export here @@ -49,43 +32,15 @@ from reflex.utils.imports import ( ParsedImportDict, parse_imports, ) -from reflex.utils.types import get_origin, override if TYPE_CHECKING: + from reflex.ivars import ImmutableVar from reflex.state import BaseState # Set of unique variable names. USED_VARIABLES = set() -# Supported operators for all types. -ALL_OPS = ["==", "!=", "!==", "===", "&&", "||"] -# Delimiters used between function args or operands. -DELIMITERS = [","] -# Mapping of valid operations for different type combinations. -OPERATION_MAPPING = { - (int, int): { - "+", - "-", - "/", - "//", - "*", - "%", - "**", - ">", - "<", - "<=", - ">=", - "|", - "&", - }, - (int, str): {"*"}, - (int, list): {"*"}, - (str, str): {"+", ">", "<", "<=", ">="}, - (float, float): {"+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="}, - (float, int): {"+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="}, - (list, list): {"+", ">", "<", "<=", ">="}, -} # These names were changed in reflex 0.3.0 REPLACED_NAMES = { @@ -99,15 +54,6 @@ REPLACED_NAMES = { "deps": "_deps", } -PYTHON_JS_TYPE_MAP = { - (int, float): "number", - (str,): "string", - (bool,): "boolean", - (list, tuple): "Array", - (dict,): "Object", - (None,): "null", -} - def get_unique_variable_name() -> str: """Get a unique variable name. @@ -122,124 +68,11 @@ def get_unique_variable_name() -> str: return get_unique_variable_name() -class VarData(Base): - """Metadata associated with a Var.""" - - # The name of the enclosing state. - state: str = "" - - # Imports needed to render this var - imports: ParsedImportDict = {} - - # Hooks that need to be present in the component to render this var - hooks: Dict[str, None] = {} - - # Positions of interpolated strings. This is used by the decoder to figure - # out where the interpolations are and only escape the non-interpolated - # segments. - interpolations: List[Tuple[int, int]] = [] - - def __init__( - self, imports: Union[ImportDict, ParsedImportDict] | None = None, **kwargs: Any - ): - """Initialize the var data. - - Args: - imports: The imports needed to render this var. - **kwargs: The var data fields. - """ - if imports: - kwargs["imports"] = parse_imports(imports) - super().__init__(**kwargs) - - @classmethod - def merge(cls, *others: ImmutableVarData | VarData | None) -> VarData | None: - """Merge multiple var data objects. - - Args: - *others: The var data objects to merge. - - Returns: - The merged var data object. - """ - state = "" - _imports = {} - hooks = {} - interpolations = [] - for var_data in others: - if var_data is None: - continue - state = state or var_data.state - _imports = imports.merge_imports(_imports, var_data.imports) - hooks.update( - var_data.hooks - if isinstance(var_data.hooks, dict) - else {k: None for k in var_data.hooks} - ) - interpolations += ( - var_data.interpolations if isinstance(var_data, VarData) else [] - ) - - if state or _imports or hooks or interpolations: - return cls( - state=state, - imports=_imports, - hooks=hooks, - interpolations=interpolations, - ) - return None - - def __bool__(self) -> bool: - """Check if the var data is non-empty. - - Returns: - True if any field is set to a non-default value. - """ - return bool(self.state or self.imports or self.hooks or self.interpolations) - - def __eq__(self, other: Any) -> bool: - """Check if two var data objects are equal. - - Args: - other: The other var data object to compare. - - Returns: - True if all fields are equal and collapsed imports are equal. - """ - if not isinstance(other, VarData): - return False - - # Don't compare interpolations - that's added in by the decoder, and - # not part of the vardata itself. - return ( - self.state == other.state - and self.hooks.keys() == other.hooks.keys() - and imports.collapse_imports(self.imports) - == imports.collapse_imports(other.imports) - ) - - def dict(self) -> dict: - """Convert the var data to a dictionary. - - Returns: - The var data dictionary. - """ - return { - "state": self.state, - "interpolations": list(self.interpolations), - "imports": { - lib: [import_var.dict() for import_var in import_vars] - for lib, import_vars in self.imports.items() - }, - "hooks": self.hooks, - } - - @dataclasses.dataclass( eq=True, frozen=True, ) -class ImmutableVarData: +class VarData: """Metadata associated with a Var.""" # The name of the enclosing state. @@ -273,10 +106,16 @@ class ImmutableVarData: object.__setattr__(self, "imports", immutable_imports) object.__setattr__(self, "hooks", tuple(hooks or {})) + def old_school_imports(self) -> ImportDict: + """Return the imports as a mutable dict. + + Returns: + The imports as a mutable dict. + """ + return dict((k, list(v)) for k, v in self.imports) + @classmethod - def merge( - cls, *others: ImmutableVarData | VarData | None - ) -> ImmutableVarData | None: + def merge(cls, *others: VarData | None) -> VarData | None: """Merge multiple var data objects. Args: @@ -300,7 +139,7 @@ class ImmutableVarData: ) if state or _imports or hooks: - return ImmutableVarData( + return VarData( state=state, imports=_imports, hooks=hooks, @@ -324,7 +163,7 @@ class ImmutableVarData: Returns: True if all fields are equal and collapsed imports are equal. """ - if not isinstance(other, (ImmutableVarData, VarData)): + if not isinstance(other, VarData): return False # Don't compare interpolations - that's added in by the decoder, and @@ -333,16 +172,14 @@ class ImmutableVarData: self.state == other.state and self.hooks == ( - other.hooks - if isinstance(other, ImmutableVarData) - else tuple(other.hooks.keys()) + other.hooks if isinstance(other, VarData) else tuple(other.hooks.keys()) ) and imports.collapse_imports(self.imports) == imports.collapse_imports(other.imports) ) @classmethod - def from_state(cls, state: Type[BaseState] | str) -> ImmutableVarData: + def from_state(cls, state: Type[BaseState] | str) -> VarData: """Set the state of the var. Args: @@ -354,7 +191,7 @@ class ImmutableVarData: from reflex.utils import format state_name = state if isinstance(state, str) else state.get_full_name() - new_var_data = ImmutableVarData( + new_var_data = VarData( state=state_name, hooks={ "const {0} = useContext(StateContexts.{0})".format( @@ -369,7 +206,7 @@ class ImmutableVarData: return new_var_data -def _decode_var_immutable(value: str) -> tuple[ImmutableVarData | None, str]: +def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: """Decode the state name from a formatted var. Args: @@ -386,15 +223,6 @@ def _decode_var_immutable(value: str) -> tuple[ImmutableVarData | None, str]: offset = 0 - # Initialize some methods for reading json. - var_data_config = VarData().__config__ - - def json_loads(s): - try: - return var_data_config.json_loads(s) - except json.decoder.JSONDecodeError: - return var_data_config.json_loads(var_data_config.json_loads(f'"{s}"')) - # Find all tags. while m := _decode_var_pattern.search(value): start, end = m.span() @@ -410,49 +238,10 @@ def _decode_var_immutable(value: str) -> tuple[ImmutableVarData | None, str]: var_data = var._get_all_var_data() if var_data is not None: - realstart = start + offset - var_datas.append(var_data) - else: - # Read the JSON, pull out the string length, parse the rest as VarData. - data = json_loads(serialized_data) - string_length = data.pop("string_length", None) - var_data = VarData.parse_obj(data) - - # Use string length to compute positions of interpolations. - if string_length is not None: - realstart = start + offset - var_data.interpolations = [(realstart, realstart + string_length)] - - var_datas.append(var_data) offset += end - start - return ImmutableVarData.merge(*var_datas) if var_datas else None, value - - -def _encode_var(value: Var) -> str: - """Encode the state name into a formatted var. - - Args: - value: The value to encode the state name into. - - Returns: - The encoded var. - """ - if value._var_data: - from reflex.utils.serializers import serialize - - final_value = str(value) - data = value._var_data.dict() - data["string_length"] = len(final_value) - data_json = value._var_data.__config__.json_dumps(data, default=serialize) - - return ( - f"{constants.REFLEX_VAR_OPENING_TAG}{data_json}{constants.REFLEX_VAR_CLOSING_TAG}" - + final_value - ) - - return str(value) + return VarData.merge(*var_datas) if var_datas else None, value # Compile regex for finding reflex var tags. @@ -462,68 +251,7 @@ _decode_var_pattern_re = ( _decode_var_pattern = re.compile(_decode_var_pattern_re, flags=re.DOTALL) # Defined global immutable vars. -_global_vars: Dict[int, Var] = {} - - -def _decode_var(value: str) -> tuple[VarData | None, str]: - """Decode the state name from a formatted var. - - Args: - value: The value to extract the state name from. - - Returns: - The extracted state name and the value without the state name. - """ - var_datas = [] - if isinstance(value, str): - # fast path if there is no encoded VarData - if constants.REFLEX_VAR_OPENING_TAG not in value: - return None, value - - offset = 0 - - # Initialize some methods for reading json. - var_data_config = VarData().__config__ - - def json_loads(s): - try: - return var_data_config.json_loads(s) - except json.decoder.JSONDecodeError: - return var_data_config.json_loads(var_data_config.json_loads(f'"{s}"')) - - # Find all tags. - while m := _decode_var_pattern.search(value): - start, end = m.span() - value = value[:start] + value[end:] - - serialized_data = m.group(1) - - if serialized_data.isnumeric() or ( - serialized_data[0] == "-" and serialized_data[1:].isnumeric() - ): - # This is a global immutable var. - var = _global_vars[int(serialized_data)] - var_data = var._var_data - - if var_data is not None: - realstart = start + offset - - var_datas.append(var_data) - else: - # Read the JSON, pull out the string length, parse the rest as VarData. - data = json_loads(serialized_data) - string_length = data.pop("string_length", None) - var_data = VarData.parse_obj(data) - - # Use string length to compute positions of interpolations. - if string_length is not None: - realstart = start + offset - var_data.interpolations = [(realstart, realstart + string_length)] - - var_datas.append(var_data) - offset += end - start - - return VarData.merge(*var_datas) if var_datas else None, value +_global_vars: Dict[int, ImmutableVar] = {} def _extract_var_data(value: Iterable) -> list[VarData | None]: @@ -535,12 +263,13 @@ def _extract_var_data(value: Iterable) -> list[VarData | None]: Returns: The extracted VarDatas. """ + from reflex.ivars import ImmutableVar from reflex.style import Style var_datas = [] with contextlib.suppress(TypeError): for sub in value: - if isinstance(sub, Var): + if isinstance(sub, ImmutableVar): var_datas.append(sub._var_data) elif not isinstance(sub, str): # Recurse into dict values. @@ -563,24 +292,6 @@ def _extract_var_data(value: Iterable) -> list[VarData | None]: class Var: """An abstract var.""" - # The name of the var. - _var_name: str - - # The type of the var. - _var_type: Type - - # Whether this is a local javascript variable. - _var_is_local: bool - - # Whether the var is a string literal. - _var_is_string: bool - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool - - # Extra metadata associated with the Var - _var_data: Optional[VarData] - @classmethod def create( cls, @@ -588,7 +299,7 @@ class Var: _var_is_local: bool = True, _var_is_string: bool | None = None, _var_data: Optional[VarData] = None, - ) -> Var | None: + ) -> ImmutableVar | None: """Create a var from a value. Args: @@ -599,59 +310,45 @@ class Var: Returns: The var. - - Raises: - VarTypeError: If the value is JSON-unserializable. """ - from reflex.utils import format + from reflex.ivars import ImmutableVar, LiteralVar # Check for none values. if value is None: return None # If the value is already a var, do nothing. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return value - # Try to pull the imports and hooks from contained values. + # If the value is not a string, create a LiteralVar. if not isinstance(value, str): - _var_data = VarData.merge(*_extract_var_data(value), _var_data) - - # Try to serialize the value. - type_ = type(value) - if type_ in types.JSONType: - name = value - else: - name, serialized_type = serializers.serialize(value, get_type=True) - if ( - serialized_type is not None - and _var_is_string is None - and issubclass(serialized_type, str) - ): - _var_is_string = True - if name is None: - raise VarTypeError( - f"No JSON serializer found for var {value} of type {type_}." - ) - name = name if isinstance(name, str) else format.json_dumps(name) - - if _var_is_string is None and type_ is str: - console.deprecate( - feature_name=f"Creating a Var ({value}) from a string without specifying _var_is_string", - reason=( - "Specify _var_is_string=False to create a Var that is not a string literal. " - "In the future, creating a Var from a string will be treated as a string literal " - "by default." - ), - deprecation_version="0.5.4", - removal_version="0.6.0", + return LiteralVar.create( + value, + _var_data=_var_data, ) - return BaseVar( - _var_name=name, - _var_type=type_, - _var_is_local=_var_is_local, - _var_is_string=_var_is_string if _var_is_string is not None else False, + # if _var_is_string is provided, use that + if _var_is_string is False: + return ImmutableVar.create( + value, + _var_data=_var_data, + ) + if _var_is_string is True: + return LiteralVar.create( + value, + _var_data=_var_data, + ) + + # Otherwise, rely on _var_is_local + if _var_is_local is True: + return LiteralVar.create( + value, + _var_data=_var_data, + ) + + return ImmutableVar.create( + value, _var_data=_var_data, ) @@ -662,7 +359,7 @@ class Var: _var_is_local: bool = True, _var_is_string: bool | None = None, _var_data: Optional[VarData] = None, - ) -> Var: + ) -> ImmutableVar: """Create a var from a value, asserting that it is not None. Args: @@ -695,164 +392,6 @@ class Var: """ return _GenericAlias(cls, type_) - def __post_init__(self) -> None: - """Post-initialize the var.""" - # Decode any inline Var markup and apply it to the instance - _var_data, _var_name = _decode_var(self._var_name) - if _var_data: - self._var_name = _var_name - self._var_data = VarData.merge(self._var_data, _var_data) - - def _replace(self, merge_var_data=None, **kwargs: Any) -> BaseVar: - """Make a copy of this Var with updated fields. - - Args: - merge_var_data: VarData to merge into the existing VarData. - **kwargs: Var fields to update. - - Returns: - A new BaseVar with the updated fields overwriting the corresponding fields in this Var. - - Raises: - TypeError: If kwargs contains keys that are not allowed. - """ - field_values = dict( - _var_name=kwargs.pop("_var_name", self._var_name), - _var_type=kwargs.pop("_var_type", self._var_type), - _var_is_local=kwargs.pop("_var_is_local", self._var_is_local), - _var_is_string=kwargs.pop("_var_is_string", self._var_is_string), - _var_full_name_needs_state_prefix=kwargs.pop( - "_var_full_name_needs_state_prefix", - self._var_full_name_needs_state_prefix, - ), - _var_data=VarData.merge( - kwargs.pop("_var_data", self._var_data), merge_var_data - ), - ) - - if kwargs: - unexpected_kwargs = ", ".join(kwargs.keys()) - raise TypeError(f"Unexpected keyword arguments: {unexpected_kwargs}") - - return BaseVar(**field_values) - - def _decode(self) -> Any: - """Decode Var as a python value. - - Note that Var with state set cannot be decoded python-side and will be - returned as full_name. - - Returns: - The decoded value or the Var name. - """ - if self._var_is_string: - return self._var_name - try: - return json.loads(self._var_name) - except ValueError: - try: - return json.loads(self.json()) - except (ValueError, NotImplementedError): - return self._var_name - - def equals(self, other: Var) -> bool: - """Check if two vars are equal. - - Args: - other: The other var to compare. - - Returns: - Whether the vars are equal. - """ - from reflex.ivars import ImmutableVar - - if isinstance(other, ImmutableVar) or isinstance(self, ImmutableVar): - return ( - self._var_name == other._var_name - and self._var_type == other._var_type - and ImmutableVarData.merge(self._get_all_var_data()) - == ImmutableVarData.merge(other._get_all_var_data()) - ) - - return ( - self._var_name == other._var_name - and self._var_type == other._var_type - and self._var_is_local == other._var_is_local - and self._var_full_name_needs_state_prefix - == other._var_full_name_needs_state_prefix - and self._var_data == other._var_data - ) - - def _merge(self, other) -> Var: - """Merge two or more dicts. - - Args: - other: The other var to merge. - - Returns: - The merged var. - """ - if other is None: - return self._replace() - if not isinstance(other, Var): - other = Var.create(other, _var_is_string=False) - return self._replace( - _var_name=f"{{...{self._var_name}, ...{other._var_name}}}" # type: ignore - ) - - def to_string(self, json: bool = True) -> Var: - """Convert a var to a string. - - Args: - json: Whether to convert to a JSON string. - - Returns: - The stringified var. - """ - fn = "JSON.stringify" if json else "String" - return self.operation(fn=fn, type_=str) - - def to_int(self) -> Var: - """Convert a var to an int. - - Returns: - The parseInt var. - """ - return self.operation(fn="parseInt", type_=int) - - def __hash__(self) -> int: - """Define a hash function for a var. - - Returns: - The hash of the var. - """ - return hash((self._var_name, str(self._var_type))) - - def __str__(self) -> str: - """Wrap the var so it can be used in templates. - - Returns: - The wrapped var, i.e. {state.var}. - """ - from reflex.utils import format - - if self._var_is_local: - console.deprecate( - feature_name="Local Vars", - reason=( - "Setting _var_is_local to True does not have any effect anymore. " - "Use the new ImmutableVar instead." - ), - deprecation_version="0.5.9", - removal_version="0.6.0", - ) - out = self._var_full_name - else: - out = format.wrap(self._var_full_name, "{") - if self._var_is_string: - out = format.format_string(out) - return out - def __bool__(self) -> bool: """Raise exception if using Var in a boolean context. @@ -860,7 +399,7 @@ class Var: VarTypeError: when attempting to bool-ify the Var. """ raise VarTypeError( - f"Cannot convert Var {self._var_full_name!r} to bool for use with `if`, `and`, `or`, and `not`. " + f"Cannot convert Var {str(self)!r} to bool for use with `if`, `and`, `or`, and `not`. " "Instead use `rx.cond` and bitwise operators `&` (and), `|` (or), `~` (invert)." ) @@ -871,784 +410,10 @@ class Var: VarTypeError: when attempting to iterate over the Var. """ raise VarTypeError( - f"Cannot iterate over Var {self._var_full_name!r}. Instead use `rx.foreach`." + f"Cannot iterate over Var {str(self)!r}. Instead use `rx.foreach`." ) - def __format__(self, format_spec: str) -> str: - """Format the var into a Javascript equivalent to an f-string. - - Args: - format_spec: The format specifier (Ignored for now). - - Returns: - The formatted var. - """ - # Encode the _var_data into the formatted output for tracking purposes. - str_self = _encode_var(self) - if self._var_is_local: - return str_self - return f"${str_self}" - - def __getitem__(self, i: Any) -> Var: - """Index into a var. - - Args: - i: The index to index into. - - Returns: - The indexed var. - - Raises: - VarTypeError: If the var is not indexable. - """ - from reflex.utils import format - - # Indexing is only supported for strings, lists, tuples, dicts, and dataframes. - if not ( - types._issubclass(self._var_type, Union[List, Dict, Tuple, str]) - or types.is_dataframe(self._var_type) - ): - if self._var_type == Any: - raise VarTypeError( - "Could not index into var of type Any. (If you are trying to index into a state var, " - "add the correct type annotation to the var.)" - ) - raise VarTypeError( - f"Var {self._var_name} of type {self._var_type} does not support indexing." - ) - - # The type of the indexed var. - type_ = Any - - # Convert any vars to local vars. - if isinstance(i, Var): - i = i._replace(_var_is_local=True) - - # Handle list/tuple/str indexing. - if types._issubclass(self._var_type, Union[List, Tuple, str]): - # List/Tuple/String indices must be ints, slices, or vars. - if ( - not isinstance(i, types.get_args(Union[int, slice, Var])) - or isinstance(i, Var) - and not i._var_type == int - ): - raise VarTypeError("Index must be an integer or an integer var.") - - # Handle slices first. - if isinstance(i, slice): - # Get the start and stop indices. - start = i.start or 0 - stop = i.stop or "undefined" - - # Use the slice function. - return self._replace( - _var_name=f"{self._var_name}.slice({start}, {stop})", - _var_is_string=False, - ) - - # Get the type of the indexed var. - if types.is_generic_alias(self._var_type): - index = i if not isinstance(i, Var) else 0 - type_ = types.get_args(self._var_type) - type_ = type_[index % len(type_)] if type_ else Any - elif types._issubclass(self._var_type, str): - type_ = str - - # Use `at` to support negative indices. - return self._replace( - _var_name=f"{self._var_name}.at({i})", - _var_type=type_, - _var_is_string=False, - ) - - # Dictionary / dataframe indexing. - # Tuples are currently not supported as indexes. - if ( - ( - types._issubclass(self._var_type, Dict) - or types.is_dataframe(self._var_type) - ) - and not isinstance(i, types.get_args(Union[int, str, float, Var])) - ) or ( - isinstance(i, Var) - and not types._issubclass( - i._var_type, types.get_args(Union[int, str, float]) - ) - ): - raise VarTypeError( - "Index must be one of the following types: int, str, int or str Var" - ) - # Get the type of the indexed var. - if isinstance(i, str): - i = format.wrap(i, '"') - type_ = ( - types.get_args(self._var_type)[1] - if types.is_generic_alias(self._var_type) - else Any - ) - - # Use normal indexing here. - return self._replace( - _var_name=f"{self._var_name}[{i}]", - _var_type=type_, - _var_is_string=False, - ) - - def __getattribute__(self, name: str) -> Any: - """Get a var attribute. - - Args: - name: The name of the attribute. - - Returns: - The var attribute. - - Raises: - VarAttributeError: If the attribute cannot be found, or if __getattr__ fallback should be used. - """ - try: - var_attribute = super().__getattribute__(name) - if ( - not name.startswith("_") - and name not in Var.__dict__ - and name not in BaseVar.__dict__ - ): - # Check if the attribute should be accessed through the Var instead of - # accessing one of the Var operations - type_ = types.get_attribute_access_type( - super().__getattribute__("_var_type"), name - ) - if type_ is not None: - raise VarAttributeError( - f"{name} is being accessed through the Var." - ) - # Return the attribute as-is. - return var_attribute - except VarAttributeError: - raise # fall back to __getattr__ anyway - - def __getattr__(self, name: str) -> Var: - """Get a var attribute. - - Args: - name: The name of the attribute. - - Returns: - The var attribute. - - Raises: - VarAttributeError: If the var is wrongly annotated or can't find attribute. - VarTypeError: If an annotation to the var isn't provided. - """ - # Check if the attribute is one of the class fields. - if not name.startswith("_"): - if self._var_type == Any: - raise VarTypeError( - f"You must provide an annotation for the state var `{self._var_full_name}`. Annotation cannot be `{self._var_type}`" - ) from None - is_optional = types.is_optional(self._var_type) - type_ = types.get_attribute_access_type(self._var_type, name) - - if type_ is not None: - return self._replace( - _var_name=f"{self._var_name}{'?' if is_optional else ''}.{name}", - _var_type=type_, - ) - - if name in REPLACED_NAMES: - raise VarAttributeError( - f"Field {name!r} was renamed to {REPLACED_NAMES[name]!r}" - ) - - raise VarAttributeError( - f"The State var `{self._var_full_name}` has no attribute '{name}' or may have been annotated " - f"wrongly." - ) - - raise VarAttributeError( - f"The State var has no attribute '{name}' or may have been annotated wrongly.", - ) - - def operation( - self, - op: str = "", - other: Var | None = None, - type_: Type | None = None, - flip: bool = False, - fn: str | None = None, - invoke_fn: bool = False, - ) -> Var: - """Perform an operation on a var. - - Args: - op: The operation to perform. - other: The other var to perform the operation on. - type_: The type of the operation result. - flip: Whether to flip the order of the operation. - fn: A function to apply to the operation. - invoke_fn: Whether to invoke the function. - - Returns: - The operation result. - - Raises: - VarTypeError: If the operation between two operands is invalid. - VarValueError: If flip is set to true and value of operand is not provided - """ - from reflex.utils import format - - if isinstance(other, str): - other = Var.create(json.dumps(other), _var_is_string=False) - else: - other = Var.create(other, _var_is_string=False) - - type_ = type_ or self._var_type - - if other is None and flip: - raise VarValueError( - "flip_operands cannot be set to True if the value of 'other' operand is not provided" - ) - - left_operand, right_operand = (other, self) if flip else (self, other) - - def get_operand_full_name(operand): - # operand vars that are string literals need to be wrapped in back ticks. - return ( - operand._var_name_unwrapped - if operand._var_is_string - and not operand._var_state - and operand._var_is_local - else operand._var_full_name - ) - - if other is not None: - # check if the operation between operands is valid. - if op and not self.is_valid_operation( - types.get_base_class(left_operand._var_type), # type: ignore - types.get_base_class(right_operand._var_type), # type: ignore - op, - ): - raise VarTypeError( - f"Unsupported Operand type(s) for {op}: `{left_operand._var_full_name}` of type {left_operand._var_type.__name__} and `{right_operand._var_full_name}` of type {right_operand._var_type.__name__}" # type: ignore - ) - - left_operand_full_name = get_operand_full_name(left_operand) - right_operand_full_name = get_operand_full_name(right_operand) - - left_operand_full_name = format.wrap(left_operand_full_name, "(") - right_operand_full_name = format.wrap(right_operand_full_name, "(") - - # apply function to operands - if fn is not None: - if invoke_fn: - # invoke the function on left operand. - operation_name = ( - f"{left_operand_full_name}.{fn}({right_operand_full_name})" # type: ignore - ) - else: - # pass the operands as arguments to the function. - operation_name = ( - f"{left_operand_full_name} {op} {right_operand_full_name}" # type: ignore - ) - operation_name = f"{fn}({operation_name})" - else: - # apply operator to operands (left operand right_operand) - operation_name = ( - f"{left_operand_full_name} {op} {right_operand_full_name}" # type: ignore - ) - operation_name = format.wrap(operation_name, "(") - else: - # apply operator to left operand ( left_operand) - operation_name = f"{op}{get_operand_full_name(self)}" - # apply function to operands - if fn is not None: - operation_name = ( - f"{fn}({operation_name})" - if not invoke_fn - else f"{get_operand_full_name(self)}.{fn}()" - ) - - return self._replace( - _var_name=operation_name, - _var_type=type_, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - merge_var_data=other._var_data if other is not None else None, - ) - - @staticmethod - def is_valid_operation( - operand1_type: Type, operand2_type: Type, operator: str - ) -> bool: - """Check if an operation between two operands is valid. - - Args: - operand1_type: Type of the operand - operand2_type: Type of the second operand - operator: The operator. - - Returns: - Whether operation is valid or not - - """ - if operator in ALL_OPS or operator in DELIMITERS: - return True - - # bools are subclasses of ints - pair = tuple( - sorted( - [ - int if operand1_type == bool else operand1_type, - int if operand2_type == bool else operand2_type, - ], - key=lambda x: x.__name__, - ) - ) - return pair in OPERATION_MAPPING and operator in OPERATION_MAPPING[pair] - - def compare(self, op: str, other: Var) -> Var: - """Compare two vars with inequalities. - - Args: - op: The comparison operator. - other: The other var to compare with. - - Returns: - The comparison result. - """ - return self.operation(op, other, bool) - - def __invert__(self) -> Var: - """Invert a var. - - Returns: - The inverted var. - """ - return self.operation("!", type_=bool) - - def __neg__(self) -> Var: - """Negate a var. - - Returns: - The negated var. - """ - return self.operation(fn="-") - - def __abs__(self) -> Var: - """Get the absolute value of a var. - - Returns: - A var with the absolute value. - """ - return self.operation(fn="Math.abs") - - def length(self) -> Var: - """Get the length of a list var. - - Returns: - A var with the absolute value. - - Raises: - VarTypeError: If the var is not a list. - """ - if not types._issubclass(self._var_type, List): - raise VarTypeError(f"Cannot get length of non-list var {self}.") - return self._replace( - _var_name=f"{self._var_name}.length", - _var_type=int, - _var_is_string=False, - ) - - def _type(self) -> Var: - """Get the type of the Var in Javascript. - - Returns: - A var representing the type check. - """ - return self._replace( - _var_name=f"typeof {self._var_full_name}", - _var_type=str, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - ) - - def __eq__(self, other: Union[Var, Type]) -> Var: - """Perform an equality comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the equality comparison. - """ - for python_types, js_type in PYTHON_JS_TYPE_MAP.items(): - if not isinstance(other, Var) and other in python_types: - return self.compare("===", Var.create(js_type, _var_is_string=True)) # type: ignore - return self.compare("===", other) - - def __ne__(self, other: Union[Var, Type]) -> Var: - """Perform an inequality comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the inequality comparison. - """ - for python_types, js_type in PYTHON_JS_TYPE_MAP.items(): - if not isinstance(other, Var) and other in python_types: - return self.compare("!==", Var.create(js_type, _var_is_string=True)) # type: ignore - return self.compare("!==", other) - - def __gt__(self, other: Var) -> Var: - """Perform a greater than comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the greater than comparison. - """ - return self.compare(">", other) - - def __ge__(self, other: Var) -> Var: - """Perform a greater than or equal to comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the greater than or equal to comparison. - """ - return self.compare(">=", other) - - def __lt__(self, other: Var) -> Var: - """Perform a less than comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the less than comparison. - """ - return self.compare("<", other) - - def __le__(self, other: Var) -> Var: - """Perform a less than or equal to comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the less than or equal to comparison. - """ - return self.compare("<=", other) - - def __add__(self, other: Var, flip=False) -> Var: - """Add two vars. - - Args: - other: The other var to add. - flip: Whether to flip operands. - - Returns: - A var representing the sum. - """ - other_type = other._var_type if isinstance(other, Var) else type(other) - # For list-list addition, javascript concatenates the content of the lists instead of - # merging the list, and for that reason we use the spread operator available through spreadArraysOrObjects - # utility function - if ( - types.get_base_class(self._var_type) == list - and types.get_base_class(other_type) == list - ): - return self.operation( - ",", other, fn="spreadArraysOrObjects", flip=flip - )._replace( - merge_var_data=VarData( - imports={ - f"/{constants.Dirs.STATE_PATH}": [ - ImportVar(tag="spreadArraysOrObjects") - ] - }, - ), - ) - return self.operation("+", other, flip=flip) - - def __radd__(self, other: Var) -> Var: - """Add two vars. - - Args: - other: The other var to add. - - Returns: - A var representing the sum. - """ - return self.__add__(other=other, flip=True) - - def __sub__(self, other: Var) -> Var: - """Subtract two vars. - - Args: - other: The other var to subtract. - - Returns: - A var representing the difference. - """ - return self.operation("-", other) - - def __rsub__(self, other: Var) -> Var: - """Subtract two vars. - - Args: - other: The other var to subtract. - - Returns: - A var representing the difference. - """ - return self.operation("-", other, flip=True) - - def __mul__(self, other: Var, flip=True) -> Var: - """Multiply two vars. - - Args: - other: The other var to multiply. - flip: Whether to flip operands - - Returns: - A var representing the product. - """ - other_type = other._var_type if isinstance(other, Var) else type(other) - # For str-int multiplication, we use the repeat function. - # i.e "hello" * 2 is equivalent to "hello".repeat(2) in js. - if (types.get_base_class(self._var_type), types.get_base_class(other_type)) in [ - (int, str), - (str, int), - ]: - return self.operation(other=other, fn="repeat", invoke_fn=True) - - # For list-int multiplication, we use the Array function. - # i.e ["hello"] * 2 is equivalent to Array(2).fill().map(() => ["hello"]).flat() in js. - if (types.get_base_class(self._var_type), types.get_base_class(other_type)) in [ - (int, list), - (list, int), - ]: - other_name = other._var_full_name if isinstance(other, Var) else other - name = f"Array({other_name}).fill().map(() => {self._var_full_name}).flat()" - return self._replace( - _var_name=name, - _var_type=str, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - ) - - return self.operation("*", other) - - def __rmul__(self, other: Var) -> Var: - """Multiply two vars. - - Args: - other: The other var to multiply. - - Returns: - A var representing the product. - """ - return self.__mul__(other=other, flip=True) - - def __pow__(self, other: Var) -> Var: - """Raise a var to a power. - - Args: - other: The power to raise to. - - Returns: - A var representing the power. - """ - return self.operation(",", other, fn="Math.pow") - - def __rpow__(self, other: Var) -> Var: - """Raise a var to a power. - - Args: - other: The power to raise to. - - Returns: - A var representing the power. - """ - return self.operation(",", other, flip=True, fn="Math.pow") - - def __truediv__(self, other: Var) -> Var: - """Divide two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the quotient. - """ - return self.operation("/", other) - - def __rtruediv__(self, other: Var) -> Var: - """Divide two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the quotient. - """ - return self.operation("/", other, flip=True) - - def __floordiv__(self, other: Var) -> Var: - """Divide two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the quotient. - """ - return self.operation("/", other, fn="Math.floor") - - def __mod__(self, other: Var) -> Var: - """Get the remainder of two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the remainder. - """ - return self.operation("%", other) - - def __rmod__(self, other: Var) -> Var: - """Get the remainder of two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the remainder. - """ - return self.operation("%", other, flip=True) - - def __and__(self, other: Var) -> Var: - """Perform a logical and. - - Args: - other: The other var to perform the logical AND with. - - Returns: - A var representing the logical AND. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '&&' operator) of a logical AND operation. - In JavaScript, the - logical OR operator '&&' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical AND 'and' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. - Therefore, this method leverages the - bitwise AND '__and__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 & var2 - >>> print(js_code._var_full_name) - '(true && false)' - """ - return self.operation("&&", other, type_=bool) - - def __rand__(self, other: Var) -> Var: - """Perform a logical and. - - Args: - other: The other var to perform the logical AND with. - - Returns: - A var representing the logical AND. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '&&' operator) of a logical AND operation. - In JavaScript, the - logical OR operator '&&' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical AND 'and' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. - Therefore, this method leverages the - bitwise AND '__rand__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 & var2 - >>> print(js_code._var_full_name) - '(false && true)' - """ - return self.operation("&&", other, type_=bool, flip=True) - - def __or__(self, other: Var) -> Var: - """Perform a logical or. - - Args: - other: The other var to perform the logical or with. - - Returns: - A var representing the logical or. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '||' operator) of a logical OR operation. In JavaScript, the - logical OR operator '||' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical OR 'or' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. Therefore, this method leverages the - bitwise OR '__or__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 | var2 - >>> print(js_code._var_full_name) - '(true || false)' - """ - return self.operation("||", other, type_=bool) - - def __ror__(self, other: Var) -> Var: - """Perform a logical or. - - Args: - other: The other var to perform the logical or with. - - Returns: - A var representing the logical or. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '||' operator) of a logical OR operation. In JavaScript, the - logical OR operator '||' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical OR 'or' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. Therefore, this method leverages the - bitwise OR '__or__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 | var2 - >>> print(js_code) - 'false || true' - """ - return self.operation("||", other, type_=bool, flip=True) - - def __contains__(self, _: Any) -> Var: + def __contains__(self, _: Any) -> ImmutableVar: """Override the 'in' operator to alert the user that it is not supported. Raises: @@ -1658,244 +423,25 @@ class Var: "'in' operator not supported for Var types, use Var.contains() instead." ) - def contains(self, other: Any, field: Union[Var, None] = None) -> Var: - """Check if a var contains the object `other`. + def __get__(self, instance: Any, owner: Any) -> ImmutableVar: + """Return the value of the Var. Args: - other: The object to check. - field: Optionally specify a field to check on both object and the other var. - - Raises: - VarTypeError: If the var is not a valid type: dict, list, tuple or str. + instance: The instance of the Var. + owner: The owner of the Var. Returns: - A var representing the contain check. + The value of the Var. """ - if not (types._issubclass(self._var_type, Union[dict, list, tuple, str, set])): - raise VarTypeError( - f"Var {self._var_full_name} of type {self._var_type} does not support contains check." - ) - method = ( - "hasOwnProperty" - if types.get_base_class(self._var_type) == dict - else "includes" - ) - if isinstance(other, str): - other = Var.create(json.dumps(other), _var_is_string=True) - elif not isinstance(other, Var): - other = Var.create(other, _var_is_string=False) - if types._issubclass(self._var_type, Dict): - return self._replace( - _var_name=f"{self._var_name}.{method}({other._var_full_name})", - _var_type=bool, - _var_is_string=False, - merge_var_data=other._var_data, - ) - else: # str, list, tuple - # For strings, the left operand must be a string. - if types._issubclass(self._var_type, str) and not types._issubclass( - other._var_type, str - ): - raise VarTypeError( - f"'in ' requires string as left operand, not {other._var_type}" - ) - - _var_name = None - if field is None: - _var_name = f"{self._var_name}.includes({other._var_full_name})" - else: - field = Var.create_safe(field, _var_is_string=isinstance(field, str)) - _var_name = f"{self._var_name}.some(e=>e[{field._var_name_unwrapped}]==={other._var_full_name})" - - return self._replace( - _var_name=_var_name, - _var_type=bool, - _var_is_string=False, - merge_var_data=other._var_data, - ) - - def reverse(self) -> Var: - """Reverse a list var. - - Raises: - VarTypeError: If the var is not a list. - - Returns: - A var with the reversed list. - """ - if not types._issubclass(self._var_type, list): - raise VarTypeError(f"Cannot reverse non-list var {self._var_full_name}.") - - return self._replace( - _var_name=f"[...{self._var_full_name}].reverse()", - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - ) - - def lower(self) -> Var: - """Convert a string var to lowercase. - - Returns: - A var with the lowercase string. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError( - f"Cannot convert non-string var {self._var_full_name} to lowercase." - ) - - return self._replace( - _var_name=f"{self._var_name}.toLowerCase()", - _var_is_string=False, - _var_type=str, - ) - - def upper(self) -> Var: - """Convert a string var to uppercase. - - Returns: - A var with the uppercase string. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError( - f"Cannot convert non-string var {self._var_full_name} to uppercase." - ) - - return self._replace( - _var_name=f"{self._var_name}.toUpperCase()", - _var_is_string=False, - _var_type=str, - ) - - def strip(self, other: str | Var[str] = " ") -> Var: - """Strip a string var. - - Args: - other: The string to strip the var with. - - Returns: - A var with the stripped string. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError(f"Cannot strip non-string var {self._var_full_name}.") - - other = ( - Var.create_safe(json.dumps(other), _var_is_string=False) - if isinstance(other, str) - else other - ) - - return self._replace( - _var_name=f"{self._var_name}.replace(/^${other._var_full_name}|${other._var_full_name}$/g, '')", - _var_is_string=False, - merge_var_data=other._var_data, - ) - - def split(self, other: str | Var[str] = " ") -> Var: - """Split a string var into a list. - - Args: - other: The string to split the var with. - - Returns: - A var with the list. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError(f"Cannot split non-string var {self._var_full_name}.") - - other = ( - Var.create_safe(json.dumps(other), _var_is_string=False) - if isinstance(other, str) - else other - ) - - return self._replace( - _var_name=f"{self._var_name}.split({other._var_full_name})", - _var_is_string=False, - _var_type=List[str], - merge_var_data=other._var_data, - ) - - def join(self, other: str | Var[str] | None = None) -> Var: - """Join a list var into a string. - - Args: - other: The string to join the list with. - - Returns: - A var with the string. - - Raises: - VarTypeError: If the var is not a list. - """ - if not types._issubclass(self._var_type, list): - raise VarTypeError(f"Cannot join non-list var {self._var_full_name}.") - - if other is None: - other = Var.create_safe('""', _var_is_string=False) - if isinstance(other, str): - other = Var.create_safe(json.dumps(other), _var_is_string=False) - else: - other = Var.create_safe(other, _var_is_string=False) - - return self._replace( - _var_name=f"{self._var_name}.join({other._var_full_name})", - _var_is_string=False, - _var_type=str, - merge_var_data=other._var_data, - ) - - def foreach(self, fn: Callable) -> Var: - """Return a list of components. after doing a foreach on this var. - - Args: - fn: The function to call on each component. - - Returns: - A var representing foreach operation. - - Raises: - VarTypeError: If the var is not a list. - """ - inner_types = get_args(self._var_type) - if not inner_types: - raise VarTypeError( - f"Cannot foreach over non-sequence var {self._var_full_name} of type {self._var_type}." - ) - arg = BaseVar( - _var_name=get_unique_variable_name(), - _var_type=inner_types[0], - ) - index = BaseVar( - _var_name=get_unique_variable_name(), - _var_type=int, - ) - fn_signature = inspect.signature(fn) - fn_args = (arg, index) - fn_ret = fn(*fn_args[: len(fn_signature.parameters)]) - return self._replace( - _var_name=f"{self._var_full_name}.map(({arg._var_name}, {index._var_name}) => {fn_ret})", - _var_is_string=False, - ) + return self # type: ignore @classmethod def range( cls, - v1: Var | int = 0, - v2: Var | int | None = None, - step: Var | int | None = None, - ) -> Var: + v1: ImmutableVar | int = 0, + v2: ImmutableVar | int | None = None, + step: ImmutableVar | int | None = None, + ) -> ImmutableVar: """Return an iterator over indices from v1 to v2 (or 0 to v1). Args: @@ -1905,140 +451,18 @@ class Var: Returns: A var representing range operation. - - Raises: - VarTypeError: If the var is not an int. """ - if not isinstance(v1, Var): - v1 = Var.create_safe(v1) - if v1._var_type != int: - raise VarTypeError(f"Cannot get range on non-int var {v1._var_full_name}.") - if not isinstance(v2, Var): - v2 = Var.create(v2) - if v2 is None: - v2 = Var.create_safe("undefined", _var_is_string=False) - elif v2._var_type != int: - raise VarTypeError(f"Cannot get range on non-int var {v2._var_full_name}.") + from reflex.ivars import ArrayVar - if not isinstance(step, Var): - step = Var.create(step) - if step is None: - step = Var.create_safe(1) - elif step._var_type != int: - raise VarTypeError( - f"Cannot get range on non-int var {step._var_full_name}." - ) + return ArrayVar.range(v1, v2, step) # type: ignore - return BaseVar( - _var_name=f"Array.from(range({v1._var_full_name}, {v2._var_full_name}, {step._var_name}))", - _var_type=List[int], - _var_is_local=False, - _var_data=VarData.merge( - v1._var_data, - v2._var_data, - step._var_data, - VarData( - imports={ - "/utils/helpers/range.js": [ - ImportVar(tag="range", is_default=True), - ], - }, - ), - ), - ) - - def to(self, type_: Type) -> Var: - """Convert the type of the var. - - Args: - type_: The type to convert to. + def upcast(self) -> ImmutableVar: + """Upcast a Var to an ImmutableVar. Returns: - The converted var. + The upcasted Var. """ - return self._replace(_var_type=type_) - - def as_ref(self) -> Var: - """Convert the var to a ref. - - Returns: - The var as a ref. - """ - return self._replace( - _var_name=f"refs['{self._var_full_name}']", - _var_is_local=True, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - merge_var_data=VarData( - imports={ - f"/{constants.Dirs.STATE_PATH}": [imports.ImportVar(tag="refs")], - }, - ), - ) - - @property - def _var_full_name(self) -> str: - """Get the full name of the var. - - Returns: - The full name of the var. - """ - from reflex.utils import format - - if not self._var_full_name_needs_state_prefix: - return self._var_name - return ( - self._var_name - if self._var_data is None or self._var_data.state == "" - else ".".join( - [format.format_state_name(self._var_data.state), self._var_name] - ) - ) - - def _var_set_state(self, state: Type[BaseState] | str) -> Any: - """Set the state of the var. - - Args: - state: The state to set or the full name of the state. - - Returns: - The var with the set state. - """ - from reflex.utils import format - - state_name = state if isinstance(state, str) else state.get_full_name() - new_var_data = VarData( - state=state_name, - hooks={ - "const {0} = useContext(StateContexts.{0})".format( - format.format_state_name(state_name) - ): None - }, - imports={ - f"/{constants.Dirs.CONTEXTS_PATH}": [ImportVar(tag="StateContexts")], - "react": [ImportVar(tag="useContext")], - }, - ) - self._var_data = VarData.merge(self._var_data, new_var_data) - self._var_full_name_needs_state_prefix = True - return self - - @property - def _var_state(self) -> str: - """Compat method for getting the state. - - Returns: - The state name associated with the var. - """ - return self._var_data.state if self._var_data else "" - - def _get_all_var_data(self) -> VarData | None: - """Get all the var data. - - Returns: - The var data. - """ - return self._var_data + return self # type: ignore def json(self) -> str: """Serialize the var to a JSON string. @@ -2048,565 +472,8 @@ class Var: """ raise NotImplementedError("Var subclasses must implement the json method.") - @property - def _var_name_unwrapped(self) -> str: - """Get the var str without wrapping in curly braces. - Returns: - The str var without the wrapped curly braces - """ - from reflex.style import Style - - generic_alias = types.is_generic_alias(self._var_type) - - type_ = get_origin(self._var_type) if generic_alias else self._var_type - wrapped_var = str(self) - - return ( - wrapped_var - if not self._var_state - and not generic_alias - and (types._issubclass(type_, dict) or types._issubclass(type_, Style)) - else wrapped_var.strip("{}") - ) - - -# Allow automatic serialization of Var within JSON structures -serializers.serializer(_encode_var) - - -@dataclasses.dataclass( - eq=False, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class BaseVar(Var): - """A base (non-computed) var of the app state.""" - - # The name of the var. - _var_name: str = dataclasses.field() - - # The type of the var. - _var_type: Type = dataclasses.field(default=Any) - - # Whether this is a local javascript variable. - _var_is_local: bool = dataclasses.field(default=False) - - # Whether the var is a string literal. - _var_is_string: bool = dataclasses.field(default=False) - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool = dataclasses.field(default=False) - - # Extra metadata associated with the Var - _var_data: Optional[VarData] = dataclasses.field(default=None) - - def __hash__(self) -> int: - """Define a hash function for a var. - - Returns: - The hash of the var. - """ - return hash((self._var_name, str(self._var_type))) - - def get_default_value(self) -> Any: - """Get the default value of the var. - - Returns: - The default value of the var. - - Raises: - ImportError: If the var is a dataframe and pandas is not installed. - """ - if types.is_optional(self._var_type): - return None - - type_ = ( - get_origin(self._var_type) - if types.is_generic_alias(self._var_type) - else self._var_type - ) - if type_ is Literal: - args = get_args(self._var_type) - return args[0] if args else None - if issubclass(type_, str): - return "" - if issubclass(type_, types.get_args(Union[int, float])): - return 0 - if issubclass(type_, bool): - return False - if issubclass(type_, list): - return [] - if issubclass(type_, dict): - return {} - if issubclass(type_, tuple): - return () - if types.is_dataframe(type_): - try: - import pandas as pd - - return pd.DataFrame() - except ImportError as e: - raise ImportError( - "Please install pandas to use dataframes in your app." - ) from e - return set() if issubclass(type_, set) else None - - def get_setter_name(self, include_state: bool = True) -> str: - """Get the name of the var's generated setter function. - - Args: - include_state: Whether to include the state name in the setter name. - - Returns: - The name of the setter function. - """ - setter = constants.SETTER_PREFIX + self._var_name - if self._var_data is None: - return setter - if not include_state or self._var_data.state == "": - return setter - return ".".join((self._var_data.state, setter)) - - def get_setter(self) -> Callable[[BaseState, Any], None]: - """Get the var's setter function. - - Returns: - A function that that creates a setter for the var. - """ - - def setter(state: BaseState, value: Any): - """Get the setter for the var. - - Args: - state: The state within which we add the setter function. - value: The value to set. - """ - if self._var_type in [int, float]: - try: - value = self._var_type(value) - setattr(state, self._var_name, value) - except ValueError: - console.debug( - f"{type(state).__name__}.{self._var_name}: Failed conversion of {value} to '{self._var_type.__name__}'. Value not set.", - ) - else: - setattr(state, self._var_name, value) - - setter.__qualname__ = self.get_setter_name() - - return setter - - -@dataclasses.dataclass(init=False, eq=False) -class ComputedVar(Var, property): - """A field with computed getters.""" - - # Whether to track dependencies and cache computed values - _cache: bool = dataclasses.field(default=False) - - # Whether the computed var is a backend var - _backend: bool = dataclasses.field(default=False) - - # The initial value of the computed var - _initial_value: Any | types.Unset = dataclasses.field(default=types.Unset()) - - # Explicit var dependencies to track - _static_deps: set[str] = dataclasses.field(default_factory=set) - - # Whether var dependencies should be auto-determined - _auto_deps: bool = dataclasses.field(default=True) - - # Interval at which the computed var should be updated - _update_interval: Optional[datetime.timedelta] = dataclasses.field(default=None) - - # The name of the var. - _var_name: str = dataclasses.field() - - # The type of the var. - _var_type: Type = dataclasses.field(default=Any) - - # Whether this is a local javascript variable. - _var_is_local: bool = dataclasses.field(default=False) - - # Whether the var is a string literal. - _var_is_string: bool = dataclasses.field(default=False) - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool = dataclasses.field(default=False) - - # Extra metadata associated with the Var - _var_data: Optional[VarData] = dataclasses.field(default=None) - - def __init__( - self, - fget: Callable[[BaseState], Any], - initial_value: Any | types.Unset = types.Unset(), - cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[int, datetime.timedelta]] = None, - backend: bool | None = None, - **kwargs, - ): - """Initialize a ComputedVar. - - Args: - fget: The getter function. - initial_value: The initial value of the computed var. - cache: Whether to cache the computed value. - deps: Explicit var dependencies to track. - auto_deps: Whether var dependencies should be auto-determined. - interval: Interval at which the computed var should be updated. - backend: Whether the computed var is a backend var. - **kwargs: additional attributes to set on the instance - - Raises: - TypeError: If the computed var dependencies are not Var instances or var names. - """ - if backend is None: - backend = fget.__name__.startswith("_") - self._backend = backend - - self._initial_value = initial_value - self._cache = cache - if isinstance(interval, int): - interval = datetime.timedelta(seconds=interval) - self._update_interval = interval - if deps is None: - deps = [] - else: - for dep in deps: - if isinstance(dep, Var): - continue - if isinstance(dep, str) and dep != "": - continue - raise TypeError( - "ComputedVar dependencies must be Var instances or var names (non-empty strings)." - ) - self._static_deps = { - dep._var_name if isinstance(dep, Var) else dep for dep in deps - } - self._auto_deps = auto_deps - property.__init__(self, fget) - kwargs["_var_name"] = kwargs.pop("_var_name", fget.__name__) - kwargs["_var_type"] = kwargs.pop("_var_type", self._determine_var_type()) - BaseVar.__init__(self, **kwargs) # type: ignore - - @override - def _replace(self, merge_var_data=None, **kwargs: Any) -> ComputedVar: - """Replace the attributes of the ComputedVar. - - Args: - merge_var_data: VarData to merge into the existing VarData. - **kwargs: Var fields to update. - - Returns: - The new ComputedVar instance. - - Raises: - TypeError: If kwargs contains keys that are not allowed. - """ - field_values = dict( - fget=kwargs.pop("fget", self.fget), - initial_value=kwargs.pop("initial_value", self._initial_value), - cache=kwargs.pop("cache", self._cache), - deps=kwargs.pop("deps", self._static_deps), - auto_deps=kwargs.pop("auto_deps", self._auto_deps), - interval=kwargs.pop("interval", self._update_interval), - backend=kwargs.pop("backend", self._backend), - _var_name=kwargs.pop("_var_name", self._var_name), - _var_type=kwargs.pop("_var_type", self._var_type), - _var_is_local=kwargs.pop("_var_is_local", self._var_is_local), - _var_is_string=kwargs.pop("_var_is_string", self._var_is_string), - _var_full_name_needs_state_prefix=kwargs.pop( - "_var_full_name_needs_state_prefix", - self._var_full_name_needs_state_prefix, - ), - _var_data=VarData.merge(self._var_data, merge_var_data), - ) - - if kwargs: - unexpected_kwargs = ", ".join(kwargs.keys()) - raise TypeError(f"Unexpected keyword arguments: {unexpected_kwargs}") - - return ComputedVar(**field_values) - - @property - def _cache_attr(self) -> str: - """Get the attribute used to cache the value on the instance. - - Returns: - An attribute name. - """ - return f"__cached_{self._var_name}" - - @property - def _last_updated_attr(self) -> str: - """Get the attribute used to store the last updated timestamp. - - Returns: - An attribute name. - """ - return f"__last_updated_{self._var_name}" - - def needs_update(self, instance: BaseState) -> bool: - """Check if the computed var needs to be updated. - - Args: - instance: The state instance that the computed var is attached to. - - Returns: - True if the computed var needs to be updated, False otherwise. - """ - if self._update_interval is None: - return False - last_updated = getattr(instance, self._last_updated_attr, None) - if last_updated is None: - return True - return datetime.datetime.now() - last_updated > self._update_interval - - def __get__(self, instance: BaseState | None, owner): - """Get the ComputedVar value. - - If the value is already cached on the instance, return the cached value. - - Args: - instance: the instance of the class accessing this computed var. - owner: the class that this descriptor is attached to. - - Returns: - The value of the var for the given instance. - """ - if instance is None or not self._cache: - return super().__get__(instance, owner) - - # handle caching - if not hasattr(instance, self._cache_attr) or self.needs_update(instance): - # Set cache attr on state instance. - setattr(instance, self._cache_attr, super().__get__(instance, owner)) - # Ensure the computed var gets serialized to redis. - instance._was_touched = True - # Set the last updated timestamp on the state instance. - setattr(instance, self._last_updated_attr, datetime.datetime.now()) - return getattr(instance, self._cache_attr) - - def _deps( - self, - objclass: Type, - obj: FunctionType | CodeType | None = None, - self_name: Optional[str] = None, - ) -> set[str]: - """Determine var dependencies of this ComputedVar. - - Save references to attributes accessed on "self". Recursively called - when the function makes a method call on "self" or define comprehensions - or nested functions that may reference "self". - - Args: - objclass: the class obj this ComputedVar is attached to. - obj: the object to disassemble (defaults to the fget function). - self_name: if specified, look for this name in LOAD_FAST and LOAD_DEREF instructions. - - Returns: - A set of variable names accessed by the given obj. - - Raises: - VarValueError: if the function references the get_state, parent_state, or substates attributes - (cannot track deps in a related state, only implicitly via parent state). - """ - if not self._auto_deps: - return self._static_deps - d = self._static_deps.copy() - if obj is None: - fget = property.__getattribute__(self, "fget") - if fget is not None: - obj = cast(FunctionType, fget) - else: - return set() - with contextlib.suppress(AttributeError): - # unbox functools.partial - obj = cast(FunctionType, obj.func) # type: ignore - with contextlib.suppress(AttributeError): - # unbox EventHandler - obj = cast(FunctionType, obj.fn) # type: ignore - - if self_name is None and isinstance(obj, FunctionType): - try: - # the first argument to the function is the name of "self" arg - self_name = obj.__code__.co_varnames[0] - except (AttributeError, IndexError): - self_name = None - if self_name is None: - # cannot reference attributes on self if method takes no args - return set() - - invalid_names = ["get_state", "parent_state", "substates", "get_substate"] - self_is_top_of_stack = False - for instruction in dis.get_instructions(obj): - if ( - instruction.opname in ("LOAD_FAST", "LOAD_DEREF") - and instruction.argval == self_name - ): - # bytecode loaded the class instance to the top of stack, next load instruction - # is referencing an attribute on self - self_is_top_of_stack = True - continue - if self_is_top_of_stack and instruction.opname in ( - "LOAD_ATTR", - "LOAD_METHOD", - ): - try: - ref_obj = getattr(objclass, instruction.argval) - except Exception: - ref_obj = None - if instruction.argval in invalid_names: - raise VarValueError( - f"Cached var {self._var_full_name} cannot access arbitrary state via `{instruction.argval}`." - ) - if callable(ref_obj): - # recurse into callable attributes - d.update( - self._deps( - objclass=objclass, - obj=ref_obj, - ) - ) - # recurse into property fget functions - elif isinstance(ref_obj, property) and not isinstance( - ref_obj, ComputedVar - ): - d.update( - self._deps( - objclass=objclass, - obj=ref_obj.fget, # type: ignore - ) - ) - elif ( - instruction.argval in objclass.backend_vars - or instruction.argval in objclass.vars - ): - # var access - d.add(instruction.argval) - elif instruction.opname == "LOAD_CONST" and isinstance( - instruction.argval, CodeType - ): - # recurse into nested functions / comprehensions, which can reference - # instance attributes from the outer scope - d.update( - self._deps( - objclass=objclass, - obj=instruction.argval, - self_name=self_name, - ) - ) - self_is_top_of_stack = False - return d - - def mark_dirty(self, instance) -> None: - """Mark this ComputedVar as dirty. - - Args: - instance: the state instance that needs to recompute the value. - """ - with contextlib.suppress(AttributeError): - delattr(instance, self._cache_attr) - - def _determine_var_type(self) -> Type: - """Get the type of the var. - - Returns: - The type of the var. - """ - hints = get_type_hints(property.__getattribute__(self, "fget")) - if "return" in hints: - return hints["return"] - return Any - - -def computed_var( - fget: Callable[[BaseState], Any] | None = None, - initial_value: Any | types.Unset = types.Unset(), - cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[datetime.timedelta, int]] = None, - backend: bool | None = None, - **kwargs, -) -> ComputedVar | Callable[[Callable[[BaseState], Any]], ComputedVar]: - """A ComputedVar decorator with or without kwargs. - - Args: - fget: The getter function. - initial_value: The initial value of the computed var. - cache: Whether to cache the computed value. - deps: Explicit var dependencies to track. - auto_deps: Whether var dependencies should be auto-determined. - interval: Interval at which the computed var should be updated. - backend: Whether the computed var is a backend var. - **kwargs: additional attributes to set on the instance - - Returns: - A ComputedVar instance. - - Raises: - ValueError: If caching is disabled and an update interval is set. - VarDependencyError: If user supplies dependencies without caching. - """ - if cache is False and interval is not None: - raise ValueError("Cannot set update interval without caching.") - - if cache is False and (deps is not None or auto_deps is False): - raise VarDependencyError("Cannot track dependencies without caching.") - - if fget is not None: - return ComputedVar(fget=fget, cache=cache) - - def wrapper(fget: Callable[[BaseState], Any]) -> ComputedVar: - return ComputedVar( - fget=fget, - initial_value=initial_value, - cache=cache, - deps=deps, - auto_deps=auto_deps, - interval=interval, - backend=backend, - **kwargs, - ) - - return wrapper - - -class CallableVar(BaseVar): - """Decorate a Var-returning function to act as both a Var and a function. - - This is used as a compatibility shim for replacing Var objects in the - API with functions that return a family of Var. - """ - - def __init__(self, fn: Callable[..., BaseVar]): - """Initialize a CallableVar. - - Args: - fn: The function to decorate (must return Var) - """ - self.fn = fn - default_var = fn() - super().__init__(**dataclasses.asdict(default_var)) - - def __call__(self, *args, **kwargs) -> BaseVar: - """Call the decorated function. - - Args: - *args: The args to pass to the function. - **kwargs: The kwargs to pass to the function. - - Returns: - The Var returned from calling the function. - """ - return self.fn(*args, **kwargs) - - -def get_uuid_string_var() -> Var: +def get_uuid_string_var() -> ImmutableVar: """Return a Var that generates a single memoized UUID via .web/utils/state.js. useMemo with an empty dependency array ensures that the generated UUID is @@ -2615,6 +482,7 @@ def get_uuid_string_var() -> Var: Returns: A Var that generates a UUID at runtime. """ + from reflex.ivars import ImmutableVar from reflex.utils.imports import ImportVar unique_uuid_var = get_unique_variable_name() @@ -2626,7 +494,7 @@ def get_uuid_string_var() -> Var: hooks={f"const {unique_uuid_var} = useMemo(generateUUID, [])": None}, ) - return BaseVar( + return ImmutableVar( _var_name=unique_uuid_var, _var_type=str, _var_data=unique_uuid_var_data, diff --git a/reflex/vars.pyi b/reflex/vars.pyi deleted file mode 100644 index 8c923f03e..000000000 --- a/reflex/vars.pyi +++ /dev/null @@ -1,221 +0,0 @@ -"""Generated with stubgen from mypy, then manually edited, do not regen.""" - -from __future__ import annotations - -import datetime -from dataclasses import dataclass -from types import FunctionType -from typing import ( - Any, - Callable, - Dict, - Iterable, - List, - Optional, - Set, - Tuple, - Type, - Union, - _GenericAlias, # type: ignore - overload, -) - -from _typeshed import Incomplete - -from reflex import constants as constants -from reflex.base import Base as Base -from reflex.state import BaseState as BaseState -from reflex.state import State as State -from reflex.utils import console as console -from reflex.utils import format as format -from reflex.utils import types as types -from reflex.utils.imports import ImmutableParsedImportDict, ImportDict, ParsedImportDict - -USED_VARIABLES: Incomplete - -def get_unique_variable_name() -> str: ... -def _encode_var(value: Var) -> str: ... - -_global_vars: Dict[int, Var] - -def _decode_var(value: str) -> tuple[VarData, str]: ... -def _extract_var_data(value: Iterable) -> list[VarData | None]: ... - -class VarData(Base): - state: str = "" - imports: Union[ImportDict, ParsedImportDict] = {} - hooks: Dict[str, None] = {} - interpolations: List[Tuple[int, int]] = [] - @classmethod - def merge(cls, *others: ImmutableVarData | VarData | None) -> VarData | None: ... - -class ImmutableVarData: - state: str = "" - imports: ImmutableParsedImportDict = tuple() - hooks: Tuple[str, ...] = tuple() - def __init__( - self, - state: str = "", - imports: ImportDict | ParsedImportDict | None = None, - hooks: dict[str, None] | None = None, - ) -> None: ... - @classmethod - def merge( - cls, *others: ImmutableVarData | VarData | None - ) -> ImmutableVarData | None: ... - @classmethod - def from_state(cls, state: Type[BaseState] | str) -> ImmutableVarData: ... - -def _decode_var_immutable(value: str) -> tuple[ImmutableVarData, str]: ... - -class Var: - _var_name: str - _var_type: Type - _var_is_local: bool = False - _var_is_string: bool = False - _var_full_name_needs_state_prefix: bool = False - _var_data: VarData | None = None - @classmethod - def create( - cls, - value: Any, - _var_is_local: bool = True, - _var_is_string: bool | None = None, - _var_data: VarData | None = None, - ) -> Optional[Var]: ... - @classmethod - def create_safe( - cls, - value: Any, - _var_is_local: bool = True, - _var_is_string: bool | None = None, - _var_data: VarData | None = None, - ) -> Var: ... - @classmethod - def __class_getitem__(cls, type_: Type) -> _GenericAlias: ... - def _replace(self, merge_var_data=None, **kwargs: Any) -> BaseVar: ... - def equals(self, other: Var) -> bool: ... - def to_string(self) -> Var: ... - def __hash__(self) -> int: ... - def __format__(self, format_spec: str) -> str: ... - def __getitem__(self, i: Any) -> Var: ... - def __getattribute__(self, name: str) -> Var: ... - def operation( - self, - op: str = ..., - other: Optional[Var] = ..., - type_: Optional[Type] = ..., - flip: bool = ..., - fn: Optional[str] = ..., - ) -> Var: ... - def compare(self, op: str, other: Var) -> Var: ... - def __invert__(self) -> Var: ... - def __neg__(self) -> Var: ... - def __abs__(self) -> Var: ... - def length(self) -> Var: ... - def __eq__(self, other: Var) -> Var: ... - def __ne__(self, other: Var) -> Var: ... - def __gt__(self, other: Var) -> Var: ... - def __ge__(self, other: Var) -> Var: ... - def __lt__(self, other: Var) -> Var: ... - def __le__(self, other: Var) -> Var: ... - def __add__(self, other: Var) -> Var: ... - def __radd__(self, other: Var) -> Var: ... - def __sub__(self, other: Var) -> Var: ... - def __rsub__(self, other: Var) -> Var: ... - def __mul__(self, other: Var) -> Var: ... - def __rmul__(self, other: Var) -> Var: ... - def __pow__(self, other: Var) -> Var: ... - def __rpow__(self, other: Var) -> Var: ... - def __truediv__(self, other: Var) -> Var: ... - def __rtruediv__(self, other: Var) -> Var: ... - def __floordiv__(self, other: Var) -> Var: ... - def __mod__(self, other: Var) -> Var: ... - def __rmod__(self, other: Var) -> Var: ... - def __and__(self, other: Var) -> Var: ... - def __rand__(self, other: Var) -> Var: ... - def __or__(self, other: Var) -> Var: ... - def __ror__(self, other: Var) -> Var: ... - def __contains__(self, _: Any) -> Var: ... - def contains(self, other: Any, field: Union[Var, None] = None) -> Var: ... - def reverse(self) -> Var: ... - def foreach(self, fn: Callable) -> Var: ... - @classmethod - def range( - cls, - v1: Var | int = 0, - v2: Var | int | None = None, - step: Var | int | None = None, - ) -> Var: ... - def to(self, type_: Type) -> Var: ... - def as_ref(self) -> Var: ... - @property - def _var_full_name(self) -> str: ... - def _var_set_state(self, state: Type[BaseState] | str) -> Any: ... - def _get_all_var_data(self) -> VarData | ImmutableVarData: ... - def json(self) -> str: ... - def _type(self) -> Var: ... - -@dataclass(eq=False) -class BaseVar(Var): - _var_name: str - _var_type: Any - _var_is_local: bool = False - _var_is_string: bool = False - _var_full_name_needs_state_prefix: bool = False - _var_data: VarData | None = None - def __hash__(self) -> int: ... - def get_default_value(self) -> Any: ... - def get_setter_name(self, include_state: bool = ...) -> str: ... - def get_setter(self) -> Callable[[BaseState, Any], None]: ... - -@dataclass(init=False) -class ComputedVar(Var): - _var_cache: bool - fget: FunctionType - @property - def _cache_attr(self) -> str: ... - def __get__(self, instance, owner): ... - def _deps(self, objclass: Type, obj: Optional[FunctionType] = ...) -> Set[str]: ... - def _replace(self, merge_var_data=None, **kwargs: Any) -> ComputedVar: ... - def mark_dirty(self, instance) -> None: ... - def needs_update(self, instance) -> bool: ... - def _determine_var_type(self) -> Type: ... - @overload - def __init__( - self, - fget: Callable[[BaseState], Any], - **kwargs, - ) -> None: ... - @overload - def __init__(self, func) -> None: ... - -@overload -def computed_var( - fget: Callable[[BaseState], Any] | None = None, - initial_value: Any | types.Unset = types.Unset(), - cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[datetime.timedelta, int]] = None, - **kwargs, -) -> Callable[[Callable[[Any], Any]], ComputedVar]: ... -@overload -def computed_var(fget: Callable[[Any], Any]) -> ComputedVar: ... -@overload -def cached_var( - fget: Callable[[BaseState], Any] | None = None, - initial_value: Any | types.Unset = types.Unset(), - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[datetime.timedelta, int]] = None, - **kwargs, -) -> Callable[[Callable[[Any], Any]], ComputedVar]: ... -@overload -def cached_var(fget: Callable[[Any], Any]) -> ComputedVar: ... - -class CallableVar(BaseVar): - def __init__(self, fn: Callable[..., BaseVar]): ... - def __call__(self, *args, **kwargs) -> BaseVar: ... - -def get_uuid_string_var() -> Var: ... diff --git a/tests/components/core/test_banner.py b/tests/components/core/test_banner.py index f46ee16b1..02b030902 100644 --- a/tests/components/core/test_banner.py +++ b/tests/components/core/test_banner.py @@ -19,12 +19,14 @@ def test_websocket_target_url(): def test_connection_banner(): banner = ConnectionBanner.create() _imports = banner._get_all_imports(collapse=True) - assert tuple(_imports) == ( - "react", - "/utils/context", - "/utils/state", - "@radix-ui/themes@^3.0.0", - "/env.json", + assert sorted(tuple(_imports)) == sorted( + ( + "react", + "/utils/context", + "/utils/state", + "@radix-ui/themes@^3.0.0", + "/env.json", + ) ) msg = "Connection error" @@ -35,12 +37,14 @@ def test_connection_banner(): def test_connection_modal(): modal = ConnectionModal.create() _imports = modal._get_all_imports(collapse=True) - assert tuple(_imports) == ( - "react", - "/utils/context", - "/utils/state", - "@radix-ui/themes@^3.0.0", - "/env.json", + assert sorted(tuple(_imports)) == sorted( + ( + "react", + "/utils/context", + "/utils/state", + "@radix-ui/themes@^3.0.0", + "/env.json", + ) ) msg = "Connection error" diff --git a/tests/components/core/test_colors.py b/tests/components/core/test_colors.py index ace7adad6..4907bb486 100644 --- a/tests/components/core/test_colors.py +++ b/tests/components/core/test_colors.py @@ -54,8 +54,8 @@ def create_color_var(color): ], ) def test_color(color, expected): - assert color._var_is_string or color._var_type is str - assert color._var_full_name == expected + assert color._var_type is str + assert str(color) == expected if color._var_type == Color: assert str(color) == f"{{`{expected}`}}" else: diff --git a/tests/components/core/test_cond.py b/tests/components/core/test_cond.py index 53f8e0640..eb2fe200a 100644 --- a/tests/components/core/test_cond.py +++ b/tests/components/core/test_cond.py @@ -9,7 +9,6 @@ from reflex.components.radix.themes.typography.text import Text from reflex.ivars.base import ImmutableVar, LiteralVar, immutable_computed_var from reflex.state import BaseState, State from reflex.utils.format import format_state_name -from reflex.vars import Var @pytest.fixture @@ -76,7 +75,7 @@ def test_validate_cond(cond_state: BaseState): (32, 0), ("hello", ""), (2.3, 0.0), - (Var.create("a"), Var.create("b")), + (LiteralVar.create("a"), LiteralVar.create("b")), ], ) def test_prop_cond(c1: Any, c2: Any): @@ -92,18 +91,18 @@ def test_prop_cond(c1: Any, c2: Any): c2, ) - assert isinstance(prop_cond, Var) - if not isinstance(c1, Var): + assert isinstance(prop_cond, ImmutableVar) + if not isinstance(c1, ImmutableVar): c1 = json.dumps(c1) - if not isinstance(c2, Var): + if not isinstance(c2, ImmutableVar): c2 = json.dumps(c2) - assert str(prop_cond) == f"(true ? {c1} : {c2})" + assert str(prop_cond) == f"(true ? {str(c1)} : {str(c2)})" def test_cond_no_mix(): """Test if cond can't mix components and props.""" with pytest.raises(ValueError): - cond(True, Var.create("hello"), Text.create("world")) + cond(True, LiteralVar.create("hello"), Text.create("world")) def test_cond_no_else(): diff --git a/tests/components/core/test_debounce.py b/tests/components/core/test_debounce.py index 95feb7ae6..c4a18e610 100644 --- a/tests/components/core/test_debounce.py +++ b/tests/components/core/test_debounce.py @@ -4,7 +4,7 @@ import pytest import reflex as rx from reflex.components.core.debounce import DEFAULT_DEBOUNCE_TIMEOUT -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState @@ -100,7 +100,7 @@ def test_render_with_key(): def test_render_with_special_props(): - special_prop = rx.Var.create_safe("{foo_bar}", _var_is_string=False) + special_prop = ImmutableVar.create_safe("{foo_bar}") tag = rx.debounce_input( rx.input( on_change=S.on_change, diff --git a/tests/components/core/test_foreach.py b/tests/components/core/test_foreach.py index f1fae2577..53459f92d 100644 --- a/tests/components/core/test_foreach.py +++ b/tests/components/core/test_foreach.py @@ -12,8 +12,10 @@ from reflex.components.core.foreach import ( ) from reflex.components.radix.themes.layout.box import box from reflex.components.radix.themes.typography.text import text +from reflex.ivars.base import ImmutableVar +from reflex.ivars.number import NumberVar +from reflex.ivars.sequence import ArrayVar from reflex.state import BaseState, ComponentState -from reflex.vars import Var class ForEachState(BaseState): @@ -113,7 +115,7 @@ def display_colors_set(color): return box(text(color)) -def display_nested_list_element(element: Var[str], index: Var[int]): +def display_nested_list_element(element: ArrayVar[List[str]], index: NumberVar[int]): assert element._var_type == List[str] assert index._var_type == int return box(text(element[index])) @@ -236,7 +238,7 @@ def test_foreach_render(state_var, render_fn, render_dict): # Make sure the index vars are unique. arg_index = rend["arg_index"] - assert isinstance(arg_index, Var) + assert isinstance(arg_index, ImmutableVar) assert arg_index._var_name not in seen_index_vars assert arg_index._var_type == int seen_index_vars.add(arg_index._var_name) diff --git a/tests/components/core/test_match.py b/tests/components/core/test_match.py index 1843b914d..f2cc97f25 100644 --- a/tests/components/core/test_match.py +++ b/tests/components/core/test_match.py @@ -4,9 +4,9 @@ import pytest import reflex as rx from reflex.components.core.match import Match +from reflex.ivars.base import ImmutableVar from reflex.state import BaseState from reflex.utils.exceptions import MatchTypeError -from reflex.vars import Var class MatchState(BaseState): @@ -135,8 +135,8 @@ def test_match_vars(cases, expected): expected: The expected var full name. """ match_comp = Match.create(MatchState.value, *cases) - assert isinstance(match_comp, Var) - assert match_comp._var_full_name == expected + assert isinstance(match_comp, ImmutableVar) + assert str(match_comp) == expected def test_match_on_component_without_default(): @@ -261,7 +261,7 @@ def test_match_case_tuple_elements(match_case): rx.text("default value"), ), 'Match cases should have the same return types. Case 3 with return value ` {"first value"} ` ' - "of type is not ", + "of type is not ", ), ], ) diff --git a/tests/components/core/test_upload.py b/tests/components/core/test_upload.py index e6b27effc..cf7bafcd3 100644 --- a/tests/components/core/test_upload.py +++ b/tests/components/core/test_upload.py @@ -7,8 +7,8 @@ from reflex.components.core.upload import ( get_upload_url, ) from reflex.event import EventSpec +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import State -from reflex.vars import Var class TestUploadState(State): @@ -38,11 +38,11 @@ def test_cancel_upload(): def test_get_upload_url(): url = get_upload_url("foo_file") - assert isinstance(url, Var) + assert isinstance(url, ImmutableVar) def test__on_drop_spec(): - assert isinstance(_on_drop_spec(Var.create([])), list) + assert isinstance(_on_drop_spec(LiteralVar.create([])), list) def test_upload_create(): diff --git a/tests/components/forms/test_form.py b/tests/components/forms/test_form.py index b979d261a..efb31b97a 100644 --- a/tests/components/forms/test_form.py +++ b/tests/components/forms/test_form.py @@ -1,12 +1,12 @@ from reflex_chakra.components.forms.form import Form from reflex.event import EventChain -from reflex.vars import BaseVar +from reflex.ivars.base import ImmutableVar def test_render_on_submit(): """Test that on_submit event chain is rendered as a separate function.""" - submit_it = BaseVar( + submit_it = ImmutableVar( _var_name="submit_it", _var_type=EventChain, ) diff --git a/tests/components/radix/test_icon_button.py b/tests/components/radix/test_icon_button.py index 852c0c97c..b80611c02 100644 --- a/tests/components/radix/test_icon_button.py +++ b/tests/components/radix/test_icon_button.py @@ -2,8 +2,8 @@ import pytest from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.icon_button import IconButton +from reflex.ivars.base import LiteralVar from reflex.style import Style -from reflex.vars import Var def test_icon_button(): @@ -26,5 +26,5 @@ def test_icon_button_size_prop(): ib1 = IconButton.create("activity", size="2") assert isinstance(ib1, IconButton) - ib2 = IconButton.create("activity", size=Var.create("2")) + ib2 = IconButton.create("activity", size=LiteralVar.create("2")) assert isinstance(ib2, IconButton) diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 3c824ed01..3ce5decad 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -18,13 +18,13 @@ from reflex.components.component import ( ) from reflex.constants import EventTriggers from reflex.event import EventChain, EventHandler, parse_args_spec -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.style import Style from reflex.utils import imports from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.imports import ImportDict, ImportVar, ParsedImportDict, parse_imports -from reflex.vars import BaseVar, Var, VarData +from reflex.vars import Var, VarData @pytest.fixture @@ -270,121 +270,121 @@ def test_create_component(component1): [ pytest.param( "text", - Var.create("hello"), + LiteralVar.create("hello"), None, id="text", ), pytest.param( "text", - BaseVar(_var_name="hello", _var_type=Optional[str]), + ImmutableVar(_var_name="hello", _var_type=Optional[str]), None, id="text-optional", ), pytest.param( "text", - BaseVar(_var_name="hello", _var_type=Union[str, None]), + ImmutableVar(_var_name="hello", _var_type=Union[str, None]), None, id="text-union-str-none", ), pytest.param( "text", - BaseVar(_var_name="hello", _var_type=Union[None, str]), + ImmutableVar(_var_name="hello", _var_type=Union[None, str]), None, id="text-union-none-str", ), pytest.param( "text", - Var.create(1), + LiteralVar.create(1), TypeError, id="text-int", ), pytest.param( "number", - Var.create(1), + LiteralVar.create(1), None, id="number", ), pytest.param( "number", - BaseVar(_var_name="1", _var_type=Optional[int]), + ImmutableVar(_var_name="1", _var_type=Optional[int]), None, id="number-optional", ), pytest.param( "number", - BaseVar(_var_name="1", _var_type=Union[int, None]), + ImmutableVar(_var_name="1", _var_type=Union[int, None]), None, id="number-union-int-none", ), pytest.param( "number", - BaseVar(_var_name="1", _var_type=Union[None, int]), + ImmutableVar(_var_name="1", _var_type=Union[None, int]), None, id="number-union-none-int", ), pytest.param( "number", - Var.create("1"), + LiteralVar.create("1"), TypeError, id="number-str", ), pytest.param( "text_or_number", - Var.create("hello"), + LiteralVar.create("hello"), None, id="text_or_number-str", ), pytest.param( "text_or_number", - Var.create(1), + LiteralVar.create(1), None, id="text_or_number-int", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Optional[str]), + ImmutableVar(_var_name="hello", _var_type=Optional[str]), None, id="text_or_number-optional-str", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Union[str, None]), + ImmutableVar(_var_name="hello", _var_type=Union[str, None]), None, id="text_or_number-union-str-none", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Union[None, str]), + ImmutableVar(_var_name="hello", _var_type=Union[None, str]), None, id="text_or_number-union-none-str", ), pytest.param( "text_or_number", - BaseVar(_var_name="1", _var_type=Optional[int]), + ImmutableVar(_var_name="1", _var_type=Optional[int]), None, id="text_or_number-optional-int", ), pytest.param( "text_or_number", - BaseVar(_var_name="1", _var_type=Union[int, None]), + ImmutableVar(_var_name="1", _var_type=Union[int, None]), None, id="text_or_number-union-int-none", ), pytest.param( "text_or_number", - BaseVar(_var_name="1", _var_type=Union[None, int]), + ImmutableVar(_var_name="1", _var_type=Union[None, int]), None, id="text_or_number-union-none-int", ), pytest.param( "text_or_number", - Var.create(1.0), + LiteralVar.create(1.0), TypeError, id="text_or_number-float", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Optional[Union[str, int]]), + ImmutableVar(_var_name="hello", _var_type=Optional[Union[str, int]]), None, id="text_or_number-optional-union-str-int", ), @@ -393,7 +393,7 @@ def test_create_component(component1): def test_create_component_prop_validation( component1: Type[Component], prop_name: str, - var: Union[Var, str, int], + var: Union[ImmutableVar, str, int], expected: Type[Exception], ): """Test that component props are validated correctly. @@ -874,7 +874,7 @@ def test_custom_component_wrapper(): from reflex.components.radix.themes.typography.text import Text ccomponent = my_component( - rx.text("child"), width=Var.create(1), color=Var.create("red") + rx.text("child"), width=LiteralVar.create(1), color=LiteralVar.create("red") ) assert isinstance(ccomponent, CustomComponent) assert len(ccomponent.children) == 1 @@ -1175,13 +1175,12 @@ TEST_VAR = LiteralVar.create("test")._replace( hooks={"useTest": None}, imports={"test": [ImportVar(tag="test")]}, state="Test", - interpolations=[], ) ) FORMATTED_TEST_VAR = LiteralVar.create(f"foo{TEST_VAR}bar") STYLE_VAR = TEST_VAR._replace(_var_name="style") EVENT_CHAIN_VAR = TEST_VAR._replace(_var_type=EventChain) -ARG_VAR = Var.create("arg") +ARG_VAR = ImmutableVar.create_safe("arg") TEST_VAR_DICT_OF_DICT = LiteralVar.create({"a": {"b": "test"}})._replace( merge_var_data=TEST_VAR._var_data @@ -1401,6 +1400,7 @@ class EventState(rx.State): def test_get_vars(component, exp_vars): comp_vars = sorted(component._get_vars(), key=lambda v: v._var_name) assert len(comp_vars) == len(exp_vars) + print(comp_vars, exp_vars) for comp_var, exp_var in zip( comp_vars, sorted(exp_vars, key=lambda v: v._var_name), @@ -1518,7 +1518,7 @@ def test_validate_valid_children(): True, rx.fragment(valid_component2()), rx.fragment( - rx.foreach(Var.create([1, 2, 3]), lambda x: valid_component2(x)) # type: ignore + rx.foreach(LiteralVar.create([1, 2, 3]), lambda x: valid_component2(x)) # type: ignore ), ) ) @@ -1578,7 +1578,7 @@ def test_validate_valid_parents(): rx.fragment(valid_component3()), rx.fragment( rx.foreach( - Var.create([1, 2, 3]), # type: ignore + LiteralVar.create([1, 2, 3]), # type: ignore lambda x: valid_component2(valid_component3(x)), ) ), @@ -1645,7 +1645,9 @@ def test_validate_invalid_children(): True, rx.fragment(invalid_component()), rx.fragment( - rx.foreach(Var.create([1, 2, 3]), lambda x: invalid_component(x)) # type: ignore + rx.foreach( + LiteralVar.create([1, 2, 3]), lambda x: invalid_component(x) + ) # type: ignore ), ) ) @@ -2027,7 +2029,7 @@ def test_component_add_hooks_var(): return [ "const hook3 = useRef(null)", "const hook1 = 42", - Var.create( + ImmutableVar.create( "useEffect(() => () => {}, [])", _var_data=VarData( hooks={ @@ -2037,7 +2039,7 @@ def test_component_add_hooks_var(): imports={"react": [ImportVar(tag="useEffect")]}, ), ), - Var.create( + ImmutableVar.create( "const hook3 = useRef(null)", _var_data=VarData( imports={"react": [ImportVar(tag="useRef")]}, @@ -2150,7 +2152,9 @@ class TriggerState(rx.State): rx.text("random text", on_click=TriggerState.do_something), rx.text( "random text", - on_click=BaseVar(_var_name="toggleColorMode", _var_type=EventChain), + on_click=ImmutableVar( + _var_name="toggleColorMode", _var_type=EventChain + ), ), ), True, @@ -2160,7 +2164,9 @@ class TriggerState(rx.State): rx.text("random text", on_click=rx.console_log("log")), rx.text( "random text", - on_click=BaseVar(_var_name="toggleColorMode", _var_type=EventChain), + on_click=ImmutableVar( + _var_name="toggleColorMode", _var_type=EventChain + ), ), ), False, diff --git a/tests/components/test_tag.py b/tests/components/test_tag.py index d43f73842..b4b37cc28 100644 --- a/tests/components/test_tag.py +++ b/tests/components/test_tag.py @@ -3,8 +3,7 @@ from typing import Dict, List import pytest from reflex.components.tags import CondTag, Tag, tagless -from reflex.ivars.base import LiteralVar -from reflex.vars import BaseVar, Var +from reflex.ivars.base import ImmutableVar, LiteralVar @pytest.mark.parametrize( @@ -17,7 +16,7 @@ from reflex.vars import BaseVar, Var ({"key": True, "key2": "value2"}, ["key={true}", 'key2={"value2"}']), ], ) -def test_format_props(props: Dict[str, Var], test_props: List): +def test_format_props(props: Dict[str, ImmutableVar], test_props: List): """Test that the formatted props are correct. Args: @@ -41,7 +40,7 @@ def test_format_props(props: Dict[str, Var], test_props: List): (None, False), ], ) -def test_is_valid_prop(prop: Var, valid: bool): +def test_is_valid_prop(prop: ImmutableVar, valid: bool): """Test that the prop is valid. Args: @@ -111,7 +110,7 @@ def test_format_cond_tag(): tag = CondTag( true_value=dict(Tag(name="h1", contents="True content")), false_value=dict(Tag(name="h2", contents="False content")), - cond=BaseVar(_var_name="logged_in", _var_type=bool), + cond=ImmutableVar(_var_name="logged_in", _var_type=bool), ) tag_dict = dict(tag) cond, true_value, false_value = ( diff --git a/tests/test_app.py b/tests/test_app.py index ab7b50bdf..167cbf0d4 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -35,6 +35,7 @@ from reflex.components.base.fragment import Fragment from reflex.components.core.cond import Cond from reflex.components.radix.themes.typography.text import Text from reflex.event import Event +from reflex.ivars.base import immutable_computed_var from reflex.middleware import HydrateMiddleware from reflex.model import Model from reflex.state import ( @@ -50,7 +51,6 @@ from reflex.state import ( ) from reflex.style import Style from reflex.utils import exceptions, format -from reflex.vars import computed_var from .conftest import chdir from .states import ( @@ -906,7 +906,7 @@ class DynamicState(BaseState): """Increment the counter var.""" self.counter = self.counter + 1 - @computed_var(cache=True) + @immutable_computed_var(cache=True) def comp_dynamic(self) -> str: """A computed var that depends on the dynamic var. @@ -1499,11 +1499,11 @@ def test_app_with_valid_var_dependencies(compilable_app: tuple[App, Path]): base: int = 0 _backend: int = 0 - @computed_var(cache=True) + @immutable_computed_var(cache=True) def foo(self) -> str: return "foo" - @computed_var(deps=["_backend", "base", foo], cache=True) + @immutable_computed_var(deps=["_backend", "base", foo], cache=True) def bar(self) -> str: return "bar" @@ -1515,7 +1515,7 @@ def test_app_with_invalid_var_dependencies(compilable_app: tuple[App, Path]): app, _ = compilable_app class InvalidDepState(BaseState): - @computed_var(deps=["foolksjdf"], cache=True) + @immutable_computed_var(deps=["foolksjdf"], cache=True) def bar(self) -> str: return "bar" diff --git a/tests/test_event.py b/tests/test_event.py index a484e0a3c..c538ce069 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -7,10 +7,9 @@ from reflex.event import Event, EventHandler, EventSpec, call_event_handler, fix from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.utils import format -from reflex.vars import Var -def make_var(value) -> Var: +def make_var(value) -> ImmutableVar: """Make a variable. Args: @@ -19,9 +18,7 @@ def make_var(value) -> Var: Returns: The var. """ - var = Var.create(value) - assert var is not None - return var + return ImmutableVar.create_safe(value) def test_create_event(): @@ -57,10 +54,10 @@ def test_call_event_handler(): # Test passing vars as args. assert event_spec.handler == handler - assert event_spec.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec.args[0][1].equals(Var.create_safe("first")) - assert event_spec.args[1][0].equals(Var.create_safe("arg2")) - assert event_spec.args[1][1].equals(Var.create_safe("second")) + assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec.args[0][1].equals(ImmutableVar.create_safe("first")) + assert event_spec.args[1][0].equals(ImmutableVar.create_safe("arg2")) + assert event_spec.args[1][1].equals(ImmutableVar.create_safe("second")) assert ( format.format_event(event_spec) == 'Event("test_fn_with_args", {arg1:first,arg2:second})' @@ -82,9 +79,9 @@ def test_call_event_handler(): ) assert event_spec.handler == handler - assert event_spec.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec.args[0][1].equals(Var.create_safe(first)) - assert event_spec.args[1][0].equals(Var.create_safe("arg2")) + assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec.args[0][1].equals(LiteralVar.create(first)) + assert event_spec.args[1][0].equals(ImmutableVar.create_safe("arg2")) assert event_spec.args[1][1].equals(LiteralVar.create(second)) handler = EventHandler(fn=test_fn_with_args) @@ -109,17 +106,17 @@ def test_call_event_handler_partial(): assert event_spec.handler == handler assert len(event_spec.args) == 1 - assert event_spec.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec.args[0][1].equals(Var.create_safe("first")) + assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec.args[0][1].equals(ImmutableVar.create_safe("first")) assert format.format_event(event_spec) == 'Event("test_fn_with_args", {arg1:first})' assert event_spec2 is not event_spec assert event_spec2.handler == handler assert len(event_spec2.args) == 2 - assert event_spec2.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec2.args[0][1].equals(Var.create_safe("first")) - assert event_spec2.args[1][0].equals(Var.create_safe("arg2")) - assert event_spec2.args[1][1].equals(Var.create_safe("_a2")) + assert event_spec2.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec2.args[0][1].equals(ImmutableVar.create_safe("first")) + assert event_spec2.args[1][0].equals(ImmutableVar.create_safe("arg2")) + assert event_spec2.args[1][1].equals(ImmutableVar.create_safe("_a2")) assert ( format.format_event(event_spec2) == 'Event("test_fn_with_args", {arg1:first,arg2:_a2})' @@ -171,7 +168,7 @@ def test_fix_events(arg1, arg2): 'Event("_redirect", {path:"/path",external:false,replace:false})', ), ( - (Var.create_safe("path"), None, None), + (ImmutableVar.create_safe("path"), None, None), 'Event("_redirect", {path:path,external:false,replace:false})', ), ( @@ -237,7 +234,7 @@ def test_set_focus(): spec = event.set_focus("input1") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_set_focus" - assert spec.args[0][0].equals(Var.create_safe("ref")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("ref")) assert spec.args[0][1].equals(LiteralVar.create("ref_input1")) assert format.format_event(spec) == 'Event("_set_focus", {ref:"ref_input1"})' spec = event.set_focus("input1") @@ -249,9 +246,9 @@ def test_set_value(): spec = event.set_value("input1", "") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_set_value" - assert spec.args[0][0].equals(Var.create_safe("ref")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("ref")) assert spec.args[0][1].equals(LiteralVar.create("ref_input1")) - assert spec.args[1][0].equals(Var.create_safe("value")) + assert spec.args[1][0].equals(ImmutableVar.create_safe("value")) assert spec.args[1][1].equals(LiteralVar.create("")) assert ( format.format_event(spec) == 'Event("_set_value", {ref:"ref_input1",value:""})' @@ -268,9 +265,9 @@ def test_remove_cookie(): spec = event.remove_cookie("testkey") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_cookie" - assert spec.args[0][0].equals(Var.create_safe("key")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(Var.create_safe("options")) + assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) assert spec.args[1][1].equals(LiteralVar.create({"path": "/"})) assert ( format.format_event(spec) @@ -289,9 +286,9 @@ def test_remove_cookie_with_options(): spec = event.remove_cookie("testkey", options) assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_cookie" - assert spec.args[0][0].equals(Var.create_safe("key")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(Var.create_safe("options")) + assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) assert spec.args[1][1].equals(LiteralVar.create(options)) assert ( format.format_event(spec) @@ -313,7 +310,7 @@ def test_remove_local_storage(): spec = event.remove_local_storage("testkey") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_local_storage" - assert spec.args[0][0].equals(Var.create_safe("key")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) assert ( format.format_event(spec) == 'Event("_remove_local_storage", {key:"testkey"})' diff --git a/tests/test_state.py b/tests/test_state.py index 0344ea052..29944840e 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -22,6 +22,7 @@ from reflex.base import Base from reflex.components.sonner.toast import Toaster from reflex.constants import CompileVars, RouteVar, SocketEvent from reflex.event import Event, EventHandler +from reflex.ivars.base import ImmutableComputedVar, ImmutableVar from reflex.state import ( BaseState, ImmutableStateError, @@ -41,7 +42,6 @@ from reflex.state import ( from reflex.testing import chdir from reflex.utils import format, prerequisites, types from reflex.utils.format import json_dumps -from reflex.vars import BaseVar, ComputedVar, Var from tests.states.mutation import MutableSQLAModel, MutableTestState from .states import GenState @@ -102,7 +102,7 @@ class TestState(BaseState): fig: Figure = Figure() dt: datetime.datetime = datetime.datetime.fromisoformat("1989-11-09T18:53:00+01:00") - @ComputedVar + @ImmutableComputedVar def sum(self) -> float: """Dynamically sum the numbers. @@ -111,7 +111,7 @@ class TestState(BaseState): """ return self.num1 + self.num2 - @ComputedVar + @ImmutableComputedVar def upper(self) -> str: """Uppercase the key. @@ -267,7 +267,7 @@ def test_base_class_vars(test_state): if field in test_state.get_skip_vars(): continue prop = getattr(cls, field) - assert isinstance(prop, Var) + assert isinstance(prop, ImmutableVar) assert prop._var_name.split(".")[-1] == field assert cls.num1._var_type == int @@ -518,10 +518,10 @@ def test_set_class_var(): with pytest.raises(AttributeError): TestState.num3 # type: ignore TestState._set_var( - BaseVar(_var_name="num3", _var_type=int)._var_set_state(TestState) + ImmutableVar(_var_name="num3", _var_type=int)._var_set_state(TestState) ) var = TestState.num3 # type: ignore - assert var._var_name == "num3" + assert var._var_name == TestState.get_full_name() + ".num3" assert var._var_type == int assert var._var_state == TestState.get_full_name() @@ -1102,7 +1102,7 @@ def test_child_state(): v: int = 2 class ChildState(MainState): - @ComputedVar + @ImmutableComputedVar def rendered_var(self): return self.v @@ -1121,7 +1121,7 @@ def test_conditional_computed_vars(): t1: str = "a" t2: str = "b" - @ComputedVar + @ImmutableComputedVar def rendered_var(self) -> str: if self.flag: return self.t1 @@ -3068,12 +3068,12 @@ def test_potentially_dirty_substates(): """ class State(RxState): - @ComputedVar + @ImmutableComputedVar def foo(self) -> str: return "" class C1(State): - @ComputedVar + @ImmutableComputedVar def bar(self) -> str: return "" diff --git a/tests/test_style.py b/tests/test_style.py index 8fa443cdf..e170fe614 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -9,7 +9,7 @@ from reflex import style from reflex.components.component import evaluate_style_namespaces from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import VarData test_style = [ ({"a": 1}, {"a": 1}), @@ -81,7 +81,7 @@ def compare_dict_of_var(d1: dict[str, Any], d2: dict[str, Any]): assert key in d2 if isinstance(value, dict): compare_dict_of_var(value, d2[key]) - elif isinstance(value, Var): + elif isinstance(value, ImmutableVar): assert value.equals(d2[key]) else: assert value == d2[key] @@ -504,7 +504,7 @@ def test_style_via_component_with_state( comp = rx.el.div(**kwargs) assert ( - ImmutableVarData.merge(comp.style._var_data) + VarData.merge(comp.style._var_data) == expected_get_style["css"]._get_all_var_data() ) # Assert that style values are equal. diff --git a/tests/test_var.py b/tests/test_var.py index ba9cf24c8..bf66561b2 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -9,8 +9,10 @@ from pandas import DataFrame from reflex.base import Base from reflex.constants.base import REFLEX_VAR_CLOSING_TAG, REFLEX_VAR_OPENING_TAG from reflex.ivars.base import ( + ImmutableComputedVar, ImmutableVar, LiteralVar, + immutable_computed_var, var_operation, var_operation_return, ) @@ -20,7 +22,7 @@ from reflex.ivars.number import ( LiteralNumberVar, NumberVar, ) -from reflex.ivars.object import LiteralObjectVar +from reflex.ivars.object import LiteralObjectVar, ObjectVar from reflex.ivars.sequence import ( ArrayVar, ConcatVarOperation, @@ -30,22 +32,16 @@ from reflex.ivars.sequence import ( from reflex.state import BaseState from reflex.utils.imports import ImportVar from reflex.vars import ( - BaseVar, - ComputedVar, - ImmutableVarData, Var, VarData, - computed_var, ) test_vars = [ - BaseVar(_var_name="prop1", _var_type=int), - BaseVar(_var_name="key", _var_type=str), - BaseVar(_var_name="value", _var_type=str)._var_set_state("state"), - BaseVar(_var_name="local", _var_type=str, _var_is_local=True)._var_set_state( - "state" - ), - BaseVar(_var_name="local2", _var_type=str, _var_is_local=True), + ImmutableVar(_var_name="prop1", _var_type=int), + ImmutableVar(_var_name="key", _var_type=str), + ImmutableVar(_var_name="value", _var_type=str)._var_set_state("state"), + ImmutableVar(_var_name="local", _var_type=str)._var_set_state("state"), + ImmutableVar(_var_name="local2", _var_type=str), ] @@ -71,7 +67,7 @@ def ParentState(TestObj): foo: int bar: int - @computed_var + @immutable_computed_var def var_without_annotation(self): return TestObj @@ -81,7 +77,7 @@ def ParentState(TestObj): @pytest.fixture def ChildState(ParentState, TestObj): class ChildState(ParentState): - @computed_var + @immutable_computed_var def var_without_annotation(self): return TestObj @@ -91,7 +87,7 @@ def ChildState(ParentState, TestObj): @pytest.fixture def GrandChildState(ChildState, TestObj): class GrandChildState(ChildState): - @computed_var + @immutable_computed_var def var_without_annotation(self): return TestObj @@ -101,7 +97,7 @@ def GrandChildState(ChildState, TestObj): @pytest.fixture def StateWithAnyVar(TestObj): class StateWithAnyVar(BaseState): - @computed_var + @immutable_computed_var def var_without_annotation(self) -> typing.Any: return TestObj @@ -111,7 +107,7 @@ def StateWithAnyVar(TestObj): @pytest.fixture def StateWithCorrectVarAnnotation(): class StateWithCorrectVarAnnotation(BaseState): - @computed_var + @immutable_computed_var def var_with_annotation(self) -> str: return "Correct annotation" @@ -121,7 +117,7 @@ def StateWithCorrectVarAnnotation(): @pytest.fixture def StateWithWrongVarAnnotation(TestObj): class StateWithWrongVarAnnotation(BaseState): - @computed_var + @immutable_computed_var def var_with_annotation(self) -> str: return TestObj @@ -131,7 +127,7 @@ def StateWithWrongVarAnnotation(TestObj): @pytest.fixture def StateWithInitialComputedVar(): class StateWithInitialComputedVar(BaseState): - @computed_var(initial_value="Initial value") + @immutable_computed_var(initial_value="Initial value") def var_with_initial_value(self) -> str: return "Runtime value" @@ -141,7 +137,7 @@ def StateWithInitialComputedVar(): @pytest.fixture def ChildWithInitialComputedVar(StateWithInitialComputedVar): class ChildWithInitialComputedVar(StateWithInitialComputedVar): - @computed_var(initial_value="Initial value") + @immutable_computed_var(initial_value="Initial value") def var_with_initial_value_child(self) -> str: return "Runtime value" @@ -151,7 +147,7 @@ def ChildWithInitialComputedVar(StateWithInitialComputedVar): @pytest.fixture def StateWithRuntimeOnlyVar(): class StateWithRuntimeOnlyVar(BaseState): - @computed_var(initial_value=None) + @immutable_computed_var(initial_value=None) def var_raises_at_runtime(self) -> str: raise ValueError("So nicht, mein Freund") @@ -161,7 +157,7 @@ def StateWithRuntimeOnlyVar(): @pytest.fixture def ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): class ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): - @computed_var(initial_value="Initial value") + @immutable_computed_var(initial_value="Initial value") def var_raises_at_runtime_child(self) -> str: raise ValueError("So nicht, mein Freund") @@ -188,14 +184,14 @@ def test_full_name(prop, expected): prop: The var to test. expected: The expected full name. """ - assert prop._var_full_name == expected + assert str(prop) == expected @pytest.mark.parametrize( "prop,expected", zip( test_vars, - ["{prop1}", "{key}", "{state.value}", "state.local", "local2"], + ["prop1", "key", "state.value", "state.local", "local2"], ), ) def test_str(prop, expected): @@ -211,14 +207,14 @@ def test_str(prop, expected): @pytest.mark.parametrize( "prop,expected", [ - (BaseVar(_var_name="p", _var_type=int), 0), - (BaseVar(_var_name="p", _var_type=float), 0.0), - (BaseVar(_var_name="p", _var_type=str), ""), - (BaseVar(_var_name="p", _var_type=bool), False), - (BaseVar(_var_name="p", _var_type=list), []), - (BaseVar(_var_name="p", _var_type=dict), {}), - (BaseVar(_var_name="p", _var_type=tuple), ()), - (BaseVar(_var_name="p", _var_type=set), set()), + (ImmutableVar(_var_name="p", _var_type=int), 0), + (ImmutableVar(_var_name="p", _var_type=float), 0.0), + (ImmutableVar(_var_name="p", _var_type=str), ""), + (ImmutableVar(_var_name="p", _var_type=bool), False), + (ImmutableVar(_var_name="p", _var_type=list), []), + (ImmutableVar(_var_name="p", _var_type=dict), {}), + (ImmutableVar(_var_name="p", _var_type=tuple), ()), + (ImmutableVar(_var_name="p", _var_type=set), set()), ], ) def test_default_value(prop, expected): @@ -257,14 +253,16 @@ def test_get_setter(prop, expected): @pytest.mark.parametrize( "value,expected", [ - (None, None), - (1, BaseVar(_var_name="1", _var_type=int, _var_is_local=True)), - ("key", BaseVar(_var_name="key", _var_type=str, _var_is_local=True)), - (3.14, BaseVar(_var_name="3.14", _var_type=float, _var_is_local=True)), - ([1, 2, 3], BaseVar(_var_name="[1, 2, 3]", _var_type=list, _var_is_local=True)), + (None, ImmutableVar(_var_name="null", _var_type=None)), + (1, ImmutableVar(_var_name="1", _var_type=int)), + ("key", ImmutableVar(_var_name='"key"', _var_type=str)), + (3.14, ImmutableVar(_var_name="3.14", _var_type=float)), + ([1, 2, 3], ImmutableVar(_var_name="[1, 2, 3]", _var_type=List[int])), ( {"a": 1, "b": 2}, - BaseVar(_var_name='{"a": 1, "b": 2}', _var_type=dict, _var_is_local=True), + ImmutableVar( + _var_name='({ ["a"] : 1, ["b"] : 2 })', _var_type=Dict[str, int] + ), ), ], ) @@ -275,11 +273,8 @@ def test_create(value, expected): value: The value to create a var from. expected: The expected name of the setter function. """ - prop = Var.create(value) - if value is None: - assert prop == expected - else: - assert prop.equals(expected) # type: ignore + prop = LiteralVar.create(value) + assert prop.equals(expected) # type: ignore def test_create_type_error(): @@ -291,17 +286,11 @@ def test_create_type_error(): value = ErrorType() with pytest.raises(TypeError): - Var.create(value) + LiteralVar.create(value) -def v(value) -> Var: - val = ( - Var.create(json.dumps(value), _var_is_string=True, _var_is_local=False) - if isinstance(value, str) - else Var.create(value, _var_is_local=False) - ) - assert val is not None - return val +def v(value) -> ImmutableVar: + return LiteralVar.create(value) def test_basic_operations(TestObj): @@ -310,129 +299,78 @@ def test_basic_operations(TestObj): Args: TestObj: The test object. """ - assert str(v(1) == v(2)) == "{((1) === (2))}" - assert str(v(1) != v(2)) == "{((1) !== (2))}" - assert str(v(1) < v(2)) == "{((1) < (2))}" - assert str(v(1) <= v(2)) == "{((1) <= (2))}" - assert str(v(1) > v(2)) == "{((1) > (2))}" - assert str(v(1) >= v(2)) == "{((1) >= (2))}" - assert str(v(1) + v(2)) == "{((1) + (2))}" - assert str(v(1) - v(2)) == "{((1) - (2))}" - assert str(v(1) * v(2)) == "{((1) * (2))}" - assert str(v(1) / v(2)) == "{((1) / (2))}" - assert str(v(1) // v(2)) == "{Math.floor((1) / (2))}" - assert str(v(1) % v(2)) == "{((1) % (2))}" - assert str(v(1) ** v(2)) == "{Math.pow((1) , (2))}" - assert str(v(1) & v(2)) == "{((1) && (2))}" - assert str(v(1) | v(2)) == "{((1) || (2))}" - assert str(v([1, 2, 3])[v(0)]) == "{[1, 2, 3].at(0)}" - assert str(v({"a": 1, "b": 2})["a"]) == '{{"a": 1, "b": 2}["a"]}' - assert str(v("foo") == v("bar")) == '{(("foo") === ("bar"))}' + assert str(v(1) == v(2)) == "(1 === 2)" + assert str(v(1) != v(2)) == "(1 !== 2)" + assert str(LiteralNumberVar.create(1) < 2) == "(1 < 2)" + assert str(LiteralNumberVar.create(1) <= 2) == "(1 <= 2)" + assert str(LiteralNumberVar.create(1) > 2) == "(1 > 2)" + assert str(LiteralNumberVar.create(1) >= 2) == "(1 >= 2)" + assert str(LiteralNumberVar.create(1) + 2) == "(1 + 2)" + assert str(LiteralNumberVar.create(1) - 2) == "(1 - 2)" + assert str(LiteralNumberVar.create(1) * 2) == "(1 * 2)" + assert str(LiteralNumberVar.create(1) / 2) == "(1 / 2)" + assert str(LiteralNumberVar.create(1) // 2) == "Math.floor(1 / 2)" + assert str(LiteralNumberVar.create(1) % 2) == "(1 % 2)" + assert str(LiteralNumberVar.create(1) ** 2) == "(1 ** 2)" + assert str(LiteralNumberVar.create(1) & v(2)) == "(1 && 2)" + assert str(LiteralNumberVar.create(1) | v(2)) == "(1 || 2)" + assert str(LiteralArrayVar.create([1, 2, 3])[0]) == "[1, 2, 3].at(0)" assert ( - str( - Var.create("foo", _var_is_local=False) - == Var.create("bar", _var_is_local=False) - ) - == "{((foo) === (bar))}" + str(LiteralObjectVar.create({"a": 1, "b": 2})["a"]) + == '({ ["a"] : 1, ["b"] : 2 })["a"]' + ) + assert str(v("foo") == v("bar")) == '("foo" === "bar")' + assert ( + str(ImmutableVar.create("foo") == ImmutableVar.create("bar")) == "(foo === bar)" ) assert ( - str( - BaseVar( - _var_name="foo", _var_type=str, _var_is_string=True, _var_is_local=True - ) - == BaseVar( - _var_name="bar", _var_type=str, _var_is_string=True, _var_is_local=True - ) - ) - == "((`foo`) === (`bar`))" + str(LiteralVar.create("foo") == LiteralVar.create("bar")) == '("foo" === "bar")' ) + print(ImmutableVar(_var_name="foo").to(ObjectVar, TestObj)._var_set_state("state")) assert ( str( - BaseVar( - _var_name="foo", - _var_type=TestObj, - _var_is_string=True, - _var_is_local=False, - ) + ImmutableVar(_var_name="foo") + .to(ObjectVar, TestObj) ._var_set_state("state") .bar - == BaseVar( - _var_name="bar", _var_type=str, _var_is_string=True, _var_is_local=True - ) + == LiteralVar.create("bar") ) - == "{((state.foo.bar) === (`bar`))}" + == '(state.foo["bar"] === "bar")' ) assert ( - str(BaseVar(_var_name="foo", _var_type=TestObj)._var_set_state("state").bar) - == "{state.foo.bar}" + str( + ImmutableVar(_var_name="foo") + .to(ObjectVar, TestObj) + ._var_set_state("state") + .bar + ) + == 'state.foo["bar"]' + ) + assert str(abs(LiteralNumberVar.create(1))) == "Math.abs(1)" + assert str(LiteralArrayVar.create([1, 2, 3]).length()) == "[1, 2, 3].length" + assert ( + str(LiteralArrayVar.create([1, 2]) + LiteralArrayVar.create([3, 4])) + == "[...[1, 2], ...[3, 4]]" ) - assert str(abs(v(1))) == "{Math.abs(1)}" - assert str(v([1, 2, 3]).length()) == "{[1, 2, 3].length}" - assert str(v([1, 2]) + v([3, 4])) == "{spreadArraysOrObjects(([1, 2]) , ([3, 4]))}" # Tests for reverse operation - assert str(v([1, 2, 3]).reverse()) == "{[...[1, 2, 3]].reverse()}" - assert str(v(["1", "2", "3"]).reverse()) == '{[...["1", "2", "3"]].reverse()}' assert ( - str(BaseVar(_var_name="foo", _var_type=list)._var_set_state("state").reverse()) - == "{[...state.foo].reverse()}" + str(LiteralArrayVar.create([1, 2, 3]).reverse()) + == "[1, 2, 3].slice().reverse()" ) assert ( - str(BaseVar(_var_name="foo", _var_type=list).reverse()) - == "{[...foo].reverse()}" - ) - assert str(BaseVar(_var_name="foo", _var_type=str)._type()) == "{typeof foo}" # type: ignore - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == str) # type: ignore - == "{((typeof foo) === (`string`))}" + str(LiteralArrayVar.create(["1", "2", "3"]).reverse()) + == '["1", "2", "3"].slice().reverse()' ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == str) # type: ignore - == "{((typeof foo) === (`string`))}" + str(ImmutableVar(_var_name="foo")._var_set_state("state").to(list).reverse()) + == "state.foo.slice().reverse()" ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == int) # type: ignore - == "{((typeof foo) === (`number`))}" + str(ImmutableVar(_var_name="foo").to(list).reverse()) == "foo.slice().reverse()" ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == list) # type: ignore - == "{((typeof foo) === (`Array`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == float) # type: ignore - == "{((typeof foo) === (`number`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == tuple) # type: ignore - == "{((typeof foo) === (`Array`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == dict) # type: ignore - == "{((typeof foo) === (`Object`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != str) # type: ignore - == "{((typeof foo) !== (`string`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != int) # type: ignore - == "{((typeof foo) !== (`number`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != list) # type: ignore - == "{((typeof foo) !== (`Array`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != float) # type: ignore - == "{((typeof foo) !== (`number`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != tuple) # type: ignore - == "{((typeof foo) !== (`Array`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != dict) # type: ignore - == "{((typeof foo) !== (`Object`))}" + str(ImmutableVar(_var_name="foo", _var_type=str).js_type()) == "(typeof(foo))" ) @@ -442,76 +380,81 @@ def test_basic_operations(TestObj): (v([1, 2, 3]), "[1, 2, 3]"), (v(set([1, 2, 3])), "[1, 2, 3]"), (v(["1", "2", "3"]), '["1", "2", "3"]'), - (BaseVar(_var_name="foo", _var_type=list)._var_set_state("state"), "state.foo"), - (BaseVar(_var_name="foo", _var_type=list), "foo"), + ( + ImmutableVar(_var_name="foo")._var_set_state("state").to(list), + "state.foo", + ), + (ImmutableVar(_var_name="foo").to(list), "foo"), (v((1, 2, 3)), "[1, 2, 3]"), (v(("1", "2", "3")), '["1", "2", "3"]'), ( - BaseVar(_var_name="foo", _var_type=tuple)._var_set_state("state"), + ImmutableVar(_var_name="foo")._var_set_state("state").to(tuple), "state.foo", ), - (BaseVar(_var_name="foo", _var_type=tuple), "foo"), + (ImmutableVar(_var_name="foo").to(tuple), "foo"), ], ) def test_list_tuple_contains(var, expected): - assert str(var.contains(1)) == f"{{{expected}.includes(1)}}" - assert str(var.contains("1")) == f'{{{expected}.includes("1")}}' - assert str(var.contains(v(1))) == f"{{{expected}.includes(1)}}" - assert str(var.contains(v("1"))) == f'{{{expected}.includes("1")}}' - other_state_var = BaseVar(_var_name="other", _var_type=str)._var_set_state("state") - other_var = BaseVar(_var_name="other", _var_type=str) - assert str(var.contains(other_state_var)) == f"{{{expected}.includes(state.other)}}" - assert str(var.contains(other_var)) == f"{{{expected}.includes(other)}}" + assert str(var.contains(1)) == f"{expected}.includes(1)" + assert str(var.contains("1")) == f'{expected}.includes("1")' + assert str(var.contains(v(1))) == f"{expected}.includes(1)" + assert str(var.contains(v("1"))) == f'{expected}.includes("1")' + other_state_var = ImmutableVar(_var_name="other", _var_type=str)._var_set_state( + "state" + ) + other_var = ImmutableVar(_var_name="other", _var_type=str) + assert str(var.contains(other_state_var)) == f"{expected}.includes(state.other)" + assert str(var.contains(other_var)) == f"{expected}.includes(other)" @pytest.mark.parametrize( "var, expected", [ (v("123"), json.dumps("123")), - (BaseVar(_var_name="foo", _var_type=str)._var_set_state("state"), "state.foo"), - (BaseVar(_var_name="foo", _var_type=str), "foo"), + (ImmutableVar(_var_name="foo")._var_set_state("state").to(str), "state.foo"), + (ImmutableVar(_var_name="foo").to(str), "foo"), ], ) def test_str_contains(var, expected): - assert str(var.contains("1")) == f'{{{expected}.includes("1")}}' - assert str(var.contains(v("1"))) == f'{{{expected}.includes("1")}}' - other_state_var = BaseVar(_var_name="other", _var_type=str)._var_set_state("state") - other_var = BaseVar(_var_name="other", _var_type=str) - assert str(var.contains(other_state_var)) == f"{{{expected}.includes(state.other)}}" - assert str(var.contains(other_var)) == f"{{{expected}.includes(other)}}" + assert str(var.contains("1")) == f'{expected}.includes("1")' + assert str(var.contains(v("1"))) == f'{expected}.includes("1")' + other_state_var = ImmutableVar(_var_name="other")._var_set_state("state").to(str) + other_var = ImmutableVar(_var_name="other").to(str) + assert str(var.contains(other_state_var)) == f"{expected}.includes(state.other)" + assert str(var.contains(other_var)) == f"{expected}.includes(other)" assert ( - str(var.contains("1", "hello")) == f'{{{expected}.some(e=>e[`hello`]==="1")}}' + str(var.contains("1", "hello")) + == f'{expected}.some(obj => obj["hello"] === "1")' ) @pytest.mark.parametrize( "var, expected", [ - (v({"a": 1, "b": 2}), '{"a": 1, "b": 2}'), - (BaseVar(_var_name="foo", _var_type=dict)._var_set_state("state"), "state.foo"), - (BaseVar(_var_name="foo", _var_type=dict), "foo"), + (v({"a": 1, "b": 2}), '({ ["a"] : 1, ["b"] : 2 })'), + (ImmutableVar(_var_name="foo")._var_set_state("state").to(dict), "state.foo"), + (ImmutableVar(_var_name="foo").to(dict), "foo"), ], ) def test_dict_contains(var, expected): - assert str(var.contains(1)) == f"{{{expected}.hasOwnProperty(1)}}" - assert str(var.contains("1")) == f'{{{expected}.hasOwnProperty("1")}}' - assert str(var.contains(v(1))) == f"{{{expected}.hasOwnProperty(1)}}" - assert str(var.contains(v("1"))) == f'{{{expected}.hasOwnProperty("1")}}' - other_state_var = BaseVar(_var_name="other", _var_type=str)._var_set_state("state") - other_var = BaseVar(_var_name="other", _var_type=str) + assert str(var.contains(1)) == f"{expected}.hasOwnProperty(1)" + assert str(var.contains("1")) == f'{expected}.hasOwnProperty("1")' + assert str(var.contains(v(1))) == f"{expected}.hasOwnProperty(1)" + assert str(var.contains(v("1"))) == f'{expected}.hasOwnProperty("1")' + other_state_var = ImmutableVar(_var_name="other")._var_set_state("state").to(str) + other_var = ImmutableVar(_var_name="other").to(str) assert ( - str(var.contains(other_state_var)) - == f"{{{expected}.hasOwnProperty(state.other)}}" + str(var.contains(other_state_var)) == f"{expected}.hasOwnProperty(state.other)" ) - assert str(var.contains(other_var)) == f"{{{expected}.hasOwnProperty(other)}}" + assert str(var.contains(other_var)) == f"{expected}.hasOwnProperty(other)" @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="list", _var_type=List[int]), - BaseVar(_var_name="tuple", _var_type=Tuple[int, int]), - BaseVar(_var_name="str", _var_type=str), + ImmutableVar(_var_name="list", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="tuple", _var_type=Tuple[int, int]).guess_type(), + ImmutableVar(_var_name="str", _var_type=str).guess_type(), ], ) def test_var_indexing_lists(var): @@ -521,18 +464,21 @@ def test_var_indexing_lists(var): var : The str, list or tuple base var. """ # Test basic indexing. - assert str(var[0]) == f"{{{var._var_name}.at(0)}}" - assert str(var[1]) == f"{{{var._var_name}.at(1)}}" + assert str(var[0]) == f"{var._var_name}.at(0)" + assert str(var[1]) == f"{var._var_name}.at(1)" # Test negative indexing. - assert str(var[-1]) == f"{{{var._var_name}.at(-1)}}" + assert str(var[-1]) == f"{var._var_name}.at(-1)" @pytest.mark.parametrize( "var, type_", [ - (BaseVar(_var_name="list", _var_type=List[int]), [int, int]), - (BaseVar(_var_name="tuple", _var_type=Tuple[int, str]), [int, str]), + (ImmutableVar(_var_name="list", _var_type=List[int]).guess_type(), [int, int]), + ( + ImmutableVar(_var_name="tuple", _var_type=Tuple[int, str]).guess_type(), + [int, str], + ), ], ) def test_var_indexing_types(var, type_): @@ -549,99 +495,105 @@ def test_var_indexing_types(var, type_): def test_var_indexing_str(): """Test that we can index into str vars.""" - str_var = BaseVar(_var_name="str", _var_type=str) + str_var = ImmutableVar(_var_name="str").to(str) # Test that indexing gives a type of Var[str]. - assert isinstance(str_var[0], Var) + assert isinstance(str_var[0], ImmutableVar) assert str_var[0]._var_type == str # Test basic indexing. - assert str(str_var[0]) == "{str.at(0)}" - assert str(str_var[1]) == "{str.at(1)}" + assert str(str_var[0]) == "str.at(0)" + assert str(str_var[1]) == "str.at(1)" # Test negative indexing. - assert str(str_var[-1]) == "{str.at(-1)}" + assert str(str_var[-1]) == "str.at(-1)" @pytest.mark.parametrize( "var", [ - (BaseVar(_var_name="foo", _var_type=int)), - (BaseVar(_var_name="bar", _var_type=float)), + (ImmutableVar(_var_name="foo", _var_type=int).guess_type()), + (ImmutableVar(_var_name="bar", _var_type=float).guess_type()), ], ) def test_var_replace_with_invalid_kwargs(var): with pytest.raises(TypeError) as excinfo: var._replace(_this_should_fail=True) - assert "Unexpected keyword arguments" in str(excinfo.value) + assert "unexpected keyword argument" in str(excinfo.value) def test_computed_var_replace_with_invalid_kwargs(): - @computed_var(initial_value=1) + @immutable_computed_var(initial_value=1) def test_var(state) -> int: return 1 with pytest.raises(TypeError) as excinfo: test_var._replace(_random_kwarg=True) - assert "Unexpected keyword arguments" in str(excinfo.value) + assert "Unexpected keyword argument" in str(excinfo.value) @pytest.mark.parametrize( "var, index", [ - (BaseVar(_var_name="lst", _var_type=List[int]), [1, 2]), - (BaseVar(_var_name="lst", _var_type=List[int]), {"name": "dict"}), - (BaseVar(_var_name="lst", _var_type=List[int]), {"set"}), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), [1, 2]), ( - BaseVar(_var_name="lst", _var_type=List[int]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + {"name": "dict"}, + ), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), {"set"}), + ( + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), ( 1, 2, ), ), - (BaseVar(_var_name="lst", _var_type=List[int]), 1.5), - (BaseVar(_var_name="lst", _var_type=List[int]), "str"), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), 1.5), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), "str"), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="string_var", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="float_var", _var_type=float), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="list_var", _var_type=List[int]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="set_var", _var_type=Set[str]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), ), - (BaseVar(_var_name="str", _var_type=str), [1, 2]), - (BaseVar(_var_name="lst", _var_type=str), {"name": "dict"}), - (BaseVar(_var_name="lst", _var_type=str), {"set"}), + (ImmutableVar(_var_name="str", _var_type=str).guess_type(), [1, 2]), + (ImmutableVar(_var_name="lst", _var_type=str).guess_type(), {"name": "dict"}), + (ImmutableVar(_var_name="lst", _var_type=str).guess_type(), {"set"}), ( - BaseVar(_var_name="lst", _var_type=str), - BaseVar(_var_name="string_var", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=str).guess_type(), + ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=str), - BaseVar(_var_name="float_var", _var_type=float), + ImmutableVar(_var_name="lst", _var_type=str).guess_type(), + ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), ), - (BaseVar(_var_name="str", _var_type=Tuple[str]), [1, 2]), - (BaseVar(_var_name="lst", _var_type=Tuple[str]), {"name": "dict"}), - (BaseVar(_var_name="lst", _var_type=Tuple[str]), {"set"}), + (ImmutableVar(_var_name="str", _var_type=Tuple[str]).guess_type(), [1, 2]), ( - BaseVar(_var_name="lst", _var_type=Tuple[str]), - BaseVar(_var_name="string_var", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), + {"name": "dict"}, + ), + (ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), {"set"}), + ( + ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), + ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=Tuple[str]), - BaseVar(_var_name="float_var", _var_type=float), + ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), + ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), ), ], ) @@ -659,9 +611,8 @@ def test_var_unsupported_indexing_lists(var, index): @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="tuple", _var_type=Tuple[int, int]), - BaseVar(_var_name="str", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="tuple", _var_type=Tuple[int, int]).guess_type(), ], ) def test_var_list_slicing(var): @@ -670,84 +621,105 @@ def test_var_list_slicing(var): Args: var : The str, list or tuple base var. """ - assert str(var[:1]) == f"{{{var._var_name}.slice(0, 1)}}" - assert str(var[:1]) == f"{{{var._var_name}.slice(0, 1)}}" - assert str(var[:]) == f"{{{var._var_name}.slice(0, undefined)}}" + assert str(var[:1]) == f"{var._var_name}.slice(undefined, 1)" + assert str(var[1:]) == f"{var._var_name}.slice(1, undefined)" + assert str(var[:]) == f"{var._var_name}.slice(undefined, undefined)" + + +def test_str_var_slicing(): + """Test that we can slice into str vars.""" + str_var = ImmutableVar(_var_name="str").to(str) + + # Test that slicing gives a type of Var[str]. + assert isinstance(str_var[:1], ImmutableVar) + assert str_var[:1]._var_type == str + + # Test basic slicing. + assert str(str_var[:1]) == 'str.split("").slice(undefined, 1).join("")' + assert str(str_var[1:]) == 'str.split("").slice(1, undefined).join("")' + assert str(str_var[:]) == 'str.split("").slice(undefined, undefined).join("")' + assert str(str_var[1:2]) == 'str.split("").slice(1, 2).join("")' + + # Test negative slicing. + assert str(str_var[:-1]) == 'str.split("").slice(undefined, -1).join("")' + assert str(str_var[-1:]) == 'str.split("").slice(-1, undefined).join("")' + assert str(str_var[:-2]) == 'str.split("").slice(undefined, -2).join("")' + assert str(str_var[-2:]) == 'str.split("").slice(-2, undefined).join("")' def test_dict_indexing(): """Test that we can index into dict vars.""" - dct = BaseVar(_var_name="dct", _var_type=Dict[str, int]) + dct = ImmutableVar(_var_name="dct").to(ObjectVar, Dict[str, str]) # Check correct indexing. - assert str(dct["a"]) == '{dct["a"]}' - assert str(dct["asdf"]) == '{dct["asdf"]}' + assert str(dct["a"]) == 'dct["a"]' + assert str(dct["asdf"]) == 'dct["asdf"]' @pytest.mark.parametrize( "var, index", [ ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), [1, 2], ), ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), {"name": "dict"}, ), ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), {"set"}, ), ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), ( 1, 2, ), ), ( - BaseVar(_var_name="lst", _var_type=Dict[str, str]), - BaseVar(_var_name="list_var", _var_type=List[int]), + ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), + ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=Dict[str, str]), - BaseVar(_var_name="set_var", _var_type=Set[str]), + ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), + ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=Dict[str, str]), - BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), + ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), + ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), [1, 2], ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), {"name": "dict"}, ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), {"set"}, ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), ( 1, 2, ), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), - BaseVar(_var_name="list_var", _var_type=List[int]), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), - BaseVar(_var_name="set_var", _var_type=Set[str]), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), - BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), ), ], ) @@ -1079,7 +1051,9 @@ def nested_base(): bar: Boo baz: int - parent_obj = LiteralVar.create(Foo(bar=Boo(foo="bar", bar=5), baz=5)) + parent_obj = LiteralObjectVar.create( + Foo(bar=Boo(foo="bar", bar=5), baz=5).dict(), Foo + ) assert ( str(parent_obj.bar.foo) @@ -1104,7 +1078,7 @@ def test_retrival(): assert REFLEX_VAR_OPENING_TAG in f_string assert REFLEX_VAR_CLOSING_TAG in f_string - result_var_data = Var.create_safe(f_string)._var_data + result_var_data = LiteralVar.create(f_string)._get_all_var_data() result_immutable_var_data = ImmutableVar.create_safe(f_string)._var_data assert result_var_data is not None and result_immutable_var_data is not None assert ( @@ -1114,30 +1088,18 @@ def test_retrival(): ) assert ( result_var_data.imports - == ( - result_immutable_var_data.imports - if isinstance(result_immutable_var_data.imports, dict) - else { - k: list(v) - for k, v in result_immutable_var_data.imports - if k in original_var_data.imports - } - ) + == result_immutable_var_data.imports == original_var_data.imports ) assert ( - list(result_var_data.hooks.keys()) - == ( - list(result_immutable_var_data.hooks.keys()) - if isinstance(result_immutable_var_data.hooks, dict) - else list(result_immutable_var_data.hooks) - ) - == list(original_var_data.hooks.keys()) + tuple(result_var_data.hooks) + == tuple(result_immutable_var_data.hooks) + == tuple(original_var_data.hooks) ) def test_fstring_concat(): - original_var_with_data = Var.create_safe( + original_var_with_data = LiteralVar.create( "imagination", _var_data=VarData(state="fear") ) @@ -1160,9 +1122,9 @@ def test_fstring_concat(): ), ) - assert str(string_concat) == '("foo"+imagination+"bar"+consequences+"baz")' + assert str(string_concat) == '("fooimaginationbar"+consequences+"baz")' assert isinstance(string_concat, ConcatVarOperation) - assert string_concat._get_all_var_data() == ImmutableVarData( + assert string_concat._get_all_var_data() == VarData( state="fear", imports={ "react": [ImportVar(tag="useRef")], @@ -1172,17 +1134,22 @@ def test_fstring_concat(): ) +var = ImmutableVar(_var_name="var", _var_type=str) +myvar = ImmutableVar(_var_name="myvar", _var_type=int)._var_set_state("state") +x = ImmutableVar(_var_name="x", _var_type=str) + + @pytest.mark.parametrize( "out, expected", [ - (f"{BaseVar(_var_name='var', _var_type=str)}", "${var}"), + (f"{var}", f"{hash(var)}var"), ( - f"testing f-string with {BaseVar(_var_name='myvar', _var_type=int)._var_set_state('state')}", - 'testing f-string with ${"state": "state", "interpolations": [], "imports": {"/utils/context": [{"tag": "StateContexts", "is_default": false, "alias": null, "install": true, "render": true, "transpile": false}], "react": [{"tag": "useContext", "is_default": false, "alias": null, "install": true, "render": true, "transpile": false}]}, "hooks": {"const state = useContext(StateContexts.state)": null}, "string_length": 13}{state.myvar}', + f"testing f-string with {myvar}", + f"testing f-string with {hash(myvar)}state.myvar", ), ( - f"testing local f-string {BaseVar(_var_name='x', _var_is_local=True, _var_type=str)}", - "testing local f-string x", + f"testing local f-string {x}", + f"testing local f-string {hash(x)}x", ), ], ) @@ -1195,8 +1162,8 @@ def test_fstrings(out, expected): [ ([1], ""), ({"a": 1}, ""), - ([Var.create_safe(1)._var_set_state("foo")], "foo"), - ({"a": Var.create_safe(1)._var_set_state("foo")}, "foo"), + ([LiteralVar.create(1)._var_set_state("foo")], "foo"), + ({"a": LiteralVar.create(1)._var_set_state("foo")}, "foo"), ], ) def test_extract_state_from_container(value, expect_state): @@ -1206,7 +1173,9 @@ def test_extract_state_from_container(value, expect_state): value: The value to create a var from. expect_state: The expected state. """ - assert Var.create_safe(value)._var_state == expect_state + var_data = LiteralVar.create(value)._get_all_var_data() + var_state = var_data.state if var_data else "" + assert var_state == expect_state @pytest.mark.parametrize( @@ -1222,25 +1191,21 @@ def test_fstring_roundtrip(value): Args: value: The value to create a Var from. """ - var = BaseVar.create_safe(value)._var_set_state("state") - rt_var = Var.create_safe(f"{var}") + var = ImmutableVar.create_safe(value)._var_set_state("state") + rt_var = LiteralVar.create(f"{var}") assert var._var_state == rt_var._var_state - assert var._var_full_name_needs_state_prefix - assert not rt_var._var_full_name_needs_state_prefix - assert rt_var._var_name == var._var_full_name + assert str(rt_var) == str(var) @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="var", _var_type=int), - BaseVar(_var_name="var", _var_type=float), - BaseVar(_var_name="var", _var_type=str), - BaseVar(_var_name="var", _var_type=bool), - BaseVar(_var_name="var", _var_type=dict), - BaseVar(_var_name="var", _var_type=tuple), - BaseVar(_var_name="var", _var_type=set), - BaseVar(_var_name="var", _var_type=None), + ImmutableVar(_var_name="var", _var_type=int).guess_type(), + ImmutableVar(_var_name="var", _var_type=float).guess_type(), + ImmutableVar(_var_name="var", _var_type=str).guess_type(), + ImmutableVar(_var_name="var", _var_type=bool).guess_type(), + ImmutableVar(_var_name="var", _var_type=dict).guess_type(), + ImmutableVar(_var_name="var", _var_type=None).guess_type(), ], ) def test_unsupported_types_for_reverse(var): @@ -1251,16 +1216,16 @@ def test_unsupported_types_for_reverse(var): """ with pytest.raises(TypeError) as err: var.reverse() - assert err.value.args[0] == f"Cannot reverse non-list var var." + assert err.value.args[0] == f"Cannot reverse non-list var." @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="var", _var_type=int), - BaseVar(_var_name="var", _var_type=float), - BaseVar(_var_name="var", _var_type=bool), - BaseVar(_var_name="var", _var_type=None), + ImmutableVar(_var_name="var", _var_type=int).guess_type(), + ImmutableVar(_var_name="var", _var_type=float).guess_type(), + ImmutableVar(_var_name="var", _var_type=bool).guess_type(), + ImmutableVar(_var_name="var", _var_type=None).guess_type(), ], ) def test_unsupported_types_for_contains(var): @@ -1273,34 +1238,34 @@ def test_unsupported_types_for_contains(var): assert var.contains(1) assert ( err.value.args[0] - == f"Var var of type {var._var_type} does not support contains check." + == f"Var of type {var._var_type} does not support contains check." ) @pytest.mark.parametrize( "other", [ - BaseVar(_var_name="other", _var_type=int), - BaseVar(_var_name="other", _var_type=float), - BaseVar(_var_name="other", _var_type=bool), - BaseVar(_var_name="other", _var_type=list), - BaseVar(_var_name="other", _var_type=dict), - BaseVar(_var_name="other", _var_type=tuple), - BaseVar(_var_name="other", _var_type=set), + ImmutableVar(_var_name="other", _var_type=int).guess_type(), + ImmutableVar(_var_name="other", _var_type=float).guess_type(), + ImmutableVar(_var_name="other", _var_type=bool).guess_type(), + ImmutableVar(_var_name="other", _var_type=list).guess_type(), + ImmutableVar(_var_name="other", _var_type=dict).guess_type(), + ImmutableVar(_var_name="other", _var_type=tuple).guess_type(), + ImmutableVar(_var_name="other", _var_type=set).guess_type(), ], ) def test_unsupported_types_for_string_contains(other): with pytest.raises(TypeError) as err: - assert BaseVar(_var_name="var", _var_type=str).contains(other) + assert ImmutableVar(_var_name="var").to(str).contains(other) assert ( err.value.args[0] - == f"'in ' requires string as left operand, not {other._var_type}" + == f"Unsupported Operand type(s) for contains: ToStringOperation, {type(other).__name__}" ) def test_unsupported_default_contains(): with pytest.raises(TypeError) as err: - assert 1 in BaseVar(_var_name="var", _var_type=str) + assert 1 in ImmutableVar(_var_name="var", _var_type=str).guess_type() assert ( err.value.args[0] == "'in' operator not supported for Var types, use Var.contains() instead." @@ -1311,8 +1276,8 @@ def test_unsupported_default_contains(): "operand1_var,operand2_var,operators", [ ( - Var.create(10), - Var.create(5), + LiteralVar.create(10), + LiteralVar.create(5), [ "+", "-", @@ -1330,13 +1295,13 @@ def test_unsupported_default_contains(): ], ), ( - Var.create(10.5), - Var.create(5), + LiteralVar.create(10.5), + LiteralVar.create(5), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), ( - Var.create(5), - Var.create(True), + LiteralVar.create(5), + LiteralVar.create(True), [ "+", "-", @@ -1354,22 +1319,26 @@ def test_unsupported_default_contains(): ], ), ( - Var.create(10.5), - Var.create(5.5), + LiteralVar.create(10.5), + LiteralVar.create(5.5), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), ( - Var.create(10.5), - Var.create(True), + LiteralVar.create(10.5), + LiteralVar.create(True), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), - (Var.create("10"), Var.create("5"), ["+", ">", "<", "<=", ">="]), - (Var.create([10, 20]), Var.create([5, 6]), ["+", ">", "<", "<=", ">="]), - (Var.create([10, 20]), Var.create(5), ["*"]), - (Var.create([10, 20]), Var.create(True), ["*"]), + (LiteralVar.create("10"), LiteralVar.create("5"), ["+", ">", "<", "<=", ">="]), ( - Var.create(True), - Var.create(True), + LiteralVar.create([10, 20]), + LiteralVar.create([5, 6]), + ["+", ">", "<", "<=", ">="], + ), + (LiteralVar.create([10, 20]), LiteralVar.create(5), ["*"]), + (LiteralVar.create([10, 20]), LiteralVar.create(True), ["*"]), + ( + LiteralVar.create(True), + LiteralVar.create(True), [ "+", "-", @@ -1397,16 +1366,28 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s operators: list of supported operators. """ for operator in operators: - operand1_var.operation(op=operator, other=operand2_var) - operand1_var.operation(op=operator, other=operand2_var, flip=True) + print( + "testing", + operator, + "on", + operand1_var, + operand2_var, + " of types", + type(operand1_var), + type(operand2_var), + ) + eval(f"operand1_var {operator} operand2_var") + eval(f"operand2_var {operator} operand1_var") + # operand1_var.operation(op=operator, other=operand2_var) + # operand1_var.operation(op=operator, other=operand2_var, flip=True) @pytest.mark.parametrize( "operand1_var,operand2_var,operators", [ ( - Var.create(10), - Var.create(5), + LiteralVar.create(10), + LiteralVar.create(5), [ "^", "<<", @@ -1414,41 +1395,35 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s ], ), ( - Var.create(10.5), - Var.create(5), + LiteralVar.create(10.5), + LiteralVar.create(5), [ - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create(10.5), - Var.create(True), + LiteralVar.create(10.5), + LiteralVar.create(True), [ - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create(10.5), - Var.create(5.5), + LiteralVar.create(10.5), + LiteralVar.create(5.5), [ - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create("10"), - Var.create("5"), + LiteralVar.create("10"), + LiteralVar.create("5"), [ "-", "/", @@ -1456,16 +1431,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "*", "%", "**", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create([5, 6]), + LiteralVar.create([10, 20]), + LiteralVar.create([5, 6]), [ "-", "/", @@ -1473,16 +1446,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "*", "%", "**", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create(5), + LiteralVar.create([10, 20]), + LiteralVar.create(5), [ "+", "-", @@ -1494,16 +1465,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create(True), + LiteralVar.create([10, 20]), + LiteralVar.create(True), [ "+", "-", @@ -1515,16 +1484,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create("5"), + LiteralVar.create([10, 20]), + LiteralVar.create("5"), [ "+", "-", @@ -1537,16 +1504,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create({"key": "value"}), + LiteralVar.create([10, 20]), + LiteralVar.create({"key": "value"}), [ "+", "-", @@ -1559,16 +1524,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create(5.5), + LiteralVar.create([10, 20]), + LiteralVar.create(5.5), [ "+", "-", @@ -1581,16 +1544,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create({"another_key": "another_value"}), + LiteralVar.create({"key": "value"}), + LiteralVar.create({"another_key": "another_value"}), [ "+", "-", @@ -1603,16 +1564,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create(5), + LiteralVar.create({"key": "value"}), + LiteralVar.create(5), [ "+", "-", @@ -1625,16 +1584,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create(True), + LiteralVar.create({"key": "value"}), + LiteralVar.create(True), [ "+", "-", @@ -1647,16 +1604,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create(5.5), + LiteralVar.create({"key": "value"}), + LiteralVar.create(5.5), [ "+", "-", @@ -1669,16 +1624,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create("5"), + LiteralVar.create({"key": "value"}), + LiteralVar.create("5"), [ "+", "-", @@ -1691,44 +1644,48 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ], ) def test_invalid_var_operations(operand1_var: Var, operand2_var, operators: List[str]): for operator in operators: + print(f"testing {operator} on {str(operand1_var)} and {str(operand2_var)}") with pytest.raises(TypeError): - operand1_var.operation(op=operator, other=operand2_var) + print(eval(f"operand1_var {operator} operand2_var")) + # operand1_var.operation(op=operator, other=operand2_var) with pytest.raises(TypeError): - operand1_var.operation(op=operator, other=operand2_var, flip=True) + print(eval(f"operand2_var {operator} operand1_var")) + # operand1_var.operation(op=operator, other=operand2_var, flip=True) @pytest.mark.parametrize( "var, expected", [ - (Var.create("string_value", _var_is_string=True), "`string_value`"), - (Var.create(1), "1"), - (Var.create([1, 2, 3]), "[1, 2, 3]"), - (Var.create({"foo": "bar"}), '{"foo": "bar"}'), + (LiteralVar.create("string_value"), '"string_value"'), + (LiteralVar.create(1), "1"), + (LiteralVar.create([1, 2, 3]), "[1, 2, 3]"), + (LiteralVar.create({"foo": "bar"}), '({ ["foo"] : "bar" })'), ( - Var.create(ATestState.value, _var_is_string=True), + LiteralVar.create(ATestState.value), f"{ATestState.get_full_name()}.value", ), ( LiteralVar.create(f"{ATestState.value} string"), f'({ATestState.get_full_name()}.value+" string")', ), - (Var.create(ATestState.dict_val), f"{ATestState.get_full_name()}.dict_val"), + ( + LiteralVar.create(ATestState.dict_val), + f"{ATestState.get_full_name()}.dict_val", + ), ], ) def test_var_name_unwrapped(var, expected): - assert var._var_name_unwrapped == expected + assert str(var) == expected def cv_fget(state: BaseState) -> int: @@ -1740,11 +1697,11 @@ def cv_fget(state: BaseState) -> int: [ (["a"], {"a"}), (["b"], {"b"}), - ([ComputedVar(fget=cv_fget)], {"cv_fget"}), + ([ImmutableComputedVar(fget=cv_fget)], {"cv_fget"}), ], ) -def test_computed_var_deps(deps: List[Union[str, Var]], expected: Set[str]): - @computed_var( +def test_computed_var_deps(deps: List[Union[str, ImmutableVar]], expected: Set[str]): + @immutable_computed_var( deps=deps, cache=True, ) @@ -1765,7 +1722,7 @@ def test_computed_var_deps(deps: List[Union[str, Var]], expected: Set[str]): def test_invalid_computed_var_deps(deps: List): with pytest.raises(TypeError): - @computed_var( + @immutable_computed_var( deps=deps, cache=True, ) diff --git a/tests/utils/test_format.py b/tests/utils/test_format.py index 4623f0fb2..8c559f141 100644 --- a/tests/utils/test_format.py +++ b/tests/utils/test_format.py @@ -9,10 +9,11 @@ import pytest from reflex.components.tags.tag import Tag from reflex.event import EventChain, EventHandler, EventSpec, FrontendEvent from reflex.ivars.base import ImmutableVar, LiteralVar +from reflex.ivars.object import ObjectVar from reflex.style import Style from reflex.utils import format from reflex.utils.serializers import serialize_figure -from reflex.vars import BaseVar, Var +from reflex.vars import Var from tests.test_state import ( ChildState, ChildState2, @@ -273,16 +274,16 @@ def test_format_string(input: str, output: str): @pytest.mark.parametrize( "input,output", [ - (Var.create(value="test"), "{`test`}"), - (Var.create(value="test", _var_is_local=True), "{`test`}"), - (Var.create(value="test", _var_is_local=False), "{test}"), - (Var.create(value="test", _var_is_string=True), "{`test`}"), - (Var.create(value="test", _var_is_string=False), "{`test`}"), - (Var.create(value="test", _var_is_local=False, _var_is_string=False), "{test}"), + (Var.create(value="test"), '"test"'), + (Var.create(value="test", _var_is_local=True), '"test"'), + (Var.create(value="test", _var_is_local=False), "test"), + (Var.create(value="test", _var_is_string=True), '"test"'), + (Var.create(value='"test"', _var_is_string=False), '"test"'), + (Var.create(value="test", _var_is_local=False, _var_is_string=False), "test"), ], ) def test_format_var(input: Var, output: str): - assert format.format_var(input) == output + assert str(input) == output @pytest.mark.parametrize( @@ -313,110 +314,6 @@ def test_format_route(route: str, format_case: bool, expected: bool): assert format.format_route(route, format_case=format_case) == expected -@pytest.mark.parametrize( - "condition,true_value,false_value,is_prop,expected", - [ - ("cond", "", '""', False, '{isTrue(cond) ? : ""}'), - ("cond", "", "", False, "{isTrue(cond) ? : }"), - ( - "cond", - Var.create_safe(""), - "", - False, - "{isTrue(cond) ? : }", - ), - ( - "cond", - Var.create_safe(""), - Var.create_safe(""), - False, - "{isTrue(cond) ? : }", - ), - ( - "cond", - Var.create_safe("", _var_is_local=False), - Var.create_safe(""), - False, - "{isTrue(cond) ? ${} : }", - ), - ( - "cond", - Var.create_safe("", _var_is_string=True), - Var.create_safe(""), - False, - "{isTrue(cond) ? {``} : }", - ), - ("cond", "", '""', True, 'isTrue(cond) ? `` : `""`'), - ("cond", "", "", True, "isTrue(cond) ? `` : ``"), - ( - "cond", - Var.create_safe(""), - "", - True, - "isTrue(cond) ? : ``", - ), - ( - "cond", - Var.create_safe(""), - Var.create_safe(""), - True, - "isTrue(cond) ? : ", - ), - ( - "cond", - Var.create_safe("", _var_is_local=False), - Var.create_safe(""), - True, - "isTrue(cond) ? : ", - ), - ( - "cond", - Var.create_safe(""), - Var.create_safe("", _var_is_local=False), - True, - "isTrue(cond) ? : ", - ), - ( - "cond", - Var.create_safe("", _var_is_string=True), - Var.create_safe(""), - True, - "isTrue(cond) ? `` : ", - ), - ], -) -def test_format_cond( - condition: str, - true_value: str | Var, - false_value: str | Var, - is_prop: bool, - expected: str, -): - """Test formatting a cond. - - Args: - condition: The condition to check. - true_value: The value to return if the condition is true. - false_value: The value to return if the condition is false. - is_prop: Whether the values are rendered as props or not. - expected: The expected output string. - """ - orig_true_value = ( - true_value._replace() if isinstance(true_value, Var) else Var.create_safe("") - ) - orig_false_value = ( - false_value._replace() if isinstance(false_value, Var) else Var.create_safe("") - ) - - assert format.format_cond(condition, true_value, false_value, is_prop) == expected - - # Ensure the formatting operation didn't change the original Var - if isinstance(true_value, Var): - assert true_value.equals(orig_true_value) - if isinstance(false_value, Var): - assert false_value.equals(orig_false_value) - - @pytest.mark.parametrize( "condition, match_cases, default,expected", [ @@ -440,7 +337,10 @@ def test_format_cond( ], ) def test_format_match( - condition: str, match_cases: List[BaseVar], default: BaseVar, expected: str + condition: str, + match_cases: List[List[ImmutableVar]], + default: ImmutableVar, + expected: str, ): """Test formatting a match statement. @@ -464,14 +364,14 @@ def test_format_match( (3.14, "{3.14}"), ([1, 2, 3], "{[1, 2, 3]}"), (["a", "b", "c"], '{["a", "b", "c"]}'), - ({"a": 1, "b": 2, "c": 3}, '{{"a": 1, "b": 2, "c": 3}}'), - ({"a": 'foo "bar" baz'}, r'{{"a": "foo \"bar\" baz"}}'), + ({"a": 1, "b": 2, "c": 3}, '{({ ["a"] : 1, ["b"] : 2, ["c"] : 3 })}'), + ({"a": 'foo "bar" baz'}, r'{({ ["a"] : "foo \"bar\" baz" })}'), ( { "a": 'foo "{ "bar" }" baz', - "b": BaseVar(_var_name="val", _var_type="str"), + "b": ImmutableVar(_var_name="val", _var_type=str).guess_type(), }, - r'{{"a": "foo \"{ \"bar\" }\" baz", "b": val}}', + r'{({ ["a"] : "foo \"{ \"bar\" }\" baz", ["b"] : val })}', ), ( EventChain( @@ -487,18 +387,19 @@ def test_format_match( handler=EventHandler(fn=mock_event), args=( ( - Var.create_safe("arg"), - BaseVar( + LiteralVar.create("arg"), + ImmutableVar( _var_name="_e", - _var_type=FrontendEvent, - ).target.value, + ) + .to(ObjectVar, FrontendEvent) + .target.value, ), ), ) ], args_spec=lambda e: [e.target.value], ), - '{(_e) => addEvents([Event("mock_event", {arg:_e.target.value})], [_e], {})}', + '{(_e) => addEvents([Event("mock_event", {"arg":_e["target"]["value"]})], [_e], {})}', ), ( EventChain( @@ -516,37 +417,47 @@ def test_format_match( ), '{(...args) => addEvents([Event("mock_event", {})], args, {"preventDefault": true})}', ), - ({"a": "red", "b": "blue"}, '{{"a": "red", "b": "blue"}}'), - (BaseVar(_var_name="var", _var_type="int"), "{var}"), + ({"a": "red", "b": "blue"}, '{({ ["a"] : "red", ["b"] : "blue" })}'), + (ImmutableVar(_var_name="var", _var_type=int).guess_type(), "var"), ( - BaseVar( + ImmutableVar( _var_name="_", _var_type=Any, - _var_is_local=True, - _var_is_string=False, ), - "{_}", + "_", ), ( - BaseVar(_var_name='state.colors["a"]', _var_type="str"), - '{state.colors["a"]}', + ImmutableVar(_var_name='state.colors["a"]', _var_type=str).guess_type(), + 'state.colors["a"]', ), - ({"a": BaseVar(_var_name="val", _var_type="str")}, '{{"a": val}}'), - ({"a": BaseVar(_var_name='"val"', _var_type="str")}, '{{"a": "val"}}'), ( - {"a": BaseVar(_var_name='state.colors["val"]', _var_type="str")}, - '{{"a": state.colors["val"]}}', + {"a": ImmutableVar(_var_name="val", _var_type=str).guess_type()}, + '{({ ["a"] : val })}', + ), + ( + {"a": ImmutableVar(_var_name='"val"', _var_type=str).guess_type()}, + '{({ ["a"] : "val" })}', + ), + ( + { + "a": ImmutableVar( + _var_name='state.colors["val"]', _var_type=str + ).guess_type() + }, + '{({ ["a"] : state.colors["val"] })}', ), # tricky real-world case from markdown component ( { - "h1": f"{{({{node, ...props}}) => }}" + "h1": ImmutableVar.create_safe( + f"(({{node, ...props}}) => )" + ) }, - '{{"h1": ({node, ...props}) => }}', + '{({ ["h1"] : (({node, ...props}) => ) })}', ), ], ) -def test_format_prop(prop: Var, formatted: str): +def test_format_prop(prop: ImmutableVar, formatted: str): """Test that the formatted value of an prop is correct. Args: @@ -560,7 +471,7 @@ def test_format_prop(prop: Var, formatted: str): "single_props,key_value_props,output", [ ( - [ImmutableVar.create_safe("...props")], + [ImmutableVar.create_safe("{...props}")], {"key": 42}, ["key={42}", "{...props}"], ), @@ -614,40 +525,14 @@ def test_format_event_handler(input, output): @pytest.mark.parametrize( "input,output", [ - (EventSpec(handler=EventHandler(fn=mock_event)), 'Event("mock_event", {})'), + ( + EventSpec(handler=EventHandler(fn=mock_event)), + '(Event("mock_event", ({ })))', + ), ], ) def test_format_event(input, output): - assert format.format_event(input) == output - - -@pytest.mark.parametrize( - "input,output", - [ - ( - EventChain( - events=[ - EventSpec(handler=EventHandler(fn=mock_event)), - EventSpec(handler=EventHandler(fn=mock_event)), - ], - args_spec=None, - ), - 'addEvents([Event("mock_event", {}),Event("mock_event", {})])', - ), - ( - EventChain( - events=[ - EventSpec(handler=EventHandler(fn=mock_event)), - EventSpec(handler=EventHandler(fn=mock_event)), - ], - args_spec=lambda e0: [e0], - ), - 'addEvents([Event("mock_event", {}),Event("mock_event", {})])', - ), - ], -) -def test_format_event_chain(input, output): - assert format.format_event_chain(input) == output + assert str(LiteralVar.create(input)) == output @pytest.mark.parametrize( @@ -771,29 +656,14 @@ def test_format_ref(input, output): "input,output", [ (("my_array", None), "refs_my_array"), - (("my_array", Var.create(0)), "refs_my_array[0]"), - (("my_array", Var.create(1)), "refs_my_array[1]"), + (("my_array", LiteralVar.create(0)), "refs_my_array[0]"), + (("my_array", LiteralVar.create(1)), "refs_my_array[1]"), ], ) def test_format_array_ref(input, output): assert format.format_array_ref(input[0], input[1]) == output -@pytest.mark.parametrize( - "input,output", - [ - ("/foo", [("foo", "/foo")]), - ("/foo/bar", [("foo", "/foo"), ("bar", "/foo/bar")]), - ( - "/foo/bar/baz", - [("foo", "/foo"), ("bar", "/foo/bar"), ("baz", "/foo/bar/baz")], - ), - ], -) -def test_format_breadcrumbs(input, output): - assert format.format_breadcrumbs(input) == output - - @pytest.mark.parametrize( "input, output", [ diff --git a/tests/utils/test_serializers.py b/tests/utils/test_serializers.py index b516f5eb3..7f5c2bc66 100644 --- a/tests/utils/test_serializers.py +++ b/tests/utils/test_serializers.py @@ -1,14 +1,14 @@ import datetime from enum import Enum from pathlib import Path -from typing import Any, Dict, List, Type +from typing import Any, Dict, Type import pytest from reflex.base import Base from reflex.components.core.colors import Color +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import serializers -from reflex.vars import Var @pytest.mark.parametrize( @@ -29,20 +29,10 @@ def test_has_serializer(type_: Type, expected: bool): @pytest.mark.parametrize( "type_,expected", [ - (str, serializers.serialize_str), - (list, serializers.serialize_list), - (tuple, serializers.serialize_list), - (set, serializers.serialize_list), - (dict, serializers.serialize_dict), - (List[str], serializers.serialize_list), - (Dict[int, int], serializers.serialize_dict), (datetime.datetime, serializers.serialize_datetime), (datetime.date, serializers.serialize_datetime), (datetime.time, serializers.serialize_datetime), (datetime.timedelta, serializers.serialize_datetime), - (int, serializers.serialize_primitive), - (float, serializers.serialize_primitive), - (bool, serializers.serialize_primitive), (Enum, serializers.serialize_enum), ], ) @@ -140,41 +130,41 @@ class BaseSubclass(Base): (None, "null"), ([1, 2, 3], "[1, 2, 3]"), ([1, "2", 3.0], '[1, "2", 3.0]'), - ([{"key": 1}, {"key": 2}], '[{"key": 1}, {"key": 2}]'), + ([{"key": 1}, {"key": 2}], '[({ ["key"] : 1 }), ({ ["key"] : 2 })]'), (StrEnum.FOO, "foo"), ([StrEnum.FOO, StrEnum.BAR], '["foo", "bar"]'), ( {"key1": [1, 2, 3], "key2": [StrEnum.FOO, StrEnum.BAR]}, - '{"key1": [1, 2, 3], "key2": ["foo", "bar"]}', + '({ ["key1"] : [1, 2, 3], ["key2"] : ["foo", "bar"] })', ), (EnumWithPrefix.FOO, "prefix_foo"), ([EnumWithPrefix.FOO, EnumWithPrefix.BAR], '["prefix_foo", "prefix_bar"]'), ( {"key1": EnumWithPrefix.FOO, "key2": EnumWithPrefix.BAR}, - '{"key1": "prefix_foo", "key2": "prefix_bar"}', + '({ ["key1"] : "prefix_foo", ["key2"] : "prefix_bar" })', ), (TestEnum.FOO, "foo"), ([TestEnum.FOO, TestEnum.BAR], '["foo", "bar"]'), ( {"key1": TestEnum.FOO, "key2": TestEnum.BAR}, - '{"key1": "foo", "key2": "bar"}', + '({ ["key1"] : "foo", ["key2"] : "bar" })', ), ( BaseSubclass(ts=datetime.timedelta(1, 1, 1)), - '{"ts": "1 day, 0:00:01.000001"}', + '({ ["ts"] : "1 day, 0:00:01.000001" })', ), ( - [1, Var.create_safe("hi"), Var.create_safe("bye", _var_is_local=False)], + [1, LiteralVar.create("hi"), ImmutableVar.create("bye")], '[1, "hi", bye]', ), ( - (1, Var.create_safe("hi"), Var.create_safe("bye", _var_is_local=False)), + (1, LiteralVar.create("hi"), ImmutableVar.create("bye")), '[1, "hi", bye]', ), - ({1: 2, 3: 4}, '{"1": 2, "3": 4}'), + ({1: 2, 3: 4}, "({ [1] : 2, [3] : 4 })"), ( - {1: Var.create_safe("hi"), 3: Var.create_safe("bye", _var_is_local=False)}, - '{"1": "hi", "3": bye}', + {1: LiteralVar.create("hi"), 3: ImmutableVar.create("bye")}, + '({ [1] : "hi", [3] : bye })', ), (datetime.datetime(2021, 1, 1, 1, 1, 1, 1), "2021-01-01 01:01:01.000001"), (datetime.date(2021, 1, 1), "2021-01-01"), @@ -203,24 +193,28 @@ def test_serialize(value: Any, expected: str): @pytest.mark.parametrize( "value,expected,exp_var_is_string", [ - ("test", "test", False), + ("test", '"test"', False), (1, "1", False), (1.0, "1.0", False), (True, "true", False), (False, "false", False), ([1, 2, 3], "[1, 2, 3]", False), - ([{"key": 1}, {"key": 2}], '[{"key": 1}, {"key": 2}]', False), - (StrEnum.FOO, "foo", False), + ([{"key": 1}, {"key": 2}], '[({ ["key"] : 1 }), ({ ["key"] : 2 })]', False), + (StrEnum.FOO, '"foo"', False), ([StrEnum.FOO, StrEnum.BAR], '["foo", "bar"]', False), ( BaseSubclass(ts=datetime.timedelta(1, 1, 1)), - '{"ts": "1 day, 0:00:01.000001"}', + '({ ["ts"] : "1 day, 0:00:01.000001" })', False, ), - (datetime.datetime(2021, 1, 1, 1, 1, 1, 1), "2021-01-01 01:01:01.000001", True), - (Color(color="slate", shade=1), "var(--slate-1)", True), - (BaseSubclass, "BaseSubclass", True), - (Path("."), ".", True), + ( + datetime.datetime(2021, 1, 1, 1, 1, 1, 1), + '"2021-01-01 01:01:01.000001"', + True, + ), + (Color(color="slate", shade=1), '"var(--slate-1)"', True), + (BaseSubclass, '"BaseSubclass"', True), + (Path("."), '"."', True), ], ) def test_serialize_var_to_str(value: Any, expected: str, exp_var_is_string: bool): @@ -231,6 +225,5 @@ def test_serialize_var_to_str(value: Any, expected: str, exp_var_is_string: bool expected: The expected result. exp_var_is_string: The expected value of _var_is_string. """ - v = Var.create_safe(value) - assert v._var_full_name == expected - assert v._var_is_string == exp_var_is_string + v = LiteralVar.create(value) + assert str(v) == expected diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index e905ff587..654bd4c90 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -18,7 +18,7 @@ from reflex.utils import ( types, ) from reflex.utils import exec as utils_exec -from reflex.utils.serializers import serialize +from reflex.utils.exceptions import ReflexError from reflex.vars import Var @@ -538,11 +538,15 @@ def test_style_prop_with_event_handler_value(callable): callable: The callable function or event handler. """ + import reflex as rx + style = { "color": ( EventHandler(fn=callable) if type(callable) != EventHandler else callable ) } - with pytest.raises(TypeError): - serialize(style) # type: ignore + with pytest.raises(ReflexError): + rx.box( + style=style, # type: ignore + ) From d672c643b30cfb5729cc394745111d0de2feede9 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:09:35 +0200 Subject: [PATCH 011/201] Forbid Computed var shadowing (#3843) --- reflex/state.py | 21 +++++++++++++++++++-- tests/test_var.py | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 0ee9dbb37..c33072a4f 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -477,7 +477,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): cls._check_overridden_methods() # Computed vars should not shadow builtin state props. - cls._check_overriden_basevars() + cls._check_overridden_basevars() # Reset subclass tracking for this class. cls.class_subclasses = set() @@ -505,6 +505,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): # Get computed vars. computed_vars = cls._get_computed_vars() + cls._check_overridden_computed_vars() new_backend_vars = { name: value @@ -718,7 +719,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): ) @classmethod - def _check_overriden_basevars(cls): + def _check_overridden_basevars(cls): """Check for shadow base vars and raise error if any. Raises: @@ -730,6 +731,22 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): f"The computed var name `{computed_var_._var_name}` shadows a base var in {cls.__module__}.{cls.__name__}; use a different name instead" ) + @classmethod + def _check_overridden_computed_vars(cls) -> None: + """Check for shadow computed vars and raise error if any. + + Raises: + NameError: When a computed var shadows another. + """ + for name, cv in cls.__dict__.items(): + if not isinstance(cv, (ComputedVar, ImmutableComputedVar)): + continue + name = cv._var_name + if name in cls.inherited_vars or name in cls.inherited_backend_vars: + raise NameError( + f"The computed var name `{cv._var_name}` shadows a var in {cls.__module__}.{cls.__name__}; use a different name instead" + ) + @classmethod def get_skip_vars(cls) -> set[str]: """Get the vars to skip when serializing. diff --git a/tests/test_var.py b/tests/test_var.py index bf66561b2..5902590f5 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -79,6 +79,11 @@ def ChildState(ParentState, TestObj): class ChildState(ParentState): @immutable_computed_var def var_without_annotation(self): + """This shadows ParentState.var_without_annotation. + + Returns: + TestObj: Test object. + """ return TestObj return ChildState @@ -89,6 +94,11 @@ def GrandChildState(ChildState, TestObj): class GrandChildState(ChildState): @immutable_computed_var def var_without_annotation(self): + """This shadows ChildState.var_without_annotation. + + Returns: + TestObj: Test object. + """ return TestObj return GrandChildState @@ -738,8 +748,6 @@ def test_var_unsupported_indexing_dicts(var, index): "fixture", [ "ParentState", - "ChildState", - "GrandChildState", "StateWithAnyVar", ], ) @@ -761,6 +769,26 @@ def test_computed_var_without_annotation_error(request, fixture): ) +@pytest.mark.parametrize( + "fixture", + [ + "ChildState", + "GrandChildState", + ], +) +def test_shadow_computed_var_error(request: pytest.FixtureRequest, fixture: str): + """Test that a name error is thrown when an attribute of a computed var is + shadowed by another attribute. + + Args: + request: Fixture Request. + fixture: The state fixture. + """ + with pytest.raises(NameError): + state = request.getfixturevalue(fixture) + state.var_without_annotation.foo + + @pytest.mark.parametrize( "fixture", [ From 0810bd843cf8baf5e84a03ef588dbb339301c787 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 10 Sep 2024 13:26:58 -0700 Subject: [PATCH 012/201] remove reference to computed var (#3906) --- reflex/state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/state.py b/reflex/state.py index c33072a4f..a1b5eac8c 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -739,7 +739,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): NameError: When a computed var shadows another. """ for name, cv in cls.__dict__.items(): - if not isinstance(cv, (ComputedVar, ImmutableComputedVar)): + if not is_computed_var(cv): continue name = cv._var_name if name in cls.inherited_vars or name in cls.inherited_backend_vars: From 95631ffdba58190b7a397acd0d1741d37bd5b1c4 Mon Sep 17 00:00:00 2001 From: abulvenz Date: Wed, 11 Sep 2024 18:35:19 +0200 Subject: [PATCH 013/201] Fix type propagation in ToStringOperation (#3895) * fix: Adding type propagation to ToStringOperation. * fix: Better naming. * fix: Added test that fails without the fix. * Update reflex/ivars/base.py Co-authored-by: Masen Furer * Retain mutability inside `async with self` block (#3884) When emitting a state update, restore `_self_mutable` to the value it had previously so that `yield` in the middle of `async with self` does not result in an immutable StateProxy. Fix #3869 * Include child imports in markdown component_map (#3883) If a component in the markdown component_map contains children components, use `_get_all_imports` to recursively enumerate them. Fix #3880 * [REF-3570] Remove deprecated REDIS_URL syntax (#3892) * fix: Instead of researching the type after dropping it, preserve it. * Apply suggestions from code review Co-authored-by: Masen Furer --------- Co-authored-by: Masen Furer --- reflex/ivars/base.py | 4 ++-- tests/test_var.py | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 27c4828af..8bb7957c4 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -416,7 +416,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return ToArrayOperation.create(self, var_type or list) if issubclass(output, StringVar): - return ToStringOperation.create(self) + return ToStringOperation.create(self, var_type or str) if issubclass(output, (ObjectVar, Base)): return ToObjectOperation.create(self, var_type or dict) @@ -496,7 +496,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): if issubclass(fixed_type, (list, tuple, set)): return self.to(ArrayVar, self._var_type) if issubclass(fixed_type, str): - return self.to(StringVar) + return self.to(StringVar, self._var_type) if issubclass(fixed_type, Base): return self.to(ObjectVar, self._var_type) return self diff --git a/tests/test_var.py b/tests/test_var.py index 5902590f5..460cee39e 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -1,7 +1,7 @@ import json import math import typing -from typing import Dict, List, Set, Tuple, Union +from typing import Dict, List, Optional, Set, Tuple, Union, cast import pytest from pandas import DataFrame @@ -1756,3 +1756,21 @@ def test_invalid_computed_var_deps(deps: List): ) def test_var(state) -> int: return 1 + + +def test_to_string_operation(): + class Email(str): ... + + class TestState(BaseState): + optional_email: Optional[Email] = None + email: Email = Email("test@reflex.dev") + + assert ( + str(TestState.optional_email) == f"{TestState.get_full_name()}.optional_email" + ) + my_state = TestState() + assert my_state.optional_email is None + assert my_state.email == "test@reflex.dev" + + assert cast(ImmutableVar, TestState.email)._var_type == Email + assert cast(ImmutableVar, TestState.optional_email)._var_type == Optional[Email] From 63bf1b8817202ef70ba7e024a5e6321f2e220e55 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:43:18 +0200 Subject: [PATCH 014/201] Dynamic route vars silently shadow all other vars (#3805) * fix dynamic route vars silently shadow all other vars * add test * fix: allow multiple dynamic routes with the same arg * add test for multiple dynamic args with the same name * avoid side-effects with DynamicState tests * fix dynamic route integration test which shadowed a var * fix darglint * refactor to DynamicRouteVar * old typing stuff again * from typing_extensions import Self try to keep typing backward compatible with older releases we support * Raise a specific exception when encountering dynamic route arg shadowing --------- Co-authored-by: Masen Furer --- reflex/ivars/base.py | 12 ++++++-- reflex/state.py | 41 ++++++++++++++++++++++---- reflex/utils/exceptions.py | 4 +++ reflex/utils/types.py | 5 ++++ tests/test_app.py | 59 ++++++++++++++++++++++++++++++++++++-- 5 files changed, 110 insertions(+), 11 deletions(-) diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 8bb7957c4..3c08b8119 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -43,7 +43,7 @@ from reflex.utils.exceptions import ( VarValueError, ) from reflex.utils.format import format_state_name -from reflex.utils.types import GenericType, get_origin +from reflex.utils.types import GenericType, Self, get_origin from reflex.vars import ( REPLACED_NAMES, Var, @@ -1467,7 +1467,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): object.__setattr__(self, "_fget", fget) @override - def _replace(self, merge_var_data=None, **kwargs: Any) -> ImmutableComputedVar: + def _replace(self, merge_var_data=None, **kwargs: Any) -> Self: """Replace the attributes of the ComputedVar. Args: @@ -1499,7 +1499,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): unexpected_kwargs = ", ".join(kwargs.keys()) raise TypeError(f"Unexpected keyword arguments: {unexpected_kwargs}") - return ImmutableComputedVar(**field_values) + return type(self)(**field_values) @property def _cache_attr(self) -> str: @@ -1773,6 +1773,12 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): return self._fget +class DynamicRouteVar(ImmutableComputedVar[Union[str, List[str]]]): + """A ComputedVar that represents a dynamic route.""" + + pass + + if TYPE_CHECKING: BASE_STATE = TypeVar("BASE_STATE", bound=BaseState) diff --git a/reflex/state.py b/reflex/state.py index a1b5eac8c..b815fd44f 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -35,6 +35,7 @@ from sqlalchemy.orm import DeclarativeBase from reflex.config import get_config from reflex.ivars.base import ( + DynamicRouteVar, ImmutableComputedVar, ImmutableVar, immutable_computed_var, @@ -60,7 +61,11 @@ from reflex.event import ( fix_events, ) from reflex.utils import console, format, path_ops, prerequisites, types -from reflex.utils.exceptions import ImmutableStateError, LockExpiredError +from reflex.utils.exceptions import ( + DynamicRouteArgShadowsStateVar, + ImmutableStateError, + LockExpiredError, +) from reflex.utils.exec import is_testing_env from reflex.utils.serializers import SerializedType, serialize, serializer from reflex.utils.types import override @@ -1023,17 +1028,19 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if not args: return + cls._check_overwritten_dynamic_args(list(args.keys())) + def argsingle_factory(param): def inner_func(self) -> str: return self.router.page.params.get(param, "") - return ImmutableComputedVar(fget=inner_func, cache=True) + return DynamicRouteVar(fget=inner_func, cache=True) def arglist_factory(param): - def inner_func(self) -> List: + def inner_func(self) -> List[str]: return self.router.page.params.get(param, []) - return ImmutableComputedVar(fget=inner_func, cache=True) + return DynamicRouteVar(fget=inner_func, cache=True) for param, value in args.items(): if value == constants.RouteArgType.SINGLE: @@ -1044,12 +1051,36 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): continue # to allow passing as a prop, evade python frozen rules (bad practice) object.__setattr__(func, "_var_name", param) - cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore + # cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore + cls.vars[param] = cls.computed_vars[param] = func._replace( + _var_data=VarData.from_state(cls) + ) setattr(cls, param, func) # Reinitialize dependency tracking dicts. cls._init_var_dependency_dicts() + @classmethod + def _check_overwritten_dynamic_args(cls, args: list[str]): + """Check if dynamic args are shadowing existing vars. Recursively checks all child states. + + Args: + args: a dict of args + + Raises: + DynamicRouteArgShadowsStateVar: If a dynamic arg is shadowing an existing var. + """ + for arg in args: + if ( + arg in cls.computed_vars + and not isinstance(cls.computed_vars[arg], DynamicRouteVar) + ) or arg in cls.base_vars: + raise DynamicRouteArgShadowsStateVar( + f"Dynamic route arg '{arg}' is shadowing an existing var in {cls.__module__}.{cls.__name__}" + ) + for substate in cls.get_substates(): + substate._check_overwritten_dynamic_args(args) + def __getattribute__(self, name: str) -> Any: """Get the state var. diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 8c1a1f07f..dbab3fb6d 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -87,3 +87,7 @@ class EventHandlerArgMismatch(ReflexError, TypeError): class EventFnArgMismatch(ReflexError, TypeError): """Raised when the number of args accepted by a lambda differs from that provided by the event trigger.""" + + +class DynamicRouteArgShadowsStateVar(ReflexError, NameError): + """Raised when a dynamic route arg shadows a state var.""" diff --git a/reflex/utils/types.py b/reflex/utils/types.py index b4b4c1090..f4463fa92 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -111,6 +111,11 @@ RESERVED_BACKEND_VAR_NAMES = { "_was_touched", } +if sys.version_info >= (3, 11): + from typing import Self as Self +else: + from typing_extensions import Self as Self + class Unset: """A class to represent an unset value. diff --git a/tests/test_app.py b/tests/test_app.py index 167cbf0d4..6767abe35 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -69,7 +69,7 @@ class EmptyState(BaseState): @pytest.fixture -def index_page(): +def index_page() -> ComponentCallable: """An index page. Returns: @@ -83,7 +83,7 @@ def index_page(): @pytest.fixture -def about_page(): +def about_page() -> ComponentCallable: """An about page. Returns: @@ -919,9 +919,62 @@ class DynamicState(BaseState): on_load_internal = OnLoadInternalState.on_load_internal.fn +def test_dynamic_arg_shadow( + index_page: ComponentCallable, + windows_platform: bool, + token: str, + app_module_mock: unittest.mock.Mock, + mocker, +): + """Create app with dynamic route var and try to add a page with a dynamic arg that shadows a state var. + + Args: + index_page: The index page. + windows_platform: Whether the system is windows. + token: a Token. + app_module_mock: Mocked app module. + mocker: pytest mocker object. + """ + arg_name = "counter" + route = f"/test/[{arg_name}]" + if windows_platform: + route.lstrip("/").replace("/", "\\") + app = app_module_mock.app = App(state=DynamicState) + assert app.state is not None + with pytest.raises(NameError): + app.add_page(index_page, route=route, on_load=DynamicState.on_load) # type: ignore + + +def test_multiple_dynamic_args( + index_page: ComponentCallable, + windows_platform: bool, + token: str, + app_module_mock: unittest.mock.Mock, + mocker, +): + """Create app with multiple dynamic route vars with the same name. + + Args: + index_page: The index page. + windows_platform: Whether the system is windows. + token: a Token. + app_module_mock: Mocked app module. + mocker: pytest mocker object. + """ + arg_name = "my_arg" + route = f"/test/[{arg_name}]" + route2 = f"/test2/[{arg_name}]" + if windows_platform: + route = route.lstrip("/").replace("/", "\\") + route2 = route2.lstrip("/").replace("/", "\\") + app = app_module_mock.app = App(state=EmptyState) + app.add_page(index_page, route=route) + app.add_page(index_page, route=route2) + + @pytest.mark.asyncio async def test_dynamic_route_var_route_change_completed_on_load( - index_page, + index_page: ComponentCallable, windows_platform: bool, token: str, app_module_mock: unittest.mock.Mock, From 5dcf554bd498d98be488afa23fdc3c4a3767cf58 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Wed, 11 Sep 2024 20:15:49 +0200 Subject: [PATCH 015/201] cleanup dead test code (#3909) --- tests/test_app.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/test_app.py b/tests/test_app.py index 6767abe35..0c81f1e2c 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -268,8 +268,6 @@ def test_add_page_set_route_dynamic(index_page, windows_platform: bool): app = App(state=EmptyState) assert app.state is not None route = "/test/[dynamic]" - if windows_platform: - route.lstrip("/").replace("/", "\\") assert app.pages == {} app.add_page(index_page, route=route) assert app.pages.keys() == {"test/[dynamic]"} @@ -937,8 +935,6 @@ def test_dynamic_arg_shadow( """ arg_name = "counter" route = f"/test/[{arg_name}]" - if windows_platform: - route.lstrip("/").replace("/", "\\") app = app_module_mock.app = App(state=DynamicState) assert app.state is not None with pytest.raises(NameError): @@ -964,9 +960,6 @@ def test_multiple_dynamic_args( arg_name = "my_arg" route = f"/test/[{arg_name}]" route2 = f"/test2/[{arg_name}]" - if windows_platform: - route = route.lstrip("/").replace("/", "\\") - route2 = route2.lstrip("/").replace("/", "\\") app = app_module_mock.app = App(state=EmptyState) app.add_page(index_page, route=route) app.add_page(index_page, route=route2) @@ -994,8 +987,6 @@ async def test_dynamic_route_var_route_change_completed_on_load( """ arg_name = "dynamic" route = f"/test/[{arg_name}]" - if windows_platform: - route.lstrip("/").replace("/", "\\") app = app_module_mock.app = App(state=DynamicState) assert app.state is not None assert arg_name not in app.state.vars From 8657976a6e4b6b6aef305ee7f6154907bac86870 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 11 Sep 2024 11:47:28 -0700 Subject: [PATCH 016/201] override dict in propsbase to use camelCase (#3910) * override dict in propsbase to use camelCase * fix underscore in dict * dang it darglint --- reflex/components/props.py | 17 +++++++++++++++++ reflex/components/sonner/toast.py | 8 ++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/reflex/components/props.py b/reflex/components/props.py index 2966e9727..8736eca72 100644 --- a/reflex/components/props.py +++ b/reflex/components/props.py @@ -23,3 +23,20 @@ class PropsBase(Base): return LiteralObjectVar.create( {format.to_camel_case(key): value for key, value in self.dict().items()} ).json() + + def dict(self, *args, **kwargs): + """Convert the object to a dictionary. + + Keys will be converted to camelCase. + + Args: + *args: Arguments to pass to the parent class. + **kwargs: Keyword arguments to pass to the parent class. + + Returns: + The object as a dictionary. + """ + return { + format.to_camel_case(key): value + for key, value in super().dict(*args, **kwargs).items() + } diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index c58b4a106..c93b07044 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -171,12 +171,12 @@ class ToastProps(PropsBase): d["cancel"] = self.cancel if isinstance(self.cancel, dict): d["cancel"] = ToastAction(**self.cancel) - if "on_dismiss" in d: - d["on_dismiss"] = format.format_queue_events( + if "onDismiss" in d: + d["onDismiss"] = format.format_queue_events( self.on_dismiss, _toast_callback_signature ) - if "on_auto_close" in d: - d["on_auto_close"] = format.format_queue_events( + if "onAutoClose" in d: + d["onAutoClose"] = format.format_queue_events( self.on_auto_close, _toast_callback_signature ) return d From 625c5302dd19e886e5795ce9226b59ebe1a2310b Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Thu, 12 Sep 2024 17:46:42 +0000 Subject: [PATCH 017/201] [REF-3562][REF-3563] Replace chakra usage (#3872) --- benchmarks/test_benchmark_compile_pages.py | 3 +- integration/test_background_task.py | 5 +- integration/test_client_storage.py | 10 +- integration/test_dynamic_routes.py | 12 +- integration/test_event_actions.py | 8 +- integration/test_event_chain.py | 6 +- integration/test_form_submit.py | 65 ++----- integration/test_server_side_event.py | 10 +- integration/test_table.py | 114 +++-------- integration/test_tailwind.py | 4 +- integration/test_upload.py | 4 +- integration/test_var_operations.py | 7 +- poetry.lock | 153 +++++++++++++-- pyproject.toml | 2 +- .../.templates/jinja/web/pages/_app.js.jinja2 | 2 +- .../reflex/chakra_color_mode_provider.js | 36 ---- reflex/__init__.pyi | 1 + reflex/components/radix/__init__.pyi | 1 + reflex/components/radix/themes/base.py | 20 -- reflex/components/radix/themes/base.pyi | 1 - .../radix/themes/layout/__init__.pyi | 1 + reflex/style.py | 1 - reflex/utils/pyi_generator.py | 8 +- tests/components/datadisplay/test_table.py | 177 ------------------ tests/components/forms/test_form.py | 3 +- tests/components/media/test_icon.py | 55 ------ tests/components/test_component.py | 7 +- tests/components/typography/test_markdown.py | 5 +- tests/test_app.py | 19 +- 29 files changed, 235 insertions(+), 505 deletions(-) delete mode 100644 reflex/.templates/web/components/reflex/chakra_color_mode_provider.js delete mode 100644 tests/components/datadisplay/test_table.py delete mode 100644 tests/components/media/test_icon.py diff --git a/benchmarks/test_benchmark_compile_pages.py b/benchmarks/test_benchmark_compile_pages.py index 33404bca7..4448bca45 100644 --- a/benchmarks/test_benchmark_compile_pages.py +++ b/benchmarks/test_benchmark_compile_pages.py @@ -130,7 +130,6 @@ def render_multiple_pages(app, num: int): def AppWithOnePage(): """A reflex app with one page.""" - import reflex_chakra as rc from rxconfig import config # type: ignore import reflex as rx @@ -145,7 +144,7 @@ def AppWithOnePage(): def index() -> rx.Component: return rx.center( - rc.input( + rx.input( id="token", value=State.router.session.client_token, is_read_only=True ), rx.vstack( diff --git a/integration/test_background_task.py b/integration/test_background_task.py index 3764f67b4..b97791b0a 100644 --- a/integration/test_background_task.py +++ b/integration/test_background_task.py @@ -13,7 +13,6 @@ def BackgroundTask(): import asyncio import pytest - import reflex_chakra as rc import reflex as rx from reflex.state import ImmutableStateError @@ -116,11 +115,11 @@ def BackgroundTask(): def index() -> rx.Component: return rx.vstack( - rc.input( + rx.input( id="token", value=State.router.session.client_token, is_read_only=True ), rx.heading(State.counter, id="counter"), - rc.input( + rx.input( id="iterations", placeholder="Iterations", value=State.iterations.to_string(), # type: ignore diff --git a/integration/test_client_storage.py b/integration/test_client_storage.py index e88d2fa14..e4a38a15b 100644 --- a/integration/test_client_storage.py +++ b/integration/test_client_storage.py @@ -17,8 +17,6 @@ from . import utils def ClientSide(): """App for testing client-side state.""" - import reflex_chakra as rc - import reflex as rx class ClientSideState(rx.State): @@ -72,18 +70,18 @@ def ClientSide(): def index(): return rx.fragment( - rc.input( + rx.input( value=ClientSideState.router.session.client_token, is_read_only=True, id="token", ), - rc.input( + rx.input( placeholder="state var", value=ClientSideState.state_var, on_change=ClientSideState.set_state_var, # type: ignore id="state_var", ), - rc.input( + rx.input( placeholder="input value", value=ClientSideState.input_value, on_change=ClientSideState.set_input_value, # type: ignore @@ -313,7 +311,6 @@ async def test_client_side_state( # no cookies should be set yet! assert not driver.get_cookies() local_storage_items = local_storage.items() - local_storage_items.pop("chakra-ui-color-mode", None) local_storage_items.pop("last_compiled_time", None) assert not local_storage_items @@ -429,7 +426,6 @@ async def test_client_side_state( assert f"{sub_state_name}.c3" not in cookie_info_map(driver) local_storage_items = local_storage.items() - local_storage_items.pop("chakra-ui-color-mode", None) local_storage_items.pop("last_compiled_time", None) assert local_storage_items.pop(f"{sub_state_name}.l1") == "l1 value" assert local_storage_items.pop(f"{sub_state_name}.l2") == "l2 value" diff --git a/integration/test_dynamic_routes.py b/integration/test_dynamic_routes.py index 235232461..dc75eac6f 100644 --- a/integration/test_dynamic_routes.py +++ b/integration/test_dynamic_routes.py @@ -17,8 +17,6 @@ def DynamicRoute(): """App for testing dynamic routes.""" from typing import List - import reflex_chakra as rc - import reflex as rx class DynamicState(rx.State): @@ -41,13 +39,13 @@ def DynamicRoute(): def index(): return rx.fragment( - rc.input( + rx.input( value=DynamicState.router.session.client_token, is_read_only=True, id="token", ), - rc.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore - rc.input( + rx.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore + rx.input( value=DynamicState.router.page.raw_path, is_read_only=True, id="raw_path", @@ -60,10 +58,10 @@ def DynamicRoute(): id="link_page_next", # type: ignore ), rx.link("missing", href="/missing", id="link_missing"), - rc.list( + rx.list( # type: ignore rx.foreach( DynamicState.order, # type: ignore - lambda i: rc.list_item(rx.text(i)), + lambda i: rx.list_item(rx.text(i)), ), ), ) diff --git a/integration/test_event_actions.py b/integration/test_event_actions.py index 5845d80f1..499478a1c 100644 --- a/integration/test_event_actions.py +++ b/integration/test_event_actions.py @@ -16,8 +16,6 @@ def TestEventAction(): """App for testing event_actions.""" from typing import List, Optional - import reflex_chakra as rc - import reflex as rx class EventActionState(rx.State): @@ -55,7 +53,7 @@ def TestEventAction(): def index(): return rx.vstack( - rc.input( + rx.input( value=EventActionState.router.session.client_token, is_read_only=True, id="token", @@ -148,10 +146,10 @@ def TestEventAction(): 200 ).stop_propagation, ), - rc.list( + rx.list( # type: ignore rx.foreach( EventActionState.order, # type: ignore - rc.list_item, + rx.list_item, ), ), on_click=EventActionState.on_click("outer"), # type: ignore diff --git a/integration/test_event_chain.py b/integration/test_event_chain.py index cdef575a1..740fc71a3 100644 --- a/integration/test_event_chain.py +++ b/integration/test_event_chain.py @@ -18,8 +18,6 @@ def EventChain(): import time from typing import List - import reflex_chakra as rc - import reflex as rx # repeated here since the outer global isn't exported into the App module @@ -129,7 +127,7 @@ def EventChain(): app = rx.App(state=rx.State) - token_input = rc.input( + token_input = rx.input( value=State.router.session.client_token, is_read_only=True, id="token" ) @@ -137,7 +135,7 @@ def EventChain(): def index(): return rx.fragment( token_input, - rc.input(value=State.interim_value, is_read_only=True, id="interim_value"), + rx.input(value=State.interim_value, is_read_only=True, id="interim_value"), rx.button( "Return Event", id="return_event", diff --git a/integration/test_form_submit.py b/integration/test_form_submit.py index acc6bca96..a020a7e15 100644 --- a/integration/test_form_submit.py +++ b/integration/test_form_submit.py @@ -20,8 +20,6 @@ def FormSubmit(form_component): """ from typing import Dict, List - import reflex_chakra as rc - import reflex as rx class FormState(rx.State): @@ -37,28 +35,29 @@ def FormSubmit(form_component): @app.add_page def index(): return rx.vstack( - rc.input( + rx.input( value=FormState.router.session.client_token, is_read_only=True, id="token", ), eval(form_component)( rx.vstack( - rc.input(id="name_input"), - rx.hstack(rc.pin_input(length=4, id="pin_input")), - rc.number_input(id="number_input"), + rx.input(id="name_input"), rx.checkbox(id="bool_input"), rx.switch(id="bool_input2"), rx.checkbox(id="bool_input3"), rx.switch(id="bool_input4"), rx.slider(id="slider_input", default_value=[50], width="100%"), - rc.range_slider(id="range_input"), rx.radio(["option1", "option2"], id="radio_input"), rx.radio(FormState.var_options, id="radio_input_var"), - rc.select(["option1", "option2"], id="select_input"), - rc.select(FormState.var_options, id="select_input_var"), + rx.select( + ["option1", "option2"], + name="select_input", + default_value="option1", + ), + rx.select(FormState.var_options, id="select_input_var"), rx.text_area(id="text_area_input"), - rc.input( + rx.input( id="debounce_input", debounce_timeout=0, on_change=rx.console_log, @@ -81,8 +80,6 @@ def FormSubmitName(form_component): """ from typing import Dict, List - import reflex_chakra as rc - import reflex as rx class FormState(rx.State): @@ -98,22 +95,19 @@ def FormSubmitName(form_component): @app.add_page def index(): return rx.vstack( - rc.input( + rx.input( value=FormState.router.session.client_token, is_read_only=True, id="token", ), eval(form_component)( rx.vstack( - rc.input(name="name_input"), - rx.hstack(rc.pin_input(length=4, name="pin_input")), - rc.number_input(name="number_input"), + rx.input(name="name_input"), rx.checkbox(name="bool_input"), rx.switch(name="bool_input2"), rx.checkbox(name="bool_input3"), rx.switch(name="bool_input4"), rx.slider(name="slider_input", default_value=[50], width="100%"), - rc.range_slider(name="range_input"), rx.radio(FormState.options, name="radio_input"), rx.select( FormState.options, @@ -121,21 +115,13 @@ def FormSubmitName(form_component): default_value=FormState.options[0], ), rx.text_area(name="text_area_input"), - rc.input_group( - rc.input_left_element(rx.icon(tag="chevron_right")), - rc.input( - name="debounce_input", - debounce_timeout=0, - on_change=rx.console_log, - ), - rc.input_right_element(rx.icon(tag="chevron_left")), - ), - rc.button_group( - rx.button("Submit", type_="submit"), - rx.icon_button(FormState.val, icon=rx.icon(tag="plus")), - variant="outline", - is_attached=True, + rx.input( + name="debounce_input", + debounce_timeout=0, + on_change=rx.console_log, ), + rx.button("Submit", type_="submit"), + rx.icon_button(FormState.val, icon=rx.icon(tag="plus")), ), on_submit=FormState.form_submit, custom_attrs={"action": "/invalid"}, @@ -152,16 +138,12 @@ def FormSubmitName(form_component): functools.partial(FormSubmitName, form_component="rx.form.root"), functools.partial(FormSubmit, form_component="rx.el.form"), functools.partial(FormSubmitName, form_component="rx.el.form"), - functools.partial(FormSubmit, form_component="rc.form"), - functools.partial(FormSubmitName, form_component="rc.form"), ], ids=[ "id-radix", "name-radix", "id-html", "name-html", - "id-chakra", - "name-chakra", ], ) def form_submit(request, tmp_path_factory) -> Generator[AppHarness, None, None]: @@ -224,16 +206,6 @@ async def test_submit(driver, form_submit: AppHarness): name_input = driver.find_element(by, "name_input") name_input.send_keys("foo") - pin_inputs = driver.find_elements(By.CLASS_NAME, "chakra-pin-input") - pin_values = ["8", "1", "6", "4"] - for i, pin_input in enumerate(pin_inputs): - pin_input.send_keys(pin_values[i]) - - number_input = driver.find_element(By.CLASS_NAME, "chakra-numberinput") - buttons = number_input.find_elements(By.XPATH, "//div[@role='button']") - for _ in range(3): - buttons[1].click() - checkbox_input = driver.find_element(By.XPATH, "//button[@role='checkbox']") checkbox_input.click() @@ -275,15 +247,12 @@ async def test_submit(driver, form_submit: AppHarness): print(form_data) assert form_data["name_input"] == "foo" - assert form_data["pin_input"] == pin_values - assert form_data["number_input"] == "-3" assert form_data["bool_input"] assert form_data["bool_input2"] assert not form_data.get("bool_input3", False) assert not form_data.get("bool_input4", False) assert form_data["slider_input"] == "50" - assert form_data["range_input"] == ["25", "75"] assert form_data["radio_input"] == "option2" assert form_data["select_input"] == "option1" assert form_data["text_area_input"] == "Some\nText" diff --git a/integration/test_server_side_event.py b/integration/test_server_side_event.py index 8687b0f32..ee5e8dbc0 100644 --- a/integration/test_server_side_event.py +++ b/integration/test_server_side_event.py @@ -11,8 +11,6 @@ from reflex.testing import AppHarness def ServerSideEvent(): """App with inputs set via event handlers and set_value.""" - import reflex_chakra as rc - import reflex as rx class SSState(rx.State): @@ -41,12 +39,12 @@ def ServerSideEvent(): @app.add_page def index(): return rx.fragment( - rc.input( + rx.input( id="token", value=SSState.router.session.client_token, is_read_only=True ), - rc.input(default_value="a", id="a"), - rc.input(default_value="b", id="b"), - rc.input(default_value="c", id="c"), + rx.input(default_value="a", id="a"), + rx.input(default_value="b", id="b"), + rx.input(default_value="c", id="c"), rx.button( "Clear Immediate", id="clear_immediate", diff --git a/integration/test_table.py b/integration/test_table.py index d28798a98..09004a874 100644 --- a/integration/test_table.py +++ b/integration/test_table.py @@ -10,91 +10,47 @@ from reflex.testing import AppHarness def Table(): """App using table component.""" - from typing import List - - import reflex_chakra as rc - import reflex as rx - class TableState(rx.State): - rows: List[List[str]] = [ - ["John", "30", "New York"], - ["Jane", "31", "San Fransisco"], - ["Joe", "32", "Los Angeles"], - ] - - headers: List[str] = ["Name", "Age", "Location"] - - footers: List[str] = ["footer1", "footer2", "footer3"] - - caption: str = "random caption" - app = rx.App(state=rx.State) @app.add_page def index(): return rx.center( - rc.input( + rx.input( id="token", - value=TableState.router.session.client_token, + value=rx.State.router.session.client_token, is_read_only=True, ), - rc.table_container( - rc.table( - headers=TableState.headers, - rows=TableState.rows, - footers=TableState.footers, - caption=TableState.caption, - variant="striped", - color_scheme="blue", - width="100%", + rx.table.root( + rx.table.header( + rx.table.row( + rx.table.column_header_cell("Name"), + rx.table.column_header_cell("Age"), + rx.table.column_header_cell("Location"), + ), ), + rx.table.body( + rx.table.row( + rx.table.row_header_cell("John"), + rx.table.cell(30), + rx.table.cell("New York"), + ), + rx.table.row( + rx.table.row_header_cell("Jane"), + rx.table.cell(31), + rx.table.cell("San Fransisco"), + ), + rx.table.row( + rx.table.row_header_cell("Joe"), + rx.table.cell(32), + rx.table.cell("Los Angeles"), + ), + ), + width="100%", ), ) - @app.add_page - def another(): - return rx.center( - rc.table_container( - rc.table( # type: ignore - rc.thead( # type: ignore - rc.tr( # type: ignore - rc.th("Name"), - rc.th("Age"), - rc.th("Location"), - ) - ), - rc.tbody( # type: ignore - rc.tr( # type: ignore - rc.td("John"), - rc.td(30), - rc.td("New York"), - ), - rc.tr( # type: ignore - rc.td("Jane"), - rc.td(31), - rc.td("San Francisco"), - ), - rc.tr( # type: ignore - rc.td("Joe"), - rc.td(32), - rc.td("Los Angeles"), - ), - ), - rc.tfoot( # type: ignore - rc.tr( - rc.td("footer1"), - rc.td("footer2"), - rc.td("footer3"), - ) # type: ignore - ), - rc.table_caption("random caption"), - variant="striped", - color_scheme="teal", - ) - ) - ) - @pytest.fixture() def table(tmp_path_factory) -> Generator[AppHarness, None, None]: @@ -138,23 +94,20 @@ def driver(table: AppHarness): driver.quit() -@pytest.mark.parametrize("route", ["", "/another"]) -def test_table(driver, table: AppHarness, route): +def test_table(driver, table: AppHarness): """Test that a table component is rendered properly. Args: driver: Selenium WebDriver open to the app table: Harness for Table app - route: Page route or path. """ - driver.get(f"{table.frontend_url}/{route}") assert table.app_instance is not None, "app is not running" thead = driver.find_element(By.TAG_NAME, "thead") # poll till page is fully loaded. table.poll_for_content(element=thead) # check headers - assert thead.find_element(By.TAG_NAME, "tr").text == "NAME AGE LOCATION" + assert thead.find_element(By.TAG_NAME, "tr").text == "Name Age Location" # check first row value assert ( driver.find_element(By.TAG_NAME, "tbody") @@ -162,12 +115,3 @@ def test_table(driver, table: AppHarness, route): .text == "John 30 New York" ) - # check footer - assert ( - driver.find_element(By.TAG_NAME, "tfoot") - .find_element(By.TAG_NAME, "tr") - .text.lower() - == "footer1 footer2 footer3" - ) - # check caption - assert driver.find_element(By.TAG_NAME, "caption").text == "random caption" diff --git a/integration/test_tailwind.py b/integration/test_tailwind.py index 491eba538..bda664a1c 100644 --- a/integration/test_tailwind.py +++ b/integration/test_tailwind.py @@ -27,8 +27,6 @@ def TailwindApp( """ from pathlib import Path - import reflex_chakra as rc - import reflex as rx class UnusedState(rx.State): @@ -36,7 +34,7 @@ def TailwindApp( def index(): return rx.el.div( - rc.text(paragraph_text, class_name=paragraph_class_name), + rx.text(paragraph_text, class_name=paragraph_class_name), rx.el.p(paragraph_text, class_name=paragraph_class_name), rx.text(paragraph_text, as_="p", class_name=paragraph_class_name), rx.el.div("Test external stylesheet", class_name="external"), diff --git a/integration/test_upload.py b/integration/test_upload.py index 1f8b39efc..813313462 100644 --- a/integration/test_upload.py +++ b/integration/test_upload.py @@ -16,8 +16,6 @@ def UploadFile(): """App for testing dynamic routes.""" from typing import Dict, List - import reflex_chakra as rc - import reflex as rx class UploadState(rx.State): @@ -46,7 +44,7 @@ def UploadFile(): def index(): return rx.vstack( - rc.input( + rx.input( value=UploadState.router.session.client_token, is_read_only=True, id="token", diff --git a/integration/test_var_operations.py b/integration/test_var_operations.py index 2feb80ae0..3542bdf39 100644 --- a/integration/test_var_operations.py +++ b/integration/test_var_operations.py @@ -14,8 +14,6 @@ def VarOperations(): """App with var operations.""" from typing import Dict, List - import reflex_chakra as rc - import reflex as rx from reflex.ivars.base import LiteralVar from reflex.ivars.sequence import ArrayVar @@ -552,10 +550,7 @@ def VarOperations(): VarOperationState.html_str, id="html_str", ), - rc.highlight( - "second", - query=[VarOperationState.str_var2], - ), + rx.el.mark("second"), rx.text(ArrayVar.range(2, 5).join(","), id="list_join_range1"), rx.text(ArrayVar.range(2, 10, 2).join(","), id="list_join_range2"), rx.text(ArrayVar.range(5, 0, -1).join(","), id="list_join_range3"), diff --git a/poetry.lock b/poetry.lock index 6604a361a..6fe39acc4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,9 +1,10 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. [[package]] name = "alembic" version = "1.13.2" description = "A database migration tool for SQLAlchemy." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -25,6 +26,7 @@ tz = ["backports.zoneinfo"] name = "annotated-types" version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -39,6 +41,7 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} name = "anyio" version = "4.4.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -61,6 +64,7 @@ trio = ["trio (>=0.23)"] name = "async-timeout" version = "4.0.3" description = "Timeout context manager for asyncio programs" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -72,6 +76,7 @@ files = [ name = "asynctest" version = "0.13.0" description = "Enhance the standard unittest package with features for testing asyncio libraries" +category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -83,6 +88,7 @@ files = [ name = "attrs" version = "24.2.0" description = "Classes Without Boilerplate" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -102,6 +108,7 @@ tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] name = "backports-tarfile" version = "1.2.0" description = "Backport of CPython tarfile module" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -117,6 +124,7 @@ testing = ["jaraco.test", "pytest (!=8.0.*)", "pytest (>=6,!=8.1.*)", "pytest-ch name = "bidict" version = "0.23.1" description = "The bidirectional mapping library for Python." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -128,6 +136,7 @@ files = [ name = "build" version = "1.2.2" description = "A simple, correct Python build frontend" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -153,6 +162,7 @@ virtualenv = ["virtualenv (>=20.0.35)"] name = "certifi" version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -164,6 +174,7 @@ files = [ name = "cffi" version = "1.17.1" description = "Foreign Function Interface for Python calling C code." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -243,6 +254,7 @@ pycparser = "*" name = "cfgv" version = "3.4.0" description = "Validate configuration and produce human readable error messages." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -254,6 +266,7 @@ files = [ name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -353,6 +366,7 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -367,6 +381,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -378,6 +393,7 @@ files = [ name = "coverage" version = "7.6.1" description = "Code coverage measurement for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -465,6 +481,7 @@ toml = ["tomli"] name = "cryptography" version = "43.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -514,6 +531,7 @@ test-randomorder = ["pytest-randomly"] name = "darglint" version = "1.8.1" description = "A utility for ensuring Google-style docstrings stay up to date with the source code." +category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -525,6 +543,7 @@ files = [ name = "dill" version = "0.3.8" description = "serialize all of Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -540,6 +559,7 @@ profile = ["gprof2dot (>=2022.7.29)"] name = "distlib" version = "0.3.8" description = "Distribution utilities" +category = "dev" optional = false python-versions = "*" files = [ @@ -551,6 +571,7 @@ files = [ name = "distro" version = "1.9.0" description = "Distro - an OS platform information API" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -562,14 +583,19 @@ files = [ name = "docutils" version = "0.20.1" description = "Docutils -- Python Documentation Utilities" +category = "main" optional = false -python-versions = "*" -files = [] +python-versions = ">=3.7" +files = [ + {file = "docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"}, + {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"}, +] [[package]] name = "exceptiongroup" version = "1.2.2" description = "Backport of PEP 654 (exception groups)" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -584,6 +610,7 @@ test = ["pytest (>=6)"] name = "fastapi" version = "0.114.0" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -604,6 +631,7 @@ standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "htt name = "filelock" version = "3.15.4" description = "A platform independent file lock." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -620,6 +648,7 @@ typing = ["typing-extensions (>=4.8)"] name = "greenlet" version = "3.0.3" description = "Lightweight in-process concurrent programming" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -691,6 +720,7 @@ test = ["objgraph", "psutil"] name = "gunicorn" version = "23.0.0" description = "WSGI HTTP Server for UNIX" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -712,6 +742,7 @@ tornado = ["tornado (>=0.2)"] name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -723,6 +754,7 @@ files = [ name = "httpcore" version = "1.0.5" description = "A minimal low-level HTTP client." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -737,13 +769,14 @@ h11 = ">=0.13,<0.15" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] trio = ["trio (>=0.22.0,<0.26.0)"] [[package]] name = "httpx" version = "0.27.2" description = "The next generation HTTP client." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -754,21 +787,22 @@ files = [ [package.dependencies] anyio = "*" certifi = "*" -httpcore = "==1.*" +httpcore = ">=1.0.0,<2.0.0" idna = "*" sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] zstd = ["zstandard (>=0.18.0)"] [[package]] name = "identify" version = "2.6.0" description = "File identification library for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -783,6 +817,7 @@ license = ["ukkonen"] name = "idna" version = "3.8" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -794,6 +829,7 @@ files = [ name = "importlib-metadata" version = "8.4.0" description = "Read metadata from Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -813,6 +849,7 @@ test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "p name = "importlib-resources" version = "6.4.4" description = "Read resources from Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -835,6 +872,7 @@ type = ["pytest-mypy"] name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -846,6 +884,7 @@ files = [ name = "jaraco-classes" version = "3.4.0" description = "Utility functions for Python class constructs" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -864,6 +903,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-ena name = "jaraco-context" version = "6.0.1" description = "Useful decorators and context managers" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -882,6 +922,7 @@ test = ["portend", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-c name = "jaraco-functools" version = "4.0.2" description = "Functools like those found in stdlib" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -900,6 +941,7 @@ test = ["jaraco.classes", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "p name = "jeepney" version = "0.8.0" description = "Low-level, pure Python DBus protocol wrapper." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -915,6 +957,7 @@ trio = ["async_generator", "trio"] name = "jinja2" version = "3.1.4" description = "A very fast and expressive template engine." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -932,6 +975,7 @@ i18n = ["Babel (>=2.7)"] name = "keyring" version = "25.3.0" description = "Store and access your passwords safely." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -958,6 +1002,7 @@ test = ["pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest- name = "lazy-loader" version = "0.4" description = "Makes it easy to load subpackages and functions on demand." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -977,6 +1022,7 @@ test = ["pytest (>=7.4)", "pytest-cov (>=4.1)"] name = "mako" version = "1.3.5" description = "A super-fast templating language that borrows the best ideas from the existing templating languages." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -996,6 +1042,7 @@ testing = ["pytest"] name = "markdown-it-py" version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1020,6 +1067,7 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] name = "markupsafe" version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1089,6 +1137,7 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1100,6 +1149,7 @@ files = [ name = "more-itertools" version = "10.5.0" description = "More routines for operating on iterables, beyond itertools" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1111,6 +1161,7 @@ files = [ name = "nh3" version = "0.2.18" description = "Python bindings to the ammonia HTML sanitization library." +category = "main" optional = false python-versions = "*" files = [ @@ -1136,6 +1187,7 @@ files = [ name = "nodeenv" version = "1.9.1" description = "Node.js virtual environment builder" +category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -1147,6 +1199,7 @@ files = [ name = "numpy" version = "1.24.4" description = "Fundamental package for array computing in Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1184,6 +1237,7 @@ files = [ name = "numpy" version = "2.0.2" description = "Fundamental package for array computing in Python" +category = "dev" optional = false python-versions = ">=3.9" files = [ @@ -1238,6 +1292,7 @@ files = [ name = "numpy" version = "2.1.1" description = "Fundamental package for array computing in Python" +category = "dev" optional = false python-versions = ">=3.10" files = [ @@ -1300,6 +1355,7 @@ files = [ name = "outcome" version = "1.3.0.post0" description = "Capture the outcome of Python function calls." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1314,6 +1370,7 @@ attrs = ">=19.2.0" name = "packaging" version = "24.1" description = "Core utilities for Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1325,6 +1382,7 @@ files = [ name = "pandas" version = "1.5.3" description = "Powerful data structures for data analysis, time series, and statistics" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1369,6 +1427,7 @@ test = ["hypothesis (>=5.5.3)", "pytest (>=6.0)", "pytest-xdist (>=1.31)"] name = "pandas" version = "2.2.2" description = "Powerful data structures for data analysis, time series, and statistics" +category = "dev" optional = false python-versions = ">=3.9" files = [ @@ -1442,6 +1501,7 @@ xml = ["lxml (>=4.9.2)"] name = "pillow" version = "10.4.0" description = "Python Imaging Library (Fork)" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1539,6 +1599,7 @@ xmp = ["defusedxml"] name = "pip" version = "24.2" description = "The PyPA recommended tool for installing Python packages." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1550,6 +1611,7 @@ files = [ name = "pipdeptree" version = "2.16.2" description = "Command line utility to show dependency tree of packages." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1568,6 +1630,7 @@ test = ["covdefaults (>=2.3)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pyte name = "pkginfo" version = "1.10.0" description = "Query metadata from sdists / bdists / installed packages." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1582,6 +1645,7 @@ testing = ["pytest", "pytest-cov", "wheel"] name = "platformdirs" version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1598,6 +1662,7 @@ type = ["mypy (>=1.8)"] name = "plotly" version = "5.24.0" description = "An open-source, interactive data visualization library for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1613,6 +1678,7 @@ tenacity = ">=6.2.0" name = "pluggy" version = "1.5.0" description = "plugin and hook calling mechanisms for python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1628,6 +1694,7 @@ testing = ["pytest", "pytest-benchmark"] name = "pre-commit" version = "3.5.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1646,6 +1713,7 @@ virtualenv = ">=20.10.0" name = "psutil" version = "6.0.0" description = "Cross-platform lib for process and system monitoring in Python." +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ @@ -1675,6 +1743,7 @@ test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] name = "py-cpuinfo" version = "9.0.0" description = "Get CPU info with pure Python" +category = "dev" optional = false python-versions = "*" files = [ @@ -1686,6 +1755,7 @@ files = [ name = "pycparser" version = "2.22" description = "C parser in Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1697,6 +1767,7 @@ files = [ name = "pydantic" version = "2.9.0" description = "Data validation using Python type hints" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1720,6 +1791,7 @@ email = ["email-validator (>=2.0.0)"] name = "pydantic-core" version = "2.23.2" description = "Core functionality for Pydantic validation and serialization" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1821,6 +1893,7 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" name = "pygments" version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1835,6 +1908,7 @@ windows-terminal = ["colorama (>=0.4.6)"] name = "pyproject-hooks" version = "1.1.0" description = "Wrappers to call pyproject.toml-based build backend hooks." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1846,6 +1920,7 @@ files = [ name = "pyright" version = "1.1.334" description = "Command line wrapper for pyright" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1864,6 +1939,7 @@ dev = ["twine (>=3.4.1)"] name = "pysocks" version = "1.7.1" description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information." +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1876,6 +1952,7 @@ files = [ name = "pytest" version = "7.4.4" description = "pytest: simple powerful testing with Python" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1898,6 +1975,7 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no name = "pytest-asyncio" version = "0.21.2" description = "Pytest support for asyncio" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1916,6 +1994,7 @@ testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy name = "pytest-benchmark" version = "4.0.0" description = "A ``pytest`` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1936,6 +2015,7 @@ histogram = ["pygal", "pygaljs"] name = "pytest-cov" version = "4.1.0" description = "Pytest plugin for measuring coverage." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1954,6 +2034,7 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale name = "pytest-mock" version = "3.14.0" description = "Thin-wrapper around the mock package for easier use with pytest" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1971,6 +2052,7 @@ dev = ["pre-commit", "pytest-asyncio", "tox"] name = "python-dateutil" version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -1985,6 +2067,7 @@ six = ">=1.5" name = "python-engineio" version = "4.9.1" description = "Engine.IO server and client for Python" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2004,6 +2087,7 @@ docs = ["sphinx"] name = "python-multipart" version = "0.0.9" description = "A streaming multipart parser for Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2018,6 +2102,7 @@ dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatc name = "python-socketio" version = "5.11.4" description = "Socket.IO server and client for Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2038,6 +2123,7 @@ docs = ["sphinx"] name = "pytz" version = "2024.1" description = "World timezone definitions, modern and historical" +category = "dev" optional = false python-versions = "*" files = [ @@ -2049,6 +2135,7 @@ files = [ name = "pywin32-ctypes" version = "0.2.3" description = "A (partial) reimplementation of pywin32 using ctypes/cffi" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2060,6 +2147,7 @@ files = [ name = "pyyaml" version = "6.0.2" description = "YAML parser and emitter for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2122,6 +2210,7 @@ files = [ name = "readme-renderer" version = "43.0" description = "readme_renderer is a library for rendering readme descriptions for Warehouse" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2141,6 +2230,7 @@ md = ["cmarkgfm (>=0.8.0)"] name = "redis" version = "5.0.8" description = "Python client for Redis database and key-value store" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2157,13 +2247,14 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "reflex-chakra" -version = "0.6.0a5" +version = "0.6.0a6" description = "reflex using chakra components" +category = "main" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_chakra-0.6.0a5-py3-none-any.whl", hash = "sha256:9d502ddf3bd606baef4f0ff6453dcefb5e19dab4cfaf7c23df069fab70687a63"}, - {file = "reflex_chakra-0.6.0a5.tar.gz", hash = "sha256:b44e73478462052f09c9677d3fd7726891b4af87711b4b6a2171f010049308c9"}, + {file = "reflex_chakra-0.6.0a6-py3-none-any.whl", hash = "sha256:a526f5db8a457c68c24317d007172e77b323a34abf03f05eeb8d92c014563bfb"}, + {file = "reflex_chakra-0.6.0a6.tar.gz", hash = "sha256:124a780ea96d36d31f46b4c97bb0c0f111f2fb6e0d66a142e1577dad740f6e35"}, ] [package.dependencies] @@ -2173,6 +2264,7 @@ reflex = ">=0.6.0a" name = "reflex-hosting-cli" version = "0.1.13" description = "Reflex Hosting CLI" +category = "main" optional = false python-versions = "<4.0,>=3.8" files = [ @@ -2196,6 +2288,7 @@ websockets = ">=10.4" name = "requests" version = "2.32.3" description = "Python HTTP for Humans." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2217,6 +2310,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "requests-toolbelt" version = "1.0.0" description = "A utility belt for advanced users of python-requests" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -2231,6 +2325,7 @@ requests = ">=2.0.1,<3.0.0" name = "rfc3986" version = "2.0.0" description = "Validating URI References per RFC 3986" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2245,6 +2340,7 @@ idna2008 = ["idna"] name = "rich" version = "13.8.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -2264,6 +2360,7 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] name = "ruff" version = "0.4.10" description = "An extremely fast Python linter and code formatter, written in Rust." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2290,6 +2387,7 @@ files = [ name = "secretstorage" version = "3.3.3" description = "Python bindings to FreeDesktop.org Secret Service API" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2305,6 +2403,7 @@ jeepney = ">=0.6" name = "selenium" version = "4.24.0" description = "Official Python bindings for Selenium WebDriver" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2324,6 +2423,7 @@ websocket-client = ">=1.8,<2.0" name = "setuptools" version = "70.1.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2339,6 +2439,7 @@ testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metad name = "shellingham" version = "1.5.4" description = "Tool to Detect Surrounding Shell" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2350,6 +2451,7 @@ files = [ name = "simple-websocket" version = "1.0.0" description = "Simple WebSocket server and client for Python" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2367,6 +2469,7 @@ docs = ["sphinx"] name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -2378,6 +2481,7 @@ files = [ name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2389,6 +2493,7 @@ files = [ name = "sortedcontainers" version = "2.4.0" description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" +category = "dev" optional = false python-versions = "*" files = [ @@ -2400,6 +2505,7 @@ files = [ name = "sqlalchemy" version = "2.0.34" description = "Database Abstraction Library" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2455,7 +2561,7 @@ files = [ ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"} +greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and platform_machine == \"aarch64\" or python_version < \"3.13\" and platform_machine == \"ppc64le\" or python_version < \"3.13\" and platform_machine == \"x86_64\" or python_version < \"3.13\" and platform_machine == \"amd64\" or python_version < \"3.13\" and platform_machine == \"AMD64\" or python_version < \"3.13\" and platform_machine == \"win32\" or python_version < \"3.13\" and platform_machine == \"WIN32\""} typing-extensions = ">=4.6.0" [package.extras] @@ -2487,6 +2593,7 @@ sqlcipher = ["sqlcipher3_binary"] name = "sqlmodel" version = "0.0.22" description = "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2502,6 +2609,7 @@ SQLAlchemy = ">=2.0.14,<2.1.0" name = "starlette" version = "0.38.4" description = "The little ASGI library that shines." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2520,6 +2628,7 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7 name = "starlette-admin" version = "0.14.1" description = "Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2543,6 +2652,7 @@ test = ["aiomysql (>=0.1.1,<0.3.0)", "aiosqlite (>=0.17.0,<0.21.0)", "arrow (>=1 name = "tabulate" version = "0.9.0" description = "Pretty-print tabular data" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2557,6 +2667,7 @@ widechars = ["wcwidth"] name = "tenacity" version = "9.0.0" description = "Retry code until it succeeds" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2572,6 +2683,7 @@ test = ["pytest", "tornado (>=4.5)", "typeguard"] name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -2583,6 +2695,7 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2594,6 +2707,7 @@ files = [ name = "tomlkit" version = "0.13.2" description = "Style preserving TOML library" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2605,6 +2719,7 @@ files = [ name = "trio" version = "0.26.2" description = "A friendly Python library for async concurrency and I/O" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2625,6 +2740,7 @@ sortedcontainers = "*" name = "trio-websocket" version = "0.11.1" description = "WebSocket library for Trio" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2641,6 +2757,7 @@ wsproto = ">=0.14" name = "twine" version = "5.1.1" description = "Collection of utilities for publishing packages on PyPI" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2663,6 +2780,7 @@ urllib3 = ">=1.26.0" name = "typer" version = "0.12.5" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2680,6 +2798,7 @@ typing-extensions = ">=3.7.4.3" name = "typing-extensions" version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2691,6 +2810,7 @@ files = [ name = "tzdata" version = "2024.1" description = "Provider of IANA time zone data" +category = "main" optional = false python-versions = ">=2" files = [ @@ -2702,6 +2822,7 @@ files = [ name = "urllib3" version = "2.2.2" description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2722,6 +2843,7 @@ zstd = ["zstandard (>=0.18.0)"] name = "uvicorn" version = "0.30.6" description = "The lightning-fast ASGI server." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2741,6 +2863,7 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", name = "virtualenv" version = "20.26.3" description = "Virtual Python Environment builder" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2761,6 +2884,7 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess name = "websocket-client" version = "1.8.0" description = "WebSocket client for Python with low level API options" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2777,6 +2901,7 @@ test = ["websockets"] name = "websockets" version = "13.0.1" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2872,6 +2997,7 @@ files = [ name = "wheel" version = "0.44.0" description = "A built-package format for Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2886,6 +3012,7 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] name = "wrapt" version = "1.16.0" description = "Module for decorators, wrappers and monkey patching." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2965,6 +3092,7 @@ files = [ name = "wsproto" version = "1.2.0" description = "WebSockets state-machine based protocol implementation" +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -2979,6 +3107,7 @@ h11 = ">=0.9.0,<1" name = "zipp" version = "3.20.1" description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2997,4 +3126,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "0bd98b6baa48d41ec50bfa0903d89005129211f6e429d7b62504ee880f8ba523" +content-hash = "7a8990e432a404802c3ace9a81c3c8c33cdd60596f26cdc38e2de424cb1126dd" diff --git a/pyproject.toml b/pyproject.toml index c8598a479..9643b69e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ httpx = ">=0.25.1,<1.0" twine = ">=4.0.0,<6.0" tomlkit = ">=0.12.4,<1.0" lazy_loader = ">=0.4" -reflex-chakra = ">=0.6.0a" +reflex-chakra = ">=0.6.0a6" [tool.poetry.group.dev.dependencies] pytest = ">=7.1.2,<8.0" diff --git a/reflex/.templates/jinja/web/pages/_app.js.jinja2 b/reflex/.templates/jinja/web/pages/_app.js.jinja2 index d4322b171..654f7a2a4 100644 --- a/reflex/.templates/jinja/web/pages/_app.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/_app.js.jinja2 @@ -27,7 +27,7 @@ function AppWrap({children}) { export default function MyApp({ Component, pageProps }) { return ( - + diff --git a/reflex/.templates/web/components/reflex/chakra_color_mode_provider.js b/reflex/.templates/web/components/reflex/chakra_color_mode_provider.js deleted file mode 100644 index ad41d5134..000000000 --- a/reflex/.templates/web/components/reflex/chakra_color_mode_provider.js +++ /dev/null @@ -1,36 +0,0 @@ -import { useColorMode as chakraUseColorMode } from "@chakra-ui/react"; -import { useTheme } from "next-themes"; -import { useEffect, useState } from "react"; -import { ColorModeContext, defaultColorMode } from "/utils/context.js"; - -export default function ChakraColorModeProvider({ children }) { - const { theme, resolvedTheme, setTheme } = useTheme(); - const { colorMode, toggleColorMode } = chakraUseColorMode(); - const [resolvedColorMode, setResolvedColorMode] = useState(colorMode); - - useEffect(() => { - if (colorMode != resolvedTheme) { - toggleColorMode(); - } - setResolvedColorMode(resolvedTheme); - }, [theme, resolvedTheme]); - - const rawColorMode = colorMode; - const setColorMode = (mode) => { - const allowedModes = ["light", "dark", "system"]; - if (!allowedModes.includes(mode)) { - console.error( - `Invalid color mode "${mode}". Defaulting to "${defaultColorMode}".` - ); - mode = defaultColorMode; - } - setTheme(mode); - }; - return ( - - {children} - - ); -} diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index 22c7298fe..b11da5fb0 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -132,6 +132,7 @@ from .components.radix.themes.layout.container import container as container from .components.radix.themes.layout.flex import flex as flex from .components.radix.themes.layout.grid import grid as grid from .components.radix.themes.layout.list import list_item as list_item +from .components.radix.themes.layout.list import list_ns as list # noqa from .components.radix.themes.layout.list import ordered_list as ordered_list from .components.radix.themes.layout.list import unordered_list as unordered_list from .components.radix.themes.layout.section import section as section diff --git a/reflex/components/radix/__init__.pyi b/reflex/components/radix/__init__.pyi index 8ba6c242b..f4e81666a 100644 --- a/reflex/components/radix/__init__.pyi +++ b/reflex/components/radix/__init__.pyi @@ -55,6 +55,7 @@ from .themes.layout.container import container as container from .themes.layout.flex import flex as flex from .themes.layout.grid import grid as grid from .themes.layout.list import list_item as list_item +from .themes.layout.list import list_ns as list # noqa from .themes.layout.list import ordered_list as ordered_list from .themes.layout.list import unordered_list as unordered_list from .themes.layout.section import section as section diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index 5a7fb2d99..82bb3c036 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -262,26 +262,6 @@ class ThemePanel(RadixThemesComponent): """ return {"react": "useEffect"} - def add_hooks(self) -> list[str]: - """Add a hook on the ThemePanel to clear chakra-ui-color-mode. - - Returns: - The hooks to render. - """ - # The panel freezes the tab if the user color preference differs from the - # theme "appearance", so clear it out when theme panel is used. - return [ - """ - useEffect(() => { - if (typeof window !== 'undefined') { - window.onbeforeunload = () => { - localStorage.removeItem('chakra-ui-color-mode'); - } - window.onbeforeunload(); - } - }, [])""" - ] - class RadixThemesColorModeProvider(Component): """Next-themes integration for radix themes components.""" diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index c79557024..fd0b7e092 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -583,7 +583,6 @@ class Theme(RadixThemesComponent): class ThemePanel(RadixThemesComponent): def add_imports(self) -> dict[str, str]: ... - def add_hooks(self) -> list[str]: ... @overload @classmethod def create( # type: ignore diff --git a/reflex/components/radix/themes/layout/__init__.pyi b/reflex/components/radix/themes/layout/__init__.pyi index 1420299e0..6712a3068 100644 --- a/reflex/components/radix/themes/layout/__init__.pyi +++ b/reflex/components/radix/themes/layout/__init__.pyi @@ -9,6 +9,7 @@ from .container import container as container from .flex import flex as flex from .grid import grid as grid from .list import list_item as list_item +from .list import list_ns as list # noqa from .list import ordered_list as ordered_list from .list import unordered_list as unordered_list from .section import section as section diff --git a/reflex/style.py b/reflex/style.py index b29160cb2..5e5503e66 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -290,7 +290,6 @@ def _format_emotion_style_pseudo_selector(key: str) -> str: """ prefix = None if key.startswith("_"): - # Handle pseudo selectors in chakra style format. prefix = "&:" key = key[1:] if key.startswith(":"): diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index cc60418a9..bd0d9f118 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -903,7 +903,13 @@ class PyiGenerator: # construct the import statement and handle special cases for aliases sub_mod_attrs_imports = [ f"from .{path} import {mod if not isinstance(mod, tuple) else mod[0]} as {mod if not isinstance(mod, tuple) else mod[1]}" - + (" # type: ignore" if mod in pyright_ignore_imports else "") + + ( + " # type: ignore" + if mod in pyright_ignore_imports + else " # noqa" # ignore ruff formatting here for cases like rx.list. + if isinstance(mod, tuple) + else "" + ) for mod, path in sub_mod_attrs.items() ] sub_mod_attrs_imports.append("") diff --git a/tests/components/datadisplay/test_table.py b/tests/components/datadisplay/test_table.py deleted file mode 100644 index 8740d4b8c..000000000 --- a/tests/components/datadisplay/test_table.py +++ /dev/null @@ -1,177 +0,0 @@ -import sys -from typing import List, Tuple - -import pytest -from reflex_chakra.components.datadisplay.table import Tbody, Tfoot, Thead - -from reflex.state import BaseState - -PYTHON_GT_V38 = sys.version_info.major >= 3 and sys.version_info.minor > 8 - - -class TableState(BaseState): - """Test State class.""" - - rows_List_List_str: List[List[str]] = [["random", "row"]] - rows_List_List: List[List] = [["random", "row"]] - rows_List_str: List[str] = ["random", "row"] - rows_Tuple_List_str: Tuple[List[str]] = (["random", "row"],) - rows_Tuple_List: Tuple[List] = ["random", "row"] # type: ignore - rows_Tuple_str_str: Tuple[str, str] = ( - "random", - "row", - ) - rows_Tuple_Tuple_str_str: Tuple[Tuple[str, str]] = ( - ( - "random", - "row", - ), - ) - rows_Tuple_Tuple: Tuple[Tuple] = ( - ( - "random", - "row", - ), - ) - rows_str: str = "random, row" - headers_List_str: List[str] = ["header1", "header2"] - headers_Tuple_str_str: Tuple[str, str] = ( - "header1", - "header2", - ) - headers_str: str = "headers1, headers2" - footers_List_str: List[str] = ["footer1", "footer2"] - footers_Tuple_str_str: Tuple[str, str] = ( - "footer1", - "footer2", - ) - footers_str: str = "footer1, footer2" - - if sys.version_info.major >= 3 and sys.version_info.minor > 8: - rows_list_list_str: list[list[str]] = [["random", "row"]] - rows_list_list: list[list] = [["random", "row"]] - rows_list_str: list[str] = ["random", "row"] - rows_tuple_list_str: tuple[list[str]] = (["random", "row"],) - rows_tuple_list: tuple[list] = ["random", "row"] # type: ignore - rows_tuple_str_str: tuple[str, str] = ( - "random", - "row", - ) - rows_tuple_tuple_str_str: tuple[tuple[str, str]] = ( - ( - "random", - "row", - ), - ) - rows_tuple_tuple: tuple[tuple] = ( - ( - "random", - "row", - ), - ) - - -valid_extras = ( - [ - TableState.rows_list_list_str, - TableState.rows_list_list, - TableState.rows_tuple_list_str, - TableState.rows_tuple_list, - TableState.rows_tuple_tuple_str_str, - TableState.rows_tuple_tuple, - ] - if PYTHON_GT_V38 - else [] -) -invalid_extras = ( - [TableState.rows_list_str, TableState.rows_tuple_str_str] if PYTHON_GT_V38 else [] -) - - -@pytest.mark.parametrize( - "rows", - [ - [["random", "row"]], - TableState.rows_List_List_str, - TableState.rows_List_List, - TableState.rows_Tuple_List_str, - TableState.rows_Tuple_List, - TableState.rows_Tuple_Tuple_str_str, - TableState.rows_Tuple_Tuple, - *valid_extras, - ], -) -def test_create_table_body_with_valid_rows_prop(rows): - render_dict = Tbody.create(rows=rows).render() - assert render_dict["name"] == "Tbody" - assert len(render_dict["children"]) == 1 - - -@pytest.mark.parametrize( - "rows", - [ - ["random", "row"], - "random, rows", - TableState.rows_List_str, - TableState.rows_Tuple_str_str, - TableState.rows_str, - *invalid_extras, - ], -) -def test_create_table_body_with_invalid_rows_prop(rows): - with pytest.raises(TypeError): - Tbody.create(rows=rows) - - -@pytest.mark.parametrize( - "headers", - [ - ["random", "header"], - TableState.headers_List_str, - TableState.headers_Tuple_str_str, - ], -) -def test_create_table_head_with_valid_headers_prop(headers): - render_dict = Thead.create(headers=headers).render() - assert render_dict["name"] == "Thead" - assert len(render_dict["children"]) == 1 - assert render_dict["children"][0]["name"] == "Tr" - - -@pytest.mark.parametrize( - "headers", - [ - "random, header", - TableState.headers_str, - ], -) -def test_create_table_head_with_invalid_headers_prop(headers): - with pytest.raises(TypeError): - Thead.create(headers=headers) - - -@pytest.mark.parametrize( - "footers", - [ - ["random", "footers"], - TableState.footers_List_str, - TableState.footers_Tuple_str_str, - ], -) -def test_create_table_footer_with_valid_footers_prop(footers): - render_dict = Tfoot.create(footers=footers).render() - assert render_dict["name"] == "Tfoot" - assert len(render_dict["children"]) == 1 - assert render_dict["children"][0]["name"] == "Tr" - - -@pytest.mark.parametrize( - "footers", - [ - "random, footers", - TableState.footers_str, - ], -) -def test_create_table_footer_with_invalid_footers_prop(footers): - with pytest.raises(TypeError): - Tfoot.create(footers=footers) diff --git a/tests/components/forms/test_form.py b/tests/components/forms/test_form.py index efb31b97a..0611c6994 100644 --- a/tests/components/forms/test_form.py +++ b/tests/components/forms/test_form.py @@ -1,5 +1,4 @@ -from reflex_chakra.components.forms.form import Form - +from reflex.components.radix.primitives.form import Form from reflex.event import EventChain from reflex.ivars.base import ImmutableVar diff --git a/tests/components/media/test_icon.py b/tests/components/media/test_icon.py deleted file mode 100644 index 6a152c587..000000000 --- a/tests/components/media/test_icon.py +++ /dev/null @@ -1,55 +0,0 @@ -import pytest -from reflex_chakra.components.media.icon import ICON_LIST, Icon - -from reflex.utils import format - - -def test_no_tag_errors(): - """Test that an icon without a tag raises an error.""" - with pytest.raises(AttributeError): - Icon.create() - - -def test_children_errors(): - """Test that an icon with children raises an error.""" - with pytest.raises(AttributeError): - Icon.create("child", tag="search") - - -@pytest.mark.parametrize( - "tag", - ICON_LIST, -) -def test_valid_icon(tag: str): - """Test that a valid icon does not raise an error. - - Args: - tag: The icon tag. - """ - icon = Icon.create(tag=tag) - assert icon.tag == format.to_title_case(tag) + "Icon" - - -@pytest.mark.parametrize("tag", ["", " ", "invalid", 123]) -def test_invalid_icon(tag): - """Test that an invalid icon raises an error. - - Args: - tag: The icon tag. - """ - with pytest.raises(ValueError): - Icon.create(tag=tag) - - -@pytest.mark.parametrize( - "tag", - ["Check", "Close", "eDit"], -) -def test_tag_with_capital(tag: str): - """Test that an icon that tag with capital does not raise an error. - - Args: - tag: The icon tag. - """ - icon = Icon.create(tag=tag) - assert icon.tag == format.to_title_case(tag) + "Icon" diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 3ce5decad..592e1ca6e 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -2,8 +2,6 @@ from contextlib import nullcontext from typing import Any, Dict, List, Optional, Type, Union import pytest -import reflex_chakra as rc -from reflex_chakra.components.layout.box import Box import reflex as rx from reflex.base import Base @@ -16,6 +14,7 @@ from reflex.components.component import ( StatefulComponent, custom_component, ) +from reflex.components.radix.themes.layout.box import Box from reflex.constants import EventTriggers from reflex.event import EventChain, EventHandler, parse_args_spec from reflex.ivars.base import ImmutableVar, LiteralVar @@ -1114,8 +1113,8 @@ def test_component_with_only_valid_children(fixture, request): [ (rx.text("hi"), '\n {"hi"}\n'), ( - rx.box(rc.heading("test", size="md")), - '\n \n {"test"}\n\n', + rx.box(rx.heading("test", size="3")), + '\n \n {"test"}\n\n', ), ], ) diff --git a/tests/components/typography/test_markdown.py b/tests/components/typography/test_markdown.py index 2ef6fbce4..5e9abbb1f 100644 --- a/tests/components/typography/test_markdown.py +++ b/tests/components/typography/test_markdown.py @@ -1,5 +1,4 @@ import pytest -import reflex_chakra as rc import reflex as rx from reflex.components.markdown import Markdown @@ -37,9 +36,7 @@ def test_get_component(tag, expected): def test_set_component_map(): """Test setting the component map.""" component_map = { - "h1": lambda value: rx.box( - rc.heading(value, as_="h1", size="2xl"), padding="1em" - ), + "h1": lambda value: rx.box(rx.heading(value, as_="h1"), padding="1em"), "p": lambda value: rx.box(rx.text(value), padding="1em"), } md = Markdown.create("# Hello", component_map=component_map) diff --git a/tests/test_app.py b/tests/test_app.py index 0c81f1e2c..5544736bf 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -13,7 +13,6 @@ from typing import Generator, List, Tuple, Type from unittest.mock import AsyncMock import pytest -import reflex_chakra as rc import sqlmodel from fastapi import FastAPI, UploadFile from starlette_admin.auth import AuthProvider @@ -1311,13 +1310,13 @@ def test_app_wrap_priority(compilable_app: tuple[App, Path]): tag = "Fragment1" def _get_app_wrap_components(self) -> dict[tuple[int, str], Component]: - return {(99, "Box"): rc.box()} + return {(99, "Box"): rx.box()} class Fragment2(Component): tag = "Fragment2" def _get_app_wrap_components(self) -> dict[tuple[int, str], Component]: - return {(50, "Text"): rc.text()} + return {(50, "Text"): rx.text()} class Fragment3(Component): tag = "Fragment3" @@ -1337,19 +1336,17 @@ def test_app_wrap_priority(compilable_app: tuple[App, Path]): assert ( "function AppWrap({children}) {" "return (" - "" - "" - "" - "" + "" + '' + "" "" "" "{children}" "" "" - "" - "" - "" - "" + "" + "" + "" ")" "}" ) in "".join(app_js_lines) From 7c253586072adee4f745ee0950f9a980a561aa88 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 13 Sep 2024 11:20:25 -0700 Subject: [PATCH 018/201] [ENG-3717] [flexgen] Initialize app from refactored code (#3918) --- reflex/constants/base.py | 4 +++- reflex/utils/exceptions.py | 4 ++++ reflex/utils/prerequisites.py | 33 ++++++++++++++++++++++++++------- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/reflex/constants/base.py b/reflex/constants/base.py index d5407902e..df64a1006 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -117,7 +117,9 @@ class Templates(SimpleNamespace): REFLEX_BUILD_POLL_URL = REFLEX_BUILD_BACKEND + "/api/init/{reflex_init_token}" # The URL to fetch the generation's reflex code - REFLEX_BUILD_CODE_URL = REFLEX_BUILD_BACKEND + "/api/gen/{generation_hash}" + REFLEX_BUILD_CODE_URL = ( + REFLEX_BUILD_BACKEND + "/api/gen/{generation_hash}/refactored" + ) class Dirs(SimpleNamespace): """Folders used by the template system of Reflex.""" diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index dbab3fb6d..891ebe047 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -91,3 +91,7 @@ class EventFnArgMismatch(ReflexError, TypeError): class DynamicRouteArgShadowsStateVar(ReflexError, NameError): """Raised when a dynamic route arg shadows a state var.""" + + +class GeneratedCodeHasNoFunctionDefs(ReflexError): + """Raised when refactored code generated with flexgen has no functions defined.""" diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index e061207f4..3384be5cf 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -15,7 +15,7 @@ import shutil import stat import sys import tempfile -import textwrap +import time import zipfile from datetime import datetime from fileinput import FileInput @@ -36,6 +36,7 @@ from reflex.base import Base from reflex.compiler import templates from reflex.config import Config, get_config from reflex.utils import console, net, path_ops, processes +from reflex.utils.exceptions import GeneratedCodeHasNoFunctionDefs from reflex.utils.format import format_library_name from reflex.utils.registry import _get_best_registry @@ -1435,19 +1436,37 @@ def initialize_main_module_index_from_generation(app_name: str, generation_hash: Args: app_name: The name of the app. generation_hash: The generation hash from reflex.build. + + Raises: + GeneratedCodeHasNoFunctionDefs: If the fetched code has no function definitions + (the refactored reflex code is expected to have at least one root function defined). """ # Download the reflex code for the generation. - resp = net.get( - constants.Templates.REFLEX_BUILD_CODE_URL.format( - generation_hash=generation_hash + url = constants.Templates.REFLEX_BUILD_CODE_URL.format( + generation_hash=generation_hash + ) + resp = net.get(url) + while resp.status_code == httpx.codes.SERVICE_UNAVAILABLE: + console.debug("Waiting for the code to be generated...") + time.sleep(1) + resp = net.get(url) + resp.raise_for_status() + + # Determine the name of the last function, which renders the generated code. + defined_funcs = re.findall(r"def ([a-zA-Z_]+)\(", resp.text) + if not defined_funcs: + raise GeneratedCodeHasNoFunctionDefs( + f"No function definitions found in generated code from {url!r}." ) - ).raise_for_status() + render_func_name = defined_funcs[-1] def replace_content(_match): return "\n".join( [ - "def index() -> rx.Component:", - textwrap.indent("return " + resp.text, " "), + resp.text, + "", + "" "def index() -> rx.Component:", + f" return {render_func_name}()", "", "", ], From 8f937f0417f8bd7ea1bed032809204fdf06931fa Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 13 Sep 2024 12:53:30 -0700 Subject: [PATCH 019/201] Remove Pydantic from some classes (#3907) * half of the way there * add dataclass support * Forbid Computed var shadowing (#3843) * get it right pyright * fix unit tests * rip out more pydantic * fix weird issues with merge_imports * add missing docstring * make special props a list instead of a set * fix moment pyi * actually ignore the runtime error * it's ruff out there --------- Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> --- reflex/app.py | 5 +- reflex/components/component.py | 9 +- reflex/components/core/upload.py | 8 +- reflex/components/el/elements/metadata.py | 6 +- reflex/components/markdown/markdown.py | 6 +- reflex/components/moment/moment.py | 23 ++-- reflex/components/moment/moment.pyi | 5 +- reflex/components/plotly/plotly.py | 4 +- reflex/components/tags/cond_tag.py | 9 +- reflex/components/tags/iter_tag.py | 15 ++- reflex/components/tags/match_tag.py | 9 +- reflex/components/tags/tag.py | 57 ++++++---- reflex/event.py | 126 +++++++++++++++------ reflex/ivars/base.py | 21 +++- reflex/middleware/hydrate_middleware.py | 2 + reflex/middleware/middleware.py | 6 +- reflex/state.py | 131 ++++++++++++++++------ reflex/utils/format.py | 9 ++ reflex/utils/imports.py | 89 +++------------ reflex/utils/prerequisites.py | 10 +- reflex/utils/telemetry.py | 3 +- reflex/utils/types.py | 7 +- tests/components/test_component.py | 34 +++--- tests/test_app.py | 3 +- tests/test_state.py | 34 +++--- tests/utils/test_format.py | 1 + tests/utils/test_imports.py | 10 +- 27 files changed, 394 insertions(+), 248 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 9e5c2541a..43edee983 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -9,6 +9,7 @@ import copy import functools import inspect import io +import json import multiprocessing import os import platform @@ -1096,6 +1097,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): if delta: # When the state is modified reset dirty status and emit the delta to the frontend. state._clean() + print(dir(state.router)) await self.event_namespace.emit_update( update=StateUpdate(delta=delta), sid=state.router.session.session_id, @@ -1531,8 +1533,9 @@ class EventNamespace(AsyncNamespace): sid: The Socket.IO session id. data: The event data. """ + fields = json.loads(data) # Get the event. - event = Event.parse_raw(data) + event = Event(**{k: v for k, v in fields.items() if k != "handler"}) self.token_to_sid[event.token] = sid self.sid_to_token[sid] = event.token diff --git a/reflex/components/component.py b/reflex/components/component.py index e838c86d1..c2ca7c001 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -4,6 +4,7 @@ from __future__ import annotations import copy import typing +import warnings from abc import ABC, abstractmethod from functools import lru_cache, wraps from hashlib import md5 @@ -169,6 +170,8 @@ ComponentStyle = Dict[ ] ComponentChild = Union[types.PrimitiveType, Var, BaseComponent] +warnings.filterwarnings("ignore", message="fields may not start with an underscore") + class Component(BaseComponent, ABC): """A component with style, event trigger and other props.""" @@ -195,7 +198,7 @@ class Component(BaseComponent, ABC): class_name: Any = None # Special component props. - special_props: Set[ImmutableVar] = set() + special_props: List[ImmutableVar] = [] # Whether the component should take the focus once the page is loaded autofocus: bool = False @@ -655,7 +658,7 @@ class Component(BaseComponent, ABC): """ # Create the base tag. tag = Tag( - name=self.tag if not self.alias else self.alias, + name=(self.tag if not self.alias else self.alias) or "", special_props=self.special_props, ) @@ -2244,7 +2247,7 @@ class StatefulComponent(BaseComponent): Returns: The tag to render. """ - return dict(Tag(name=self.tag)) + return dict(Tag(name=self.tag or "")) def __str__(self) -> str: """Represent the component in React. diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index b6fe1024a..7501934d8 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -247,9 +247,9 @@ class Upload(MemoizationLeaf): } # The file input to use. upload = Input.create(type="file") - upload.special_props = { + upload.special_props = [ ImmutableVar(_var_name="{...getInputProps()}", _var_type=None) - } + ] # The dropzone to use. zone = Box.create( @@ -257,9 +257,9 @@ class Upload(MemoizationLeaf): *children, **{k: v for k, v in props.items() if k not in supported_props}, ) - zone.special_props = { + zone.special_props = [ ImmutableVar(_var_name="{...getRootProps()}", _var_type=None) - } + ] # Create the component. upload_props["id"] = props.get("id", DEFAULT_UPLOAD_ID) diff --git a/reflex/components/el/elements/metadata.py b/reflex/components/el/elements/metadata.py index fc8e1d9d6..df5e1e901 100644 --- a/reflex/components/el/elements/metadata.py +++ b/reflex/components/el/elements/metadata.py @@ -1,6 +1,6 @@ """Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" -from typing import Set, Union +from typing import List, Union from reflex.components.el.element import Element from reflex.ivars.base import ImmutableVar @@ -90,9 +90,9 @@ class StyleEl(Element): # noqa: E742 media: Var[Union[str, int, bool]] - special_props: Set[ImmutableVar] = { + special_props: List[ImmutableVar] = [ ImmutableVar.create_safe("suppressHydrationWarning") - } + ] base = Base.create diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index b44ca25dd..83f647f4c 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -195,17 +195,17 @@ class Markdown(Component): if tag not in self.component_map: raise ValueError(f"No markdown component found for tag: {tag}.") - special_props = {_PROPS_IN_TAG} + special_props = [_PROPS_IN_TAG] children = [_CHILDREN] # For certain tags, the props from the markdown renderer are not actually valid for the component. if tag in NO_PROPS_TAGS: - special_props = set() + special_props = [] # If the children are set as a prop, don't pass them as children. children_prop = props.pop("children", None) if children_prop is not None: - special_props.add( + special_props.append( ImmutableVar.create_safe(f"children={{{str(children_prop)}}}") ) children = [] diff --git a/reflex/components/moment/moment.py b/reflex/components/moment/moment.py index 958ba6c57..54411f870 100644 --- a/reflex/components/moment/moment.py +++ b/reflex/components/moment/moment.py @@ -1,26 +1,27 @@ """Moment component for humanized date rendering.""" +import dataclasses from typing import List, Optional -from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.event import EventHandler from reflex.utils.imports import ImportDict from reflex.vars import Var -class MomentDelta(Base): +@dataclasses.dataclass(frozen=True) +class MomentDelta: """A delta used for add/subtract prop in Moment.""" - years: Optional[int] - quarters: Optional[int] - months: Optional[int] - weeks: Optional[int] - days: Optional[int] - hours: Optional[int] - minutess: Optional[int] - seconds: Optional[int] - milliseconds: Optional[int] + years: Optional[int] = dataclasses.field(default=None) + quarters: Optional[int] = dataclasses.field(default=None) + months: Optional[int] = dataclasses.field(default=None) + weeks: Optional[int] = dataclasses.field(default=None) + days: Optional[int] = dataclasses.field(default=None) + hours: Optional[int] = dataclasses.field(default=None) + minutess: Optional[int] = dataclasses.field(default=None) + seconds: Optional[int] = dataclasses.field(default=None) + milliseconds: Optional[int] = dataclasses.field(default=None) class Moment(NoSSRComponent): diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index 168a239d7..2a19bcd01 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +import dataclasses from typing import Any, Callable, Dict, Optional, Union, overload -from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec from reflex.ivars.base import ImmutableVar @@ -13,7 +13,8 @@ from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var -class MomentDelta(Base): +@dataclasses.dataclass(frozen=True) +class MomentDelta: years: Optional[int] quarters: Optional[int] months: Optional[int] diff --git a/reflex/components/plotly/plotly.py b/reflex/components/plotly/plotly.py index ed7040d1c..c226e6e95 100644 --- a/reflex/components/plotly/plotly.py +++ b/reflex/components/plotly/plotly.py @@ -267,7 +267,7 @@ const extractPoints = (points) => { template_dict = LiteralVar.create({"layout": {"template": self.template}}) merge_dicts.append(template_dict.without_data()) if merge_dicts: - tag.special_props.add( + tag.special_props.append( # Merge all dictionaries and spread the result over props. ImmutableVar.create_safe( f"{{...mergician({str(figure)}," @@ -276,5 +276,5 @@ const extractPoints = (points) => { ) else: # Spread the figure dict over props, nothing to merge. - tag.special_props.add(ImmutableVar.create_safe(f"{{...{str(figure)}}}")) + tag.special_props.append(ImmutableVar.create_safe(f"{{...{str(figure)}}}")) return tag diff --git a/reflex/components/tags/cond_tag.py b/reflex/components/tags/cond_tag.py index 3143890c4..7bdf9a3c7 100644 --- a/reflex/components/tags/cond_tag.py +++ b/reflex/components/tags/cond_tag.py @@ -1,19 +1,22 @@ """Tag to conditionally render components.""" +import dataclasses from typing import Any, Dict, Optional from reflex.components.tags.tag import Tag +from reflex.ivars.base import LiteralVar from reflex.vars import Var +@dataclasses.dataclass() class CondTag(Tag): """A conditional tag.""" # The condition to determine which component to render. - cond: Var[Any] + cond: Var[Any] = dataclasses.field(default_factory=lambda: LiteralVar.create(True)) # The code to render if the condition is true. - true_value: Dict + true_value: Dict = dataclasses.field(default_factory=dict) # The code to render if the condition is false. - false_value: Optional[Dict] + false_value: Optional[Dict] = None diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index ee7a63628..ff6925f56 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -2,31 +2,36 @@ from __future__ import annotations +import dataclasses import inspect from typing import TYPE_CHECKING, Any, Callable, List, Tuple, Type, Union, get_args from reflex.components.tags.tag import Tag from reflex.ivars.base import ImmutableVar -from reflex.vars import Var +from reflex.ivars.sequence import LiteralArrayVar +from reflex.vars import Var, get_unique_variable_name if TYPE_CHECKING: from reflex.components.component import Component +@dataclasses.dataclass() class IterTag(Tag): """An iterator tag.""" # The var to iterate over. - iterable: Var[List] + iterable: Var[List] = dataclasses.field( + default_factory=lambda: LiteralArrayVar.create([]) + ) # The component render function for each item in the iterable. - render_fn: Callable + render_fn: Callable = dataclasses.field(default_factory=lambda: lambda x: x) # The name of the arg var. - arg_var_name: str + arg_var_name: str = dataclasses.field(default_factory=get_unique_variable_name) # The name of the index var. - index_var_name: str + index_var_name: str = dataclasses.field(default_factory=get_unique_variable_name) def get_iterable_var_type(self) -> Type: """Get the type of the iterable var. diff --git a/reflex/components/tags/match_tag.py b/reflex/components/tags/match_tag.py index c2f6649d5..b67ed62cc 100644 --- a/reflex/components/tags/match_tag.py +++ b/reflex/components/tags/match_tag.py @@ -1,19 +1,22 @@ """Tag to conditionally match cases.""" +import dataclasses from typing import Any, List from reflex.components.tags.tag import Tag +from reflex.ivars.base import LiteralVar from reflex.vars import Var +@dataclasses.dataclass() class MatchTag(Tag): """A match tag.""" # The condition to determine which case to match. - cond: Var[Any] + cond: Var[Any] = dataclasses.field(default_factory=lambda: LiteralVar.create(True)) # The list of match cases to be matched. - match_cases: List[Any] + match_cases: List[Any] = dataclasses.field(default_factory=list) # The catchall case to match. - default: Any + default: Any = dataclasses.field(default=LiteralVar.create(None)) diff --git a/reflex/components/tags/tag.py b/reflex/components/tags/tag.py index 810da30f9..8c97d72c5 100644 --- a/reflex/components/tags/tag.py +++ b/reflex/components/tags/tag.py @@ -2,22 +2,23 @@ from __future__ import annotations -from typing import Any, Dict, List, Optional, Set, Tuple, Union +import dataclasses +from typing import Any, Dict, List, Optional, Tuple, Union -from reflex.base import Base from reflex.event import EventChain from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import format, types -class Tag(Base): +@dataclasses.dataclass() +class Tag: """A React tag.""" # The name of the tag. name: str = "" # The props of the tag. - props: Dict[str, Any] = {} + props: Dict[str, Any] = dataclasses.field(default_factory=dict) # The inner contents of the tag. contents: str = "" @@ -26,25 +27,18 @@ class Tag(Base): args: Optional[Tuple[str, ...]] = None # Special props that aren't key value pairs. - special_props: Set[ImmutableVar] = set() + special_props: List[ImmutableVar] = dataclasses.field(default_factory=list) # The children components. - children: List[Any] = [] + children: List[Any] = dataclasses.field(default_factory=list) - def __init__(self, *args, **kwargs): - """Initialize the tag. - - Args: - *args: Args to initialize the tag. - **kwargs: Kwargs to initialize the tag. - """ - # Convert any props to vars. - if "props" in kwargs: - kwargs["props"] = { - name: LiteralVar.create(value) - for name, value in kwargs["props"].items() - } - super().__init__(*args, **kwargs) + def __post_init__(self): + """Post initialize the tag.""" + object.__setattr__( + self, + "props", + {name: LiteralVar.create(value) for name, value in self.props.items()}, + ) def format_props(self) -> List: """Format the tag's props. @@ -54,6 +48,29 @@ class Tag(Base): """ return format.format_props(*self.special_props, **self.props) + def set(self, **kwargs: Any): + """Set the tag's fields. + + Args: + kwargs: The fields to set. + + Returns: + The tag with the fields + """ + for name, value in kwargs.items(): + setattr(self, name, value) + + return self + + def __iter__(self): + """Iterate over the tag's fields. + + Yields: + Tuple[str, Any]: The field name and value. + """ + for field in dataclasses.fields(self): + yield field.name, getattr(self, field.name) + def add_props(self, **kwargs: Optional[Any]) -> Tag: """Add props to the tag. diff --git a/reflex/event.py b/reflex/event.py index 8384f06a8..73fecfc03 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -2,6 +2,7 @@ from __future__ import annotations +import dataclasses import inspect import types import urllib.parse @@ -18,7 +19,6 @@ from typing import ( ) from reflex import constants -from reflex.base import Base from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.ivars.function import FunctionStringVar, FunctionVar from reflex.ivars.object import ObjectVar @@ -33,7 +33,11 @@ except ImportError: from typing_extensions import Annotated -class Event(Base): +@dataclasses.dataclass( + init=True, + frozen=True, +) +class Event: """An event that describes any state change in the app.""" # The token to specify the client that the event is for. @@ -43,10 +47,10 @@ class Event(Base): name: str # The routing data where event occurred - router_data: Dict[str, Any] = {} + router_data: Dict[str, Any] = dataclasses.field(default_factory=dict) # The event payload. - payload: Dict[str, Any] = {} + payload: Dict[str, Any] = dataclasses.field(default_factory=dict) @property def substate_token(self) -> str: @@ -81,11 +85,15 @@ def background(fn): return fn -class EventActionsMixin(Base): +@dataclasses.dataclass( + init=True, + frozen=True, +) +class EventActionsMixin: """Mixin for DOM event actions.""" # Whether to `preventDefault` or `stopPropagation` on the event. - event_actions: Dict[str, Union[bool, int]] = {} + event_actions: Dict[str, Union[bool, int]] = dataclasses.field(default_factory=dict) @property def stop_propagation(self): @@ -94,8 +102,9 @@ class EventActionsMixin(Base): Returns: New EventHandler-like with stopPropagation set to True. """ - return self.copy( - update={"event_actions": {"stopPropagation": True, **self.event_actions}}, + return dataclasses.replace( + self, + event_actions={"stopPropagation": True, **self.event_actions}, ) @property @@ -105,8 +114,9 @@ class EventActionsMixin(Base): Returns: New EventHandler-like with preventDefault set to True. """ - return self.copy( - update={"event_actions": {"preventDefault": True, **self.event_actions}}, + return dataclasses.replace( + self, + event_actions={"preventDefault": True, **self.event_actions}, ) def throttle(self, limit_ms: int): @@ -118,8 +128,9 @@ class EventActionsMixin(Base): Returns: New EventHandler-like with throttle set to limit_ms. """ - return self.copy( - update={"event_actions": {"throttle": limit_ms, **self.event_actions}}, + return dataclasses.replace( + self, + event_actions={"throttle": limit_ms, **self.event_actions}, ) def debounce(self, delay_ms: int): @@ -131,26 +142,25 @@ class EventActionsMixin(Base): Returns: New EventHandler-like with debounce set to delay_ms. """ - return self.copy( - update={"event_actions": {"debounce": delay_ms, **self.event_actions}}, + return dataclasses.replace( + self, + event_actions={"debounce": delay_ms, **self.event_actions}, ) +@dataclasses.dataclass( + init=True, + frozen=True, +) class EventHandler(EventActionsMixin): """An event handler responds to an event to update the state.""" # The function to call in response to the event. - fn: Any + fn: Any = dataclasses.field(default=None) # The full name of the state class this event handler is attached to. # Empty string means this event handler is a server side event. - state_full_name: str = "" - - class Config: - """The Pydantic config.""" - - # Needed to allow serialization of Callable. - frozen = True + state_full_name: str = dataclasses.field(default="") @classmethod def __class_getitem__(cls, args_spec: str) -> Annotated: @@ -215,6 +225,10 @@ class EventHandler(EventActionsMixin): ) +@dataclasses.dataclass( + init=True, + frozen=True, +) class EventSpec(EventActionsMixin): """An event specification. @@ -223,19 +237,37 @@ class EventSpec(EventActionsMixin): """ # The event handler. - handler: EventHandler + handler: EventHandler = dataclasses.field(default=None) # type: ignore # The handler on the client to process event. - client_handler_name: str = "" + client_handler_name: str = dataclasses.field(default="") # The arguments to pass to the function. - args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] = () + args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] = dataclasses.field( + default_factory=tuple + ) - class Config: - """The Pydantic config.""" + def __init__( + self, + handler: EventHandler, + event_actions: Dict[str, Union[bool, int]] | None = None, + client_handler_name: str = "", + args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] = tuple(), + ): + """Initialize an EventSpec. - # Required to allow tuple fields. - frozen = True + Args: + event_actions: The event actions. + handler: The event handler. + client_handler_name: The client handler name. + args: The arguments to pass to the function. + """ + if event_actions is None: + event_actions = {} + object.__setattr__(self, "event_actions", event_actions) + object.__setattr__(self, "handler", handler) + object.__setattr__(self, "client_handler_name", client_handler_name) + object.__setattr__(self, "args", args or tuple()) def with_args( self, args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] @@ -286,6 +318,9 @@ class EventSpec(EventActionsMixin): return self.with_args(self.args + new_payload) +@dataclasses.dataclass( + frozen=True, +) class CallableEventSpec(EventSpec): """Decorate an EventSpec-returning function to act as both a EventSpec and a function. @@ -305,10 +340,13 @@ class CallableEventSpec(EventSpec): if fn is not None: default_event_spec = fn() super().__init__( - fn=fn, # type: ignore - **default_event_spec.dict(), + event_actions=default_event_spec.event_actions, + client_handler_name=default_event_spec.client_handler_name, + args=default_event_spec.args, + handler=default_event_spec.handler, **kwargs, ) + object.__setattr__(self, "fn", fn) else: super().__init__(**kwargs) @@ -332,12 +370,16 @@ class CallableEventSpec(EventSpec): return self.fn(*args, **kwargs) +@dataclasses.dataclass( + init=True, + frozen=True, +) class EventChain(EventActionsMixin): """Container for a chain of events that will be executed in order.""" - events: List[EventSpec] + events: List[EventSpec] = dataclasses.field(default_factory=list) - args_spec: Optional[Callable] + args_spec: Optional[Callable] = dataclasses.field(default=None) # These chains can be used for their side effects when no other events are desired. @@ -345,14 +387,22 @@ stop_propagation = EventChain(events=[], args_spec=lambda: []).stop_propagation prevent_default = EventChain(events=[], args_spec=lambda: []).prevent_default -class Target(Base): +@dataclasses.dataclass( + init=True, + frozen=True, +) +class Target: """A Javascript event target.""" checked: bool = False value: Any = None -class FrontendEvent(Base): +@dataclasses.dataclass( + init=True, + frozen=True, +) +class FrontendEvent: """A Javascript event.""" target: Target = Target() @@ -360,7 +410,11 @@ class FrontendEvent(Base): value: Any = None -class FileUpload(Base): +@dataclasses.dataclass( + init=True, + frozen=True, +) +class FileUpload: """Class to represent a file upload.""" upload_id: Optional[str] = None diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 3c08b8119..3e2d282cd 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -421,6 +421,9 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): if issubclass(output, (ObjectVar, Base)): return ToObjectOperation.create(self, var_type or dict) + if dataclasses.is_dataclass(output): + return ToObjectOperation.create(self, var_type or dict) + if issubclass(output, FunctionVar): # if fixed_type is not None and not issubclass(fixed_type, Callable): # raise TypeError( @@ -479,7 +482,11 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): ): return self.to(NumberVar, self._var_type) - if all(inspect.isclass(t) and issubclass(t, Base) for t in inner_types): + if all( + inspect.isclass(t) + and (issubclass(t, Base) or dataclasses.is_dataclass(t)) + for t in inner_types + ): return self.to(ObjectVar, self._var_type) return self @@ -499,6 +506,8 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return self.to(StringVar, self._var_type) if issubclass(fixed_type, Base): return self.to(ObjectVar, self._var_type) + if dataclasses.is_dataclass(fixed_type): + return self.to(ObjectVar, self._var_type) return self def get_default_value(self) -> Any: @@ -985,6 +994,16 @@ class LiteralVar(ImmutableVar): ) return LiteralVar.create(serialized_value, _var_data=_var_data) + if dataclasses.is_dataclass(value) and not isinstance(value, type): + return LiteralObjectVar.create( + { + k: (None if callable(v) else v) + for k, v in dataclasses.asdict(value).items() + }, + _var_type=type(value), + _var_data=_var_data, + ) + raise TypeError( f"Unsupported type {type(value)} for LiteralVar. Tried to create a LiteralVar from {value}." ) diff --git a/reflex/middleware/hydrate_middleware.py b/reflex/middleware/hydrate_middleware.py index b5694e22f..46b524cd7 100644 --- a/reflex/middleware/hydrate_middleware.py +++ b/reflex/middleware/hydrate_middleware.py @@ -2,6 +2,7 @@ from __future__ import annotations +import dataclasses from typing import TYPE_CHECKING, Optional from reflex import constants @@ -14,6 +15,7 @@ if TYPE_CHECKING: from reflex.app import App +@dataclasses.dataclass(init=True) class HydrateMiddleware(Middleware): """Middleware to handle initial app hydration.""" diff --git a/reflex/middleware/middleware.py b/reflex/middleware/middleware.py index 76cbcfe9a..ef9de0bde 100644 --- a/reflex/middleware/middleware.py +++ b/reflex/middleware/middleware.py @@ -2,10 +2,9 @@ from __future__ import annotations -from abc import ABC +from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Optional -from reflex.base import Base from reflex.event import Event from reflex.state import BaseState, StateUpdate @@ -13,9 +12,10 @@ if TYPE_CHECKING: from reflex.app import App -class Middleware(Base, ABC): +class Middleware(ABC): """Middleware to preprocess and postprocess requests.""" + @abstractmethod async def preprocess( self, app: App, state: BaseState, event: Event ) -> Optional[StateUpdate]: diff --git a/reflex/state.py b/reflex/state.py index b815fd44f..dd69522fa 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -5,8 +5,10 @@ from __future__ import annotations import asyncio import contextlib import copy +import dataclasses import functools import inspect +import json import os import uuid from abc import ABC, abstractmethod @@ -83,13 +85,15 @@ var = immutable_computed_var TOO_LARGE_SERIALIZED_STATE = 100 * 1024 # 100kb -class HeaderData(Base): +@dataclasses.dataclass(frozen=True) +class HeaderData: """An object containing headers data.""" host: str = "" origin: str = "" upgrade: str = "" connection: str = "" + cookie: str = "" pragma: str = "" cache_control: str = "" user_agent: str = "" @@ -105,13 +109,16 @@ class HeaderData(Base): Args: router_data: the router_data dict. """ - super().__init__() if router_data: for k, v in router_data.get(constants.RouteVar.HEADERS, {}).items(): - setattr(self, format.to_snake_case(k), v) + object.__setattr__(self, format.to_snake_case(k), v) + else: + for k in dataclasses.fields(self): + object.__setattr__(self, k.name, "") -class PageData(Base): +@dataclasses.dataclass(frozen=True) +class PageData: """An object containing page data.""" host: str = "" # repeated with self.headers.origin (remove or keep the duplicate?) @@ -119,7 +126,7 @@ class PageData(Base): raw_path: str = "" full_path: str = "" full_raw_path: str = "" - params: dict = {} + params: dict = dataclasses.field(default_factory=dict) def __init__(self, router_data: Optional[dict] = None): """Initalize the PageData object based on router_data. @@ -127,17 +134,34 @@ class PageData(Base): Args: router_data: the router_data dict. """ - super().__init__() if router_data: - self.host = router_data.get(constants.RouteVar.HEADERS, {}).get("origin") - self.path = router_data.get(constants.RouteVar.PATH, "") - self.raw_path = router_data.get(constants.RouteVar.ORIGIN, "") - self.full_path = f"{self.host}{self.path}" - self.full_raw_path = f"{self.host}{self.raw_path}" - self.params = router_data.get(constants.RouteVar.QUERY, {}) + object.__setattr__( + self, + "host", + router_data.get(constants.RouteVar.HEADERS, {}).get("origin", ""), + ) + object.__setattr__( + self, "path", router_data.get(constants.RouteVar.PATH, "") + ) + object.__setattr__( + self, "raw_path", router_data.get(constants.RouteVar.ORIGIN, "") + ) + object.__setattr__(self, "full_path", f"{self.host}{self.path}") + object.__setattr__(self, "full_raw_path", f"{self.host}{self.raw_path}") + object.__setattr__( + self, "params", router_data.get(constants.RouteVar.QUERY, {}) + ) + else: + object.__setattr__(self, "host", "") + object.__setattr__(self, "path", "") + object.__setattr__(self, "raw_path", "") + object.__setattr__(self, "full_path", "") + object.__setattr__(self, "full_raw_path", "") + object.__setattr__(self, "params", {}) -class SessionData(Base): +@dataclasses.dataclass(frozen=True, init=False) +class SessionData: """An object containing session data.""" client_token: str = "" @@ -150,19 +174,24 @@ class SessionData(Base): Args: router_data: the router_data dict. """ - super().__init__() if router_data: - self.client_token = router_data.get(constants.RouteVar.CLIENT_TOKEN, "") - self.client_ip = router_data.get(constants.RouteVar.CLIENT_IP, "") - self.session_id = router_data.get(constants.RouteVar.SESSION_ID, "") + client_token = router_data.get(constants.RouteVar.CLIENT_TOKEN, "") + client_ip = router_data.get(constants.RouteVar.CLIENT_IP, "") + session_id = router_data.get(constants.RouteVar.SESSION_ID, "") + else: + client_token = client_ip = session_id = "" + object.__setattr__(self, "client_token", client_token) + object.__setattr__(self, "client_ip", client_ip) + object.__setattr__(self, "session_id", session_id) -class RouterData(Base): +@dataclasses.dataclass(frozen=True, init=False) +class RouterData: """An object containing RouterData.""" - session: SessionData = SessionData() - headers: HeaderData = HeaderData() - page: PageData = PageData() + session: SessionData = dataclasses.field(default_factory=SessionData) + headers: HeaderData = dataclasses.field(default_factory=HeaderData) + page: PageData = dataclasses.field(default_factory=PageData) def __init__(self, router_data: Optional[dict] = None): """Initialize the RouterData object. @@ -170,10 +199,30 @@ class RouterData(Base): Args: router_data: the router_data dict. """ - super().__init__() - self.session = SessionData(router_data) - self.headers = HeaderData(router_data) - self.page = PageData(router_data) + object.__setattr__(self, "session", SessionData(router_data)) + object.__setattr__(self, "headers", HeaderData(router_data)) + object.__setattr__(self, "page", PageData(router_data)) + + def toJson(self) -> str: + """Convert the object to a JSON string. + + Returns: + The JSON string. + """ + return json.dumps(dataclasses.asdict(self)) + + +@serializer +def serialize_routerdata(value: RouterData) -> str: + """Serialize a RouterData instance. + + Args: + value: The RouterData to serialize. + + Returns: + The serialized RouterData. + """ + return value.toJson() def _no_chain_background_task( @@ -249,10 +298,11 @@ def _split_substate_key(substate_key: str) -> tuple[str, str]: return token, state_name +@dataclasses.dataclass(frozen=True, init=False) class EventHandlerSetVar(EventHandler): """A special event handler to wrap setvar functionality.""" - state_cls: Type[BaseState] + state_cls: Type[BaseState] = dataclasses.field(init=False) def __init__(self, state_cls: Type[BaseState]): """Initialize the EventHandlerSetVar. @@ -263,8 +313,8 @@ class EventHandlerSetVar(EventHandler): super().__init__( fn=type(self).setvar, state_full_name=state_cls.get_full_name(), - state_cls=state_cls, # type: ignore ) + object.__setattr__(self, "state_cls", state_cls) def setvar(self, var_name: str, value: Any): """Set the state variable to the value of the event. @@ -1826,8 +1876,13 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): self.dirty_vars.update(self._always_dirty_computed_vars) self._mark_dirty() + def dictify(value: Any): + if dataclasses.is_dataclass(value) and not isinstance(value, type): + return dataclasses.asdict(value) + return value + base_vars = { - prop_name: self.get_value(getattr(self, prop_name)) + prop_name: dictify(self.get_value(getattr(self, prop_name))) for prop_name in self.base_vars } if initial and include_computed: @@ -1907,9 +1962,6 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): return state -EventHandlerSetVar.update_forward_refs() - - class State(BaseState): """The app Base State.""" @@ -2341,18 +2393,29 @@ class StateProxy(wrapt.ObjectProxy): self._self_mutable = original_mutable -class StateUpdate(Base): +@dataclasses.dataclass( + frozen=True, +) +class StateUpdate: """A state update sent to the frontend.""" # The state delta. - delta: Delta = {} + delta: Delta = dataclasses.field(default_factory=dict) # Events to be added to the event queue. - events: List[Event] = [] + events: List[Event] = dataclasses.field(default_factory=list) # Whether this is the final state update for the event. final: bool = True + def json(self) -> str: + """Convert the state update to a JSON string. + + Returns: + The state update as a JSON string. + """ + return json.dumps(dataclasses.asdict(self)) + class StateManager(Base, ABC): """A class to manage many client states.""" diff --git a/reflex/utils/format.py b/reflex/utils/format.py index 0e18a8495..ddfb6b05a 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -2,6 +2,7 @@ from __future__ import annotations +import dataclasses import inspect import json import os @@ -623,6 +624,14 @@ def format_state(value: Any, key: Optional[str] = None) -> Any: if isinstance(value, dict): return {k: format_state(v, k) for k, v in value.items()} + # Hand dataclasses. + if dataclasses.is_dataclass(value): + if isinstance(value, type): + raise TypeError( + f"Cannot format state of type {type(value)}. Please provide an instance of the dataclass." + ) + return {k: format_state(v, k) for k, v in dataclasses.asdict(value).items()} + # Handle lists, sets, typles. if isinstance(value, types.StateIterBases): return [format_state(v) for v in value] diff --git a/reflex/utils/imports.py b/reflex/utils/imports.py index d58c2bf3f..8f53ed07a 100644 --- a/reflex/utils/imports.py +++ b/reflex/utils/imports.py @@ -2,10 +2,9 @@ from __future__ import annotations +import dataclasses from collections import defaultdict -from typing import Dict, List, Optional, Tuple, Union - -from reflex.base import Base +from typing import DefaultDict, Dict, List, Optional, Tuple, Union def merge_imports( @@ -19,12 +18,22 @@ def merge_imports( Returns: The merged import dicts. """ - all_imports = defaultdict(list) + all_imports: DefaultDict[str, List[ImportVar]] = defaultdict(list) for import_dict in imports: for lib, fields in ( import_dict if isinstance(import_dict, tuple) else import_dict.items() ): - all_imports[lib].extend(fields) + if isinstance(fields, (list, tuple, set)): + all_imports[lib].extend( + ( + ImportVar(field) if isinstance(field, str) else field + for field in fields + ) + ) + else: + all_imports[lib].append( + ImportVar(fields) if isinstance(fields, str) else fields + ) return all_imports @@ -75,7 +84,8 @@ def collapse_imports( } -class ImportVar(Base): +@dataclasses.dataclass(order=True, frozen=True) +class ImportVar: """An import var.""" # The name of the import tag. @@ -111,73 +121,6 @@ class ImportVar(Base): else: return self.tag or "" - def __lt__(self, other: ImportVar) -> bool: - """Compare two ImportVar objects. - - Args: - other: The other ImportVar object to compare. - - Returns: - Whether this ImportVar object is less than the other. - """ - return ( - self.tag, - self.is_default, - self.alias, - self.install, - self.render, - self.transpile, - ) < ( - other.tag, - other.is_default, - other.alias, - other.install, - other.render, - other.transpile, - ) - - def __eq__(self, other: ImportVar) -> bool: - """Check if two ImportVar objects are equal. - - Args: - other: The other ImportVar object to compare. - - Returns: - Whether the two ImportVar objects are equal. - """ - return ( - self.tag, - self.is_default, - self.alias, - self.install, - self.render, - self.transpile, - ) == ( - other.tag, - other.is_default, - other.alias, - other.install, - other.render, - other.transpile, - ) - - def __hash__(self) -> int: - """Hash the ImportVar object. - - Returns: - The hash of the ImportVar object. - """ - return hash( - ( - self.tag, - self.is_default, - self.alias, - self.install, - self.render, - self.transpile, - ) - ) - ImportTypes = Union[str, ImportVar, List[Union[str, ImportVar]], List[ImportVar]] ImportDict = Dict[str, ImportTypes] diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 3384be5cf..78139034b 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -2,6 +2,7 @@ from __future__ import annotations +import dataclasses import functools import glob import importlib @@ -32,7 +33,6 @@ from redis import exceptions from redis.asyncio import Redis from reflex import constants, model -from reflex.base import Base from reflex.compiler import templates from reflex.config import Config, get_config from reflex.utils import console, net, path_ops, processes @@ -43,7 +43,8 @@ from reflex.utils.registry import _get_best_registry CURRENTLY_INSTALLING_NODE = False -class Template(Base): +@dataclasses.dataclass(frozen=True) +class Template: """A template for a Reflex app.""" name: str @@ -52,7 +53,8 @@ class Template(Base): demo_url: str -class CpuInfo(Base): +@dataclasses.dataclass(frozen=True) +class CpuInfo: """Model to save cpu info.""" manufacturer_id: Optional[str] @@ -1279,7 +1281,7 @@ def fetch_app_templates(version: str) -> dict[str, Template]: None, ) return { - tp["name"]: Template.parse_obj(tp) + tp["name"]: Template(**tp) for tp in templates_data if not tp["hidden"] and tp["code_url"] is not None } diff --git a/reflex/utils/telemetry.py b/reflex/utils/telemetry.py index e027ed81a..03e2b943b 100644 --- a/reflex/utils/telemetry.py +++ b/reflex/utils/telemetry.py @@ -3,6 +3,7 @@ from __future__ import annotations import asyncio +import dataclasses import multiprocessing import platform import warnings @@ -144,7 +145,7 @@ def _prepare_event(event: str, **kwargs) -> dict: "python_version": get_python_version(), "cpu_count": get_cpu_count(), "memory": get_memory(), - "cpu_info": dict(cpuinfo) if cpuinfo else {}, + "cpu_info": dataclasses.asdict(cpuinfo) if cpuinfo else {}, **additional_fields, }, "timestamp": stamp, diff --git a/reflex/utils/types.py b/reflex/utils/types.py index f4463fa92..ba58408ff 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -3,6 +3,7 @@ from __future__ import annotations import contextlib +import dataclasses import inspect import sys import types @@ -480,7 +481,11 @@ def is_valid_var_type(type_: Type) -> bool: if is_union(type_): return all((is_valid_var_type(arg) for arg in get_args(type_))) - return _issubclass(type_, StateVar) or serializers.has_serializer(type_) + return ( + _issubclass(type_, StateVar) + or serializers.has_serializer(type_) + or dataclasses.is_dataclass(type_) + ) def is_backend_base_variable(name: str, cls: Type) -> bool: diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 592e1ca6e..79a72b997 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -637,21 +637,21 @@ def test_component_create_unallowed_types(children, test_component): "props": [], "contents": "", "args": None, - "special_props": set(), + "special_props": [], "children": [ { "name": "RadixThemesText", "props": ['as={"p"}'], "contents": "", "args": None, - "special_props": set(), + "special_props": [], "children": [ { "name": "", "props": [], "contents": '{"first_text"}', "args": None, - "special_props": set(), + "special_props": [], "children": [], "autofocus": False, } @@ -679,13 +679,13 @@ def test_component_create_unallowed_types(children, test_component): "contents": '{"first_text"}', "name": "", "props": [], - "special_props": set(), + "special_props": [], } ], "contents": "", "name": "RadixThemesText", "props": ['as={"p"}'], - "special_props": set(), + "special_props": [], }, { "args": None, @@ -698,19 +698,19 @@ def test_component_create_unallowed_types(children, test_component): "contents": '{"second_text"}', "name": "", "props": [], - "special_props": set(), + "special_props": [], } ], "contents": "", "name": "RadixThemesText", "props": ['as={"p"}'], - "special_props": set(), + "special_props": [], }, ], "contents": "", "name": "Fragment", "props": [], - "special_props": set(), + "special_props": [], }, ), ( @@ -730,13 +730,13 @@ def test_component_create_unallowed_types(children, test_component): "contents": '{"first_text"}', "name": "", "props": [], - "special_props": set(), + "special_props": [], } ], "contents": "", "name": "RadixThemesText", "props": ['as={"p"}'], - "special_props": set(), + "special_props": [], }, { "args": None, @@ -757,31 +757,31 @@ def test_component_create_unallowed_types(children, test_component): "contents": '{"second_text"}', "name": "", "props": [], - "special_props": set(), + "special_props": [], } ], "contents": "", "name": "RadixThemesText", "props": ['as={"p"}'], - "special_props": set(), + "special_props": [], } ], "contents": "", "name": "Fragment", "props": [], - "special_props": set(), + "special_props": [], } ], "contents": "", "name": "RadixThemesBox", "props": [], - "special_props": set(), + "special_props": [], }, ], "contents": "", "name": "Fragment", "props": [], - "special_props": set(), + "special_props": [], }, ), ], @@ -1289,12 +1289,12 @@ class EventState(rx.State): id="fstring-class_name", ), pytest.param( - rx.fragment(special_props={TEST_VAR}), + rx.fragment(special_props=[TEST_VAR]), [TEST_VAR], id="direct-special_props", ), pytest.param( - rx.fragment(special_props={LiteralVar.create(f"foo{TEST_VAR}bar")}), + rx.fragment(special_props=[LiteralVar.create(f"foo{TEST_VAR}bar")]), [FORMATTED_TEST_VAR], id="fstring-special_props", ), diff --git a/tests/test_app.py b/tests/test_app.py index 5544736bf..a2a0cede7 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,5 +1,6 @@ from __future__ import annotations +import dataclasses import functools import io import json @@ -1052,7 +1053,7 @@ async def test_dynamic_route_var_route_change_completed_on_load( f"comp_{arg_name}": exp_val, constants.CompileVars.IS_HYDRATED: False, # "side_effect_counter": exp_index, - "router": exp_router, + "router": dataclasses.asdict(exp_router), } }, events=[ diff --git a/tests/test_state.py b/tests/test_state.py index 29944840e..3da74fc89 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -2,6 +2,7 @@ from __future__ import annotations import asyncio import copy +import dataclasses import datetime import functools import json @@ -58,6 +59,7 @@ formatted_router = { "origin": "", "upgrade": "", "connection": "", + "cookie": "", "pragma": "", "cache_control": "", "user_agent": "", @@ -865,8 +867,10 @@ def test_get_headers(test_state, router_data, router_data_headers): router_data: The router data fixture. router_data_headers: The expected headers. """ + print(router_data_headers) test_state.router = RouterData(router_data) - assert test_state.router.headers.dict() == { + print(test_state.router.headers) + assert dataclasses.asdict(test_state.router.headers) == { format.to_snake_case(k): v for k, v in router_data_headers.items() } @@ -1908,19 +1912,21 @@ async def test_state_proxy(grandchild_state: GrandchildState, mock_app: rx.App): mock_app.event_namespace.emit.assert_called_once() mcall = mock_app.event_namespace.emit.mock_calls[0] assert mcall.args[0] == str(SocketEvent.EVENT) - assert json.loads(mcall.args[1]) == StateUpdate( - delta={ - parent_state.get_full_name(): { - "upper": "", - "sum": 3.14, - }, - grandchild_state.get_full_name(): { - "value2": "42", - }, - GrandchildState3.get_full_name(): { - "computed": "", - }, - } + assert json.loads(mcall.args[1]) == dataclasses.asdict( + StateUpdate( + delta={ + parent_state.get_full_name(): { + "upper": "", + "sum": 3.14, + }, + grandchild_state.get_full_name(): { + "value2": "42", + }, + GrandchildState3.get_full_name(): { + "computed": "", + }, + } + ) ) assert mcall.kwargs["to"] == grandchild_state.router.session.session_id diff --git a/tests/utils/test_format.py b/tests/utils/test_format.py index 8c559f141..286748943 100644 --- a/tests/utils/test_format.py +++ b/tests/utils/test_format.py @@ -553,6 +553,7 @@ formatted_router = { "origin": "", "upgrade": "", "connection": "", + "cookie": "", "pragma": "", "cache_control": "", "user_agent": "", diff --git a/tests/utils/test_imports.py b/tests/utils/test_imports.py index e9be5c1be..c30d1d85c 100644 --- a/tests/utils/test_imports.py +++ b/tests/utils/test_imports.py @@ -54,17 +54,21 @@ def test_import_var(import_var, expected_name): ( {"react": {"Component"}}, {"react": {"Component"}, "react-dom": {"render"}}, - {"react": {"Component"}, "react-dom": {"render"}}, + {"react": {ImportVar("Component")}, "react-dom": {ImportVar("render")}}, ), ( {"react": {"Component"}, "next/image": {"Image"}}, {"react": {"Component"}, "react-dom": {"render"}}, - {"react": {"Component"}, "react-dom": {"render"}, "next/image": {"Image"}}, + { + "react": {ImportVar("Component")}, + "react-dom": {ImportVar("render")}, + "next/image": {ImportVar("Image")}, + }, ), ( {"react": {"Component"}}, {"": {"some/custom.css"}}, - {"react": {"Component"}, "": {"some/custom.css"}}, + {"react": {ImportVar("Component")}, "": {ImportVar("some/custom.css")}}, ), ], ) From 085b761f6b2ad4d2356269233e252374b22315e4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 13 Sep 2024 16:01:52 -0700 Subject: [PATCH 020/201] replace old var system with immutable one (#3916) * delete most references to varr * [REF-3562][REF-3563] Replace chakra usage (#3872) * only one mention of var * delete vars.py why not * remove reflex.vars * rename immutable var to var * rename ivars to vars * add vars back smh * ruff * no more create_safe * reorder deprecated * remove raises * remove all Var.create * move to new api * fix unit tests * fix pyi hopefully * sort literals * fix event handler issues * update poetry * fix silly issues i'm very silly * add var_operation_return * rename immutable to not immutable * add str type * it's ruff out there --------- Co-authored-by: Elijah Ahianyo --- integration/test_var_operations.py | 4 +- poetry.lock | 561 ++--- .../jinja/web/pages/utils.js.jinja2 | 4 +- reflex/__init__.py | 1 - reflex/__init__.pyi | 1 - reflex/app.py | 3 +- reflex/base.py | 2 +- reflex/compiler/compiler.py | 4 +- reflex/compiler/utils.py | 6 +- reflex/components/base/app_wrap.py | 4 +- reflex/components/base/app_wrap.pyi | 44 +- reflex/components/base/bare.py | 9 +- reflex/components/base/body.pyi | 44 +- reflex/components/base/document.pyi | 212 +- reflex/components/base/error_boundary.py | 13 +- reflex/components/base/error_boundary.pyi | 53 +- reflex/components/base/fragment.pyi | 44 +- reflex/components/base/head.pyi | 86 +- reflex/components/base/link.py | 2 +- reflex/components/base/link.pyi | 87 +- reflex/components/base/meta.pyi | 170 +- reflex/components/base/script.py | 3 +- reflex/components/base/script.pyi | 59 +- reflex/components/component.py | 88 +- reflex/components/core/banner.py | 54 +- reflex/components/core/banner.pyi | 303 ++- reflex/components/core/client_side_routing.py | 5 +- .../components/core/client_side_routing.pyi | 87 +- reflex/components/core/clipboard.py | 3 +- reflex/components/core/clipboard.pyi | 53 +- reflex/components/core/cond.py | 10 +- reflex/components/core/debounce.py | 10 +- reflex/components/core/debounce.pyi | 53 +- reflex/components/core/foreach.py | 7 +- reflex/components/core/html.py | 2 +- reflex/components/core/html.pyi | 79 +- reflex/components/core/match.py | 34 +- reflex/components/core/upload.py | 40 +- reflex/components/core/upload.pyi | 202 +- reflex/components/datadisplay/code.py | 19 +- reflex/components/datadisplay/code.pyi | 710 +++--- reflex/components/datadisplay/dataeditor.py | 18 +- reflex/components/datadisplay/dataeditor.pyi | 93 +- reflex/components/el/element.pyi | 44 +- reflex/components/el/elements/base.py | 2 +- reflex/components/el/elements/base.pyi | 77 +- reflex/components/el/elements/forms.py | 32 +- reflex/components/el/elements/forms.pyi | 1231 +++++----- reflex/components/el/elements/inline.py | 2 +- reflex/components/el/elements/inline.pyi | 2099 +++++++---------- reflex/components/el/elements/media.py | 2 +- reflex/components/el/elements/media.pyi | 1741 ++++++-------- reflex/components/el/elements/metadata.py | 7 +- reflex/components/el/elements/metadata.pyi | 415 ++-- reflex/components/el/elements/other.py | 2 +- reflex/components/el/elements/other.pyi | 527 ++--- reflex/components/el/elements/scripts.py | 2 +- reflex/components/el/elements/scripts.pyi | 243 +- reflex/components/el/elements/sectioning.py | 2 - reflex/components/el/elements/sectioning.pyi | 1113 ++++----- reflex/components/el/elements/tables.py | 2 +- reflex/components/el/elements/tables.pyi | 783 +++--- reflex/components/el/elements/typography.py | 2 +- reflex/components/el/elements/typography.pyi | 1133 ++++----- reflex/components/gridjs/datatable.py | 15 +- reflex/components/gridjs/datatable.pyi | 91 +- reflex/components/lucide/icon.py | 2 +- reflex/components/lucide/icon.pyi | 87 +- reflex/components/markdown/markdown.py | 53 +- reflex/components/markdown/markdown.pyi | 64 +- reflex/components/moment/moment.py | 2 +- reflex/components/moment/moment.pyi | 53 +- reflex/components/next/base.pyi | 44 +- reflex/components/next/image.py | 2 +- reflex/components/next/image.pyi | 59 +- reflex/components/next/link.py | 2 +- reflex/components/next/link.pyi | 45 +- reflex/components/next/video.py | 2 +- reflex/components/next/video.pyi | 45 +- reflex/components/plotly/plotly.py | 23 +- reflex/components/plotly/plotly.pyi | 93 +- reflex/components/props.py | 2 +- .../components/radix/primitives/accordion.py | 8 +- .../components/radix/primitives/accordion.pyi | 943 ++++---- reflex/components/radix/primitives/base.py | 2 +- reflex/components/radix/primitives/base.pyi | 87 +- reflex/components/radix/primitives/drawer.py | 2 +- reflex/components/radix/primitives/drawer.pyi | 445 ++-- reflex/components/radix/primitives/form.py | 2 +- reflex/components/radix/primitives/form.pyi | 615 ++--- .../components/radix/primitives/progress.py | 2 +- .../components/radix/primitives/progress.pyi | 525 ++--- reflex/components/radix/primitives/slider.py | 2 +- reflex/components/radix/primitives/slider.pyi | 225 +- reflex/components/radix/themes/base.py | 7 +- reflex/components/radix/themes/base.pyi | 431 ++-- reflex/components/radix/themes/color_mode.py | 10 +- reflex/components/radix/themes/color_mode.pyi | 413 ++-- .../radix/themes/components/alert_dialog.py | 2 +- .../radix/themes/components/alert_dialog.pyi | 341 ++- .../radix/themes/components/aspect_ratio.py | 2 +- .../radix/themes/components/aspect_ratio.pyi | 45 +- .../radix/themes/components/avatar.py | 2 +- .../radix/themes/components/avatar.pyi | 155 +- .../radix/themes/components/badge.py | 2 +- .../radix/themes/components/badge.pyi | 189 +- .../radix/themes/components/button.py | 2 +- .../radix/themes/components/button.pyi | 209 +- .../radix/themes/components/callout.py | 2 +- .../radix/themes/components/callout.pyi | 697 +++--- .../radix/themes/components/card.py | 2 +- .../radix/themes/components/card.pyi | 85 +- .../radix/themes/components/checkbox.py | 3 +- .../radix/themes/components/checkbox.pyi | 465 ++-- .../radix/themes/components/checkbox_cards.py | 2 +- .../themes/components/checkbox_cards.pyi | 213 +- .../radix/themes/components/checkbox_group.py | 2 +- .../themes/components/checkbox_group.pyi | 197 +- .../radix/themes/components/context_menu.py | 2 +- .../radix/themes/components/context_menu.pyi | 565 ++--- .../radix/themes/components/data_list.py | 2 +- .../radix/themes/components/data_list.pyi | 305 ++- .../radix/themes/components/dialog.py | 2 +- .../radix/themes/components/dialog.pyi | 347 ++- .../radix/themes/components/dropdown_menu.py | 2 +- .../radix/themes/components/dropdown_menu.pyi | 589 ++--- .../radix/themes/components/hover_card.py | 2 +- .../radix/themes/components/hover_card.pyi | 219 +- .../radix/themes/components/icon_button.py | 5 +- .../radix/themes/components/icon_button.pyi | 209 +- .../radix/themes/components/inset.py | 2 +- .../radix/themes/components/inset.pyi | 103 +- .../radix/themes/components/popover.py | 2 +- .../radix/themes/components/popover.pyi | 229 +- .../radix/themes/components/progress.py | 2 +- .../radix/themes/components/progress.pyi | 157 +- .../radix/themes/components/radio.py | 2 +- .../radix/themes/components/radio.pyi | 153 +- .../radix/themes/components/radio_cards.py | 2 +- .../radix/themes/components/radio_cards.pyi | 221 +- .../radix/themes/components/radio_group.py | 19 +- .../radix/themes/components/radio_group.pyi | 511 ++-- .../radix/themes/components/scroll_area.py | 2 +- .../radix/themes/components/scroll_area.pyi | 53 +- .../themes/components/segmented_control.py | 2 +- .../themes/components/segmented_control.pyi | 207 +- .../radix/themes/components/select.py | 5 +- .../radix/themes/components/select.pyi | 861 +++---- .../radix/themes/components/separator.py | 3 +- .../radix/themes/components/separator.pyi | 153 +- .../radix/themes/components/skeleton.py | 2 +- .../radix/themes/components/skeleton.pyi | 57 +- .../radix/themes/components/slider.py | 5 +- .../radix/themes/components/slider.pyi | 167 +- .../radix/themes/components/spinner.py | 2 +- .../radix/themes/components/spinner.pyi | 49 +- .../radix/themes/components/switch.py | 2 +- .../radix/themes/components/switch.pyi | 159 +- .../radix/themes/components/table.py | 2 +- .../radix/themes/components/table.pyi | 579 ++--- .../radix/themes/components/tabs.py | 2 +- .../radix/themes/components/tabs.pyi | 337 ++- .../radix/themes/components/text_area.py | 2 +- .../radix/themes/components/text_area.pyi | 211 +- .../radix/themes/components/text_field.py | 2 +- .../radix/themes/components/text_field.pyi | 541 ++--- .../radix/themes/components/tooltip.py | 2 +- .../radix/themes/components/tooltip.pyi | 63 +- reflex/components/radix/themes/layout/base.py | 2 +- .../components/radix/themes/layout/base.pyi | 123 +- reflex/components/radix/themes/layout/box.pyi | 77 +- .../components/radix/themes/layout/center.pyi | 121 +- .../radix/themes/layout/container.py | 3 +- .../radix/themes/layout/container.pyi | 81 +- reflex/components/radix/themes/layout/flex.py | 2 +- .../components/radix/themes/layout/flex.pyi | 121 +- reflex/components/radix/themes/layout/grid.py | 2 +- .../components/radix/themes/layout/grid.pyi | 137 +- reflex/components/radix/themes/layout/list.py | 11 +- .../components/radix/themes/layout/list.pyi | 431 ++-- .../components/radix/themes/layout/section.py | 3 +- .../radix/themes/layout/section.pyi | 81 +- .../components/radix/themes/layout/spacer.pyi | 121 +- .../components/radix/themes/layout/stack.py | 2 +- .../components/radix/themes/layout/stack.pyi | 281 +-- .../radix/themes/typography/blockquote.py | 2 +- .../radix/themes/typography/blockquote.pyi | 191 +- .../radix/themes/typography/code.py | 2 +- .../radix/themes/typography/code.pyi | 193 +- .../radix/themes/typography/heading.py | 2 +- .../radix/themes/typography/heading.pyi | 205 +- .../radix/themes/typography/link.py | 2 +- .../radix/themes/typography/link.pyi | 219 +- .../radix/themes/typography/text.py | 2 +- .../radix/themes/typography/text.pyi | 1083 ++++----- reflex/components/react_player/audio.pyi | 93 +- .../components/react_player/react_player.py | 2 +- .../components/react_player/react_player.pyi | 93 +- reflex/components/react_player/video.pyi | 93 +- reflex/components/recharts/cartesian.py | 5 +- reflex/components/recharts/cartesian.pyi | 1571 ++++++------ reflex/components/recharts/charts.py | 9 +- reflex/components/recharts/charts.pyi | 609 ++--- reflex/components/recharts/general.py | 3 +- reflex/components/recharts/general.pyi | 427 ++-- reflex/components/recharts/polar.py | 9 +- reflex/components/recharts/polar.pyi | 331 ++- reflex/components/recharts/recharts.pyi | 86 +- reflex/components/sonner/toast.py | 33 +- reflex/components/sonner/toast.pyi | 83 +- reflex/components/suneditor/editor.py | 5 +- reflex/components/suneditor/editor.pyi | 141 +- reflex/components/tags/cond_tag.py | 5 +- reflex/components/tags/iter_tag.py | 35 +- reflex/components/tags/match_tag.py | 7 +- reflex/components/tags/tag.py | 6 +- reflex/event.py | 58 +- reflex/experimental/client_state.py | 36 +- reflex/experimental/hooks.py | 32 +- reflex/experimental/layout.py | 10 +- reflex/experimental/layout.pyi | 317 ++- reflex/state.py | 64 +- reflex/style.py | 42 +- reflex/utils/format.py | 47 +- reflex/utils/pyi_generator.py | 13 +- reflex/utils/serializers.py | 13 +- reflex/utils/types.py | 8 +- reflex/vars.py | 501 ---- reflex/{ivars => vars}/__init__.py | 8 +- reflex/{ivars => vars}/base.py | 732 ++++-- reflex/{ivars => vars}/function.py | 34 +- reflex/{ivars => vars}/number.py | 34 +- reflex/{ivars => vars}/object.py | 58 +- reflex/{ivars => vars}/sequence.py | 76 +- tests/components/base/test_bare.py | 4 +- tests/components/core/test_colors.py | 2 +- tests/components/core/test_cond.py | 14 +- tests/components/core/test_debounce.py | 24 +- tests/components/core/test_foreach.py | 12 +- tests/components/core/test_match.py | 22 +- tests/components/core/test_upload.py | 4 +- tests/components/datadisplay/test_code.py | 2 +- tests/components/forms/test_form.py | 6 +- tests/components/media/test_image.py | 4 +- tests/components/radix/test_icon_button.py | 2 +- tests/components/test_component.py | 60 +- tests/components/test_tag.py | 10 +- tests/test_app.py | 10 +- tests/test_event.py | 62 +- tests/test_state.py | 26 +- tests/test_style.py | 8 +- tests/test_var.py | 359 ++- tests/utils/test_format.py | 51 +- tests/utils/test_serializers.py | 8 +- tests/utils/test_utils.py | 2 +- 255 files changed, 16078 insertions(+), 20732 deletions(-) delete mode 100644 reflex/vars.py rename reflex/{ivars => vars}/__init__.py (73%) rename reflex/{ivars => vars}/base.py (75%) rename reflex/{ivars => vars}/function.py (85%) rename reflex/{ivars => vars}/number.py (96%) rename reflex/{ivars => vars}/object.py (91%) rename reflex/{ivars => vars}/sequence.py (96%) diff --git a/integration/test_var_operations.py b/integration/test_var_operations.py index 3542bdf39..cae56e1a8 100644 --- a/integration/test_var_operations.py +++ b/integration/test_var_operations.py @@ -15,8 +15,8 @@ def VarOperations(): from typing import Dict, List import reflex as rx - from reflex.ivars.base import LiteralVar - from reflex.ivars.sequence import ArrayVar + from reflex.vars.base import LiteralVar + from reflex.vars.sequence import ArrayVar class Object(rx.Base): str: str = "hello" diff --git a/poetry.lock b/poetry.lock index 6fe39acc4..eef29eb51 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "alembic" version = "1.13.2" description = "A database migration tool for SQLAlchemy." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -26,7 +25,6 @@ tz = ["backports.zoneinfo"] name = "annotated-types" version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -41,7 +39,6 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} name = "anyio" version = "4.4.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -64,7 +61,6 @@ trio = ["trio (>=0.23)"] name = "async-timeout" version = "4.0.3" description = "Timeout context manager for asyncio programs" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -76,7 +72,6 @@ files = [ name = "asynctest" version = "0.13.0" description = "Enhance the standard unittest package with features for testing asyncio libraries" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -88,7 +83,6 @@ files = [ name = "attrs" version = "24.2.0" description = "Classes Without Boilerplate" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -108,7 +102,6 @@ tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] name = "backports-tarfile" version = "1.2.0" description = "Backport of CPython tarfile module" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -124,7 +117,6 @@ testing = ["jaraco.test", "pytest (!=8.0.*)", "pytest (>=6,!=8.1.*)", "pytest-ch name = "bidict" version = "0.23.1" description = "The bidirectional mapping library for Python." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -136,7 +128,6 @@ files = [ name = "build" version = "1.2.2" description = "A simple, correct Python build frontend" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -162,7 +153,6 @@ virtualenv = ["virtualenv (>=20.0.35)"] name = "certifi" version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -174,7 +164,6 @@ files = [ name = "cffi" version = "1.17.1" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -254,7 +243,6 @@ pycparser = "*" name = "cfgv" version = "3.4.0" description = "Validate configuration and produce human readable error messages." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -266,7 +254,6 @@ files = [ name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -366,7 +353,6 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -381,7 +367,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -393,7 +378,6 @@ files = [ name = "coverage" version = "7.6.1" description = "Code coverage measurement for Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -481,7 +465,6 @@ toml = ["tomli"] name = "cryptography" version = "43.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -531,7 +514,6 @@ test-randomorder = ["pytest-randomly"] name = "darglint" version = "1.8.1" description = "A utility for ensuring Google-style docstrings stay up to date with the source code." -category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ @@ -543,7 +525,6 @@ files = [ name = "dill" version = "0.3.8" description = "serialize all of Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -559,7 +540,6 @@ profile = ["gprof2dot (>=2022.7.29)"] name = "distlib" version = "0.3.8" description = "Distribution utilities" -category = "dev" optional = false python-versions = "*" files = [ @@ -571,7 +551,6 @@ files = [ name = "distro" version = "1.9.0" description = "Distro - an OS platform information API" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -583,19 +562,14 @@ files = [ name = "docutils" version = "0.20.1" description = "Docutils -- Python Documentation Utilities" -category = "main" optional = false -python-versions = ">=3.7" -files = [ - {file = "docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"}, - {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"}, -] +python-versions = "*" +files = [] [[package]] name = "exceptiongroup" version = "1.2.2" description = "Backport of PEP 654 (exception groups)" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -608,14 +582,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.114.0" +version = "0.114.1" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.114.0-py3-none-any.whl", hash = "sha256:fee75aa1b1d3d73f79851c432497e4394e413e1dece6234f68d3ce250d12760a"}, - {file = "fastapi-0.114.0.tar.gz", hash = "sha256:9908f2a5cc733004de6ca5e1412698f35085cefcbfd41d539245b9edf87b73c1"}, + {file = "fastapi-0.114.1-py3-none-any.whl", hash = "sha256:5d4746f6e4b7dff0b4f6b6c6d5445645285f662fe75886e99af7ee2d6b58bb3e"}, + {file = "fastapi-0.114.1.tar.gz", hash = "sha256:1d7bbbeabbaae0acb0c22f0ab0b040f642d3093ca3645f8c876b6f91391861d8"}, ] [package.dependencies] @@ -629,87 +602,93 @@ standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "htt [[package]] name = "filelock" -version = "3.15.4" +version = "3.16.0" description = "A platform independent file lock." -category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "filelock-3.15.4-py3-none-any.whl", hash = "sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7"}, - {file = "filelock-3.15.4.tar.gz", hash = "sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb"}, + {file = "filelock-3.16.0-py3-none-any.whl", hash = "sha256:f6ed4c963184f4c84dd5557ce8fece759a3724b37b80c6c4f20a2f63a4dc6609"}, + {file = "filelock-3.16.0.tar.gz", hash = "sha256:81de9eb8453c769b63369f87f11131a7ab04e367f8d97ad39dc230daa07e3bec"}, ] [package.extras] -docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-asyncio (>=0.21)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)", "virtualenv (>=20.26.2)"] -typing = ["typing-extensions (>=4.8)"] +docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.1.1)", "pytest (>=8.3.2)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.3)"] +typing = ["typing-extensions (>=4.12.2)"] [[package]] name = "greenlet" -version = "3.0.3" +version = "3.1.0" description = "Lightweight in-process concurrent programming" -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "greenlet-3.0.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:9da2bd29ed9e4f15955dd1595ad7bc9320308a3b766ef7f837e23ad4b4aac31a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d353cadd6083fdb056bb46ed07e4340b0869c305c8ca54ef9da3421acbdf6881"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dca1e2f3ca00b84a396bc1bce13dd21f680f035314d2379c4160c98153b2059b"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ed7fb269f15dc662787f4119ec300ad0702fa1b19d2135a37c2c4de6fadfd4a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd4f49ae60e10adbc94b45c0b5e6a179acc1736cf7a90160b404076ee283cf83"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:73a411ef564e0e097dbe7e866bb2dda0f027e072b04da387282b02c308807405"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7f362975f2d179f9e26928c5b517524e89dd48530a0202570d55ad6ca5d8a56f"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:649dde7de1a5eceb258f9cb00bdf50e978c9db1b996964cd80703614c86495eb"}, - {file = "greenlet-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:68834da854554926fbedd38c76e60c4a2e3198c6fbed520b106a8986445caaf9"}, - {file = "greenlet-3.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d"}, - {file = "greenlet-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728"}, - {file = "greenlet-3.0.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:70fb482fdf2c707765ab5f0b6655e9cfcf3780d8d87355a063547b41177599be"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4d1ac74f5c0c0524e4a24335350edad7e5f03b9532da7ea4d3c54d527784f2e"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:149e94a2dd82d19838fe4b2259f1b6b9957d5ba1b25640d2380bea9c5df37676"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15d79dd26056573940fcb8c7413d84118086f2ec1a8acdfa854631084393efcc"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b7db1ebff4ba09aaaeae6aa491daeb226c8150fc20e836ad00041bcb11230"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fcd2469d6a2cf298f198f0487e0a5b1a47a42ca0fa4dfd1b6862c999f018ebbf"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1f672519db1796ca0d8753f9e78ec02355e862d0998193038c7073045899f305"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2516a9957eed41dd8f1ec0c604f1cdc86758b587d964668b5b196a9db5bfcde6"}, - {file = "greenlet-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:bba5387a6975598857d86de9eac14210a49d554a77eb8261cc68b7d082f78ce2"}, - {file = "greenlet-3.0.3-cp37-cp37m-macosx_11_0_universal2.whl", hash = "sha256:5b51e85cb5ceda94e79d019ed36b35386e8c37d22f07d6a751cb659b180d5274"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:daf3cb43b7cf2ba96d614252ce1684c1bccee6b2183a01328c98d36fcd7d5cb0"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99bf650dc5d69546e076f413a87481ee1d2d09aaaaaca058c9251b6d8c14783f"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dd6e660effd852586b6a8478a1d244b8dc90ab5b1321751d2ea15deb49ed414"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3391d1e16e2a5a1507d83e4a8b100f4ee626e8eca43cf2cadb543de69827c4c"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e1f145462f1fa6e4a4ae3c0f782e580ce44d57c8f2c7aae1b6fa88c0b2efdb41"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1a7191e42732df52cb5f39d3527217e7ab73cae2cb3694d241e18f53d84ea9a7"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6"}, - {file = "greenlet-3.0.3-cp37-cp37m-win32.whl", hash = "sha256:b542be2440edc2d48547b5923c408cbe0fc94afb9f18741faa6ae970dbcb9b6d"}, - {file = "greenlet-3.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67"}, - {file = "greenlet-3.0.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1996cb9306c8595335bb157d133daf5cf9f693ef413e7673cb07e3e5871379ca"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ddc0f794e6ad661e321caa8d2f0a55ce01213c74722587256fb6566049a8b04"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9db1c18f0eaad2f804728c67d6c610778456e3e1cc4ab4bbd5eeb8e6053c6fc"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7170375bcc99f1a2fbd9c306f5be8764eaf3ac6b5cb968862cad4c7057756506"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b66c9c1e7ccabad3a7d037b2bcb740122a7b17a53734b7d72a344ce39882a1b"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:098d86f528c855ead3479afe84b49242e174ed262456c342d70fc7f972bc13c4"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:81bb9c6d52e8321f09c3d165b2a78c680506d9af285bfccbad9fb7ad5a5da3e5"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da"}, - {file = "greenlet-3.0.3-cp38-cp38-win32.whl", hash = "sha256:d46677c85c5ba00a9cb6f7a00b2bfa6f812192d2c9f7d9c4f6a55b60216712f3"}, - {file = "greenlet-3.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:419b386f84949bf0e7c73e6032e3457b82a787c1ab4a0e43732898a761cc9dbf"}, - {file = "greenlet-3.0.3-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:da70d4d51c8b306bb7a031d5cff6cc25ad253affe89b70352af5f1cb68e74b53"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:086152f8fbc5955df88382e8a75984e2bb1c892ad2e3c80a2508954e52295257"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d73a9fe764d77f87f8ec26a0c85144d6a951a6c438dfe50487df5595c6373eac"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7dcbe92cc99f08c8dd11f930de4d99ef756c3591a5377d1d9cd7dd5e896da71"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1551a8195c0d4a68fac7a4325efac0d541b48def35feb49d803674ac32582f61"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:64d7675ad83578e3fc149b617a444fab8efdafc9385471f868eb5ff83e446b8b"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b37eef18ea55f2ffd8f00ff8fe7c8d3818abd3e25fb73fae2ca3b672e333a7a6"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:77457465d89b8263bca14759d7c1684df840b6811b2499838cc5b040a8b5b113"}, - {file = "greenlet-3.0.3-cp39-cp39-win32.whl", hash = "sha256:57e8974f23e47dac22b83436bdcf23080ade568ce77df33159e019d161ce1d1e"}, - {file = "greenlet-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:c5ee858cfe08f34712f548c3c363e807e7186f03ad7a5039ebadb29e8c6be067"}, - {file = "greenlet-3.0.3.tar.gz", hash = "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491"}, + {file = "greenlet-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a814dc3100e8a046ff48faeaa909e80cdb358411a3d6dd5293158425c684eda8"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a771dc64fa44ebe58d65768d869fcfb9060169d203446c1d446e844b62bdfdca"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0e49a65d25d7350cca2da15aac31b6f67a43d867448babf997fe83c7505f57bc"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2cd8518eade968bc52262d8c46727cfc0826ff4d552cf0430b8d65aaf50bb91d"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76dc19e660baea5c38e949455c1181bc018893f25372d10ffe24b3ed7341fb25"}, + {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c0a5b1c22c82831f56f2f7ad9bbe4948879762fe0d59833a4a71f16e5fa0f682"}, + {file = "greenlet-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:2651dfb006f391bcb240635079a68a261b227a10a08af6349cba834a2141efa1"}, + {file = "greenlet-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3e7e6ef1737a819819b1163116ad4b48d06cfdd40352d813bb14436024fcda99"}, + {file = "greenlet-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:ffb08f2a1e59d38c7b8b9ac8083c9c8b9875f0955b1e9b9b9a965607a51f8e54"}, + {file = "greenlet-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9730929375021ec90f6447bff4f7f5508faef1c02f399a1953870cdb78e0c345"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:713d450cf8e61854de9420fb7eea8ad228df4e27e7d4ed465de98c955d2b3fa6"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c3446937be153718250fe421da548f973124189f18fe4575a0510b5c928f0cc"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ddc7bcedeb47187be74208bc652d63d6b20cb24f4e596bd356092d8000da6d6"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44151d7b81b9391ed759a2f2865bbe623ef00d648fed59363be2bbbd5154656f"}, + {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cea1cca3be76c9483282dc7760ea1cc08a6ecec1f0b6ca0a94ea0d17432da19"}, + {file = "greenlet-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:619935a44f414274a2c08c9e74611965650b730eb4efe4b2270f91df5e4adf9a"}, + {file = "greenlet-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:221169d31cada333a0c7fd087b957c8f431c1dba202c3a58cf5a3583ed973e9b"}, + {file = "greenlet-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:01059afb9b178606b4b6e92c3e710ea1635597c3537e44da69f4531e111dd5e9"}, + {file = "greenlet-3.1.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:24fc216ec7c8be9becba8b64a98a78f9cd057fd2dc75ae952ca94ed8a893bf27"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3d07c28b85b350564bdff9f51c1c5007dfb2f389385d1bc23288de51134ca303"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:243a223c96a4246f8a30ea470c440fe9db1f5e444941ee3c3cd79df119b8eebf"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26811df4dc81271033a7836bc20d12cd30938e6bd2e9437f56fa03da81b0f8fc"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9d86401550b09a55410f32ceb5fe7efcd998bd2dad9e82521713cb148a4a15f"}, + {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:26d9c1c4f1748ccac0bae1dbb465fb1a795a75aba8af8ca871503019f4285e2a"}, + {file = "greenlet-3.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:cd468ec62257bb4544989402b19d795d2305eccb06cde5da0eb739b63dc04665"}, + {file = "greenlet-3.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a53dfe8f82b715319e9953330fa5c8708b610d48b5c59f1316337302af5c0811"}, + {file = "greenlet-3.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:28fe80a3eb673b2d5cc3b12eea468a5e5f4603c26aa34d88bf61bba82ceb2f9b"}, + {file = "greenlet-3.1.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:76b3e3976d2a452cba7aa9e453498ac72240d43030fdc6d538a72b87eaff52fd"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:655b21ffd37a96b1e78cc48bf254f5ea4b5b85efaf9e9e2a526b3c9309d660ca"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c6f4c2027689093775fd58ca2388d58789009116844432d920e9147f91acbe64"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76e5064fd8e94c3f74d9fd69b02d99e3cdb8fc286ed49a1f10b256e59d0d3a0b"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6a4bf607f690f7987ab3291406e012cd8591a4f77aa54f29b890f9c331e84989"}, + {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:037d9ac99540ace9424cb9ea89f0accfaff4316f149520b4ae293eebc5bded17"}, + {file = "greenlet-3.1.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:90b5bbf05fe3d3ef697103850c2ce3374558f6fe40fd57c9fac1bf14903f50a5"}, + {file = "greenlet-3.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:726377bd60081172685c0ff46afbc600d064f01053190e4450857483c4d44484"}, + {file = "greenlet-3.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:d46d5069e2eeda111d6f71970e341f4bd9aeeee92074e649ae263b834286ecc0"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81eeec4403a7d7684b5812a8aaa626fa23b7d0848edb3a28d2eb3220daddcbd0"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a3dae7492d16e85ea6045fd11cb8e782b63eac8c8d520c3a92c02ac4573b0a6"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b5ea3664eed571779403858d7cd0a9b0ebf50d57d2cdeafc7748e09ef8cd81a"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a22f4e26400f7f48faef2d69c20dc055a1f3043d330923f9abe08ea0aecc44df"}, + {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:13ff8c8e54a10472ce3b2a2da007f915175192f18e6495bad50486e87c7f6637"}, + {file = "greenlet-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f9671e7282d8c6fcabc32c0fb8d7c0ea8894ae85cee89c9aadc2d7129e1a9954"}, + {file = "greenlet-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:184258372ae9e1e9bddce6f187967f2e08ecd16906557c4320e3ba88a93438c3"}, + {file = "greenlet-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:a0409bc18a9f85321399c29baf93545152d74a49d92f2f55302f122007cfda00"}, + {file = "greenlet-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:9eb4a1d7399b9f3c7ac68ae6baa6be5f9195d1d08c9ddc45ad559aa6b556bce6"}, + {file = "greenlet-3.1.0-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:a8870983af660798dc1b529e1fd6f1cefd94e45135a32e58bd70edd694540f33"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfcfb73aed40f550a57ea904629bdaf2e562c68fa1164fa4588e752af6efdc3f"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9482c2ed414781c0af0b35d9d575226da6b728bd1a720668fa05837184965b7"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d58ec349e0c2c0bc6669bf2cd4982d2f93bf067860d23a0ea1fe677b0f0b1e09"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd65695a8df1233309b701dec2539cc4b11e97d4fcc0f4185b4a12ce54db0491"}, + {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:665b21e95bc0fce5cab03b2e1d90ba9c66c510f1bb5fdc864f3a377d0f553f6b"}, + {file = "greenlet-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d3c59a06c2c28a81a026ff11fbf012081ea34fb9b7052f2ed0366e14896f0a1d"}, + {file = "greenlet-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5415b9494ff6240b09af06b91a375731febe0090218e2898d2b85f9b92abcda0"}, + {file = "greenlet-3.1.0-cp38-cp38-win32.whl", hash = "sha256:1544b8dd090b494c55e60c4ff46e238be44fdc472d2589e943c241e0169bcea2"}, + {file = "greenlet-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:7f346d24d74c00b6730440f5eb8ec3fe5774ca8d1c9574e8e57c8671bb51b910"}, + {file = "greenlet-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:db1b3ccb93488328c74e97ff888604a8b95ae4f35f4f56677ca57a4fc3a4220b"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44cd313629ded43bb3b98737bba2f3e2c2c8679b55ea29ed73daea6b755fe8e7"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fad7a051e07f64e297e6e8399b4d6a3bdcad3d7297409e9a06ef8cbccff4f501"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3967dcc1cd2ea61b08b0b276659242cbce5caca39e7cbc02408222fb9e6ff39"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d45b75b0f3fd8d99f62eb7908cfa6d727b7ed190737dec7fe46d993da550b81a"}, + {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2d004db911ed7b6218ec5c5bfe4cf70ae8aa2223dffbb5b3c69e342bb253cb28"}, + {file = "greenlet-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b9505a0c8579899057cbefd4ec34d865ab99852baf1ff33a9481eb3924e2da0b"}, + {file = "greenlet-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fd6e94593f6f9714dbad1aaba734b5ec04593374fa6638df61592055868f8b8"}, + {file = "greenlet-3.1.0-cp39-cp39-win32.whl", hash = "sha256:d0dd943282231480aad5f50f89bdf26690c995e8ff555f26d8a5b9887b559bcc"}, + {file = "greenlet-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:ac0adfdb3a21dc2a24ed728b61e72440d297d0fd3a577389df566651fcd08f97"}, + {file = "greenlet-3.1.0.tar.gz", hash = "sha256:b395121e9bbe8d02a750886f108d540abe66075e61e22f7353d9acb0b81be0f0"}, ] [package.extras] @@ -720,7 +699,6 @@ test = ["objgraph", "psutil"] name = "gunicorn" version = "23.0.0" description = "WSGI HTTP Server for UNIX" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -742,7 +720,6 @@ tornado = ["tornado (>=0.2)"] name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -754,7 +731,6 @@ files = [ name = "httpcore" version = "1.0.5" description = "A minimal low-level HTTP client." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -769,14 +745,13 @@ h11 = ">=0.13,<0.15" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (>=1.0.0,<2.0.0)"] +socks = ["socksio (==1.*)"] trio = ["trio (>=0.22.0,<0.26.0)"] [[package]] name = "httpx" version = "0.27.2" description = "The next generation HTTP client." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -787,22 +762,21 @@ files = [ [package.dependencies] anyio = "*" certifi = "*" -httpcore = ">=1.0.0,<2.0.0" +httpcore = "==1.*" idna = "*" sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] -cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<14)"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (>=1.0.0,<2.0.0)"] +socks = ["socksio (==1.*)"] zstd = ["zstandard (>=0.18.0)"] [[package]] name = "identify" version = "2.6.0" description = "File identification library for Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -817,7 +791,6 @@ license = ["ukkonen"] name = "idna" version = "3.8" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -827,34 +800,36 @@ files = [ [[package]] name = "importlib-metadata" -version = "8.4.0" +version = "8.5.0" description = "Read metadata from Python packages" -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-8.4.0-py3-none-any.whl", hash = "sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1"}, - {file = "importlib_metadata-8.4.0.tar.gz", hash = "sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5"}, + {file = "importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b"}, + {file = "importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7"}, ] [package.dependencies] -zipp = ">=0.5" +zipp = ">=3.20" [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +enabler = ["pytest-enabler (>=2.2)"] perf = ["ipython"] -test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-perf (>=0.9.2)", "pytest-ruff (>=0.2.1)"] +test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] +type = ["pytest-mypy"] [[package]] name = "importlib-resources" -version = "6.4.4" +version = "6.4.5" description = "Read resources from Python packages" -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_resources-6.4.4-py3-none-any.whl", hash = "sha256:dda242603d1c9cd836c3368b1174ed74cb4049ecd209e7a1a0104620c18c5c11"}, - {file = "importlib_resources-6.4.4.tar.gz", hash = "sha256:20600c8b7361938dc0bb2d5ec0297802e575df486f5a544fa414da65e13721f7"}, + {file = "importlib_resources-6.4.5-py3-none-any.whl", hash = "sha256:ac29d5f956f01d5e4bb63102a5a19957f1b9175e45649977264a1416783bb717"}, + {file = "importlib_resources-6.4.5.tar.gz", hash = "sha256:980862a1d16c9e147a59603677fa2aa5fd82b87f223b6cb870695bcfce830065"}, ] [package.dependencies] @@ -872,7 +847,6 @@ type = ["pytest-mypy"] name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -884,7 +858,6 @@ files = [ name = "jaraco-classes" version = "3.4.0" description = "Utility functions for Python class constructs" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -903,7 +876,6 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-ena name = "jaraco-context" version = "6.0.1" description = "Useful decorators and context managers" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -922,7 +894,6 @@ test = ["portend", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-c name = "jaraco-functools" version = "4.0.2" description = "Functools like those found in stdlib" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -941,7 +912,6 @@ test = ["jaraco.classes", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "p name = "jeepney" version = "0.8.0" description = "Low-level, pure Python DBus protocol wrapper." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -957,7 +927,6 @@ trio = ["async_generator", "trio"] name = "jinja2" version = "3.1.4" description = "A very fast and expressive template engine." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -975,7 +944,6 @@ i18n = ["Babel (>=2.7)"] name = "keyring" version = "25.3.0" description = "Store and access your passwords safely." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1002,7 +970,6 @@ test = ["pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest- name = "lazy-loader" version = "0.4" description = "Makes it easy to load subpackages and functions on demand." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1022,7 +989,6 @@ test = ["pytest (>=7.4)", "pytest-cov (>=4.1)"] name = "mako" version = "1.3.5" description = "A super-fast templating language that borrows the best ideas from the existing templating languages." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1042,7 +1008,6 @@ testing = ["pytest"] name = "markdown-it-py" version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1067,7 +1032,6 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] name = "markupsafe" version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1137,7 +1101,6 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1149,7 +1112,6 @@ files = [ name = "more-itertools" version = "10.5.0" description = "More routines for operating on iterables, beyond itertools" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1161,7 +1123,6 @@ files = [ name = "nh3" version = "0.2.18" description = "Python bindings to the ammonia HTML sanitization library." -category = "main" optional = false python-versions = "*" files = [ @@ -1187,7 +1148,6 @@ files = [ name = "nodeenv" version = "1.9.1" description = "Node.js virtual environment builder" -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -1199,7 +1159,6 @@ files = [ name = "numpy" version = "1.24.4" description = "Fundamental package for array computing in Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1237,7 +1196,6 @@ files = [ name = "numpy" version = "2.0.2" description = "Fundamental package for array computing in Python" -category = "dev" optional = false python-versions = ">=3.9" files = [ @@ -1292,7 +1250,6 @@ files = [ name = "numpy" version = "2.1.1" description = "Fundamental package for array computing in Python" -category = "dev" optional = false python-versions = ">=3.10" files = [ @@ -1355,7 +1312,6 @@ files = [ name = "outcome" version = "1.3.0.post0" description = "Capture the outcome of Python function calls." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1370,7 +1326,6 @@ attrs = ">=19.2.0" name = "packaging" version = "24.1" description = "Core utilities for Python packages" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1382,7 +1337,6 @@ files = [ name = "pandas" version = "1.5.3" description = "Powerful data structures for data analysis, time series, and statistics" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1427,7 +1381,6 @@ test = ["hypothesis (>=5.5.3)", "pytest (>=6.0)", "pytest-xdist (>=1.31)"] name = "pandas" version = "2.2.2" description = "Powerful data structures for data analysis, time series, and statistics" -category = "dev" optional = false python-versions = ">=3.9" files = [ @@ -1501,7 +1454,6 @@ xml = ["lxml (>=4.9.2)"] name = "pillow" version = "10.4.0" description = "Python Imaging Library (Fork)" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1599,7 +1551,6 @@ xmp = ["defusedxml"] name = "pip" version = "24.2" description = "The PyPA recommended tool for installing Python packages." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1611,7 +1562,6 @@ files = [ name = "pipdeptree" version = "2.16.2" description = "Command line utility to show dependency tree of packages." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1630,7 +1580,6 @@ test = ["covdefaults (>=2.3)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pyte name = "pkginfo" version = "1.10.0" description = "Query metadata from sdists / bdists / installed packages." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1643,31 +1592,29 @@ testing = ["pytest", "pytest-cov", "wheel"] [[package]] name = "platformdirs" -version = "4.2.2" +version = "4.3.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, - {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, + {file = "platformdirs-4.3.2-py3-none-any.whl", hash = "sha256:eb1c8582560b34ed4ba105009a4badf7f6f85768b30126f351328507b2beb617"}, + {file = "platformdirs-4.3.2.tar.gz", hash = "sha256:9e5e27a08aa095dd127b9f2e764d74254f482fef22b0970773bfba79d091ab8c"}, ] [package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] -type = ["mypy (>=1.8)"] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] [[package]] name = "plotly" -version = "5.24.0" +version = "5.24.1" description = "An open-source, interactive data visualization library for Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "plotly-5.24.0-py3-none-any.whl", hash = "sha256:0e54efe52c8cef899f7daa41be9ed97dfb6be622613a2a8f56a86a0634b2b67e"}, - {file = "plotly-5.24.0.tar.gz", hash = "sha256:eae9f4f54448682442c92c1e97148e3ad0c52f0cf86306e1b76daba24add554a"}, + {file = "plotly-5.24.1-py3-none-any.whl", hash = "sha256:f67073a1e637eb0dc3e46324d9d51e2fe76e9727c892dde64ddf1e1b51f29089"}, + {file = "plotly-5.24.1.tar.gz", hash = "sha256:dbc8ac8339d248a4bcc36e08a5659bacfe1b079390b8953533f4eb22169b4bae"}, ] [package.dependencies] @@ -1678,7 +1625,6 @@ tenacity = ">=6.2.0" name = "pluggy" version = "1.5.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1694,7 +1640,6 @@ testing = ["pytest", "pytest-benchmark"] name = "pre-commit" version = "3.5.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1713,7 +1658,6 @@ virtualenv = ">=20.10.0" name = "psutil" version = "6.0.0" description = "Cross-platform lib for process and system monitoring in Python." -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ @@ -1743,7 +1687,6 @@ test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] name = "py-cpuinfo" version = "9.0.0" description = "Get CPU info with pure Python" -category = "dev" optional = false python-versions = "*" files = [ @@ -1755,7 +1698,6 @@ files = [ name = "pycparser" version = "2.22" description = "C parser in Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1765,125 +1707,123 @@ files = [ [[package]] name = "pydantic" -version = "2.9.0" +version = "2.9.1" description = "Data validation using Python type hints" -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.9.0-py3-none-any.whl", hash = "sha256:f66a7073abd93214a20c5f7b32d56843137a7a2e70d02111f3be287035c45370"}, - {file = "pydantic-2.9.0.tar.gz", hash = "sha256:c7a8a9fdf7d100afa49647eae340e2d23efa382466a8d177efcd1381e9be5598"}, + {file = "pydantic-2.9.1-py3-none-any.whl", hash = "sha256:7aff4db5fdf3cf573d4b3c30926a510a10e19a0774d38fc4967f78beb6deb612"}, + {file = "pydantic-2.9.1.tar.gz", hash = "sha256:1363c7d975c7036df0db2b4a61f2e062fbc0aa5ab5f2772e0ffc7191a4f4bce2"}, ] [package.dependencies] -annotated-types = ">=0.4.0" -pydantic-core = "2.23.2" +annotated-types = ">=0.6.0" +pydantic-core = "2.23.3" typing-extensions = [ {version = ">=4.6.1", markers = "python_version < \"3.13\""}, {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] -tzdata = {version = "*", markers = "python_version >= \"3.9\""} [package.extras] email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] [[package]] name = "pydantic-core" -version = "2.23.2" +version = "2.23.3" description = "Core functionality for Pydantic validation and serialization" -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.23.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:7d0324a35ab436c9d768753cbc3c47a865a2cbc0757066cb864747baa61f6ece"}, - {file = "pydantic_core-2.23.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:276ae78153a94b664e700ac362587c73b84399bd1145e135287513442e7dfbc7"}, - {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:964c7aa318da542cdcc60d4a648377ffe1a2ef0eb1e996026c7f74507b720a78"}, - {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1cf842265a3a820ebc6388b963ead065f5ce8f2068ac4e1c713ef77a67b71f7c"}, - {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae90b9e50fe1bd115b24785e962b51130340408156d34d67b5f8f3fa6540938e"}, - {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ae65fdfb8a841556b52935dfd4c3f79132dc5253b12c0061b96415208f4d622"}, - {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c8aa40f6ca803f95b1c1c5aeaee6237b9e879e4dfb46ad713229a63651a95fb"}, - {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c53100c8ee5a1e102766abde2158077d8c374bee0639201f11d3032e3555dfbc"}, - {file = "pydantic_core-2.23.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d6b9dd6aa03c812017411734e496c44fef29b43dba1e3dd1fa7361bbacfc1354"}, - {file = "pydantic_core-2.23.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b18cf68255a476b927910c6873d9ed00da692bb293c5b10b282bd48a0afe3ae2"}, - {file = "pydantic_core-2.23.2-cp310-none-win32.whl", hash = "sha256:e460475719721d59cd54a350c1f71c797c763212c836bf48585478c5514d2854"}, - {file = "pydantic_core-2.23.2-cp310-none-win_amd64.whl", hash = "sha256:5f3cf3721eaf8741cffaf092487f1ca80831202ce91672776b02b875580e174a"}, - {file = "pydantic_core-2.23.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:7ce8e26b86a91e305858e018afc7a6e932f17428b1eaa60154bd1f7ee888b5f8"}, - {file = "pydantic_core-2.23.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7e9b24cca4037a561422bf5dc52b38d390fb61f7bfff64053ce1b72f6938e6b2"}, - {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:753294d42fb072aa1775bfe1a2ba1012427376718fa4c72de52005a3d2a22178"}, - {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:257d6a410a0d8aeb50b4283dea39bb79b14303e0fab0f2b9d617701331ed1515"}, - {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c8319e0bd6a7b45ad76166cc3d5d6a36c97d0c82a196f478c3ee5346566eebfd"}, - {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7a05c0240f6c711eb381ac392de987ee974fa9336071fb697768dfdb151345ce"}, - {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d5b0ff3218858859910295df6953d7bafac3a48d5cd18f4e3ed9999efd2245f"}, - {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:96ef39add33ff58cd4c112cbac076726b96b98bb8f1e7f7595288dcfb2f10b57"}, - {file = "pydantic_core-2.23.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0102e49ac7d2df3379ef8d658d3bc59d3d769b0bdb17da189b75efa861fc07b4"}, - {file = "pydantic_core-2.23.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a6612c2a844043e4d10a8324c54cdff0042c558eef30bd705770793d70b224aa"}, - {file = "pydantic_core-2.23.2-cp311-none-win32.whl", hash = "sha256:caffda619099cfd4f63d48462f6aadbecee3ad9603b4b88b60cb821c1b258576"}, - {file = "pydantic_core-2.23.2-cp311-none-win_amd64.whl", hash = "sha256:6f80fba4af0cb1d2344869d56430e304a51396b70d46b91a55ed4959993c0589"}, - {file = "pydantic_core-2.23.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:4c83c64d05ffbbe12d4e8498ab72bdb05bcc1026340a4a597dc647a13c1605ec"}, - {file = "pydantic_core-2.23.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6294907eaaccf71c076abdd1c7954e272efa39bb043161b4b8aa1cd76a16ce43"}, - {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a801c5e1e13272e0909c520708122496647d1279d252c9e6e07dac216accc41"}, - {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cc0c316fba3ce72ac3ab7902a888b9dc4979162d320823679da270c2d9ad0cad"}, - {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b06c5d4e8701ac2ba99a2ef835e4e1b187d41095a9c619c5b185c9068ed2a49"}, - {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:82764c0bd697159fe9947ad59b6db6d7329e88505c8f98990eb07e84cc0a5d81"}, - {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b1a195efd347ede8bcf723e932300292eb13a9d2a3c1f84eb8f37cbbc905b7f"}, - {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b7efb12e5071ad8d5b547487bdad489fbd4a5a35a0fc36a1941517a6ad7f23e0"}, - {file = "pydantic_core-2.23.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:5dd0ec5f514ed40e49bf961d49cf1bc2c72e9b50f29a163b2cc9030c6742aa73"}, - {file = "pydantic_core-2.23.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:820f6ee5c06bc868335e3b6e42d7ef41f50dfb3ea32fbd523ab679d10d8741c0"}, - {file = "pydantic_core-2.23.2-cp312-none-win32.whl", hash = "sha256:3713dc093d5048bfaedbba7a8dbc53e74c44a140d45ede020dc347dda18daf3f"}, - {file = "pydantic_core-2.23.2-cp312-none-win_amd64.whl", hash = "sha256:e1895e949f8849bc2757c0dbac28422a04be031204df46a56ab34bcf98507342"}, - {file = "pydantic_core-2.23.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:da43cbe593e3c87d07108d0ebd73771dc414488f1f91ed2e204b0370b94b37ac"}, - {file = "pydantic_core-2.23.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:64d094ea1aa97c6ded4748d40886076a931a8bf6f61b6e43e4a1041769c39dd2"}, - {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:084414ffe9a85a52940b49631321d636dadf3576c30259607b75516d131fecd0"}, - {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:043ef8469f72609c4c3a5e06a07a1f713d53df4d53112c6d49207c0bd3c3bd9b"}, - {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3649bd3ae6a8ebea7dc381afb7f3c6db237fc7cebd05c8ac36ca8a4187b03b30"}, - {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6db09153d8438425e98cdc9a289c5fade04a5d2128faff8f227c459da21b9703"}, - {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5668b3173bb0b2e65020b60d83f5910a7224027232c9f5dc05a71a1deac9f960"}, - {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1c7b81beaf7c7ebde978377dc53679c6cba0e946426fc7ade54251dfe24a7604"}, - {file = "pydantic_core-2.23.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:ae579143826c6f05a361d9546446c432a165ecf1c0b720bbfd81152645cb897d"}, - {file = "pydantic_core-2.23.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:19f1352fe4b248cae22a89268720fc74e83f008057a652894f08fa931e77dced"}, - {file = "pydantic_core-2.23.2-cp313-none-win32.whl", hash = "sha256:e1a79ad49f346aa1a2921f31e8dbbab4d64484823e813a002679eaa46cba39e1"}, - {file = "pydantic_core-2.23.2-cp313-none-win_amd64.whl", hash = "sha256:582871902e1902b3c8e9b2c347f32a792a07094110c1bca6c2ea89b90150caac"}, - {file = "pydantic_core-2.23.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:743e5811b0c377eb830150d675b0847a74a44d4ad5ab8845923d5b3a756d8100"}, - {file = "pydantic_core-2.23.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6650a7bbe17a2717167e3e23c186849bae5cef35d38949549f1c116031b2b3aa"}, - {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:56e6a12ec8d7679f41b3750ffa426d22b44ef97be226a9bab00a03365f217b2b"}, - {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:810ca06cca91de9107718dc83d9ac4d2e86efd6c02cba49a190abcaf33fb0472"}, - {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:785e7f517ebb9890813d31cb5d328fa5eda825bb205065cde760b3150e4de1f7"}, - {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ef71ec876fcc4d3bbf2ae81961959e8d62f8d74a83d116668409c224012e3af"}, - {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d50ac34835c6a4a0d456b5db559b82047403c4317b3bc73b3455fefdbdc54b0a"}, - {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16b25a4a120a2bb7dab51b81e3d9f3cde4f9a4456566c403ed29ac81bf49744f"}, - {file = "pydantic_core-2.23.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:41ae8537ad371ec018e3c5da0eb3f3e40ee1011eb9be1da7f965357c4623c501"}, - {file = "pydantic_core-2.23.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07049ec9306ec64e955b2e7c40c8d77dd78ea89adb97a2013d0b6e055c5ee4c5"}, - {file = "pydantic_core-2.23.2-cp38-none-win32.whl", hash = "sha256:086c5db95157dc84c63ff9d96ebb8856f47ce113c86b61065a066f8efbe80acf"}, - {file = "pydantic_core-2.23.2-cp38-none-win_amd64.whl", hash = "sha256:67b6655311b00581914aba481729971b88bb8bc7996206590700a3ac85e457b8"}, - {file = "pydantic_core-2.23.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:358331e21a897151e54d58e08d0219acf98ebb14c567267a87e971f3d2a3be59"}, - {file = "pydantic_core-2.23.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c4d9f15ffe68bcd3898b0ad7233af01b15c57d91cd1667f8d868e0eacbfe3f87"}, - {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0123655fedacf035ab10c23450163c2f65a4174f2bb034b188240a6cf06bb123"}, - {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e6e3ccebdbd6e53474b0bb7ab8b88e83c0cfe91484b25e058e581348ee5a01a5"}, - {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc535cb898ef88333cf317777ecdfe0faac1c2a3187ef7eb061b6f7ecf7e6bae"}, - {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aab9e522efff3993a9e98ab14263d4e20211e62da088298089a03056980a3e69"}, - {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05b366fb8fe3d8683b11ac35fa08947d7b92be78ec64e3277d03bd7f9b7cda79"}, - {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7568f682c06f10f30ef643a1e8eec4afeecdafde5c4af1b574c6df079e96f96c"}, - {file = "pydantic_core-2.23.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:cdd02a08205dc90238669f082747612cb3c82bd2c717adc60f9b9ecadb540f80"}, - {file = "pydantic_core-2.23.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1a2ab4f410f4b886de53b6bddf5dd6f337915a29dd9f22f20f3099659536b2f6"}, - {file = "pydantic_core-2.23.2-cp39-none-win32.whl", hash = "sha256:0448b81c3dfcde439551bb04a9f41d7627f676b12701865c8a2574bcea034437"}, - {file = "pydantic_core-2.23.2-cp39-none-win_amd64.whl", hash = "sha256:4cebb9794f67266d65e7e4cbe5dcf063e29fc7b81c79dc9475bd476d9534150e"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e758d271ed0286d146cf7c04c539a5169a888dd0b57026be621547e756af55bc"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:f477d26183e94eaafc60b983ab25af2a809a1b48ce4debb57b343f671b7a90b6"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da3131ef2b940b99106f29dfbc30d9505643f766704e14c5d5e504e6a480c35e"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329a721253c7e4cbd7aad4a377745fbcc0607f9d72a3cc2102dd40519be75ed2"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7706e15cdbf42f8fab1e6425247dfa98f4a6f8c63746c995d6a2017f78e619ae"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:e64ffaf8f6e17ca15eb48344d86a7a741454526f3a3fa56bc493ad9d7ec63936"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dd59638025160056687d598b054b64a79183f8065eae0d3f5ca523cde9943940"}, - {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:12625e69b1199e94b0ae1c9a95d000484ce9f0182f9965a26572f054b1537e44"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5d813fd871b3d5c3005157622ee102e8908ad6011ec915a18bd8fde673c4360e"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:1eb37f7d6a8001c0f86dc8ff2ee8d08291a536d76e49e78cda8587bb54d8b329"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ce7eaf9a98680b4312b7cebcdd9352531c43db00fca586115845df388f3c465"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f087879f1ffde024dd2788a30d55acd67959dcf6c431e9d3682d1c491a0eb474"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6ce883906810b4c3bd90e0ada1f9e808d9ecf1c5f0b60c6b8831d6100bcc7dd6"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a8031074a397a5925d06b590121f8339d34a5a74cfe6970f8a1124eb8b83f4ac"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:23af245b8f2f4ee9e2c99cb3f93d0e22fb5c16df3f2f643f5a8da5caff12a653"}, - {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c57e493a0faea1e4c38f860d6862ba6832723396c884fbf938ff5e9b224200e2"}, - {file = "pydantic_core-2.23.2.tar.gz", hash = "sha256:95d6bf449a1ac81de562d65d180af5d8c19672793c81877a2eda8fde5d08f2fd"}, + {file = "pydantic_core-2.23.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:7f10a5d1b9281392f1bf507d16ac720e78285dfd635b05737c3911637601bae6"}, + {file = "pydantic_core-2.23.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3c09a7885dd33ee8c65266e5aa7fb7e2f23d49d8043f089989726391dd7350c5"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6470b5a1ec4d1c2e9afe928c6cb37eb33381cab99292a708b8cb9aa89e62429b"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9172d2088e27d9a185ea0a6c8cebe227a9139fd90295221d7d495944d2367700"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86fc6c762ca7ac8fbbdff80d61b2c59fb6b7d144aa46e2d54d9e1b7b0e780e01"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0cb80fd5c2df4898693aa841425ea1727b1b6d2167448253077d2a49003e0ed"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03667cec5daf43ac4995cefa8aaf58f99de036204a37b889c24a80927b629cec"}, + {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:047531242f8e9c2db733599f1c612925de095e93c9cc0e599e96cf536aaf56ba"}, + {file = "pydantic_core-2.23.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5499798317fff7f25dbef9347f4451b91ac2a4330c6669821c8202fd354c7bee"}, + {file = "pydantic_core-2.23.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bbb5e45eab7624440516ee3722a3044b83fff4c0372efe183fd6ba678ff681fe"}, + {file = "pydantic_core-2.23.3-cp310-none-win32.whl", hash = "sha256:8b5b3ed73abb147704a6e9f556d8c5cb078f8c095be4588e669d315e0d11893b"}, + {file = "pydantic_core-2.23.3-cp310-none-win_amd64.whl", hash = "sha256:2b603cde285322758a0279995b5796d64b63060bfbe214b50a3ca23b5cee3e83"}, + {file = "pydantic_core-2.23.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:c889fd87e1f1bbeb877c2ee56b63bb297de4636661cc9bbfcf4b34e5e925bc27"}, + {file = "pydantic_core-2.23.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ea85bda3189fb27503af4c45273735bcde3dd31c1ab17d11f37b04877859ef45"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7f7f72f721223f33d3dc98a791666ebc6a91fa023ce63733709f4894a7dc611"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b2b55b0448e9da68f56b696f313949cda1039e8ec7b5d294285335b53104b61"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c24574c7e92e2c56379706b9a3f07c1e0c7f2f87a41b6ee86653100c4ce343e5"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2b05e6ccbee333a8f4b8f4d7c244fdb7a979e90977ad9c51ea31261e2085ce0"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2c409ce1c219c091e47cb03feb3c4ed8c2b8e004efc940da0166aaee8f9d6c8"}, + {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d965e8b325f443ed3196db890d85dfebbb09f7384486a77461347f4adb1fa7f8"}, + {file = "pydantic_core-2.23.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:f56af3a420fb1ffaf43ece3ea09c2d27c444e7c40dcb7c6e7cf57aae764f2b48"}, + {file = "pydantic_core-2.23.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5b01a078dd4f9a52494370af21aa52964e0a96d4862ac64ff7cea06e0f12d2c5"}, + {file = "pydantic_core-2.23.3-cp311-none-win32.whl", hash = "sha256:560e32f0df04ac69b3dd818f71339983f6d1f70eb99d4d1f8e9705fb6c34a5c1"}, + {file = "pydantic_core-2.23.3-cp311-none-win_amd64.whl", hash = "sha256:c744fa100fdea0d000d8bcddee95213d2de2e95b9c12be083370b2072333a0fa"}, + {file = "pydantic_core-2.23.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e0ec50663feedf64d21bad0809f5857bac1ce91deded203efc4a84b31b2e4305"}, + {file = "pydantic_core-2.23.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:db6e6afcb95edbe6b357786684b71008499836e91f2a4a1e55b840955b341dbb"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:98ccd69edcf49f0875d86942f4418a4e83eb3047f20eb897bffa62a5d419c8fa"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a678c1ac5c5ec5685af0133262103defb427114e62eafeda12f1357a12140162"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01491d8b4d8db9f3391d93b0df60701e644ff0894352947f31fff3e52bd5c801"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fcf31facf2796a2d3b7fe338fe8640aa0166e4e55b4cb108dbfd1058049bf4cb"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7200fd561fb3be06827340da066df4311d0b6b8eb0c2116a110be5245dceb326"}, + {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dc1636770a809dee2bd44dd74b89cc80eb41172bcad8af75dd0bc182c2666d4c"}, + {file = "pydantic_core-2.23.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:67a5def279309f2e23014b608c4150b0c2d323bd7bccd27ff07b001c12c2415c"}, + {file = "pydantic_core-2.23.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:748bdf985014c6dd3e1e4cc3db90f1c3ecc7246ff5a3cd4ddab20c768b2f1dab"}, + {file = "pydantic_core-2.23.3-cp312-none-win32.whl", hash = "sha256:255ec6dcb899c115f1e2a64bc9ebc24cc0e3ab097775755244f77360d1f3c06c"}, + {file = "pydantic_core-2.23.3-cp312-none-win_amd64.whl", hash = "sha256:40b8441be16c1e940abebed83cd006ddb9e3737a279e339dbd6d31578b802f7b"}, + {file = "pydantic_core-2.23.3-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:6daaf5b1ba1369a22c8b050b643250e3e5efc6a78366d323294aee54953a4d5f"}, + {file = "pydantic_core-2.23.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d015e63b985a78a3d4ccffd3bdf22b7c20b3bbd4b8227809b3e8e75bc37f9cb2"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3fc572d9b5b5cfe13f8e8a6e26271d5d13f80173724b738557a8c7f3a8a3791"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f6bd91345b5163ee7448bee201ed7dd601ca24f43f439109b0212e296eb5b423"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc379c73fd66606628b866f661e8785088afe2adaba78e6bbe80796baf708a63"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbdce4b47592f9e296e19ac31667daed8753c8367ebb34b9a9bd89dacaa299c9"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc3cf31edf405a161a0adad83246568647c54404739b614b1ff43dad2b02e6d5"}, + {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8e22b477bf90db71c156f89a55bfe4d25177b81fce4aa09294d9e805eec13855"}, + {file = "pydantic_core-2.23.3-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:0a0137ddf462575d9bce863c4c95bac3493ba8e22f8c28ca94634b4a1d3e2bb4"}, + {file = "pydantic_core-2.23.3-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:203171e48946c3164fe7691fc349c79241ff8f28306abd4cad5f4f75ed80bc8d"}, + {file = "pydantic_core-2.23.3-cp313-none-win32.whl", hash = "sha256:76bdab0de4acb3f119c2a4bff740e0c7dc2e6de7692774620f7452ce11ca76c8"}, + {file = "pydantic_core-2.23.3-cp313-none-win_amd64.whl", hash = "sha256:37ba321ac2a46100c578a92e9a6aa33afe9ec99ffa084424291d84e456f490c1"}, + {file = "pydantic_core-2.23.3-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d063c6b9fed7d992bcbebfc9133f4c24b7a7f215d6b102f3e082b1117cddb72c"}, + {file = "pydantic_core-2.23.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6cb968da9a0746a0cf521b2b5ef25fc5a0bee9b9a1a8214e0a1cfaea5be7e8a4"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edbefe079a520c5984e30e1f1f29325054b59534729c25b874a16a5048028d16"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cbaaf2ef20d282659093913da9d402108203f7cb5955020bd8d1ae5a2325d1c4"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fb539d7e5dc4aac345846f290cf504d2fd3c1be26ac4e8b5e4c2b688069ff4cf"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7e6f33503c5495059148cc486867e1d24ca35df5fc064686e631e314d959ad5b"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04b07490bc2f6f2717b10c3969e1b830f5720b632f8ae2f3b8b1542394c47a8e"}, + {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:03795b9e8a5d7fda05f3873efc3f59105e2dcff14231680296b87b80bb327295"}, + {file = "pydantic_core-2.23.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c483dab0f14b8d3f0df0c6c18d70b21b086f74c87ab03c59250dbf6d3c89baba"}, + {file = "pydantic_core-2.23.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8b2682038e255e94baf2c473dca914a7460069171ff5cdd4080be18ab8a7fd6e"}, + {file = "pydantic_core-2.23.3-cp38-none-win32.whl", hash = "sha256:f4a57db8966b3a1d1a350012839c6a0099f0898c56512dfade8a1fe5fb278710"}, + {file = "pydantic_core-2.23.3-cp38-none-win_amd64.whl", hash = "sha256:13dd45ba2561603681a2676ca56006d6dee94493f03d5cadc055d2055615c3ea"}, + {file = "pydantic_core-2.23.3-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:82da2f4703894134a9f000e24965df73cc103e31e8c31906cc1ee89fde72cbd8"}, + {file = "pydantic_core-2.23.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dd9be0a42de08f4b58a3cc73a123f124f65c24698b95a54c1543065baca8cf0e"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89b731f25c80830c76fdb13705c68fef6a2b6dc494402987c7ea9584fe189f5d"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6de1ec30c4bb94f3a69c9f5f2182baeda5b809f806676675e9ef6b8dc936f28"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb68b41c3fa64587412b104294b9cbb027509dc2f6958446c502638d481525ef"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c3980f2843de5184656aab58698011b42763ccba11c4a8c35936c8dd6c7068c"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94f85614f2cba13f62c3c6481716e4adeae48e1eaa7e8bac379b9d177d93947a"}, + {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:510b7fb0a86dc8f10a8bb43bd2f97beb63cffad1203071dc434dac26453955cd"}, + {file = "pydantic_core-2.23.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1eba2f7ce3e30ee2170410e2171867ea73dbd692433b81a93758ab2de6c64835"}, + {file = "pydantic_core-2.23.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4b259fd8409ab84b4041b7b3f24dcc41e4696f180b775961ca8142b5b21d0e70"}, + {file = "pydantic_core-2.23.3-cp39-none-win32.whl", hash = "sha256:40d9bd259538dba2f40963286009bf7caf18b5112b19d2b55b09c14dde6db6a7"}, + {file = "pydantic_core-2.23.3-cp39-none-win_amd64.whl", hash = "sha256:5a8cd3074a98ee70173a8633ad3c10e00dcb991ecec57263aacb4095c5efb958"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f399e8657c67313476a121a6944311fab377085ca7f490648c9af97fc732732d"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:6b5547d098c76e1694ba85f05b595720d7c60d342f24d5aad32c3049131fa5c4"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0dda0290a6f608504882d9f7650975b4651ff91c85673341789a476b1159f211"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b6e5da855e9c55a0c67f4db8a492bf13d8d3316a59999cfbaf98cc6e401961"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:09e926397f392059ce0afdcac920df29d9c833256354d0c55f1584b0b70cf07e"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:87cfa0ed6b8c5bd6ae8b66de941cece179281239d482f363814d2b986b79cedc"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e61328920154b6a44d98cabcb709f10e8b74276bc709c9a513a8c37a18786cc4"}, + {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce3317d155628301d649fe5e16a99528d5680af4ec7aa70b90b8dacd2d725c9b"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e89513f014c6be0d17b00a9a7c81b1c426f4eb9224b15433f3d98c1a071f8433"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:4f62c1c953d7ee375df5eb2e44ad50ce2f5aff931723b398b8bc6f0ac159791a"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2718443bc671c7ac331de4eef9b673063b10af32a0bb385019ad61dcf2cc8f6c"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0d90e08b2727c5d01af1b5ef4121d2f0c99fbee692c762f4d9d0409c9da6541"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2b676583fc459c64146debea14ba3af54e540b61762dfc0613dc4e98c3f66eeb"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:50e4661f3337977740fdbfbae084ae5693e505ca2b3130a6d4eb0f2281dc43b8"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:68f4cf373f0de6abfe599a38307f4417c1c867ca381c03df27c873a9069cda25"}, + {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:59d52cf01854cb26c46958552a21acb10dd78a52aa34c86f284e66b209db8cab"}, + {file = "pydantic_core-2.23.3.tar.gz", hash = "sha256:3cb0f65d8b4121c1b015c60104a685feb929a29d7cf204387c7f2688c7974690"}, ] [package.dependencies] @@ -1893,7 +1833,6 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" name = "pygments" version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1908,7 +1847,6 @@ windows-terminal = ["colorama (>=0.4.6)"] name = "pyproject-hooks" version = "1.1.0" description = "Wrappers to call pyproject.toml-based build backend hooks." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1920,7 +1858,6 @@ files = [ name = "pyright" version = "1.1.334" description = "Command line wrapper for pyright" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1939,7 +1876,6 @@ dev = ["twine (>=3.4.1)"] name = "pysocks" version = "1.7.1" description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1952,7 +1888,6 @@ files = [ name = "pytest" version = "7.4.4" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1975,7 +1910,6 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no name = "pytest-asyncio" version = "0.21.2" description = "Pytest support for asyncio" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1994,7 +1928,6 @@ testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy name = "pytest-benchmark" version = "4.0.0" description = "A ``pytest`` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2015,7 +1948,6 @@ histogram = ["pygal", "pygaljs"] name = "pytest-cov" version = "4.1.0" description = "Pytest plugin for measuring coverage." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2034,7 +1966,6 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale name = "pytest-mock" version = "3.14.0" description = "Thin-wrapper around the mock package for easier use with pytest" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2052,7 +1983,6 @@ dev = ["pre-commit", "pytest-asyncio", "tox"] name = "python-dateutil" version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -2067,7 +1997,6 @@ six = ">=1.5" name = "python-engineio" version = "4.9.1" description = "Engine.IO server and client for Python" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2087,7 +2016,6 @@ docs = ["sphinx"] name = "python-multipart" version = "0.0.9" description = "A streaming multipart parser for Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2102,7 +2030,6 @@ dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatc name = "python-socketio" version = "5.11.4" description = "Socket.IO server and client for Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2121,21 +2048,19 @@ docs = ["sphinx"] [[package]] name = "pytz" -version = "2024.1" +version = "2024.2" description = "World timezone definitions, modern and historical" -category = "dev" optional = false python-versions = "*" files = [ - {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, - {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, + {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"}, + {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"}, ] [[package]] name = "pywin32-ctypes" version = "0.2.3" description = "A (partial) reimplementation of pywin32 using ctypes/cffi" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2147,7 +2072,6 @@ files = [ name = "pyyaml" version = "6.0.2" description = "YAML parser and emitter for Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2210,7 +2134,6 @@ files = [ name = "readme-renderer" version = "43.0" description = "readme_renderer is a library for rendering readme descriptions for Warehouse" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2230,7 +2153,6 @@ md = ["cmarkgfm (>=0.8.0)"] name = "redis" version = "5.0.8" description = "Python client for Redis database and key-value store" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2247,14 +2169,13 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "reflex-chakra" -version = "0.6.0a6" +version = "0.6.0a7" description = "reflex using chakra components" -category = "main" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_chakra-0.6.0a6-py3-none-any.whl", hash = "sha256:a526f5db8a457c68c24317d007172e77b323a34abf03f05eeb8d92c014563bfb"}, - {file = "reflex_chakra-0.6.0a6.tar.gz", hash = "sha256:124a780ea96d36d31f46b4c97bb0c0f111f2fb6e0d66a142e1577dad740f6e35"}, + {file = "reflex_chakra-0.6.0a7-py3-none-any.whl", hash = "sha256:d693aee7323af13ce491165ffb4fe392344939e45516991671d5601727f749f4"}, + {file = "reflex_chakra-0.6.0a7.tar.gz", hash = "sha256:fe17282e439fdfdfd507e24857a615258ef9789f15049aa0e70239fbcb4d5fbf"}, ] [package.dependencies] @@ -2264,7 +2185,6 @@ reflex = ">=0.6.0a" name = "reflex-hosting-cli" version = "0.1.13" description = "Reflex Hosting CLI" -category = "main" optional = false python-versions = "<4.0,>=3.8" files = [ @@ -2288,7 +2208,6 @@ websockets = ">=10.4" name = "requests" version = "2.32.3" description = "Python HTTP for Humans." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2310,7 +2229,6 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "requests-toolbelt" version = "1.0.0" description = "A utility belt for advanced users of python-requests" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -2325,7 +2243,6 @@ requests = ">=2.0.1,<3.0.0" name = "rfc3986" version = "2.0.0" description = "Validating URI References per RFC 3986" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2338,14 +2255,13 @@ idna2008 = ["idna"] [[package]] name = "rich" -version = "13.8.0" +version = "13.8.1" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" -category = "main" optional = false python-versions = ">=3.7.0" files = [ - {file = "rich-13.8.0-py3-none-any.whl", hash = "sha256:2e85306a063b9492dffc86278197a60cbece75bcb766022f3436f567cae11bdc"}, - {file = "rich-13.8.0.tar.gz", hash = "sha256:a5ac1f1cd448ade0d59cc3356f7db7a7ccda2c8cbae9c7a90c28ff463d3e91f4"}, + {file = "rich-13.8.1-py3-none-any.whl", hash = "sha256:1760a3c0848469b97b558fc61c85233e3dafb69c7a071b4d60c38099d3cd4c06"}, + {file = "rich-13.8.1.tar.gz", hash = "sha256:8260cda28e3db6bf04d2d1ef4dbc03ba80a824c88b0e7668a0f23126a424844a"}, ] [package.dependencies] @@ -2360,7 +2276,6 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] name = "ruff" version = "0.4.10" description = "An extremely fast Python linter and code formatter, written in Rust." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2387,7 +2302,6 @@ files = [ name = "secretstorage" version = "3.3.3" description = "Python bindings to FreeDesktop.org Secret Service API" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2403,7 +2317,6 @@ jeepney = ">=0.6" name = "selenium" version = "4.24.0" description = "Official Python bindings for Selenium WebDriver" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2423,7 +2336,6 @@ websocket-client = ">=1.8,<2.0" name = "setuptools" version = "70.1.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2439,7 +2351,6 @@ testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metad name = "shellingham" version = "1.5.4" description = "Tool to Detect Surrounding Shell" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2451,7 +2362,6 @@ files = [ name = "simple-websocket" version = "1.0.0" description = "Simple WebSocket server and client for Python" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -2469,7 +2379,6 @@ docs = ["sphinx"] name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -2481,7 +2390,6 @@ files = [ name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2493,7 +2401,6 @@ files = [ name = "sortedcontainers" version = "2.4.0" description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" -category = "dev" optional = false python-versions = "*" files = [ @@ -2505,7 +2412,6 @@ files = [ name = "sqlalchemy" version = "2.0.34" description = "Database Abstraction Library" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2561,7 +2467,7 @@ files = [ ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and platform_machine == \"aarch64\" or python_version < \"3.13\" and platform_machine == \"ppc64le\" or python_version < \"3.13\" and platform_machine == \"x86_64\" or python_version < \"3.13\" and platform_machine == \"amd64\" or python_version < \"3.13\" and platform_machine == \"AMD64\" or python_version < \"3.13\" and platform_machine == \"win32\" or python_version < \"3.13\" and platform_machine == \"WIN32\""} +greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"} typing-extensions = ">=4.6.0" [package.extras] @@ -2593,7 +2499,6 @@ sqlcipher = ["sqlcipher3_binary"] name = "sqlmodel" version = "0.0.22" description = "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2607,14 +2512,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.38.4" +version = "0.38.5" description = "The little ASGI library that shines." -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.38.4-py3-none-any.whl", hash = "sha256:526f53a77f0e43b85f583438aee1a940fd84f8fd610353e8b0c1a77ad8a87e76"}, - {file = "starlette-0.38.4.tar.gz", hash = "sha256:53a7439060304a208fea17ed407e998f46da5e5d9b1addfea3040094512a6379"}, + {file = "starlette-0.38.5-py3-none-any.whl", hash = "sha256:632f420a9d13e3ee2a6f18f437b0a9f1faecb0bc42e1942aa2ea0e379a4c4206"}, + {file = "starlette-0.38.5.tar.gz", hash = "sha256:04a92830a9b6eb1442c766199d62260c3d4dc9c4f9188360626b1e0273cb7077"}, ] [package.dependencies] @@ -2628,7 +2532,6 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7 name = "starlette-admin" version = "0.14.1" description = "Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2652,7 +2555,6 @@ test = ["aiomysql (>=0.1.1,<0.3.0)", "aiosqlite (>=0.17.0,<0.21.0)", "arrow (>=1 name = "tabulate" version = "0.9.0" description = "Pretty-print tabular data" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2667,7 +2569,6 @@ widechars = ["wcwidth"] name = "tenacity" version = "9.0.0" description = "Retry code until it succeeds" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2683,7 +2584,6 @@ test = ["pytest", "tornado (>=4.5)", "typeguard"] name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -2695,7 +2595,6 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2707,7 +2606,6 @@ files = [ name = "tomlkit" version = "0.13.2" description = "Style preserving TOML library" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2719,7 +2617,6 @@ files = [ name = "trio" version = "0.26.2" description = "A friendly Python library for async concurrency and I/O" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2740,7 +2637,6 @@ sortedcontainers = "*" name = "trio-websocket" version = "0.11.1" description = "WebSocket library for Trio" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2757,7 +2653,6 @@ wsproto = ">=0.14" name = "twine" version = "5.1.1" description = "Collection of utilities for publishing packages on PyPI" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2780,7 +2675,6 @@ urllib3 = ">=1.26.0" name = "typer" version = "0.12.5" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2798,7 +2692,6 @@ typing-extensions = ">=3.7.4.3" name = "typing-extensions" version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2810,7 +2703,6 @@ files = [ name = "tzdata" version = "2024.1" description = "Provider of IANA time zone data" -category = "main" optional = false python-versions = ">=2" files = [ @@ -2820,14 +2712,13 @@ files = [ [[package]] name = "urllib3" -version = "2.2.2" +version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, - {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, + {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, + {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.dependencies] @@ -2843,7 +2734,6 @@ zstd = ["zstandard (>=0.18.0)"] name = "uvicorn" version = "0.30.6" description = "The lightning-fast ASGI server." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2861,14 +2751,13 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [[package]] name = "virtualenv" -version = "20.26.3" +version = "20.26.4" description = "Virtual Python Environment builder" -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.26.3-py3-none-any.whl", hash = "sha256:8cc4a31139e796e9a7de2cd5cf2489de1217193116a8fd42328f1bd65f434589"}, - {file = "virtualenv-20.26.3.tar.gz", hash = "sha256:4c43a2a236279d9ea36a0d76f98d84bd6ca94ac4e0f4a3b9d46d05e10fea542a"}, + {file = "virtualenv-20.26.4-py3-none-any.whl", hash = "sha256:48f2695d9809277003f30776d155615ffc11328e6a0a8c1f0ec80188d7874a55"}, + {file = "virtualenv-20.26.4.tar.gz", hash = "sha256:c17f4e0f3e6036e9f26700446f85c76ab11df65ff6d8a9cbfad9f71aabfcf23c"}, ] [package.dependencies] @@ -2884,7 +2773,6 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess name = "websocket-client" version = "1.8.0" description = "WebSocket client for Python with low level API options" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2901,7 +2789,6 @@ test = ["websockets"] name = "websockets" version = "13.0.1" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2997,7 +2884,6 @@ files = [ name = "wheel" version = "0.44.0" description = "A built-package format for Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -3012,7 +2898,6 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] name = "wrapt" version = "1.16.0" description = "Module for decorators, wrappers and monkey patching." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -3092,7 +2977,6 @@ files = [ name = "wsproto" version = "1.2.0" description = "WebSockets state-machine based protocol implementation" -category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -3105,14 +2989,13 @@ h11 = ">=0.9.0,<1" [[package]] name = "zipp" -version = "3.20.1" +version = "3.20.2" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.20.1-py3-none-any.whl", hash = "sha256:9960cd8967c8f85a56f920d5d507274e74f9ff813a0ab8889a5b5be2daf44064"}, - {file = "zipp-3.20.1.tar.gz", hash = "sha256:c22b14cc4763c5a5b04134207736c107db42e9d3ef2d9779d465f5f1bcba572b"}, + {file = "zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350"}, + {file = "zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29"}, ] [package.extras] diff --git a/reflex/.templates/jinja/web/pages/utils.js.jinja2 b/reflex/.templates/jinja/web/pages/utils.js.jinja2 index e0311a79a..908482d24 100644 --- a/reflex/.templates/jinja/web/pages/utils.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/utils.js.jinja2 @@ -85,10 +85,10 @@ {% macro render_match_tag(component) %} { (() => { - switch (JSON.stringify({{ component.cond._var_name }})) { + switch (JSON.stringify({{ component.cond._js_expr }})) { {% for case in component.match_cases %} {% for condition in case[:-1] %} - case JSON.stringify({{ condition._var_name }}): + case JSON.stringify({{ condition._js_expr }}): {% endfor %} return {{ case[-1] }}; break; diff --git a/reflex/__init__.py b/reflex/__init__.py index d69e33d47..d396bc97c 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -338,7 +338,6 @@ _SUBMODULES: set[str] = { "testing", "utils", "vars", - "ivars", "config", "compiler", } diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index b11da5fb0..54329a6eb 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -12,7 +12,6 @@ from . import compiler as compiler from . import components as components from . import config as config from . import event as event -from . import ivars as ivars from . import model as model from . import style as style from . import testing as testing diff --git a/reflex/app.py b/reflex/app.py index 43edee983..63334997c 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -824,7 +824,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): for dep in deps: if dep not in state.vars and dep not in state.backend_vars: raise exceptions.VarDependencyError( - f"ComputedVar {var._var_name} on state {state.__name__} has an invalid dependency {dep}" + f"ComputedVar {var._js_expr} on state {state.__name__} has an invalid dependency {dep}" ) for substate in state.class_subclasses: @@ -1097,7 +1097,6 @@ class App(MiddlewareMixin, LifespanMixin, Base): if delta: # When the state is modified reset dirty status and emit the delta to the frontend. state._clean() - print(dir(state.router)) await self.event_namespace.emit_update( update=StateUpdate(delta=delta), sid=state.router.session.session_id, diff --git a/reflex/base.py b/reflex/base.py index 5a2a6d2a9..22b52cfb9 100644 --- a/reflex/base.py +++ b/reflex/base.py @@ -110,7 +110,7 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable] var: The variable to add a pydantic field for. default_value: The default value of the field """ - var_name = var._var_name.split(".")[-1] + var_name = var._js_expr.split(".")[-1] new_field = ModelField.infer( name=var_name, value=default_value, diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index 55602d2b2..edf03039e 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -17,12 +17,12 @@ from reflex.components.component import ( StatefulComponent, ) from reflex.config import get_config -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.style import SYSTEM_COLOR_MODE from reflex.utils.exec import is_prod_mode from reflex.utils.imports import ImportVar from reflex.utils.prerequisites import get_web_dir +from reflex.vars.base import LiteralVar, Var def _compile_document_root(root: Component) -> str: @@ -320,7 +320,7 @@ def _compile_tailwind( def compile_document_root( head_components: list[Component], html_lang: Optional[str] = None, - html_custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, ) -> tuple[str, str]: """Compile the document root. diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 942faa058..3b643718f 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -7,8 +7,8 @@ from pathlib import Path from typing import Any, Callable, Dict, Optional, Type, Union from urllib.parse import urlparse -from reflex.ivars.base import ImmutableVar from reflex.utils.prerequisites import get_web_dir +from reflex.vars.base import Var try: from pydantic.v1.fields import ModelField @@ -268,7 +268,7 @@ def compile_custom_component( } # Concatenate the props. - props = [prop._var_name for prop in component.get_prop_vars()] + props = [prop._js_expr for prop in component.get_prop_vars()] # Compile the component. return ( @@ -286,7 +286,7 @@ def compile_custom_component( def create_document_root( head_components: list[Component] | None = None, html_lang: Optional[str] = None, - html_custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, ) -> Component: """Create the document root. diff --git a/reflex/components/base/app_wrap.py b/reflex/components/base/app_wrap.py index 7d6a085b4..c7cfe6505 100644 --- a/reflex/components/base/app_wrap.py +++ b/reflex/components/base/app_wrap.py @@ -2,7 +2,7 @@ from reflex.components.base.fragment import Fragment from reflex.components.component import Component -from reflex.ivars.base import ImmutableVar +from reflex.vars.base import Var class AppWrap(Fragment): @@ -15,4 +15,4 @@ class AppWrap(Fragment): Returns: A new AppWrap component containing {children}. """ - return super().create(ImmutableVar.create("children")) + return super().create(Var(_js_expr="children")) diff --git a/reflex/components/base/app_wrap.pyi b/reflex/components/base/app_wrap.pyi index 90fc646e8..29e1e54b1 100644 --- a/reflex/components/base/app_wrap.pyi +++ b/reflex/components/base/app_wrap.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.base.fragment import Fragment from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class AppWrap(Fragment): @overload @@ -21,51 +21,41 @@ class AppWrap(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AppWrap": diff --git a/reflex/components/base/bare.py b/reflex/components/base/bare.py index 8fa053a5b..970cdfc84 100644 --- a/reflex/components/base/bare.py +++ b/reflex/components/base/bare.py @@ -7,8 +7,7 @@ from typing import Any, Iterator from reflex.components.component import Component from reflex.components.tags import Tag from reflex.components.tags.tagless import Tagless -from reflex.ivars.base import ImmutableVar -from reflex.vars import Var +from reflex.vars.base import Var class Bare(Component): @@ -26,18 +25,18 @@ class Bare(Component): Returns: The component. """ - if isinstance(contents, ImmutableVar): + if isinstance(contents, Var): return cls(contents=contents) else: contents = str(contents) if contents is not None else "" return cls(contents=contents) # type: ignore def _render(self) -> Tag: - if isinstance(self.contents, ImmutableVar): + if isinstance(self.contents, Var): return Tagless(contents=f"{{{str(self.contents)}}}") return Tagless(contents=str(self.contents)) - def _get_vars(self, include_children: bool = False) -> Iterator[ImmutableVar]: + def _get_vars(self, include_children: bool = False) -> Iterator[Var]: """Walk all Vars used in this component. Args: diff --git a/reflex/components/base/body.pyi b/reflex/components/base/body.pyi index b0b514674..d638a5f3e 100644 --- a/reflex/components/base/body.pyi +++ b/reflex/components/base/body.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class Body(Component): @overload @@ -21,51 +21,41 @@ class Body(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Body": diff --git a/reflex/components/base/document.pyi b/reflex/components/base/document.pyi index db736e0b7..d9641a0d1 100644 --- a/reflex/components/base/document.pyi +++ b/reflex/components/base/document.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class NextDocumentLib(Component): @overload @@ -21,51 +21,41 @@ class NextDocumentLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextDocumentLib": @@ -98,51 +88,41 @@ class Html(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Html": @@ -174,51 +154,41 @@ class DocumentHead(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DocumentHead": @@ -250,51 +220,41 @@ class Main(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Main": @@ -326,51 +286,41 @@ class NextScript(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextScript": diff --git a/reflex/components/base/error_boundary.py b/reflex/components/base/error_boundary.py index a532b682f..66a9c43c8 100644 --- a/reflex/components/base/error_boundary.py +++ b/reflex/components/base/error_boundary.py @@ -9,10 +9,9 @@ from reflex.components.component import Component from reflex.components.el import div, p from reflex.constants import Hooks, Imports from reflex.event import EventChain, EventHandler -from reflex.ivars.base import ImmutableVar -from reflex.ivars.function import FunctionVar from reflex.utils.imports import ImportVar -from reflex.vars import Var +from reflex.vars.base import Var +from reflex.vars.function import FunctionVar class ErrorBoundary(Component): @@ -22,12 +21,12 @@ class ErrorBoundary(Component): tag = "ErrorBoundary" # Fired when the boundary catches an error. - on_error: EventHandler[lambda error, info: [error, info]] = ImmutableVar( # type: ignore + on_error: EventHandler[lambda error, info: [error, info]] = Var( # type: ignore "logFrontendError" ).to(FunctionVar, EventChain) # Rendered instead of the children when an error is caught. - Fallback_component: Var[Component] = ImmutableVar.create_safe("Fallback")._replace( + Fallback_component: Var[Component] = Var(_js_expr="Fallback")._replace( _var_type=Component ) @@ -39,7 +38,7 @@ class ErrorBoundary(Component): """ return Imports.EVENTS - def add_hooks(self) -> List[str | ImmutableVar]: + def add_hooks(self) -> List[str | Var]: """Add hooks for the component. Returns: @@ -58,7 +57,7 @@ class ErrorBoundary(Component): fallback_container = div( p("Ooops...Unknown Reflex error has occured:"), p( - ImmutableVar.create("error.message"), + Var(_js_expr="error.message"), color="red", ), p("Please contact the support."), diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index 0fecd063a..3497f3141 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -7,74 +7,61 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar -from reflex.vars import Var +from reflex.vars.base import Var class ErrorBoundary(Component): def add_imports(self) -> dict[str, list[ImportVar]]: ... - def add_hooks(self) -> List[str | ImmutableVar]: ... + def add_hooks(self) -> List[str | Var]: ... def add_custom_code(self) -> List[str]: ... @overload @classmethod def create( # type: ignore cls, *children, - Fallback_component: Optional[Union[Var[Component], Component]] = None, + Fallback_component: Optional[Union[Component, Var[Component]]] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ErrorBoundary": diff --git a/reflex/components/base/fragment.pyi b/reflex/components/base/fragment.pyi index 08cc28ea8..7c7f397db 100644 --- a/reflex/components/base/fragment.pyi +++ b/reflex/components/base/fragment.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class Fragment(Component): @overload @@ -21,51 +21,41 @@ class Fragment(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Fragment": diff --git a/reflex/components/base/head.pyi b/reflex/components/base/head.pyi index eff4427b2..64554a57f 100644 --- a/reflex/components/base/head.pyi +++ b/reflex/components/base/head.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class NextHeadLib(Component): @overload @@ -21,51 +21,41 @@ class NextHeadLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextHeadLib": @@ -97,51 +87,41 @@ class Head(NextHeadLib, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Head": diff --git a/reflex/components/base/link.py b/reflex/components/base/link.py index 1c11ab262..3ea34f212 100644 --- a/reflex/components/base/link.py +++ b/reflex/components/base/link.py @@ -1,7 +1,7 @@ """Display the title of the current page.""" from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class RawLink(Component): diff --git a/reflex/components/base/link.pyi b/reflex/components/base/link.pyi index 0889a06b1..6493b012c 100644 --- a/reflex/components/base/link.pyi +++ b/reflex/components/base/link.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class RawLink(Component): @overload @@ -24,51 +23,41 @@ class RawLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RawLink": @@ -109,51 +98,41 @@ class ScriptTag(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ScriptTag": diff --git a/reflex/components/base/meta.pyi b/reflex/components/base/meta.pyi index 185425ff1..08b8be65e 100644 --- a/reflex/components/base/meta.pyi +++ b/reflex/components/base/meta.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class Title(Component): def render(self) -> dict: ... @@ -22,51 +22,41 @@ class Title(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Title": @@ -103,51 +93,41 @@ class Meta(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Meta": @@ -189,51 +169,41 @@ class Description(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Description": @@ -275,51 +245,41 @@ class Image(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Image": diff --git a/reflex/components/base/script.py b/reflex/components/base/script.py index 7b0596966..0eba03f49 100644 --- a/reflex/components/base/script.py +++ b/reflex/components/base/script.py @@ -9,8 +9,7 @@ from typing import Literal from reflex.components.component import Component from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var class Script(Component): diff --git a/reflex/components/base/script.pyi b/reflex/components/base/script.pyi index 6a1033f7d..2de7b2fcc 100644 --- a/reflex/components/base/script.pyi +++ b/reflex/components/base/script.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class Script(Component): @overload @@ -20,8 +19,8 @@ class Script(Component): src: Optional[Union[Var[str], str]] = None, strategy: Optional[ Union[ - Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]], Literal["afterInteractive", "beforeInteractive", "lazyOnload"], + Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]], ] ] = None, style: Optional[Style] = None, @@ -29,60 +28,44 @@ class Script(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_load: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_ready: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Script": diff --git a/reflex/components/component.py b/reflex/components/component.py index c2ca7c001..164ae479e 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -44,7 +44,6 @@ from reflex.event import ( call_event_handler, get_handler_args, ) -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style, format_as_emotion from reflex.utils import format, imports, types from reflex.utils.imports import ( @@ -55,7 +54,8 @@ from reflex.utils.imports import ( parse_imports, ) from reflex.utils.serializers import serializer -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var class BaseComponent(Base, ABC): @@ -180,7 +180,7 @@ class Component(BaseComponent, ABC): style: Style = Style() # A mapping from event triggers to event chains. - event_triggers: Dict[str, Union[EventChain, ImmutableVar]] = {} + event_triggers: Dict[str, Union[EventChain, Var]] = {} # The alias for the tag. alias: Optional[str] = None @@ -198,7 +198,7 @@ class Component(BaseComponent, ABC): class_name: Any = None # Special component props. - special_props: List[ImmutableVar] = [] + special_props: List[Var] = [] # Whether the component should take the focus once the page is loaded autofocus: bool = False @@ -216,7 +216,7 @@ class Component(BaseComponent, ABC): _rename_props: Dict[str, str] = {} # custom attribute - custom_attrs: Dict[str, Union[ImmutableVar, str]] = {} + custom_attrs: Dict[str, Union[Var, str]] = {} # When to memoize this component and its children. _memoization_mode: MemoizationMode = MemoizationMode() @@ -252,7 +252,7 @@ class Component(BaseComponent, ABC): """ return {} - def add_hooks(self) -> list[str | ImmutableVar]: + def add_hooks(self) -> list[str | Var]: """Add hooks inside the component function. Hooks are pieces of literal Javascript code that is inserted inside the @@ -407,7 +407,7 @@ class Component(BaseComponent, ABC): passed_types = None try: # Try to create a var from the value. - if isinstance(value, ImmutableVar): + if isinstance(value, Var): kwargs[key] = value else: kwargs[key] = LiteralVar.create(value) @@ -450,9 +450,7 @@ class Component(BaseComponent, ABC): not passed_types and not types._issubclass(passed_type, expected_type, value) ): - value_name = ( - value._var_name if isinstance(value, ImmutableVar) else value - ) + value_name = value._js_expr if isinstance(value, Var) else value raise TypeError( f"Invalid var passed for prop {type(self).__name__}.{key}, expected type {expected_type}, got value {value_name} of type {passed_types or passed_type}." ) @@ -502,9 +500,13 @@ class Component(BaseComponent, ABC): self, args_spec: Any, value: Union[ - Var, EventHandler, EventSpec, List[Union[EventHandler, EventSpec]], Callable + Var, + EventHandler, + EventSpec, + List[Union[EventHandler, EventSpec]], + Callable, ], - ) -> Union[EventChain, ImmutableVar]: + ) -> Union[EventChain, Var]: """Create an event chain from a variety of input types. Args: @@ -518,7 +520,7 @@ class Component(BaseComponent, ABC): ValueError: If the value is not a valid event chain. """ # If it's an event chain var, return it. - if isinstance(value, ImmutableVar): + if isinstance(value, Var): if value._var_type is not EventChain: raise ValueError( f"Invalid event chain: {repr(value)} of type {type(value)}" @@ -542,7 +544,7 @@ class Component(BaseComponent, ABC): elif isinstance(v, Callable): # Call the lambda to get the event chain. result = call_event_fn(v, args_spec) - if isinstance(result, ImmutableVar): + if isinstance(result, Var): raise ValueError( f"Invalid event chain: {v}. Cannot use a Var-returning " "lambda inside an EventChain list." @@ -554,7 +556,7 @@ class Component(BaseComponent, ABC): # If the input is a callable, create an event chain. elif isinstance(value, Callable): result = call_event_fn(value, args_spec) - if isinstance(result, ImmutableVar): + if isinstance(result, Var): # Recursively call this function if the lambda returned an EventChain Var. return self._create_event_chain(args_spec, result) events = result @@ -572,7 +574,7 @@ class Component(BaseComponent, ABC): event_actions.update(e.event_actions) # Return the event chain. - if isinstance(args_spec, ImmutableVar): + if isinstance(args_spec, Var): return EventChain( events=events, args_spec=None, @@ -672,7 +674,7 @@ class Component(BaseComponent, ABC): # Add ref to element if `id` is not None. ref = self.get_ref() if ref is not None: - props["ref"] = ImmutableVar.create(ref) + props["ref"] = Var(_js_expr=ref) else: props = props.copy() @@ -885,7 +887,7 @@ class Component(BaseComponent, ABC): Returns: The dictionary of the component style as value and the style notation as key. """ - if isinstance(self.style, ImmutableVar): + if isinstance(self.style, Var): return {"css": self.style} emotion_style = format_as_emotion(self.style) return ( @@ -1001,8 +1003,8 @@ class Component(BaseComponent, ABC): @staticmethod def _get_vars_from_event_triggers( - event_triggers: dict[str, EventChain | ImmutableVar], - ) -> Iterator[tuple[str, list[ImmutableVar]]]: + event_triggers: dict[str, EventChain | Var], + ) -> Iterator[tuple[str, list[Var]]]: """Get the Vars associated with each event trigger. Args: @@ -1012,7 +1014,7 @@ class Component(BaseComponent, ABC): tuple of (event_name, event_vars) """ for event_trigger, event in event_triggers.items(): - if isinstance(event, ImmutableVar): + if isinstance(event, Var): yield event_trigger, [event] elif isinstance(event, EventChain): event_args = [] @@ -1021,7 +1023,7 @@ class Component(BaseComponent, ABC): event_args.extend(args) yield event_trigger, event_args - def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: + def _get_vars(self, include_children: bool = False) -> list[Var]: """Walk all Vars used in this component. Args: @@ -1041,18 +1043,14 @@ class Component(BaseComponent, ABC): # Get Vars associated with component props. for prop in self.get_props(): prop_var = getattr(self, prop) - if isinstance(prop_var, ImmutableVar): + if isinstance(prop_var, Var): vars.append(prop_var) # Style keeps track of its own VarData instance, so embed in a temp Var that is yielded. - if ( - isinstance(self.style, dict) - and self.style - or isinstance(self.style, ImmutableVar) - ): + if isinstance(self.style, dict) and self.style or isinstance(self.style, Var): vars.append( - ImmutableVar( - _var_name="style", + Var( + _js_expr="style", _var_type=str, _var_data=VarData.merge(self.style._var_data), ) @@ -1069,7 +1067,7 @@ class Component(BaseComponent, ABC): self.autofocus, *self.custom_attrs.values(), ): - if isinstance(comp_prop, ImmutableVar): + if isinstance(comp_prop, Var): vars.append(comp_prop) elif isinstance(comp_prop, str): # Collapse VarData encoded in f-strings. @@ -1098,7 +1096,7 @@ class Component(BaseComponent, ABC): for event in trigger.events: if event.handler.state_full_name: return True - elif isinstance(trigger, ImmutableVar) and trigger._var_state: + elif isinstance(trigger, Var) and trigger._var_state: return True return False @@ -1290,7 +1288,7 @@ class Component(BaseComponent, ABC): user_hooks = self._get_hooks() user_hooks_data = ( VarData.merge(user_hooks._get_all_var_data()) - if user_hooks is not None and isinstance(user_hooks, ImmutableVar) + if user_hooks is not None and isinstance(user_hooks, Var) else None ) if user_hooks_data is not None: @@ -1393,7 +1391,7 @@ class Component(BaseComponent, ABC): """ ref = self.get_ref() if ref is not None: - return f"const {ref} = useRef(null); {str(ImmutableVar.create_safe(ref).as_ref())} = {ref};" + return f"const {ref} = useRef(null); {str(Var(_js_expr=ref).as_ref())} = {ref};" def _get_vars_hooks(self) -> dict[str, None]: """Get the hooks required by vars referenced in this component. @@ -1456,7 +1454,7 @@ class Component(BaseComponent, ABC): """ code = {} - def extract_var_hooks(hook: ImmutableVar): + def extract_var_hooks(hook: Var): _imports = {} var_data = VarData.merge(hook._get_all_var_data()) if var_data is not None: @@ -1473,7 +1471,7 @@ class Component(BaseComponent, ABC): # the order of the hooks in the final output) for clz in reversed(tuple(self._iter_parent_classes_with_method("add_hooks"))): for hook in clz.add_hooks(self): - if isinstance(hook, ImmutableVar): + if isinstance(hook, Var): extract_var_hooks(hook) else: code[hook] = {} @@ -1534,7 +1532,7 @@ class Component(BaseComponent, ABC): The ref name. """ # do not create a ref if the id is dynamic or unspecified - if self.id is None or isinstance(self.id, ImmutableVar): + if self.id is None or isinstance(self.id, Var): return None return format.format_ref(self.id) @@ -1773,15 +1771,15 @@ class CustomComponent(Component): """ return super()._render(props=self.props) - def get_prop_vars(self) -> List[ImmutableVar]: + def get_prop_vars(self) -> List[Var]: """Get the prop vars. Returns: The prop vars. """ return [ - ImmutableVar( - _var_name=name, + Var( + _js_expr=name, _var_type=( prop._var_type if types._isinstance(prop, Var) else type(prop) ), @@ -1789,7 +1787,7 @@ class CustomComponent(Component): for name, prop in self.props.items() ] - def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: + def _get_vars(self, include_children: bool = False) -> list[Var]: """Walk all Vars used in this component. Args: @@ -1800,7 +1798,7 @@ class CustomComponent(Component): """ return ( super()._get_vars(include_children=include_children) - + [prop for prop in self.props.values() if isinstance(prop, ImmutableVar)] + + [prop for prop in self.props.values() if isinstance(prop, Var)] + self.get_component(self)._get_vars(include_children=include_children) ) @@ -1971,7 +1969,7 @@ class StatefulComponent(BaseComponent): should_memoize = True break child = cls._child_var(child) - if isinstance(child, ImmutableVar) and child._get_all_var_data(): + if isinstance(child, Var) and child._get_all_var_data(): should_memoize = True break @@ -2127,7 +2125,7 @@ class StatefulComponent(BaseComponent): def _get_memoized_event_triggers( cls, component: Component, - ) -> dict[str, tuple[ImmutableVar, str]]: + ) -> dict[str, tuple[Var, str]]: """Memoize event handler functions with useCallback to avoid unnecessary re-renders. Args: @@ -2174,7 +2172,7 @@ class StatefulComponent(BaseComponent): # Store the memoized function name and hook code for this event trigger. trigger_memo[event_trigger] = ( - ImmutableVar.create_safe(memo_name)._replace( + Var(_js_expr=memo_name)._replace( _var_type=EventChain, merge_var_data=memo_var_data ), f"const {memo_name} = useCallback({rendered_chain}, [{', '.join(var_deps)}])", diff --git a/reflex/components/core/banner.py b/reflex/components/core/banner.py index 834d59a83..29897cffa 100644 --- a/reflex/components/core/banner.py +++ b/reflex/components/core/banner.py @@ -18,56 +18,52 @@ from reflex.components.radix.themes.typography.text import Text from reflex.components.sonner.toast import Toaster, ToastProps from reflex.constants import Dirs, Hooks, Imports from reflex.constants.compiler import CompileVars -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.ivars.function import FunctionStringVar -from reflex.ivars.number import BooleanVar -from reflex.ivars.sequence import LiteralArrayVar from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var +from reflex.vars.function import FunctionStringVar +from reflex.vars.number import BooleanVar +from reflex.vars.sequence import LiteralArrayVar connect_error_var_data: VarData = VarData( # type: ignore imports=Imports.EVENTS, hooks={Hooks.EVENTS: None}, ) -connect_errors: Var = ImmutableVar.create_safe( - value=CompileVars.CONNECT_ERROR, +connect_errors = Var( + _js_expr=CompileVars.CONNECT_ERROR, _var_data=connect_error_var_data +) + +connection_error = Var( + _js_expr="((connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : '')", _var_data=connect_error_var_data, ) -connection_error: Var = ImmutableVar.create_safe( - value="((connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : '')", - _var_data=connect_error_var_data, +connection_errors_count = Var( + _js_expr="connectErrors.length", _var_data=connect_error_var_data ) -connection_errors_count: Var = ImmutableVar.create_safe( - value="connectErrors.length", - _var_data=connect_error_var_data, -) - -has_connection_errors: Var = ImmutableVar.create_safe( - value="(connectErrors.length > 0)", - _var_data=connect_error_var_data, +has_connection_errors = Var( + _js_expr="(connectErrors.length > 0)", _var_data=connect_error_var_data ).to(BooleanVar) -has_too_many_connection_errors: Var = ImmutableVar.create_safe( - value="(connectErrors.length >= 2)", - _var_data=connect_error_var_data, +has_too_many_connection_errors = Var( + _js_expr="(connectErrors.length >= 2)", _var_data=connect_error_var_data ).to(BooleanVar) -class WebsocketTargetURL(ImmutableVar): +class WebsocketTargetURL(Var): """A component that renders the websocket target URL.""" @classmethod - def create(cls) -> ImmutableVar: + def create(cls) -> Var: """Create a websocket target URL component. Returns: The websocket target URL component. """ - return ImmutableVar( - _var_name="getBackendURL(env.EVENT).href", + return Var( + _js_expr="getBackendURL(env.EVENT).href", _var_data=VarData( imports={ "/env.json": [ImportVar(tag="env", is_default=True)], @@ -95,7 +91,7 @@ def default_connection_error() -> list[str | Var | Component]: class ConnectionToaster(Toaster): """A connection toaster component.""" - def add_hooks(self) -> list[str | ImmutableVar]: + def add_hooks(self) -> list[str | Var]: """Add the hooks for the connection toaster. Returns: @@ -125,8 +121,8 @@ class ConnectionToaster(Toaster): ), ).call( # TODO: This breaks the assumption that Vars are JS expressions - ImmutableVar.create_safe( - f""" + Var( + _js_expr=f""" () => {{ if ({str(has_too_many_connection_errors)}) {{ if (!userDismissed) {{ @@ -238,7 +234,7 @@ class WifiOffPulse(Icon): Returns: The icon component with default props applied. """ - pulse_var = ImmutableVar.create("pulse") + pulse_var = Var(_js_expr="pulse") return super().create( "wifi_off", color=props.pop("color", "crimson"), diff --git a/reflex/components/core/banner.pyi b/reflex/components/core/banner.pyi index 0a4072c31..01c526fac 100644 --- a/reflex/components/core/banner.pyi +++ b/reflex/components/core/banner.pyi @@ -9,27 +9,40 @@ from reflex.components.component import Component from reflex.components.el.elements.typography import Div from reflex.components.lucide.icon import Icon from reflex.components.sonner.toast import Toaster, ToastProps +from reflex.constants.compiler import CompileVars from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import Var +from reflex.vars.number import BooleanVar connect_error_var_data: VarData -connect_errors: Var -connection_error: Var -connection_errors_count: Var -has_connection_errors: Var -has_too_many_connection_errors: Var +connect_errors = Var( + _js_expr=CompileVars.CONNECT_ERROR, _var_data=connect_error_var_data +) +connection_error = Var( + _js_expr="((connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : '')", + _var_data=connect_error_var_data, +) +connection_errors_count = Var( + _js_expr="connectErrors.length", _var_data=connect_error_var_data +) +has_connection_errors = Var( + _js_expr="(connectErrors.length > 0)", _var_data=connect_error_var_data +).to(BooleanVar) +has_too_many_connection_errors = Var( + _js_expr="(connectErrors.length >= 2)", _var_data=connect_error_var_data +).to(BooleanVar) -class WebsocketTargetURL(ImmutableVar): +class WebsocketTargetURL(Var): @classmethod - def create(cls) -> ImmutableVar: ... # type: ignore + def create(cls) -> Var: ... # type: ignore def default_connection_error() -> list[str | Var | Component]: ... class ConnectionToaster(Toaster): - def add_hooks(self) -> list[str | ImmutableVar]: ... + def add_hooks(self) -> list[str | Var]: ... @overload @classmethod def create( # type: ignore @@ -41,24 +54,24 @@ class ConnectionToaster(Toaster): visible_toasts: Optional[Union[Var[int], int]] = None, position: Optional[ Union[ + Literal[ + "bottom-center", + "bottom-left", + "bottom-right", + "top-center", + "top-left", + "top-right", + ], Var[ Literal[ - "top-left", - "top-center", - "top-right", - "bottom-left", "bottom-center", + "bottom-left", "bottom-right", + "top-center", + "top-left", + "top-right", ] ], - Literal[ - "top-left", - "top-center", - "top-right", - "bottom-left", - "bottom-center", - "bottom-right", - ], ] ] = None, close_button: Optional[Union[Var[bool], bool]] = None, @@ -66,60 +79,50 @@ class ConnectionToaster(Toaster): dir: Optional[Union[Var[str], str]] = None, hotkey: Optional[Union[Var[str], str]] = None, invert: Optional[Union[Var[bool], bool]] = None, - toast_options: Optional[Union[Var[ToastProps], ToastProps]] = None, + toast_options: Optional[Union[ToastProps, Var[ToastProps]]] = None, gap: Optional[Union[Var[int], int]] = None, - loading_icon: Optional[Union[Var[Icon], Icon]] = None, + loading_icon: Optional[Union[Icon, Var[Icon]]] = None, pause_when_page_is_hidden: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionToaster": @@ -165,51 +168,41 @@ class ConnectionBanner(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionBanner": @@ -234,51 +227,41 @@ class ConnectionModal(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionModal": @@ -304,51 +287,41 @@ class WifiOffPulse(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "WifiOffPulse": @@ -378,80 +351,70 @@ class ConnectionPulser(Div): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionPulser": diff --git a/reflex/components/core/client_side_routing.py b/reflex/components/core/client_side_routing.py index 33e54f227..efa622f81 100644 --- a/reflex/components/core/client_side_routing.py +++ b/reflex/components/core/client_side_routing.py @@ -13,10 +13,9 @@ from __future__ import annotations from reflex import constants from reflex.components.component import Component from reflex.components.core.cond import cond -from reflex.ivars.base import ImmutableVar -from reflex.vars import Var +from reflex.vars.base import Var -route_not_found: Var = ImmutableVar.create_safe(constants.ROUTE_NOT_FOUND) +route_not_found: Var = Var(_js_expr=constants.ROUTE_NOT_FOUND) class ClientSideRouting(Component): diff --git a/reflex/components/core/client_side_routing.pyi b/reflex/components/core/client_side_routing.pyi index 57d1e1ae4..9f73467b3 100644 --- a/reflex/components/core/client_side_routing.pyi +++ b/reflex/components/core/client_side_routing.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var route_not_found: Var @@ -26,51 +25,41 @@ class ClientSideRouting(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ClientSideRouting": @@ -105,51 +94,41 @@ class Default404Page(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Default404Page": diff --git a/reflex/components/core/clipboard.py b/reflex/components/core/clipboard.py index abc1b5b4a..1d7ce7c14 100644 --- a/reflex/components/core/clipboard.py +++ b/reflex/components/core/clipboard.py @@ -9,7 +9,8 @@ from reflex.components.tags.tag import Tag from reflex.event import EventChain, EventHandler from reflex.utils.format import format_prop, wrap from reflex.utils.imports import ImportVar -from reflex.vars import Var, get_unique_variable_name +from reflex.vars import get_unique_variable_name +from reflex.vars.base import Var class Clipboard(Fragment): diff --git a/reflex/components/core/clipboard.pyi b/reflex/components/core/clipboard.pyi index 3ffaad293..cf02709fc 100644 --- a/reflex/components/core/clipboard.pyi +++ b/reflex/components/core/clipboard.pyi @@ -7,10 +7,9 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.base.fragment import Fragment from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar -from reflex.vars import Var +from reflex.vars.base import Var class Clipboard(Fragment): @overload @@ -18,63 +17,51 @@ class Clipboard(Fragment): def create( # type: ignore cls, *children, - targets: Optional[Union[Var[List[str]], List[str]]] = None, + targets: Optional[Union[List[str], Var[List[str]]]] = None, on_paste_event_actions: Optional[ - Union[Var[Dict[str, Union[bool, int]]], Dict[str, Union[bool, int]]] + Union[Dict[str, Union[bool, int]], Var[Dict[str, Union[bool, int]]]] ] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_paste: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Clipboard": diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py index 33e145f41..d1f53be23 100644 --- a/reflex/components/core/cond.py +++ b/reflex/components/core/cond.py @@ -8,11 +8,11 @@ from reflex.components.base.fragment import Fragment from reflex.components.component import BaseComponent, Component, MemoizationLeaf from reflex.components.tags import CondTag, Tag from reflex.constants import Dirs -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.ivars.number import ternary_operation from reflex.style import LIGHT_COLOR_MODE, resolved_color_mode from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var +from reflex.vars.number import ternary_operation _IS_TRUE_IMPORT: ImportDict = { f"/{Dirs.STATE_PATH}": [ImportVar(tag="isTrue")], @@ -119,10 +119,10 @@ def cond(condition: Any, c1: Component) -> Component: ... @overload -def cond(condition: Any, c1: Any, c2: Any) -> ImmutableVar: ... +def cond(condition: Any, c1: Any, c2: Any) -> Var: ... -def cond(condition: Any, c1: Any, c2: Any = None) -> Component | ImmutableVar: +def cond(condition: Any, c1: Any, c2: Any = None) -> Component | Var: """Create a conditional component or Prop. Args: diff --git a/reflex/components/core/debounce.py b/reflex/components/core/debounce.py index b11bb120b..a8f20f08a 100644 --- a/reflex/components/core/debounce.py +++ b/reflex/components/core/debounce.py @@ -7,8 +7,8 @@ from typing import Any, Type, Union from reflex.components.component import Component from reflex.constants import EventTriggers from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import Var DEFAULT_DEBOUNCE_TIMEOUT = 300 @@ -107,14 +107,14 @@ class DebounceInput(Component): props[field] = getattr(child, field) child_ref = child.get_ref() if props.get("input_ref") is None and child_ref: - props["input_ref"] = ImmutableVar.create_safe(child_ref) + props["input_ref"] = Var(_js_expr=child_ref, _var_type=str) props["id"] = child.id # Set the child element to wrap, including any imports/hooks from the child. props.setdefault( "element", - ImmutableVar( - _var_name=str(child.alias or child.tag), + Var( + _js_expr=str(child.alias or child.tag), _var_type=Type[Component], _var_data=VarData( imports=child._get_imports(), diff --git a/reflex/components/core/debounce.pyi b/reflex/components/core/debounce.pyi index ca740f85d..dc2b505f5 100644 --- a/reflex/components/core/debounce.pyi +++ b/reflex/components/core/debounce.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Type, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var DEFAULT_DEBOUNCE_TIMEOUT = 300 @@ -23,62 +22,50 @@ class DebounceInput(Component): debounce_timeout: Optional[Union[Var[int], int]] = None, force_notify_by_enter: Optional[Union[Var[bool], bool]] = None, force_notify_on_blur: Optional[Union[Var[bool], bool]] = None, - value: Optional[Union[Var[Union[float, int, str]], str, int, float]] = None, + value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, input_ref: Optional[Union[Var[str], str]] = None, - element: Optional[Union[Var[Type[Component]], Type[Component]]] = None, + element: Optional[Union[Type[Component], Var[Type[Component]]]] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DebounceInput": diff --git a/reflex/components/core/foreach.py b/reflex/components/core/foreach.py index a87e0022d..a3f97d594 100644 --- a/reflex/components/core/foreach.py +++ b/reflex/components/core/foreach.py @@ -9,9 +9,8 @@ from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.tags import IterTag from reflex.constants import MemoizationMode -from reflex.ivars.base import ImmutableVar from reflex.state import ComponentState -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var class ForeachVarError(TypeError): @@ -52,7 +51,7 @@ class Foreach(Component): ForeachVarError: If the iterable is of type Any. TypeError: If the render function is a ComponentState. """ - iterable = ImmutableVar.create_safe(iterable) + iterable = LiteralVar.create(iterable) if iterable._var_type == Any: raise ForeachVarError( f"Could not foreach over var `{str(iterable)}` of type Any. " @@ -130,7 +129,7 @@ class Foreach(Component): iterable_state=str(tag.iterable), arg_name=tag.arg_var_name, arg_index=tag.get_index_var_arg(), - iterable_type=tag.iterable.upcast()._var_type.mro()[0].__name__, + iterable_type=tag.iterable._var_type.mro()[0].__name__, ) diff --git a/reflex/components/core/html.py b/reflex/components/core/html.py index 812bf64be..cfe46e591 100644 --- a/reflex/components/core/html.py +++ b/reflex/components/core/html.py @@ -3,7 +3,7 @@ from typing import Dict from reflex.components.el.elements.typography import Div -from reflex.vars import Var +from reflex.vars.base import Var class Html(Div): diff --git a/reflex/components/core/html.pyi b/reflex/components/core/html.pyi index ab4cfecc8..969508a6a 100644 --- a/reflex/components/core/html.pyi +++ b/reflex/components/core/html.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.elements.typography import Div from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class Html(Div): @overload @@ -18,82 +17,72 @@ class Html(Div): cls, *children, dangerouslySetInnerHTML: Optional[ - Union[Var[Dict[str, str]], Dict[str, str]] + Union[Dict[str, str], Var[Dict[str, str]]] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Html": diff --git a/reflex/components/core/match.py b/reflex/components/core/match.py index 38d56f862..8b9382c89 100644 --- a/reflex/components/core/match.py +++ b/reflex/components/core/match.py @@ -6,12 +6,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from reflex.components.base import Fragment from reflex.components.component import BaseComponent, Component, MemoizationLeaf from reflex.components.tags import MatchTag, Tag -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.utils import format, types from reflex.utils.exceptions import MatchTypeError from reflex.utils.imports import ImportDict -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var class Match(MemoizationLeaf): @@ -27,7 +27,7 @@ class Match(MemoizationLeaf): default: Any @classmethod - def create(cls, cond: Any, *cases) -> Union[Component, ImmutableVar]: + def create(cls, cond: Any, *cases) -> Union[Component, Var]: """Create a Match Component. Args: @@ -56,7 +56,7 @@ class Match(MemoizationLeaf): ) @classmethod - def _create_condition_var(cls, cond: Any) -> ImmutableVar: + def _create_condition_var(cls, cond: Any) -> Var: """Convert the condition to a Var. Args: @@ -77,7 +77,7 @@ class Match(MemoizationLeaf): @classmethod def _process_cases( cls, cases: List - ) -> Tuple[List, Optional[Union[ImmutableVar, BaseComponent]]]: + ) -> Tuple[List, Optional[Union[Var, BaseComponent]]]: """Process the list of match cases and the catchall default case. Args: @@ -125,7 +125,7 @@ class Match(MemoizationLeaf): return case_element @classmethod - def _process_match_cases(cls, cases: List) -> List[List[ImmutableVar]]: + def _process_match_cases(cls, cases: List) -> List[List[Var]]: """Process the individual match cases. Args: @@ -157,7 +157,7 @@ class Match(MemoizationLeaf): if not isinstance(element, BaseComponent) else element ) - if not isinstance(el, (ImmutableVar, BaseComponent)): + if not isinstance(el, (Var, BaseComponent)): raise ValueError("Case element must be a var or component") case_list.append(el) @@ -166,7 +166,7 @@ class Match(MemoizationLeaf): return match_cases @classmethod - def _validate_return_types(cls, match_cases: List[List[ImmutableVar]]) -> None: + def _validate_return_types(cls, match_cases: List[List[Var]]) -> None: """Validate that match cases have the same return types. Args: @@ -180,24 +180,24 @@ class Match(MemoizationLeaf): if types._isinstance(first_case_return, BaseComponent): return_type = BaseComponent - elif types._isinstance(first_case_return, ImmutableVar): - return_type = ImmutableVar + elif types._isinstance(first_case_return, Var): + return_type = Var for index, case in enumerate(match_cases): if not types._issubclass(type(case[-1]), return_type): raise MatchTypeError( f"Match cases should have the same return types. Case {index} with return " - f"value `{case[-1]._var_name if isinstance(case[-1], ImmutableVar) else textwrap.shorten(str(case[-1]), width=250)}`" + f"value `{case[-1]._js_expr if isinstance(case[-1], Var) else textwrap.shorten(str(case[-1]), width=250)}`" f" of type {type(case[-1])!r} is not {return_type}" ) @classmethod def _create_match_cond_var_or_component( cls, - match_cond_var: ImmutableVar, - match_cases: List[List[ImmutableVar]], - default: Optional[Union[ImmutableVar, BaseComponent]], - ) -> Union[Component, ImmutableVar]: + match_cond_var: Var, + match_cases: List[List[Var]], + default: Optional[Union[Var, BaseComponent]], + ) -> Union[Component, Var]: """Create and return the match condition var or component. Args: @@ -232,8 +232,8 @@ class Match(MemoizationLeaf): ) or not types._isinstance(default, Var): raise ValueError("Return types of match cases should be Vars.") - return ImmutableVar( - _var_name=format.format_match( + return Var( + _js_expr=format.format_match( cond=str(match_cond_var), match_cases=match_cases, default=default, # type: ignore diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index 7501934d8..62a46d823 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -19,10 +19,10 @@ from reflex.event import ( call_script, parse_args_spec, ) -from reflex.ivars.base import ImmutableCallableVar, ImmutableVar, LiteralVar -from reflex.ivars.sequence import LiteralStringVar from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import CallableVar, LiteralVar, Var +from reflex.vars.sequence import LiteralStringVar DEFAULT_UPLOAD_ID: str = "default" @@ -37,8 +37,8 @@ upload_files_context_var_data: VarData = VarData( ) -@ImmutableCallableVar -def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: +@CallableVar +def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> Var: """Get the file upload drop trigger. This var is passed to the dropzone component to update the file list when a @@ -58,8 +58,8 @@ def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: }}) """ - return ImmutableVar( - _var_name=var_name, + return Var( + _js_expr=var_name, _var_type=EventChain, _var_data=VarData.merge( upload_files_context_var_data, id_var._get_all_var_data() @@ -67,8 +67,8 @@ def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: ) -@ImmutableCallableVar -def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: +@CallableVar +def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> Var: """Get the list of selected files. Args: @@ -78,8 +78,8 @@ def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: A var referencing the list of selected file paths. """ id_var = LiteralStringVar.create(id_) - return ImmutableVar( - _var_name=f"(filesById[{str(id_var)}] ? filesById[{str(id_var)}].map((f) => (f.path || f.name)) : [])", + return Var( + _js_expr=f"(filesById[{str(id_var)}] ? filesById[{str(id_var)}].map((f) => (f.path || f.name)) : [])", _var_type=List[str], _var_data=VarData.merge( upload_files_context_var_data, id_var._get_all_var_data() @@ -132,8 +132,8 @@ def get_upload_dir() -> Path: return uploaded_files_dir -uploaded_files_url_prefix = ImmutableVar( - _var_name="getBackendURL(env.UPLOAD)", +uploaded_files_url_prefix = Var( + _js_expr="getBackendURL(env.UPLOAD)", _var_data=VarData( imports={ f"/{Dirs.STATE_PATH}": "getBackendURL", @@ -247,9 +247,7 @@ class Upload(MemoizationLeaf): } # The file input to use. upload = Input.create(type="file") - upload.special_props = [ - ImmutableVar(_var_name="{...getInputProps()}", _var_type=None) - ] + upload.special_props = [Var(_js_expr="{...getInputProps()}", _var_type=None)] # The dropzone to use. zone = Box.create( @@ -257,9 +255,7 @@ class Upload(MemoizationLeaf): *children, **{k: v for k, v in props.items() if k not in supported_props}, ) - zone.special_props = [ - ImmutableVar(_var_name="{...getRootProps()}", _var_type=None) - ] + zone.special_props = [Var(_js_expr="{...getRootProps()}", _var_type=None)] # Create the component. upload_props["id"] = props.get("id", DEFAULT_UPLOAD_ID) @@ -287,9 +283,7 @@ class Upload(MemoizationLeaf): ) @classmethod - def _update_arg_tuple_for_on_drop( - cls, arg_value: tuple[ImmutableVar, ImmutableVar] - ): + def _update_arg_tuple_for_on_drop(cls, arg_value: tuple[Var, Var]): """Helper to update caller-provided EventSpec args for direct use with on_drop. Args: @@ -298,7 +292,7 @@ class Upload(MemoizationLeaf): Returns: The updated arg_value tuple when arg is "files", otherwise the original arg_value. """ - if arg_value[0]._var_name == "files": + if arg_value[0]._js_expr == "files": placeholder = parse_args_spec(_on_drop_spec)[0] return (arg_value[0], placeholder) return arg_value diff --git a/reflex/components/core/upload.pyi b/reflex/components/core/upload.pyi index 67b350c8d..22f229098 100644 --- a/reflex/components/core/upload.pyi +++ b/reflex/components/core/upload.pyi @@ -13,25 +13,25 @@ from reflex.event import ( EventHandler, EventSpec, ) -from reflex.ivars.base import ImmutableCallableVar, ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import CallableVar, Var DEFAULT_UPLOAD_ID: str upload_files_context_var_data: VarData -@ImmutableCallableVar -def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: ... -@ImmutableCallableVar -def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: ... +@CallableVar +def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> Var: ... +@CallableVar +def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> Var: ... @CallableEventSpec def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec: ... def cancel_upload(upload_id: str) -> EventSpec: ... def get_upload_dir() -> Path: ... -uploaded_files_url_prefix = ImmutableVar( - _var_name="getBackendURL(env.UPLOAD)", +uploaded_files_url_prefix = Var( + _js_expr="getBackendURL(env.UPLOAD)", _var_data=VarData( imports={ f"/{Dirs.STATE_PATH}": "getBackendURL", @@ -53,51 +53,41 @@ class UploadFilesProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "UploadFilesProvider": @@ -126,7 +116,7 @@ class Upload(MemoizationLeaf): def create( # type: ignore cls, *children, - accept: Optional[Union[Var[Optional[Dict[str, List]]], Dict[str, List]]] = None, + accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None, disabled: Optional[Union[Var[bool], bool]] = None, max_files: Optional[Union[Var[int], int]] = None, max_size: Optional[Union[Var[int], int]] = None, @@ -140,54 +130,42 @@ class Upload(MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_drop: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Upload": @@ -223,7 +201,7 @@ class StyledUpload(Upload): def create( # type: ignore cls, *children, - accept: Optional[Union[Var[Optional[Dict[str, List]]], Dict[str, List]]] = None, + accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None, disabled: Optional[Union[Var[bool], bool]] = None, max_files: Optional[Union[Var[int], int]] = None, max_size: Optional[Union[Var[int], int]] = None, @@ -237,54 +215,42 @@ class StyledUpload(Upload): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_drop: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "StyledUpload": @@ -320,7 +286,7 @@ class UploadNamespace(ComponentNamespace): @staticmethod def __call__( *children, - accept: Optional[Union[Var[Optional[Dict[str, List]]], Dict[str, List]]] = None, + accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None, disabled: Optional[Union[Var[bool], bool]] = None, max_files: Optional[Union[Var[int], int]] = None, max_size: Optional[Union[Var[int], int]] = None, @@ -334,54 +300,42 @@ class UploadNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_drop: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "StyledUpload": diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index 96f91a36e..d9ab46e53 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Literal, Optional, Union +from typing import Any, Dict, Literal, Optional, Union from typing_extensions import get_args @@ -13,11 +13,10 @@ from reflex.components.radix.themes.components.button import Button from reflex.components.radix.themes.layout.box import Box from reflex.constants.colors import Color from reflex.event import set_clipboard -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.utils import format from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var LiteralCodeBlockTheme = Literal[ "a11y-dark", @@ -375,7 +374,7 @@ class CodeBlock(Component): alias = "SyntaxHighlighter" # The theme to use ("light" or "dark"). - theme: Var[LiteralCodeBlockTheme] = "one-light" # type: ignore + theme: Var[Any] = "one-light" # type: ignore # The language to use. language: Var[LiteralCodeLanguage] = "python" # type: ignore @@ -481,13 +480,13 @@ class CodeBlock(Component): if "theme" not in props: # Default color scheme responds to global color mode. props["theme"] = color_mode_cond( - light=ImmutableVar.create_safe("oneLight"), - dark=ImmutableVar.create_safe("oneDark"), + light=Var(_js_expr="oneLight"), + dark=Var(_js_expr="oneDark"), ) # react-syntax-highlighter doesnt have an explicit "light" or "dark" theme so we use one-light and one-dark # themes respectively to ensure code compatibility. - if "theme" in props and not isinstance(props["theme"], ImmutableVar): + if "theme" in props and not isinstance(props["theme"], Var): props["theme"] = cls.convert_theme_name(props["theme"]) if can_copy: @@ -513,7 +512,7 @@ class CodeBlock(Component): # Carry the children (code) via props if children: props["code"] = children[0] - if not isinstance(props["code"], ImmutableVar): + if not isinstance(props["code"], Var): props["code"] = LiteralVar.create(props["code"]) # Create the component. @@ -534,8 +533,8 @@ class CodeBlock(Component): def _render(self): out = super()._render() - theme = self.theme.upcast()._replace( - _var_name=replace_quotes_with_camel_case(str(self.theme)) + theme = self.theme._replace( + _js_expr=replace_quotes_with_camel_case(str(self.theme)) ) out.add_props(style=theme).remove_props("theme", "code").add_props( diff --git a/reflex/components/datadisplay/code.pyi b/reflex/components/datadisplay/code.pyi index 63209ec8a..49a7bbb51 100644 --- a/reflex/components/datadisplay/code.pyi +++ b/reflex/components/datadisplay/code.pyi @@ -8,10 +8,9 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var LiteralCodeBlockTheme = Literal[ "a11y-dark", @@ -353,108 +352,290 @@ class CodeBlock(Component): *children, can_copy: Optional[bool] = False, copy_button: Optional[Union[Component, bool]] = None, - theme: Optional[ - Union[ - Var[ - Literal[ - "a11y-dark", - "atom-dark", - "cb", - "coldark-cold", - "coldark-dark", - "coy", - "coy-without-shadows", - "darcula", - "dark", - "dracula", - "duotone-dark", - "duotone-earth", - "duotone-forest", - "duotone-light", - "duotone-sea", - "duotone-space", - "funky", - "ghcolors", - "gruvbox-dark", - "gruvbox-light", - "holi-theme", - "hopscotch", - "light", - "lucario", - "material-dark", - "material-light", - "material-oceanic", - "night-owl", - "nord", - "okaidia", - "one-dark", - "one-light", - "pojoaque", - "prism", - "shades-of-purple", - "solarized-dark-atom", - "solarizedlight", - "synthwave84", - "tomorrow", - "twilight", - "vs", - "vs-dark", - "vsc-dark-plus", - "xonokai", - "z-touch", - ] - ], - Literal[ - "a11y-dark", - "atom-dark", - "cb", - "coldark-cold", - "coldark-dark", - "coy", - "coy-without-shadows", - "darcula", - "dark", - "dracula", - "duotone-dark", - "duotone-earth", - "duotone-forest", - "duotone-light", - "duotone-sea", - "duotone-space", - "funky", - "ghcolors", - "gruvbox-dark", - "gruvbox-light", - "holi-theme", - "hopscotch", - "light", - "lucario", - "material-dark", - "material-light", - "material-oceanic", - "night-owl", - "nord", - "okaidia", - "one-dark", - "one-light", - "pojoaque", - "prism", - "shades-of-purple", - "solarized-dark-atom", - "solarizedlight", - "synthwave84", - "tomorrow", - "twilight", - "vs", - "vs-dark", - "vsc-dark-plus", - "xonokai", - "z-touch", - ], - ] - ] = None, + theme: Optional[Union[Any, Var[Any]]] = None, language: Optional[ Union[ + Literal[ + "abap", + "abnf", + "actionscript", + "ada", + "agda", + "al", + "antlr4", + "apacheconf", + "apex", + "apl", + "applescript", + "aql", + "arduino", + "arff", + "asciidoc", + "asm6502", + "asmatmel", + "aspnet", + "autohotkey", + "autoit", + "avisynth", + "avro-idl", + "bash", + "basic", + "batch", + "bbcode", + "bicep", + "birb", + "bison", + "bnf", + "brainfuck", + "brightscript", + "bro", + "bsl", + "c", + "cfscript", + "chaiscript", + "cil", + "clike", + "clojure", + "cmake", + "cobol", + "coffeescript", + "concurnas", + "coq", + "core", + "cpp", + "crystal", + "csharp", + "cshtml", + "csp", + "css", + "css-extras", + "csv", + "cypher", + "d", + "dart", + "dataweave", + "dax", + "dhall", + "diff", + "django", + "dns-zone-file", + "docker", + "dot", + "ebnf", + "editorconfig", + "eiffel", + "ejs", + "elixir", + "elm", + "erb", + "erlang", + "etlua", + "excel-formula", + "factor", + "false", + "firestore-security-rules", + "flow", + "fortran", + "fsharp", + "ftl", + "gap", + "gcode", + "gdscript", + "gedcom", + "gherkin", + "git", + "glsl", + "gml", + "gn", + "go", + "go-module", + "graphql", + "groovy", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hlsl", + "hoon", + "hpkp", + "hsts", + "http", + "ichigojam", + "icon", + "icu-message-format", + "idris", + "iecst", + "ignore", + "index", + "inform7", + "ini", + "io", + "j", + "java", + "javadoc", + "javadoclike", + "javascript", + "javastacktrace", + "jexl", + "jolie", + "jq", + "js-extras", + "js-templates", + "jsdoc", + "json", + "json5", + "jsonp", + "jsstacktrace", + "jsx", + "julia", + "keepalived", + "keyman", + "kotlin", + "kumir", + "kusto", + "latex", + "latte", + "less", + "lilypond", + "liquid", + "lisp", + "livescript", + "llvm", + "log", + "lolcode", + "lua", + "magma", + "makefile", + "markdown", + "markup", + "markup-templating", + "matlab", + "maxscript", + "mel", + "mermaid", + "mizar", + "mongodb", + "monkey", + "moonscript", + "n1ql", + "n4js", + "nand2tetris-hdl", + "naniscript", + "nasm", + "neon", + "nevod", + "nginx", + "nim", + "nix", + "nsis", + "objectivec", + "ocaml", + "opencl", + "openqasm", + "oz", + "parigp", + "parser", + "pascal", + "pascaligo", + "pcaxis", + "peoplecode", + "perl", + "php", + "php-extras", + "phpdoc", + "plsql", + "powerquery", + "powershell", + "processing", + "prolog", + "promql", + "properties", + "protobuf", + "psl", + "pug", + "puppet", + "pure", + "purebasic", + "purescript", + "python", + "q", + "qml", + "qore", + "qsharp", + "r", + "racket", + "reason", + "regex", + "rego", + "renpy", + "rest", + "rip", + "roboconf", + "robotframework", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shell-session", + "smali", + "smalltalk", + "smarty", + "sml", + "solidity", + "solution-file", + "soy", + "sparql", + "splunk-spl", + "sqf", + "sql", + "squirrel", + "stan", + "stylus", + "swift", + "systemd", + "t4-cs", + "t4-templating", + "t4-vb", + "tap", + "tcl", + "textile", + "toml", + "tremor", + "tsx", + "tt2", + "turtle", + "twig", + "typescript", + "typoscript", + "unrealscript", + "uorazor", + "uri", + "v", + "vala", + "vbnet", + "velocity", + "verilog", + "vhdl", + "vim", + "visual-basic", + "warpscript", + "wasm", + "web-idl", + "wiki", + "wolfram", + "wren", + "xeora", + "xml-doc", + "xojo", + "xquery", + "yaml", + "yang", + "zig", + ], Var[ Literal[ "abap", @@ -738,287 +919,6 @@ class CodeBlock(Component): "zig", ] ], - Literal[ - "abap", - "abnf", - "actionscript", - "ada", - "agda", - "al", - "antlr4", - "apacheconf", - "apex", - "apl", - "applescript", - "aql", - "arduino", - "arff", - "asciidoc", - "asm6502", - "asmatmel", - "aspnet", - "autohotkey", - "autoit", - "avisynth", - "avro-idl", - "bash", - "basic", - "batch", - "bbcode", - "bicep", - "birb", - "bison", - "bnf", - "brainfuck", - "brightscript", - "bro", - "bsl", - "c", - "cfscript", - "chaiscript", - "cil", - "clike", - "clojure", - "cmake", - "cobol", - "coffeescript", - "concurnas", - "coq", - "core", - "cpp", - "crystal", - "csharp", - "cshtml", - "csp", - "css", - "css-extras", - "csv", - "cypher", - "d", - "dart", - "dataweave", - "dax", - "dhall", - "diff", - "django", - "dns-zone-file", - "docker", - "dot", - "ebnf", - "editorconfig", - "eiffel", - "ejs", - "elixir", - "elm", - "erb", - "erlang", - "etlua", - "excel-formula", - "factor", - "false", - "firestore-security-rules", - "flow", - "fortran", - "fsharp", - "ftl", - "gap", - "gcode", - "gdscript", - "gedcom", - "gherkin", - "git", - "glsl", - "gml", - "gn", - "go", - "go-module", - "graphql", - "groovy", - "haml", - "handlebars", - "haskell", - "haxe", - "hcl", - "hlsl", - "hoon", - "hpkp", - "hsts", - "http", - "ichigojam", - "icon", - "icu-message-format", - "idris", - "iecst", - "ignore", - "index", - "inform7", - "ini", - "io", - "j", - "java", - "javadoc", - "javadoclike", - "javascript", - "javastacktrace", - "jexl", - "jolie", - "jq", - "js-extras", - "js-templates", - "jsdoc", - "json", - "json5", - "jsonp", - "jsstacktrace", - "jsx", - "julia", - "keepalived", - "keyman", - "kotlin", - "kumir", - "kusto", - "latex", - "latte", - "less", - "lilypond", - "liquid", - "lisp", - "livescript", - "llvm", - "log", - "lolcode", - "lua", - "magma", - "makefile", - "markdown", - "markup", - "markup-templating", - "matlab", - "maxscript", - "mel", - "mermaid", - "mizar", - "mongodb", - "monkey", - "moonscript", - "n1ql", - "n4js", - "nand2tetris-hdl", - "naniscript", - "nasm", - "neon", - "nevod", - "nginx", - "nim", - "nix", - "nsis", - "objectivec", - "ocaml", - "opencl", - "openqasm", - "oz", - "parigp", - "parser", - "pascal", - "pascaligo", - "pcaxis", - "peoplecode", - "perl", - "php", - "php-extras", - "phpdoc", - "plsql", - "powerquery", - "powershell", - "processing", - "prolog", - "promql", - "properties", - "protobuf", - "psl", - "pug", - "puppet", - "pure", - "purebasic", - "purescript", - "python", - "q", - "qml", - "qore", - "qsharp", - "r", - "racket", - "reason", - "regex", - "rego", - "renpy", - "rest", - "rip", - "roboconf", - "robotframework", - "ruby", - "rust", - "sas", - "sass", - "scala", - "scheme", - "scss", - "shell-session", - "smali", - "smalltalk", - "smarty", - "sml", - "solidity", - "solution-file", - "soy", - "sparql", - "splunk-spl", - "sqf", - "sql", - "squirrel", - "stan", - "stylus", - "swift", - "systemd", - "t4-cs", - "t4-templating", - "t4-vb", - "tap", - "tcl", - "textile", - "toml", - "tremor", - "tsx", - "tt2", - "turtle", - "twig", - "typescript", - "typoscript", - "unrealscript", - "uorazor", - "uri", - "v", - "vala", - "vbnet", - "velocity", - "verilog", - "vhdl", - "vim", - "visual-basic", - "warpscript", - "wasm", - "web-idl", - "wiki", - "wolfram", - "wren", - "xeora", - "xml-doc", - "xojo", - "xquery", - "yaml", - "yang", - "zig", - ], ] ] = None, code: Optional[Union[Var[str], str]] = None, @@ -1026,57 +926,47 @@ class CodeBlock(Component): starting_line_number: Optional[Union[Var[int], int]] = None, wrap_long_lines: Optional[Union[Var[bool], bool]] = None, custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None, - code_tag_props: Optional[Union[Var[Dict[str, str]], Dict[str, str]]] = None, + code_tag_props: Optional[Union[Dict[str, str], Var[Dict[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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CodeBlock": diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index 006a2472f..9d1ecc775 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -9,12 +9,12 @@ from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.components.literals import LiteralRowMarker from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar -from reflex.ivars.sequence import ArrayVar from reflex.utils import console, format, types from reflex.utils.imports import ImportDict, ImportVar from reflex.utils.serializers import serializer -from reflex.vars import Var, get_unique_variable_name +from reflex.vars import get_unique_variable_name +from reflex.vars.base import Var +from reflex.vars.sequence import ArrayVar # TODO: Fix the serialization issue for custom types. @@ -295,7 +295,7 @@ class DataEditor(NoSSRComponent): # Define the name of the getData callback associated with this component and assign to get_cell_content. data_callback = f"getData_{editor_id}" - self.get_cell_content = ImmutableVar.create(data_callback) # type: ignore + self.get_cell_content = Var(_js_expr=data_callback) # type: ignore code = [f"function {data_callback}([col, row])" "{"] @@ -333,18 +333,16 @@ class DataEditor(NoSSRComponent): # If rows is not provided, determine from data. if rows is None: - if isinstance(data, ImmutableVar) and not isinstance(data, ArrayVar): + if isinstance(data, Var) and not isinstance(data, ArrayVar): raise ValueError( "DataEditor data must be an ArrayVar if rows is not provided." ) - props["rows"] = ( - data.length() if isinstance(data, ImmutableVar) else len(data) - ) + props["rows"] = data.length() if isinstance(data, Var) else len(data) - if not isinstance(columns, ImmutableVar) and len(columns): + if not isinstance(columns, Var) and len(columns): if ( types.is_dataframe(type(data)) - or isinstance(data, ImmutableVar) + or isinstance(data, Var) and types.is_dataframe(data._var_type) ): raise ValueError( diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index 66452ffae..edfd0521a 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -9,11 +9,10 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.utils.serializers import serializer -from reflex.vars import Var +from reflex.vars.base import Var class GridColumnIcons(Enum): Array = "array" @@ -89,9 +88,9 @@ class DataEditor(NoSSRComponent): *children, rows: Optional[Union[Var[int], int]] = None, columns: Optional[ - Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]] + Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]] ] = None, - data: Optional[Union[Var[List[List[Any]]], List[List[Any]]]] = None, + data: Optional[Union[List[List[Any]], Var[List[List[Any]]]]] = None, get_cell_content: Optional[Union[Var[str], str]] = None, get_cell_for_selection: Optional[Union[Var[bool], bool]] = None, on_paste: Optional[Union[Var[bool], bool]] = None, @@ -107,8 +106,8 @@ class DataEditor(NoSSRComponent): row_height: Optional[Union[Var[int], int]] = None, row_markers: Optional[ Union[ - Var[Literal["none", "number", "checkbox", "both", "clickable-number"]], - Literal["none", "number", "checkbox", "both", "clickable-number"], + Literal["both", "checkbox", "clickable-number", "none", "number"], + Var[Literal["both", "checkbox", "clickable-number", "none", "number"]], ] ] = None, row_marker_start_index: Optional[Union[Var[int], int]] = None, @@ -118,8 +117,8 @@ class DataEditor(NoSSRComponent): vertical_border: Optional[Union[Var[bool], bool]] = None, column_select: Optional[ Union[ - Var[Literal["none", "single", "multi"]], - Literal["none", "single", "multi"], + Literal["multi", "none", "single"], + Var[Literal["multi", "none", "single"]], ] ] = None, prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None, @@ -128,106 +127,94 @@ class DataEditor(NoSSRComponent): scroll_offset_x: Optional[Union[Var[int], int]] = None, scroll_offset_y: Optional[Union[Var[int], int]] = None, theme: Optional[ - Union[Var[Union[DataEditorTheme, Dict]], DataEditorTheme, Dict] + 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_cell_activated: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_cell_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_cell_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_cell_edited: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_column_resize: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_delete: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_delete: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_finished_editing: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_group_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_group_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_group_header_renamed: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_header_menu_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_item_hovered: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_row_appended: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selection_cleared: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataEditor": diff --git a/reflex/components/el/element.pyi b/reflex/components/el/element.pyi index 576941618..4ea86f273 100644 --- a/reflex/components/el/element.pyi +++ b/reflex/components/el/element.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class Element(Component): @overload @@ -21,51 +21,41 @@ class Element(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Element": diff --git a/reflex/components/el/elements/base.py b/reflex/components/el/elements/base.py index 5eb8aa70c..a9748ae25 100644 --- a/reflex/components/el/elements/base.py +++ b/reflex/components/el/elements/base.py @@ -3,7 +3,7 @@ from typing import Union from reflex.components.el.element import Element -from reflex.vars import Var as Var +from reflex.vars.base import Var class BaseHTML(Element): diff --git a/reflex/components/el/elements/base.pyi b/reflex/components/el/elements/base.pyi index 4cc1c397c..d3f0622da 100644 --- a/reflex/components/el/elements/base.pyi +++ b/reflex/components/el/elements/base.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.element import Element from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class BaseHTML(Element): @overload @@ -17,80 +16,70 @@ class BaseHTML(Element): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BaseHTML": diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index f2a6a42f5..29fea357b 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -11,13 +11,13 @@ from reflex.components.el.element import Element from reflex.components.tags.tag import Tag from reflex.constants import Dirs, EventTriggers from reflex.event import EventChain, EventHandler -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils.imports import ImportDict -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var from .base import BaseHTML -FORM_DATA = ImmutableVar.create("form_data") +FORM_DATA = Var(_js_expr="form_data") HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string( """ const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => { @@ -197,8 +197,8 @@ class Form(BaseHTML): if EventTriggers.ON_SUBMIT in self.event_triggers: render_tag.add_props( **{ - EventTriggers.ON_SUBMIT: ImmutableVar( - _var_name=f"handleSubmit_{self.handle_submit_unique_name}", + EventTriggers.ON_SUBMIT: Var( + _js_expr=f"handleSubmit_{self.handle_submit_unique_name}", _var_type=EventChain, ) } @@ -212,21 +212,21 @@ class Form(BaseHTML): # when ref start with refs_ it's an array of refs, so we need different method # to collect data if ref.startswith("refs_"): - ref_var = ImmutableVar.create_safe(ref[:-3]).as_ref() - form_refs[ref[len("refs_") : -3]] = ImmutableVar.create_safe( - f"getRefValues({str(ref_var)})", + ref_var = Var(_js_expr=ref[:-3]).as_ref() + form_refs[ref[len("refs_") : -3]] = Var( + _js_expr=f"getRefValues({str(ref_var)})", _var_data=VarData.merge(ref_var._get_all_var_data()), ) else: - ref_var = ImmutableVar.create_safe(ref).as_ref() - form_refs[ref[4:]] = ImmutableVar.create_safe( - f"getRefValue({str(ref_var)})", + ref_var = Var(_js_expr=ref).as_ref() + form_refs[ref[4:]] = Var( + _js_expr=f"getRefValue({str(ref_var)})", _var_data=VarData.merge(ref_var._get_all_var_data()), ) # print(repr(form_refs)) return form_refs - def _get_vars(self, include_children: bool = True) -> Iterator[ImmutableVar]: + def _get_vars(self, include_children: bool = True) -> Iterator[Var]: yield from super()._get_vars(include_children=include_children) yield from self._get_form_refs().values() @@ -624,15 +624,15 @@ class Textarea(BaseHTML): "Cannot combine `enter_key_submit` with `on_key_down`.", ) tag.add_props( - on_key_down=ImmutableVar.create_safe( - f"(e) => enterKeySubmitOnKeyDown(e, {str(self.enter_key_submit)})", + on_key_down=Var( + _js_expr=f"(e) => enterKeySubmitOnKeyDown(e, {str(self.enter_key_submit)})", _var_data=VarData.merge(self.enter_key_submit._get_all_var_data()), ) ) if self.auto_height is not None: tag.add_props( - on_input=ImmutableVar.create_safe( - f"(e) => autoHeightOnInput(e, {str(self.auto_height)})", + on_input=Var( + _js_expr=f"(e) => autoHeightOnInput(e, {str(self.auto_height)})", _var_data=VarData.merge(self.auto_height._get_all_var_data()), ) ) diff --git a/reflex/components/el/elements/forms.pyi b/reflex/components/el/elements/forms.pyi index 0b2f42754..5677eb741 100644 --- a/reflex/components/el/elements/forms.pyi +++ b/reflex/components/el/elements/forms.pyi @@ -9,14 +9,13 @@ from jinja2 import Environment from reflex.components.el.element import Element from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML -FORM_DATA = ImmutableVar.create("form_data") +FORM_DATA = Var(_js_expr="form_data") HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string( "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}};\n\n ({{ on_submit_event_chain }}());\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n " ) @@ -27,95 +26,85 @@ class Button(BaseHTML): def create( # type: ignore cls, *children, - auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form_action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_enc_type: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_no_validate: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Button": @@ -169,80 +158,70 @@ class Datalist(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Datalist": @@ -285,59 +264,49 @@ class Fieldset(Element): def create( # type: ignore cls, *children, - disabled: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + disabled: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Fieldset": @@ -367,98 +336,86 @@ class Form(BaseHTML): def create( # type: ignore cls, *children, - accept: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, accept_charset: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - enc_type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - no_validate: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + enc_type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + no_validate: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, reset_on_submit: Optional[Union[Var[bool], bool]] = None, handle_submit_unique_name: Optional[Union[Var[str], str]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_submit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Form": @@ -515,128 +472,114 @@ class Input(BaseHTML): def create( # type: ignore cls, *children, - accept: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - alt: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + alt: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - capture: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - checked: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + capture: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + checked: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, default_checked: Optional[Union[Var[bool], bool]] = None, default_value: Optional[Union[Var[str], str]] = None, - dirname: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - disabled: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form_action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dirname: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + disabled: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_enc_type: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_no_validate: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - list: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - max: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - max_length: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - min_length: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - min: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - multiple: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - pattern: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - placeholder: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - read_only: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - required: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - size: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - step: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - use_map: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[float, int, str]], str, int, float]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + list: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + max: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + max_length: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + min_length: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + min: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + multiple: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + pattern: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + placeholder: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + read_only: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + required: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + size: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + step: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + use_map: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Input": @@ -712,82 +655,72 @@ class Label(BaseHTML): def create( # type: ignore cls, *children, - html_for: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + html_for: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Label": @@ -832,80 +765,70 @@ class Legend(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Legend": @@ -948,87 +871,77 @@ class Meter(BaseHTML): def create( # type: ignore cls, *children, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - high: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - low: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - max: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - min: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - optimum: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + high: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + low: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + max: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + min: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + optimum: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Meter": @@ -1078,82 +991,72 @@ class Optgroup(BaseHTML): def create( # type: ignore cls, *children, - disabled: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - label: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + disabled: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + label: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Optgroup": @@ -1198,84 +1101,74 @@ class Option(BaseHTML): def create( # type: ignore cls, *children, - disabled: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - label: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - selected: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + disabled: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + label: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + selected: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Option": @@ -1322,83 +1215,73 @@ class Output(BaseHTML): def create( # type: ignore cls, *children, - html_for: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + html_for: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Output": @@ -1444,83 +1327,73 @@ class Progress(BaseHTML): def create( # type: ignore cls, *children, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - max: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + max: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": @@ -1567,92 +1440,80 @@ class Select(BaseHTML): cls, *children, auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - disabled: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - multiple: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - required: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - size: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + disabled: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + multiple: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + required: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + size: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Select": @@ -1707,107 +1568,93 @@ class Textarea(BaseHTML): cls, *children, auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_height: Optional[Union[Var[bool], bool]] = None, - cols: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - dirname: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - disabled: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cols: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + dirname: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + disabled: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_submit: Optional[Union[Var[bool], bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - max_length: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - min_length: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - placeholder: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - read_only: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - required: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - rows: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - wrap: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + max_length: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + min_length: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + placeholder: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + read_only: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + required: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + rows: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + wrap: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Textarea": diff --git a/reflex/components/el/elements/inline.py b/reflex/components/el/elements/inline.py index 4364c1ead..d1bdf6b87 100644 --- a/reflex/components/el/elements/inline.py +++ b/reflex/components/el/elements/inline.py @@ -2,7 +2,7 @@ from typing import Union -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML diff --git a/reflex/components/el/elements/inline.pyi b/reflex/components/el/elements/inline.pyi index 0c1b81d1f..e53e6da04 100644 --- a/reflex/components/el/elements/inline.pyi +++ b/reflex/components/el/elements/inline.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -18,91 +17,81 @@ class A(BaseHTML): def create( # type: ignore cls, *children, - download: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - href: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - href_lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - ping: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + download: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + href: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + href_lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + media: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + ping: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, referrer_policy: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - rel: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - shape: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + rel: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + shape: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "A": @@ -154,80 +143,70 @@ class Abbr(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Abbr": @@ -270,80 +249,70 @@ class B(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "B": @@ -386,80 +355,70 @@ class Bdi(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Bdi": @@ -502,80 +461,70 @@ class Bdo(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Bdo": @@ -618,80 +567,70 @@ class Br(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Br": @@ -734,80 +673,70 @@ class Cite(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Cite": @@ -850,80 +779,70 @@ class Code(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Code": @@ -966,81 +885,71 @@ class Data(BaseHTML): def create( # type: ignore cls, *children, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Data": @@ -1084,80 +993,70 @@ class Dfn(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dfn": @@ -1200,80 +1099,70 @@ class Em(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Em": @@ -1316,80 +1205,70 @@ class I(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "I": @@ -1432,80 +1311,70 @@ class Kbd(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Kbd": @@ -1548,80 +1417,70 @@ class Mark(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Mark": @@ -1664,81 +1523,71 @@ class Q(BaseHTML): def create( # type: ignore cls, *children, - cite: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cite: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Q": @@ -1782,80 +1631,70 @@ class Rp(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Rp": @@ -1898,80 +1737,70 @@ class Rt(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Rt": @@ -2014,80 +1843,70 @@ class Ruby(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ruby": @@ -2130,80 +1949,70 @@ class S(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "S": @@ -2246,80 +2055,70 @@ class Samp(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Samp": @@ -2362,80 +2161,70 @@ class Small(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Small": @@ -2478,80 +2267,70 @@ class Span(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Span": @@ -2594,80 +2373,70 @@ class Strong(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Strong": @@ -2710,80 +2479,70 @@ class Sub(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Sub": @@ -2826,80 +2585,70 @@ class Sup(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Sup": @@ -2942,81 +2691,71 @@ class Time(BaseHTML): def create( # type: ignore cls, *children, - date_time: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + date_time: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Time": @@ -3060,80 +2799,70 @@ class U(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "U": @@ -3176,80 +2905,70 @@ class Wbr(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Wbr": diff --git a/reflex/components/el/elements/media.py b/reflex/components/el/elements/media.py index 7f006bf65..705233532 100644 --- a/reflex/components/el/elements/media.py +++ b/reflex/components/el/elements/media.py @@ -4,7 +4,7 @@ from typing import Any, Union from reflex import Component, ComponentNamespace from reflex.constants.colors import Color -from reflex.vars import Var as Var +from reflex.vars.base import Var from .base import BaseHTML diff --git a/reflex/components/el/elements/media.pyi b/reflex/components/el/elements/media.pyi index 08b2be719..6d05fe69f 100644 --- a/reflex/components/el/elements/media.pyi +++ b/reflex/components/el/elements/media.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex import ComponentNamespace from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -20,93 +19,83 @@ class Area(BaseHTML): def create( # type: ignore cls, *children, - alt: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - coords: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - download: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - href: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - href_lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - ping: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + alt: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + coords: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + download: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + href: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + href_lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + media: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + ping: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, referrer_policy: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - rel: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - shape: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + rel: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + shape: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Area": @@ -160,90 +149,80 @@ class Audio(BaseHTML): def create( # type: ignore cls, *children, - auto_play: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - buffered: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - controls: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_play: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + buffered: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + controls: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, cross_origin: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - loop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - muted: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - preload: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + loop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + muted: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + preload: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Audio": @@ -294,98 +273,88 @@ class Img(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - alt: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + alt: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, cross_origin: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - decoding: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + decoding: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, intrinsicsize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - ismap: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - loading: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + ismap: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + loading: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, referrer_policy: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - sizes: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src: Optional[Union[Var[Any], Any]] = None, - src_set: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - use_map: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + sizes: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Any, Var[Any]]] = None, + src_set: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + use_map: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Img": @@ -441,81 +410,71 @@ class Map(BaseHTML): def create( # type: ignore cls, *children, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Map": @@ -559,85 +518,75 @@ class Track(BaseHTML): def create( # type: ignore cls, *children, - default: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - kind: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - label: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src_lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + default: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + kind: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + label: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src_lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Track": @@ -685,94 +634,84 @@ class Video(BaseHTML): def create( # type: ignore cls, *children, - auto_play: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - buffered: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - controls: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_play: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + buffered: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + controls: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, cross_origin: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - loop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - muted: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + loop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + muted: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, plays_inline: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - poster: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - preload: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + poster: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + preload: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Video": @@ -825,82 +764,72 @@ class Embed(BaseHTML): def create( # type: ignore cls, *children, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Embed": @@ -945,91 +874,81 @@ class Iframe(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - allow: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - csp: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - loading: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + allow: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + csp: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + loading: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, referrer_policy: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - sandbox: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src_doc: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + sandbox: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src_doc: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Iframe": @@ -1081,85 +1000,75 @@ class Object(BaseHTML): def create( # type: ignore cls, *children, - data: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - use_map: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + data: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + use_map: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Object": @@ -1207,80 +1116,70 @@ class Picture(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Picture": @@ -1323,80 +1222,70 @@ class Portal(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Portal": @@ -1439,85 +1328,75 @@ class Source(BaseHTML): def create( # type: ignore cls, *children, - media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - sizes: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - src_set: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + media: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + sizes: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + src_set: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Source": @@ -1565,83 +1444,73 @@ class Svg(BaseHTML): def create( # type: ignore cls, *children, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, str]] = None, xmlns: Optional[Union[Var[str], str]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Svg": @@ -1687,84 +1556,74 @@ class Circle(BaseHTML): def create( # type: ignore cls, *children, - cx: Optional[Union[Var[Union[int, str]], str, int]] = None, - cy: Optional[Union[Var[Union[int, str]], str, int]] = None, - r: Optional[Union[Var[Union[int, str]], str, int]] = None, + cx: Optional[Union[Var[Union[int, str]], int, str]] = None, + cy: Optional[Union[Var[Union[int, str]], int, str]] = None, + r: Optional[Union[Var[Union[int, str]], int, str]] = None, path_length: Optional[Union[Var[int], int]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Circle": @@ -1811,87 +1670,77 @@ class Rect(BaseHTML): def create( # type: ignore cls, *children, - x: Optional[Union[Var[Union[int, str]], str, int]] = None, - y: Optional[Union[Var[Union[int, str]], str, int]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, - rx: Optional[Union[Var[Union[int, str]], str, int]] = None, - ry: Optional[Union[Var[Union[int, str]], str, int]] = None, + x: Optional[Union[Var[Union[int, str]], int, str]] = None, + y: Optional[Union[Var[Union[int, str]], int, str]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, str]] = None, + rx: Optional[Union[Var[Union[int, str]], int, str]] = None, + ry: Optional[Union[Var[Union[int, str]], int, str]] = None, path_length: Optional[Union[Var[int], int]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Rect": @@ -1943,80 +1792,70 @@ class Polygon(BaseHTML): *children, points: Optional[Union[Var[str], str]] = None, path_length: Optional[Union[Var[int], int]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Polygon": @@ -2061,80 +1900,70 @@ class Defs(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Defs": @@ -2177,87 +2006,77 @@ class LinearGradient(BaseHTML): def create( # type: ignore cls, *children, - gradient_units: Optional[Union[Var[Union[bool, str]], str, bool]] = None, - gradient_transform: Optional[Union[Var[Union[bool, str]], str, bool]] = None, - spread_method: Optional[Union[Var[Union[bool, str]], str, bool]] = None, - x1: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - x2: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - y1: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - y2: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + gradient_units: Optional[Union[Var[Union[bool, str]], bool, str]] = None, + gradient_transform: Optional[Union[Var[Union[bool, str]], bool, str]] = None, + spread_method: Optional[Union[Var[Union[bool, str]], bool, str]] = None, + x1: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + x2: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + y1: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + y2: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LinearGradient": @@ -2307,87 +2126,77 @@ class Stop(BaseHTML): def create( # type: ignore cls, *children, - offset: Optional[Union[Var[Union[float, int, str]], str, float, int]] = None, + offset: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, stop_color: Optional[ - Union[Var[Union[Color, bool, str]], str, Color, bool] + Union[Color, Var[Union[Color, bool, str]], bool, str] ] = None, stop_opacity: Optional[ - Union[Var[Union[bool, float, int, str]], str, float, int, bool] + Union[Var[Union[bool, float, int, str]], bool, float, int, str] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Stop": @@ -2433,81 +2242,71 @@ class Path(BaseHTML): def create( # type: ignore cls, *children, - d: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + d: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Path": @@ -2557,83 +2356,73 @@ class SVG(ComponentNamespace): @staticmethod def __call__( *children, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, str]] = None, xmlns: Optional[Union[Var[str], str]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Svg": diff --git a/reflex/components/el/elements/metadata.py b/reflex/components/el/elements/metadata.py index df5e1e901..983a8f3a0 100644 --- a/reflex/components/el/elements/metadata.py +++ b/reflex/components/el/elements/metadata.py @@ -3,8 +3,7 @@ from typing import List, Union from reflex.components.el.element import Element -from reflex.ivars.base import ImmutableVar -from reflex.vars import Var as Var +from reflex.vars.base import Var from .base import BaseHTML @@ -90,9 +89,7 @@ class StyleEl(Element): # noqa: E742 media: Var[Union[str, int, bool]] - special_props: List[ImmutableVar] = [ - ImmutableVar.create_safe("suppressHydrationWarning") - ] + special_props: List[Var] = [Var(_js_expr="suppressHydrationWarning")] base = Base.create diff --git a/reflex/components/el/elements/metadata.pyi b/reflex/components/el/elements/metadata.pyi index 26e12d0e4..f59ed14fc 100644 --- a/reflex/components/el/elements/metadata.pyi +++ b/reflex/components/el/elements/metadata.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.element import Element from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -19,82 +18,72 @@ class Base(BaseHTML): def create( # type: ignore cls, *children, - href: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + href: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Base": @@ -137,80 +126,70 @@ class Head(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Head": @@ -254,92 +233,82 @@ class Link(BaseHTML): cls, *children, cross_origin: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - href: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - href_lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - integrity: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + href: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + href_lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + integrity: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + media: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, referrer_policy: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - rel: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - sizes: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + rel: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + sizes: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Link": @@ -391,84 +360,74 @@ class Meta(BaseHTML): def create( # type: ignore cls, *children, - char_set: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - content: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - http_equiv: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + char_set: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + content: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + http_equiv: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Meta": @@ -520,51 +479,41 @@ class Title(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Title": @@ -591,57 +540,47 @@ class StyleEl(Element): def create( # type: ignore cls, *children, - media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + media: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "StyleEl": diff --git a/reflex/components/el/elements/other.py b/reflex/components/el/elements/other.py index 560ed5138..fa7c6cdec 100644 --- a/reflex/components/el/elements/other.py +++ b/reflex/components/el/elements/other.py @@ -2,7 +2,7 @@ from typing import Union -from reflex.vars import Var as Var +from reflex.vars.base import Var from .base import BaseHTML diff --git a/reflex/components/el/elements/other.pyi b/reflex/components/el/elements/other.pyi index 4a106344b..9d4cdd7c9 100644 --- a/reflex/components/el/elements/other.pyi +++ b/reflex/components/el/elements/other.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -18,81 +17,71 @@ class Details(BaseHTML): def create( # type: ignore cls, *children, - open: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + open: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Details": @@ -136,81 +125,71 @@ class Dialog(BaseHTML): def create( # type: ignore cls, *children, - open: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + open: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dialog": @@ -254,80 +233,70 @@ class Summary(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Summary": @@ -370,80 +339,70 @@ class Slot(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Slot": @@ -486,80 +445,70 @@ class Template(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Template": @@ -602,80 +551,70 @@ class Math(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Math": @@ -718,81 +657,71 @@ class Html(BaseHTML): def create( # type: ignore cls, *children, - manifest: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + manifest: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Html": diff --git a/reflex/components/el/elements/scripts.py b/reflex/components/el/elements/scripts.py index 09a9fd17a..b53306e02 100644 --- a/reflex/components/el/elements/scripts.py +++ b/reflex/components/el/elements/scripts.py @@ -2,7 +2,7 @@ from typing import Union -from reflex.vars import Var as Var +from reflex.vars.base import Var from .base import BaseHTML diff --git a/reflex/components/el/elements/scripts.pyi b/reflex/components/el/elements/scripts.pyi index f5e9f6795..a6495720c 100644 --- a/reflex/components/el/elements/scripts.pyi +++ b/reflex/components/el/elements/scripts.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -18,80 +17,70 @@ class Canvas(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Canvas": @@ -134,80 +123,70 @@ class Noscript(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Noscript": @@ -250,93 +229,83 @@ class Script(BaseHTML): def create( # type: ignore cls, *children, - async_: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - char_set: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + async_: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + char_set: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, cross_origin: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - defer: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - integrity: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - language: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + defer: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + integrity: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + language: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, referrer_policy: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Script": diff --git a/reflex/components/el/elements/sectioning.py b/reflex/components/el/elements/sectioning.py index e1544bd15..6aea8c1e3 100644 --- a/reflex/components/el/elements/sectioning.py +++ b/reflex/components/el/elements/sectioning.py @@ -1,7 +1,5 @@ """Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" -from reflex.vars import Var as Var - from .base import BaseHTML diff --git a/reflex/components/el/elements/sectioning.pyi b/reflex/components/el/elements/sectioning.pyi index 5bca34ac6..6b5905b13 100644 --- a/reflex/components/el/elements/sectioning.pyi +++ b/reflex/components/el/elements/sectioning.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -18,80 +17,70 @@ class Body(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Body": @@ -134,80 +123,70 @@ class Address(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Address": @@ -250,80 +229,70 @@ class Article(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Article": @@ -366,80 +335,70 @@ class Aside(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Aside": @@ -482,80 +441,70 @@ class Footer(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Footer": @@ -598,80 +547,70 @@ class Header(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Header": @@ -714,80 +653,70 @@ class H1(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H1": @@ -830,80 +759,70 @@ class H2(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H2": @@ -946,80 +865,70 @@ class H3(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H3": @@ -1062,80 +971,70 @@ class H4(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H4": @@ -1178,80 +1077,70 @@ class H5(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H5": @@ -1294,80 +1183,70 @@ class H6(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H6": @@ -1410,80 +1289,70 @@ class Main(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Main": @@ -1526,80 +1395,70 @@ class Nav(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Nav": @@ -1642,80 +1501,70 @@ class Section(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Section": diff --git a/reflex/components/el/elements/tables.py b/reflex/components/el/elements/tables.py index 007879358..8f6cfcba4 100644 --- a/reflex/components/el/elements/tables.py +++ b/reflex/components/el/elements/tables.py @@ -2,7 +2,7 @@ from typing import Union -from reflex.vars import Var as Var +from reflex.vars.base import Var from .base import BaseHTML diff --git a/reflex/components/el/elements/tables.pyi b/reflex/components/el/elements/tables.pyi index 0cf41c515..49ab1b407 100644 --- a/reflex/components/el/elements/tables.pyi +++ b/reflex/components/el/elements/tables.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -18,81 +17,71 @@ class Caption(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Caption": @@ -136,82 +125,72 @@ class Col(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Col": @@ -256,82 +235,72 @@ class Colgroup(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Colgroup": @@ -376,82 +345,72 @@ class Table(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - summary: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + summary: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Table": @@ -496,81 +455,71 @@ class Tbody(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tbody": @@ -614,84 +563,74 @@ class Td(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - col_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - headers: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - row_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + row_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Td": @@ -738,81 +677,71 @@ class Tfoot(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tfoot": @@ -856,85 +785,75 @@ class Th(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - col_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - headers: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - row_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - scope: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + row_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + scope: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Th": @@ -982,81 +901,71 @@ class Thead(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Thead": @@ -1100,81 +1009,71 @@ class Tr(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tr": diff --git a/reflex/components/el/elements/typography.py b/reflex/components/el/elements/typography.py index dccad7a6d..7c55ecce7 100644 --- a/reflex/components/el/elements/typography.py +++ b/reflex/components/el/elements/typography.py @@ -2,7 +2,7 @@ from typing import Union -from reflex.vars import Var as Var +from reflex.vars.base import Var from .base import BaseHTML diff --git a/reflex/components/el/elements/typography.pyi b/reflex/components/el/elements/typography.pyi index 28c8c041e..2e8177090 100644 --- a/reflex/components/el/elements/typography.pyi +++ b/reflex/components/el/elements/typography.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import BaseHTML @@ -18,81 +17,71 @@ class Blockquote(BaseHTML): def create( # type: ignore cls, *children, - cite: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cite: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Blockquote": @@ -136,80 +125,70 @@ class Dd(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dd": @@ -252,80 +231,70 @@ class Div(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Div": @@ -368,80 +337,70 @@ class Dl(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dl": @@ -484,80 +443,70 @@ class Dt(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dt": @@ -600,80 +549,70 @@ class Figcaption(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Figcaption": @@ -716,81 +655,71 @@ class Hr(BaseHTML): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Hr": @@ -834,80 +763,70 @@ class Li(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Li": @@ -950,81 +869,71 @@ class Menu(BaseHTML): def create( # type: ignore cls, *children, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Menu": @@ -1068,83 +977,73 @@ class Ol(BaseHTML): def create( # type: ignore cls, *children, - reversed: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - start: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + reversed: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + start: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ol": @@ -1190,80 +1089,70 @@ class P(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "P": @@ -1306,80 +1195,70 @@ class Pre(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Pre": @@ -1422,80 +1301,70 @@ class Ul(BaseHTML): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ul": @@ -1538,82 +1407,72 @@ class Ins(BaseHTML): def create( # type: ignore cls, *children, - cite: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - date_time: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cite: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + date_time: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ins": @@ -1658,82 +1517,72 @@ class Del(BaseHTML): def create( # type: ignore cls, *children, - cite: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - date_time: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cite: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + date_time: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Del": diff --git a/reflex/components/gridjs/datatable.py b/reflex/components/gridjs/datatable.py index cd1acf100..aaccda9d2 100644 --- a/reflex/components/gridjs/datatable.py +++ b/reflex/components/gridjs/datatable.py @@ -6,11 +6,10 @@ from typing import Any, Dict, List, Union from reflex.components.component import Component from reflex.components.tags import Tag -from reflex.ivars.base import ImmutableVar, LiteralVar, is_computed_var from reflex.utils import types from reflex.utils.imports import ImportDict from reflex.utils.serializers import serialize -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var, is_computed_var class Gridjs(Component): @@ -83,7 +82,7 @@ class DataTable(Gridjs): # If data is a pandas dataframe and columns are provided throw an error. if ( types.is_dataframe(type(data)) - or (isinstance(data, ImmutableVar) and types.is_dataframe(data._var_type)) + or (isinstance(data, Var) and types.is_dataframe(data._var_type)) ) and columns is not None: raise ValueError( "Cannot pass in both a pandas dataframe and columns to the data_table component." @@ -91,7 +90,7 @@ class DataTable(Gridjs): # If data is a list and columns are not provided, throw an error if ( - (isinstance(data, ImmutableVar) and types._issubclass(data._var_type, List)) + (isinstance(data, Var) and types._issubclass(data._var_type, List)) or issubclass(type(data), List) ) and columns is None: raise ValueError( @@ -113,15 +112,13 @@ class DataTable(Gridjs): return {"": "gridjs/dist/theme/mermaid.css"} def _render(self) -> Tag: - if isinstance(self.data, ImmutableVar) 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( - _var_name=f"{self.data._var_name}.columns", + _js_expr=f"{self.data._js_expr}.columns", _var_type=List[Any], ) self.data = self.data._replace( - _var_name=f"{self.data._var_name}.data", + _js_expr=f"{self.data._js_expr}.data", _var_type=List[List[Any]], ) if types.is_dataframe(type(self.data)): diff --git a/reflex/components/gridjs/datatable.pyi b/reflex/components/gridjs/datatable.pyi index c80cacd85..ae7a8c0d3 100644 --- a/reflex/components/gridjs/datatable.pyi +++ b/reflex/components/gridjs/datatable.pyi @@ -7,10 +7,9 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var class Gridjs(Component): @overload @@ -23,51 +22,41 @@ class Gridjs(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Gridjs": @@ -95,61 +84,51 @@ class DataTable(Gridjs): cls, *children, data: Optional[Any] = None, - columns: Optional[Union[Var[List], List]] = None, + columns: Optional[Union[List, Var[List]]] = None, search: Optional[Union[Var[bool], bool]] = None, sort: Optional[Union[Var[bool], bool]] = None, resizable: Optional[Union[Var[bool], bool]] = None, - pagination: Optional[Union[Var[Union[Dict, bool]], bool, Dict]] = None, + pagination: Optional[Union[Dict, Var[Union[Dict, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataTable": diff --git a/reflex/components/lucide/icon.py b/reflex/components/lucide/icon.py index f593621d2..1ee68aaa3 100644 --- a/reflex/components/lucide/icon.py +++ b/reflex/components/lucide/icon.py @@ -2,7 +2,7 @@ from reflex.components.component import Component from reflex.utils import format -from reflex.vars import Var +from reflex.vars.base import Var class LucideIconComponent(Component): diff --git a/reflex/components/lucide/icon.pyi b/reflex/components/lucide/icon.pyi index 1e25ac002..811576200 100644 --- a/reflex/components/lucide/icon.pyi +++ b/reflex/components/lucide/icon.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class LucideIconComponent(Component): @overload @@ -22,51 +21,41 @@ class LucideIconComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LucideIconComponent": @@ -99,51 +88,41 @@ class Icon(LucideIconComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Icon": diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index 83f647f4c..1596f5ce2 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -17,25 +17,25 @@ from reflex.components.radix.themes.typography.heading import Heading from reflex.components.radix.themes.typography.link import Link from reflex.components.radix.themes.typography.text import Text from reflex.components.tags.tag import Tag -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import types from reflex.utils.imports import ImportDict, ImportVar +from reflex.vars.base import LiteralVar, Var # Special vars used in the component map. -_CHILDREN = ImmutableVar.create_safe("children") -_PROPS = ImmutableVar.create_safe("...props") -_PROPS_IN_TAG = ImmutableVar.create_safe("{...props}") -_MOCK_ARG = ImmutableVar.create_safe("") +_CHILDREN = Var(_js_expr="children", _var_type=str) +_PROPS = Var(_js_expr="...props") +_PROPS_IN_TAG = Var(_js_expr="{...props}") +_MOCK_ARG = Var(_js_expr="", _var_type=str) # Special remark plugins. -_REMARK_MATH = ImmutableVar.create_safe("remarkMath") -_REMARK_GFM = ImmutableVar.create_safe("remarkGfm") -_REMARK_UNWRAP_IMAGES = ImmutableVar.create_safe("remarkUnwrapImages") +_REMARK_MATH = Var(_js_expr="remarkMath") +_REMARK_GFM = Var(_js_expr="remarkGfm") +_REMARK_UNWRAP_IMAGES = Var(_js_expr="remarkUnwrapImages") _REMARK_PLUGINS = LiteralVar.create([_REMARK_MATH, _REMARK_GFM, _REMARK_UNWRAP_IMAGES]) # Special rehype plugins. -_REHYPE_KATEX = ImmutableVar.create_safe("rehypeKatex") -_REHYPE_RAW = ImmutableVar.create_safe("rehypeRaw") +_REHYPE_KATEX = Var(_js_expr="rehypeKatex") +_REHYPE_RAW = Var(_js_expr="rehypeRaw") _REHYPE_PLUGINS = LiteralVar.create([_REHYPE_KATEX, _REHYPE_RAW]) # These tags do NOT get props passed to them @@ -99,8 +99,7 @@ class Markdown(Component): The markdown component. """ assert ( - len(children) == 1 - and types._isinstance(children[0], Union[str, ImmutableVar]) + len(children) == 1 and types._isinstance(children[0], Union[str, Var]) ), "Markdown component must have exactly one child containing the markdown source." # Update the base component map with the custom component map. @@ -155,19 +154,19 @@ class Markdown(Component): { "": "katex/dist/katex.min.css", "remark-math@5.1.1": ImportVar( - tag=_REMARK_MATH._var_name, is_default=True + tag=_REMARK_MATH._js_expr, is_default=True ), "remark-gfm@3.0.1": ImportVar( - tag=_REMARK_GFM._var_name, is_default=True + tag=_REMARK_GFM._js_expr, is_default=True ), "remark-unwrap-images@4.0.0": ImportVar( - tag=_REMARK_UNWRAP_IMAGES._var_name, is_default=True + tag=_REMARK_UNWRAP_IMAGES._js_expr, is_default=True ), "rehype-katex@6.0.3": ImportVar( - tag=_REHYPE_KATEX._var_name, is_default=True + tag=_REHYPE_KATEX._js_expr, is_default=True ), "rehype-raw@6.1.1": ImportVar( - tag=_REHYPE_RAW._var_name, is_default=True + tag=_REHYPE_RAW._js_expr, is_default=True ), }, *[ @@ -205,9 +204,7 @@ class Markdown(Component): # If the children are set as a prop, don't pass them as children. children_prop = props.pop("children", None) if children_prop is not None: - special_props.append( - ImmutableVar.create_safe(f"children={{{str(children_prop)}}}") - ) + special_props.append(Var(_js_expr=f"children={{{str(children_prop)}}}")) children = [] # Get the component. component = self.component_map[tag](*children, **props).set( @@ -227,22 +224,22 @@ class Markdown(Component): """ return str(self.get_component(tag, **props)).replace("\n", "") - def format_component_map(self) -> dict[str, ImmutableVar]: + def format_component_map(self) -> dict[str, Var]: """Format the component map for rendering. Returns: The formatted component map. """ components = { - tag: ImmutableVar.create_safe( - f"(({{node, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => ({self.format_component(tag)}))" + tag: Var( + _js_expr=f"(({{node, {_CHILDREN._js_expr}, {_PROPS._js_expr}}}) => ({self.format_component(tag)}))" ) for tag in self.component_map } # Separate out inline code and code blocks. - components["code"] = ImmutableVar.create_safe( - f"""(({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{ + components["code"] = Var( + _js_expr=f"""(({{node, inline, className, {_CHILDREN._js_expr}, {_PROPS._js_expr}}}) => {{ const match = (className || '').match(/language-(?.*)/); const language = match ? match[1] : ''; if (language) {{ @@ -258,7 +255,7 @@ class Markdown(Component): return inline ? ( {self.format_component("code")} ) : ( - {self.format_component("codeblock", language=ImmutableVar.create_safe("language"))} + {self.format_component("codeblock", language=Var(_js_expr="language", _var_type=str))} ); }})""".replace("\n", " ") ) @@ -298,9 +295,7 @@ class Markdown(Component): .add_props( remark_plugins=_REMARK_PLUGINS, rehype_plugins=_REHYPE_PLUGINS, - components=ImmutableVar.create_safe( - f"{self._get_component_map_name()}()" - ), + components=Var(_js_expr=f"{self._get_component_map_name()}()"), ) .remove_props("componentMap", "componentMapHash") ) diff --git a/reflex/components/markdown/markdown.pyi b/reflex/components/markdown/markdown.pyi index e5f660b6c..611770a55 100644 --- a/reflex/components/markdown/markdown.pyi +++ b/reflex/components/markdown/markdown.pyi @@ -8,20 +8,20 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.utils.imports import ImportDict +from reflex.vars.base import LiteralVar, Var -_CHILDREN = ImmutableVar.create_safe("children") -_PROPS = ImmutableVar.create_safe("...props") -_PROPS_IN_TAG = ImmutableVar.create_safe("{...props}") -_MOCK_ARG = ImmutableVar.create_safe("") -_REMARK_MATH = ImmutableVar.create_safe("remarkMath") -_REMARK_GFM = ImmutableVar.create_safe("remarkGfm") -_REMARK_UNWRAP_IMAGES = ImmutableVar.create_safe("remarkUnwrapImages") +_CHILDREN = Var(_js_expr="children", _var_type=str) +_PROPS = Var(_js_expr="...props") +_PROPS_IN_TAG = Var(_js_expr="{...props}") +_MOCK_ARG = Var(_js_expr="", _var_type=str) +_REMARK_MATH = Var(_js_expr="remarkMath") +_REMARK_GFM = Var(_js_expr="remarkGfm") +_REMARK_UNWRAP_IMAGES = Var(_js_expr="remarkUnwrapImages") _REMARK_PLUGINS = LiteralVar.create([_REMARK_MATH, _REMARK_GFM, _REMARK_UNWRAP_IMAGES]) -_REHYPE_KATEX = ImmutableVar.create_safe("rehypeKatex") -_REHYPE_RAW = ImmutableVar.create_safe("rehypeRaw") +_REHYPE_KATEX = Var(_js_expr="rehypeKatex") +_REHYPE_RAW = Var(_js_expr="rehypeRaw") _REHYPE_PLUGINS = LiteralVar.create([_REHYPE_KATEX, _REHYPE_RAW]) NO_PROPS_TAGS = ("ul", "ol", "li") @@ -41,51 +41,41 @@ class Markdown(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Markdown": @@ -111,4 +101,4 @@ class Markdown(Component): def add_imports(self) -> ImportDict | list[ImportDict]: ... def get_component(self, tag: str, **props) -> Component: ... def format_component(self, tag: str, **props) -> str: ... - def format_component_map(self) -> dict[str, ImmutableVar]: ... + def format_component_map(self) -> dict[str, Var]: ... diff --git a/reflex/components/moment/moment.py b/reflex/components/moment/moment.py index 54411f870..da9949235 100644 --- a/reflex/components/moment/moment.py +++ b/reflex/components/moment/moment.py @@ -6,7 +6,7 @@ from typing import List, Optional from reflex.components.component import Component, NoSSRComponent from reflex.event import EventHandler from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var @dataclasses.dataclass(frozen=True) diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index 2a19bcd01..f0d747f77 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -8,10 +8,9 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var @dataclasses.dataclass(frozen=True) class MomentDelta: @@ -36,8 +35,8 @@ class Moment(NoSSRComponent): format: Optional[Union[Var[str], str]] = None, trim: Optional[Union[Var[bool], bool]] = None, parse: Optional[Union[Var[str], str]] = None, - add: Optional[Union[Var[MomentDelta], MomentDelta]] = None, - subtract: Optional[Union[Var[MomentDelta], MomentDelta]] = None, + add: Optional[Union[MomentDelta, Var[MomentDelta]]] = None, + subtract: Optional[Union[MomentDelta, Var[MomentDelta]]] = None, from_now: Optional[Union[Var[bool], bool]] = None, from_now_during: Optional[Union[Var[int], int]] = None, to_now: Optional[Union[Var[bool], bool]] = None, @@ -57,54 +56,42 @@ class Moment(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Moment": diff --git a/reflex/components/next/base.pyi b/reflex/components/next/base.pyi index 996ed41e8..af8064aaf 100644 --- a/reflex/components/next/base.pyi +++ b/reflex/components/next/base.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class NextComponent(Component): ... @@ -23,51 +23,41 @@ class NextComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextComponent": diff --git a/reflex/components/next/image.py b/reflex/components/next/image.py index 817bf590a..9e2f71821 100644 --- a/reflex/components/next/image.py +++ b/reflex/components/next/image.py @@ -4,7 +4,7 @@ from typing import Any, Literal, Optional, Union from reflex.event import EventHandler from reflex.utils import types -from reflex.vars import Var +from reflex.vars.base import Var from .base import NextComponent diff --git a/reflex/components/next/image.pyi b/reflex/components/next/image.pyi index 695a8d80e..7786c8a4b 100644 --- a/reflex/components/next/image.pyi +++ b/reflex/components/next/image.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import NextComponent @@ -20,16 +19,16 @@ class Image(NextComponent): *children, width: Optional[Union[int, str]] = None, height: Optional[Union[int, str]] = None, - src: Optional[Union[Var[Any], Any]] = None, + src: Optional[Union[Any, Var[Any]]] = None, alt: Optional[Union[Var[str], str]] = None, - loader: Optional[Union[Var[Any], Any]] = None, + loader: Optional[Union[Any, Var[Any]]] = None, fill: Optional[Union[Var[bool], bool]] = None, sizes: Optional[Union[Var[str], str]] = None, quality: Optional[Union[Var[int], int]] = None, priority: Optional[Union[Var[bool], bool]] = None, placeholder: Optional[Union[Var[str], str]] = None, loading: Optional[ - Union[Var[Literal["lazy", "eager"]], Literal["lazy", "eager"]] + Union[Literal["eager", "lazy"], Var[Literal["eager", "lazy"]]] ] = None, blurDataURL: Optional[Union[Var[str], str]] = None, style: Optional[Style] = None, @@ -37,57 +36,43 @@ class Image(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_load: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Image": diff --git a/reflex/components/next/link.py b/reflex/components/next/link.py index be32cd8e5..0f7c81296 100644 --- a/reflex/components/next/link.py +++ b/reflex/components/next/link.py @@ -1,7 +1,7 @@ """A link component.""" from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class NextLink(Component): diff --git a/reflex/components/next/link.pyi b/reflex/components/next/link.pyi index 0aa6e4127..2a3207956 100644 --- a/reflex/components/next/link.pyi +++ b/reflex/components/next/link.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class NextLink(Component): @overload @@ -24,51 +23,41 @@ class NextLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextLink": diff --git a/reflex/components/next/video.py b/reflex/components/next/video.py index ae6007671..435f4401f 100644 --- a/reflex/components/next/video.py +++ b/reflex/components/next/video.py @@ -3,7 +3,7 @@ from typing import Optional from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var from .base import NextComponent diff --git a/reflex/components/next/video.pyi b/reflex/components/next/video.pyi index f1f1b94de..842e27d22 100644 --- a/reflex/components/next/video.pyi +++ b/reflex/components/next/video.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import NextComponent @@ -26,51 +25,41 @@ class Video(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Video": diff --git a/reflex/components/plotly/plotly.py b/reflex/components/plotly/plotly.py index c226e6e95..eb12bbc1c 100644 --- a/reflex/components/plotly/plotly.py +++ b/reflex/components/plotly/plotly.py @@ -8,9 +8,8 @@ from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.components.core.cond import color_mode_cond from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import console -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var try: from plotly.graph_objects import Figure, layout @@ -31,7 +30,7 @@ def _event_data_signature(e0: Var) -> List[Any]: Returns: The event key extracted from the event data (if defined). """ - return [ImmutableVar.create_safe(f"{e0}?.event")] + return [Var(_js_expr=f"{e0}?.event")] def _event_points_data_signature(e0: Var) -> List[Any]: @@ -44,8 +43,8 @@ def _event_points_data_signature(e0: Var) -> List[Any]: The event data and the extracted points. """ return [ - ImmutableVar.create_safe(f"{e0}?.event"), - ImmutableVar.create_safe(f"extractPoints({e0}?.points)"), + Var(_js_expr=f"{e0}?.event"), + Var(_js_expr=f"extractPoints({e0}?.points)"), ] @@ -102,13 +101,13 @@ class Plotly(NoSSRComponent): is_default = True # The figure to display. This can be a plotly figure or a plotly data json. - data: Var[Figure] + data: Var[Figure] # type: ignore # The layout of the graph. layout: Var[Dict] # The template for visual appearance of the graph. - template: Var[Template] + template: Var[Template] # type: ignore # The config of the graph. config: Var[Dict] @@ -243,7 +242,7 @@ const extractPoints = (points) => { light=LiteralVar.create(templates["plotly"]), dark=LiteralVar.create(templates["plotly_dark"]), ) - if isinstance(responsive_template, ImmutableVar): + if isinstance(responsive_template, Var): # Mark the conditional Var as a Template to avoid type mismatch responsive_template = responsive_template.to(Template) props.setdefault("template", responsive_template) @@ -255,7 +254,7 @@ const extractPoints = (points) => { def _render(self): tag = super()._render() - figure = self.data.upcast().to(dict) + figure = self.data.to(dict) merge_dicts = [] # Data will be merged and spread from these dict Vars if self.layout is not None: # Why is this not a literal dict? Great question... it didn't work @@ -269,12 +268,12 @@ const extractPoints = (points) => { if merge_dicts: tag.special_props.append( # Merge all dictionaries and spread the result over props. - ImmutableVar.create_safe( - f"{{...mergician({str(figure)}," + Var( + _js_expr=f"{{...mergician({str(figure)}," f"{','.join(str(md) for md in merge_dicts)})}}", ), ) else: # Spread the figure dict over props, nothing to merge. - tag.special_props.append(ImmutableVar.create_safe(f"{{...{str(figure)}}}")) + tag.special_props.append(Var(_js_expr=f"{{...{str(figure)}}}")) return tag diff --git a/reflex/components/plotly/plotly.pyi b/reflex/components/plotly/plotly.pyi index 48797a7ef..c8be366c8 100644 --- a/reflex/components/plotly/plotly.pyi +++ b/reflex/components/plotly/plotly.pyi @@ -8,10 +8,9 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils import console -from reflex.vars import Var +from reflex.vars.base import Var try: from plotly.graph_objects import Figure, layout @@ -35,115 +34,101 @@ class Plotly(NoSSRComponent): def create( # type: ignore cls, *children, - data: Optional[Union[Var[Figure], Figure]] = None, # type: ignore - layout: Optional[Union[Var[Dict], Dict]] = None, - template: Optional[Union[Var[Template], Template]] = None, # type: ignore - config: Optional[Union[Var[Dict], Dict]] = None, + data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore + layout: Optional[Union[Dict, Var[Dict]]] = None, + template: Optional[Union[Template, Var[Template]]] = None, # type: ignore + config: Optional[Union[Dict, Var[Dict]]] = None, use_resize_handler: 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[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_after_plot: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animated: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animating_frame: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_autosize: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_before_hover: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_button_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_deselect: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_hover: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_hover: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_redraw: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_redraw: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_relayout: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_relayouting: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_restyle: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selected: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_selecting: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_transition_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_transitioning: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_unhover: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Plotly": diff --git a/reflex/components/props.py b/reflex/components/props.py index 8736eca72..92dbe8144 100644 --- a/reflex/components/props.py +++ b/reflex/components/props.py @@ -3,8 +3,8 @@ from __future__ import annotations from reflex.base import Base -from reflex.ivars.object import LiteralObjectVar from reflex.utils import format +from reflex.vars.object import LiteralObjectVar class PropsBase(Base): diff --git a/reflex/components/radix/primitives/accordion.py b/reflex/components/radix/primitives/accordion.py index cfd5808a6..40cbfa2a7 100644 --- a/reflex/components/radix/primitives/accordion.py +++ b/reflex/components/radix/primitives/accordion.py @@ -11,9 +11,9 @@ from reflex.components.lucide.icon import Icon from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import LiteralAccentColor, LiteralRadius from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style -from reflex.vars import Var, get_uuid_string_var +from reflex.vars import get_uuid_string_var +from reflex.vars.base import LiteralVar, Var LiteralAccordionType = Literal["single", "multiple"] LiteralAccordionDir = Literal["ltr", "rtl"] @@ -193,8 +193,8 @@ class AccordionItem(AccordionComponent): def create( cls, *children, - header: Optional[Component | ImmutableVar] = None, - content: Optional[Component | ImmutableVar] = None, + header: Optional[Component | Var] = None, + content: Optional[Component | Var] = None, **props, ) -> Component: """Create an accordion item. diff --git a/reflex/components/radix/primitives/accordion.pyi b/reflex/components/radix/primitives/accordion.pyi index 651e16b34..5d86636ad 100644 --- a/reflex/components/radix/primitives/accordion.pyi +++ b/reflex/components/radix/primitives/accordion.pyi @@ -9,9 +9,8 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var LiteralAccordionType = Literal["single", "multiple"] LiteralAccordionDir = Literal["ltr", "rtl"] @@ -29,70 +28,70 @@ class AccordionComponent(RadixPrimitiveComponent): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["classic", "soft", "surface", "outline", "ghost"]], - Literal["classic", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "surface"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -101,51 +100,41 @@ class AccordionComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionComponent": @@ -177,25 +166,25 @@ class AccordionRoot(AccordionComponent): cls, *children, type: Optional[ - Union[Var[Literal["single", "multiple"]], Literal["single", "multiple"]] + Union[Literal["multiple", "single"], Var[Literal["multiple", "single"]]] ] = None, - value: Optional[Union[Var[Union[List[str], str]], str, List[str]]] = None, + value: Optional[Union[List[str], Var[Union[List[str], str]], str]] = None, default_value: Optional[ - Union[Var[Union[List[str], str]], str, List[str]] + Union[List[str], Var[Union[List[str], str]], str] ] = None, collapsible: Optional[Union[Var[bool], bool]] = None, disabled: Optional[Union[Var[bool], bool]] = None, - dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None, orientation: Optional[ Union[ - Var[Literal["vertical", "horizontal"]], - Literal["vertical", "horizontal"], + Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, radius: Optional[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, duration: Optional[Union[Var[int], int]] = None, @@ -203,70 +192,70 @@ class AccordionRoot(AccordionComponent): show_dividers: Optional[Union[Var[bool], bool]] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["classic", "soft", "surface", "outline", "ghost"]], - Literal["classic", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "surface"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -275,54 +264,44 @@ class AccordionRoot(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionRoot": @@ -363,76 +342,76 @@ class AccordionItem(AccordionComponent): def create( # type: ignore cls, *children, - header: Optional[Union[Component, ImmutableVar]] = None, - content: Optional[Union[Component, ImmutableVar]] = None, + header: Optional[Union[Component, Var]] = None, + content: Optional[Union[Component, Var]] = None, value: Optional[Union[Var[str], str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["classic", "soft", "surface", "outline", "ghost"]], - Literal["classic", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "surface"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -441,51 +420,41 @@ class AccordionItem(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionItem": @@ -523,70 +492,70 @@ class AccordionHeader(AccordionComponent): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["classic", "soft", "surface", "outline", "ghost"]], - Literal["classic", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "surface"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -595,51 +564,41 @@ class AccordionHeader(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionHeader": @@ -673,70 +632,70 @@ class AccordionTrigger(AccordionComponent): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["classic", "soft", "surface", "outline", "ghost"]], - Literal["classic", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "surface"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -745,51 +704,41 @@ class AccordionTrigger(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionTrigger": @@ -827,51 +776,41 @@ class AccordionIcon(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionIcon": @@ -902,70 +841,70 @@ class AccordionContent(AccordionComponent): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["classic", "soft", "surface", "outline", "ghost"]], - Literal["classic", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "surface"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -974,51 +913,41 @@ class AccordionContent(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionContent": diff --git a/reflex/components/radix/primitives/base.py b/reflex/components/radix/primitives/base.py index 857e80b5a..479cd2912 100644 --- a/reflex/components/radix/primitives/base.py +++ b/reflex/components/radix/primitives/base.py @@ -5,7 +5,7 @@ from typing import List from reflex.components.component import Component from reflex.components.tags.tag import Tag from reflex.utils import format -from reflex.vars import Var +from reflex.vars.base import Var class RadixPrimitiveComponent(Component): diff --git a/reflex/components/radix/primitives/base.pyi b/reflex/components/radix/primitives/base.pyi index 1241044d2..3f1194424 100644 --- a/reflex/components/radix/primitives/base.pyi +++ b/reflex/components/radix/primitives/base.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class RadixPrimitiveComponent(Component): @overload @@ -23,51 +22,41 @@ class RadixPrimitiveComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixPrimitiveComponent": @@ -101,51 +90,41 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixPrimitiveComponentWithClassName": diff --git a/reflex/components/radix/primitives/drawer.py b/reflex/components/radix/primitives/drawer.py index 1c8a91837..b814e878f 100644 --- a/reflex/components/radix/primitives/drawer.py +++ b/reflex/components/radix/primitives/drawer.py @@ -11,7 +11,7 @@ from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import Theme from reflex.components.radix.themes.layout.flex import Flex from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class DrawerComponent(RadixPrimitiveComponent): diff --git a/reflex/components/radix/primitives/drawer.pyi b/reflex/components/radix/primitives/drawer.pyi index ddb770b36..269d86d47 100644 --- a/reflex/components/radix/primitives/drawer.pyi +++ b/reflex/components/radix/primitives/drawer.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class DrawerComponent(RadixPrimitiveComponent): @overload @@ -24,51 +23,41 @@ class DrawerComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerComponent": @@ -107,8 +96,8 @@ class DrawerRoot(DrawerComponent): modal: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ - Var[Literal["top", "bottom", "left", "right"]], - Literal["top", "bottom", "left", "right"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, preventScrollRestoration: Optional[Union[Var[bool], bool]] = None, @@ -118,54 +107,44 @@ class DrawerRoot(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerRoot": @@ -208,51 +187,41 @@ class DrawerTrigger(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerTrigger": @@ -279,51 +248,41 @@ class DrawerPortal(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerPortal": @@ -357,66 +316,56 @@ class DrawerContent(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerContent": @@ -454,51 +403,41 @@ class DrawerOverlay(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerOverlay": @@ -532,51 +471,41 @@ class DrawerClose(DrawerTrigger): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerClose": @@ -603,51 +532,41 @@ class DrawerTitle(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerTitle": @@ -681,51 +600,41 @@ class DrawerDescription(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerDescription": @@ -769,8 +678,8 @@ class Drawer(ComponentNamespace): modal: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ - Var[Literal["top", "bottom", "left", "right"]], - Literal["top", "bottom", "left", "right"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, preventScrollRestoration: Optional[Union[Var[bool], bool]] = None, @@ -780,54 +689,44 @@ class Drawer(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerRoot": diff --git a/reflex/components/radix/primitives/form.py b/reflex/components/radix/primitives/form.py index 3b871d0af..63a4056e0 100644 --- a/reflex/components/radix/primitives/form.py +++ b/reflex/components/radix/primitives/form.py @@ -9,7 +9,7 @@ from reflex.components.core.debounce import DebounceInput from reflex.components.el.elements.forms import Form as HTMLForm from reflex.components.radix.themes.components.text_field import TextFieldRoot from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from .base import RadixPrimitiveComponentWithClassName diff --git a/reflex/components/radix/primitives/form.pyi b/reflex/components/radix/primitives/form.pyi index 20df4b85a..75efc1a3f 100644 --- a/reflex/components/radix/primitives/form.pyi +++ b/reflex/components/radix/primitives/form.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.el.elements.forms import Form as HTMLForm from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .base import RadixPrimitiveComponentWithClassName @@ -26,51 +25,41 @@ class FormComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormComponent": @@ -100,101 +89,89 @@ class FormRoot(FormComponent, HTMLForm): cls, *children, as_child: Optional[Union[Var[bool], bool]] = None, - accept: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, accept_charset: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - enc_type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - no_validate: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + enc_type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + no_validate: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, reset_on_submit: Optional[Union[Var[bool], bool]] = None, handle_submit_unique_name: Optional[Union[Var[str], str]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_submit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormRoot": @@ -258,51 +235,41 @@ class FormField(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormField": @@ -339,51 +306,41 @@ class FormLabel(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormLabel": @@ -417,51 +374,41 @@ class FormControl(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormControl": @@ -510,6 +457,18 @@ class FormMessage(FormComponent): name: Optional[Union[Var[str], str]] = None, match: Optional[ Union[ + Literal[ + "badInput", + "patternMismatch", + "rangeOverflow", + "rangeUnderflow", + "stepMismatch", + "tooLong", + "tooShort", + "typeMismatch", + "valid", + "valueMissing", + ], Var[ Literal[ "badInput", @@ -524,18 +483,6 @@ class FormMessage(FormComponent): "valueMissing", ] ], - Literal[ - "badInput", - "patternMismatch", - "rangeOverflow", - "rangeUnderflow", - "stepMismatch", - "tooLong", - "tooShort", - "typeMismatch", - "valid", - "valueMissing", - ], ] ] = None, force_match: Optional[Union[Var[bool], bool]] = None, @@ -545,51 +492,41 @@ class FormMessage(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormMessage": @@ -626,51 +563,41 @@ class FormValidityState(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormValidityState": @@ -704,51 +631,41 @@ class FormSubmit(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormSubmit": @@ -779,101 +696,89 @@ class Form(FormRoot): cls, *children, as_child: Optional[Union[Var[bool], bool]] = None, - accept: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, accept_charset: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - enc_type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - no_validate: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + enc_type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + no_validate: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, reset_on_submit: Optional[Union[Var[bool], bool]] = None, handle_submit_unique_name: Optional[Union[Var[str], str]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_submit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Form": @@ -935,101 +840,89 @@ class FormNamespace(ComponentNamespace): def __call__( *children, as_child: Optional[Union[Var[bool], bool]] = None, - accept: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, accept_charset: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - enc_type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - no_validate: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + enc_type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + no_validate: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, reset_on_submit: Optional[Union[Var[bool], bool]] = None, handle_submit_unique_name: Optional[Union[Var[str], str]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_submit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Form": diff --git a/reflex/components/radix/primitives/progress.py b/reflex/components/radix/primitives/progress.py index 976daf505..72aee1038 100644 --- a/reflex/components/radix/primitives/progress.py +++ b/reflex/components/radix/primitives/progress.py @@ -9,7 +9,7 @@ from reflex.components.core.colors import color from reflex.components.radix.primitives.accordion import DEFAULT_ANIMATION_DURATION from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.components.radix.themes.base import LiteralAccentColor, LiteralRadius -from reflex.vars import Var +from reflex.vars.base import Var class ProgressComponent(RadixPrimitiveComponentWithClassName): diff --git a/reflex/components/radix/primitives/progress.pyi b/reflex/components/radix/primitives/progress.pyi index 630432aba..4e185a903 100644 --- a/reflex/components/radix/primitives/progress.pyi +++ b/reflex/components/radix/primitives/progress.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class ProgressComponent(RadixPrimitiveComponentWithClassName): @overload @@ -24,51 +23,41 @@ class ProgressComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ProgressComponent": @@ -99,8 +88,8 @@ class ProgressRoot(ProgressComponent): *children, radius: Optional[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -109,51 +98,41 @@ class ProgressRoot(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ProgressRoot": @@ -187,63 +166,63 @@ class ProgressIndicator(ProgressComponent): max: Optional[Union[Var[Optional[int]], int]] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -253,51 +232,41 @@ class ProgressIndicator(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ProgressIndicator": @@ -330,63 +299,63 @@ class Progress(ProgressRoot): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -394,8 +363,8 @@ class Progress(ProgressRoot): max: Optional[Union[Var[Optional[int]], int]] = None, radius: Optional[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -404,51 +373,41 @@ class Progress(ProgressRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": @@ -482,63 +441,63 @@ class ProgressNamespace(ComponentNamespace): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -546,8 +505,8 @@ class ProgressNamespace(ComponentNamespace): max: Optional[Union[Var[Optional[int]], int]] = None, radius: Optional[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, @@ -556,51 +515,41 @@ class ProgressNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/primitives/slider.py b/reflex/components/radix/primitives/slider.py index b8abd23b5..dd3108f0e 100644 --- a/reflex/components/radix/primitives/slider.py +++ b/reflex/components/radix/primitives/slider.py @@ -7,7 +7,7 @@ from typing import Any, List, Literal from reflex.components.component import Component, ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var LiteralSliderOrientation = Literal["horizontal", "vertical"] LiteralSliderDir = Literal["ltr", "rtl"] diff --git a/reflex/components/radix/primitives/slider.pyi b/reflex/components/radix/primitives/slider.pyi index e3bd27805..782a83776 100644 --- a/reflex/components/radix/primitives/slider.pyi +++ b/reflex/components/radix/primitives/slider.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var LiteralSliderOrientation = Literal["horizontal", "vertical"] LiteralSliderDir = Literal["ltr", "rtl"] @@ -27,51 +26,41 @@ class SliderComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderComponent": @@ -100,17 +89,17 @@ class SliderRoot(SliderComponent): def create( # type: ignore cls, *children, - default_value: Optional[Union[Var[List[int]], List[int]]] = None, - value: Optional[Union[Var[List[int]], List[int]]] = None, + default_value: Optional[Union[List[int], Var[List[int]]]] = None, + value: Optional[Union[List[int], Var[List[int]]]] = None, name: Optional[Union[Var[str], str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, orientation: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None, inverted: Optional[Union[Var[bool], bool]] = None, min: Optional[Union[Var[int], int]] = None, max: Optional[Union[Var[int], int]] = None, @@ -122,57 +111,47 @@ class SliderRoot(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderRoot": @@ -207,51 +186,41 @@ class SliderTrack(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderTrack": @@ -286,51 +255,41 @@ class SliderRange(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderRange": @@ -365,51 +324,41 @@ class SliderThumb(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderThumb": diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index 82bb3c036..e41c5e7b0 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -7,9 +7,8 @@ from typing import Any, Dict, Literal from reflex.components import Component from reflex.components.tags import Tag from reflex.config import get_config -from reflex.ivars.base import ImmutableVar from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars import Var +from reflex.vars.base import Var LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"] LiteralJustify = Literal["start", "center", "end", "between"] @@ -236,8 +235,8 @@ class Theme(RadixThemesComponent): def _render(self, props: dict[str, Any] | None = None) -> Tag: tag = super()._render(props) tag.add_props( - css=ImmutableVar.create( - f"{{...theme.styles.global[':root'], ...theme.styles.global.body}}" + css=Var( + _js_expr=f"{{...theme.styles.global[':root'], ...theme.styles.global.body}}" ), ) return tag diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index fd0b7e092..da3c922e9 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -7,10 +7,9 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components import Component from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"] LiteralJustify = Literal["start", "center", "end", "between"] @@ -58,44 +57,44 @@ class CommonMarginProps(Component): *children, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], 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[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], 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, @@ -103,51 +102,41 @@ class CommonMarginProps(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CommonMarginProps": @@ -187,51 +176,41 @@ class RadixLoadingProp(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixLoadingProp": @@ -264,51 +243,41 @@ class RadixThemesComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixThemesComponent": @@ -343,51 +312,41 @@ class RadixThemesTriggerComponent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixThemesTriggerComponent": @@ -408,96 +367,96 @@ class Theme(RadixThemesComponent): def create( # type: ignore cls, *children, - color_mode: Optional[Literal["inherit", "light", "dark"]] = None, + color_mode: Optional[Literal["dark", "inherit", "light"]] = None, theme_panel: Optional[bool] = False, has_background: Optional[Union[Var[bool], bool]] = None, appearance: Optional[ Union[ - Var[Literal["inherit", "light", "dark"]], - Literal["inherit", "light", "dark"], + Literal["dark", "inherit", "light"], + Var[Literal["dark", "inherit", "light"]], ] ] = None, accent_color: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"]], - Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"], + Literal["auto", "gray", "mauve", "olive", "sage", "sand", "slate"], + Var[Literal["auto", "gray", "mauve", "olive", "sage", "sand", "slate"]], ] ] = None, panel_background: Optional[ - Union[Var[Literal["solid", "translucent"]], Literal["solid", "translucent"]] + Union[Literal["solid", "translucent"], Var[Literal["solid", "translucent"]]] ] = None, radius: Optional[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, scaling: Optional[ Union[ - Var[Literal["90%", "95%", "100%", "105%", "110%"]], - Literal["90%", "95%", "100%", "105%", "110%"], + Literal["100%", "105%", "110%", "90%", "95%"], + Var[Literal["100%", "105%", "110%", "90%", "95%"]], ] ] = None, style: Optional[Style] = None, @@ -505,51 +464,41 @@ class Theme(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Theme": @@ -594,51 +543,41 @@ class ThemePanel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ThemePanel": @@ -674,51 +613,41 @@ class RadixThemesColorModeProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixThemesColorModeProvider": diff --git a/reflex/components/radix/themes/color_mode.py b/reflex/components/radix/themes/color_mode.py index 2e6707d01..b1083ba94 100644 --- a/reflex/components/radix/themes/color_mode.py +++ b/reflex/components/radix/themes/color_mode.py @@ -24,8 +24,6 @@ from reflex.components.core.cond import Cond, color_mode_cond, cond from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.dropdown_menu import dropdown_menu from reflex.components.radix.themes.components.switch import Switch -from reflex.ivars.base import ImmutableVar -from reflex.ivars.sequence import LiteralArrayVar from reflex.style import ( LIGHT_COLOR_MODE, color_mode, @@ -33,6 +31,8 @@ from reflex.style import ( set_color_mode, toggle_color_mode, ) +from reflex.vars.base import Var +from reflex.vars.sequence import LiteralArrayVar from .components.icon_button import IconButton @@ -114,7 +114,7 @@ class ColorModeIconButton(IconButton): The button component. """ # position is used to set nice defaults for positioning the icon button - if isinstance(position, ImmutableVar): + if isinstance(position, Var): _set_var_default(props, position, "position", "fixed", position) _set_var_default(props, position, "bottom", "2rem") _set_var_default(props, position, "top", "2rem") @@ -184,7 +184,7 @@ class ColorModeSwitch(Switch): ) -class ColorModeNamespace(ImmutableVar): +class ColorModeNamespace(Var): """Namespace for color mode components.""" icon = staticmethod(ColorModeIcon.create) @@ -193,7 +193,7 @@ class ColorModeNamespace(ImmutableVar): color_mode = color_mode_var_and_namespace = ColorModeNamespace( - _var_name=color_mode._var_name, + _js_expr=color_mode._js_expr, _var_type=color_mode._var_type, _var_data=color_mode.get_default_value(), ) diff --git a/reflex/components/radix/themes/color_mode.pyi b/reflex/components/radix/themes/color_mode.pyi index 8712e526b..d41019747 100644 --- a/reflex/components/radix/themes/color_mode.pyi +++ b/reflex/components/radix/themes/color_mode.pyi @@ -20,12 +20,11 @@ from reflex.components.core.cond import Cond from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.switch import Switch from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import ( Style, color_mode, ) -from reflex.vars import Var +from reflex.vars.base import Var from .components.icon_button import IconButton @@ -38,7 +37,7 @@ class ColorModeIcon(Cond): def create( # type: ignore cls, *children, - cond: Optional[Union[Var[Any], Any]] = None, + cond: Optional[Union[Any, Var[Any]]] = None, comp1: Optional[BaseComponent] = None, comp2: Optional[BaseComponent] = None, style: Optional[Style] = None, @@ -46,51 +45,41 @@ class ColorModeIcon(Cond): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ColorModeIcon": @@ -118,181 +107,171 @@ class ColorModeIconButton(IconButton): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], - Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "solid", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, - auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form_action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_enc_type: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_no_validate: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ColorModeIconButton": @@ -363,87 +342,87 @@ class ColorModeSwitch(Switch): value: Optional[Union[Var[str], str]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "full"]], Literal["none", "small", "full"] + Literal["full", "none", "small"], Var[Literal["full", "none", "small"]] ] ] = None, style: Optional[Style] = None, @@ -451,54 +430,42 @@ class ColorModeSwitch(Switch): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ColorModeSwitch": @@ -531,13 +498,13 @@ class ColorModeSwitch(Switch): """ ... -class ColorModeNamespace(ImmutableVar): +class ColorModeNamespace(Var): icon = staticmethod(ColorModeIcon.create) button = staticmethod(ColorModeIconButton.create) switch = staticmethod(ColorModeSwitch.create) color_mode = color_mode_var_and_namespace = ColorModeNamespace( - _var_name=color_mode._var_name, + _js_expr=color_mode._js_expr, _var_type=color_mode._var_type, _var_data=color_mode.get_default_value(), ) diff --git a/reflex/components/radix/themes/components/alert_dialog.py b/reflex/components/radix/themes/components/alert_dialog.py index e8dfb57b2..ca876b4c3 100644 --- a/reflex/components/radix/themes/components/alert_dialog.py +++ b/reflex/components/radix/themes/components/alert_dialog.py @@ -6,7 +6,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent, RadixThemesTriggerComponent diff --git a/reflex/components/radix/themes/components/alert_dialog.pyi b/reflex/components/radix/themes/components/alert_dialog.pyi index 8d135e6f8..019b3f89b 100644 --- a/reflex/components/radix/themes/components/alert_dialog.pyi +++ b/reflex/components/radix/themes/components/alert_dialog.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent, RadixThemesTriggerComponent @@ -29,54 +28,44 @@ class AlertDialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogRoot": @@ -112,51 +101,41 @@ class AlertDialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogTrigger": @@ -179,100 +158,90 @@ class AlertDialogContent(elements.Div, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, force_mount: Optional[Union[Var[bool], bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogContent": @@ -325,51 +294,41 @@ class AlertDialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogTitle": @@ -404,51 +363,41 @@ class AlertDialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogDescription": @@ -483,51 +432,41 @@ class AlertDialogAction(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogAction": @@ -553,51 +492,41 @@ class AlertDialogCancel(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogCancel": diff --git a/reflex/components/radix/themes/components/aspect_ratio.py b/reflex/components/radix/themes/components/aspect_ratio.py index b06b2d564..fc8052c85 100644 --- a/reflex/components/radix/themes/components/aspect_ratio.py +++ b/reflex/components/radix/themes/components/aspect_ratio.py @@ -2,7 +2,7 @@ from typing import Union -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent diff --git a/reflex/components/radix/themes/components/aspect_ratio.pyi b/reflex/components/radix/themes/components/aspect_ratio.pyi index 6ca61f67c..024261d91 100644 --- a/reflex/components/radix/themes/components/aspect_ratio.pyi +++ b/reflex/components/radix/themes/components/aspect_ratio.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -24,51 +23,41 @@ class AspectRatio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AspectRatio": diff --git a/reflex/components/radix/themes/components/avatar.py b/reflex/components/radix/themes/components/avatar.py index 22482f0c9..4f3956e76 100644 --- a/reflex/components/radix/themes/components/avatar.py +++ b/reflex/components/radix/themes/components/avatar.py @@ -3,7 +3,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi index 9a92c73f5..ee6ef6e31 100644 --- a/reflex/components/radix/themes/components/avatar.pyi +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,10 +21,12 @@ class Avatar(RadixThemesComponent): cls, *children, variant: Optional[ - Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] + Union[Literal["soft", "solid"], Var[Literal["soft", "solid"]]] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -34,77 +35,75 @@ class Avatar(RadixThemesComponent): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, src: Optional[Union[Var[str], str]] = None, @@ -114,51 +113,41 @@ class Avatar(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Avatar": diff --git a/reflex/components/radix/themes/components/badge.py b/reflex/components/radix/themes/components/badge.py index fd26b17ab..9391e53c3 100644 --- a/reflex/components/radix/themes/components/badge.py +++ b/reflex/components/radix/themes/components/badge.py @@ -4,7 +4,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi index c2936210a..d5c2f2697 100644 --- a/reflex/components/radix/themes/components/badge.pyi +++ b/reflex/components/radix/themes/components/badge.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,164 +21,154 @@ class Badge(elements.Span, RadixThemesComponent): *children, variant: Optional[ Union[ - Var[Literal["solid", "soft", "surface", "outline"]], - Literal["solid", "soft", "surface", "outline"], + Literal["outline", "soft", "solid", "surface"], + Var[Literal["outline", "soft", "solid", "surface"]], ] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Badge": diff --git a/reflex/components/radix/themes/components/button.py b/reflex/components/radix/themes/components/button.py index 0c52e6ec6..cb44ee684 100644 --- a/reflex/components/radix/themes/components/button.py +++ b/reflex/components/radix/themes/components/button.py @@ -4,7 +4,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi index 145de6452..de9651dd9 100644 --- a/reflex/components/radix/themes/components/button.pyi +++ b/reflex/components/radix/themes/components/button.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixLoadingProp, @@ -28,181 +27,171 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], - Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "solid", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, - auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form_action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_enc_type: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_no_validate: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Button": diff --git a/reflex/components/radix/themes/components/callout.py b/reflex/components/radix/themes/components/callout.py index ea8be4623..926e0ad54 100644 --- a/reflex/components/radix/themes/components/callout.py +++ b/reflex/components/radix/themes/components/callout.py @@ -7,7 +7,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements from reflex.components.lucide.icon import Icon -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi index 4bd7a54a3..5caa825d6 100644 --- a/reflex/components/radix/themes/components/callout.pyi +++ b/reflex/components/radix/themes/components/callout.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -26,158 +25,148 @@ class CalloutRoot(elements.Div, RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["soft", "surface", "outline"]], - Literal["soft", "surface", "outline"], + Literal["outline", "soft", "surface"], + Var[Literal["outline", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CalloutRoot": @@ -228,80 +217,70 @@ class CalloutIcon(elements.Div, RadixThemesComponent): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CalloutIcon": @@ -347,80 +326,70 @@ class CalloutText(elements.P, RadixThemesComponent): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CalloutText": @@ -471,158 +440,148 @@ class Callout(CalloutRoot): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["soft", "surface", "outline"]], - Literal["soft", "surface", "outline"], + Literal["outline", "soft", "surface"], + Var[Literal["outline", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Callout": @@ -679,158 +638,148 @@ class CalloutNamespace(ComponentNamespace): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["soft", "surface", "outline"]], - Literal["soft", "surface", "outline"], + Literal["outline", "soft", "surface"], + Var[Literal["outline", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Callout": diff --git a/reflex/components/radix/themes/components/card.py b/reflex/components/radix/themes/components/card.py index 574336b1b..4983cdd41 100644 --- a/reflex/components/radix/themes/components/card.py +++ b/reflex/components/radix/themes/components/card.py @@ -4,7 +4,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi index ed4399ecc..d2bc6f68c 100644 --- a/reflex/components/radix/themes/components/card.pyi +++ b/reflex/components/radix/themes/components/card.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -23,96 +22,86 @@ class Card(elements.Div, RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5"]], + Literal["1", "2", "3", "4", "5"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4", "5"]], Literal["1", "2", "3", "4", "5"], ] ], - Literal["1", "2", "3", "4", "5"], - Breakpoints[str, Literal["1", "2", "3", "4", "5"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["surface", "classic", "ghost"]], - Literal["surface", "classic", "ghost"], + Literal["classic", "ghost", "surface"], + Var[Literal["classic", "ghost", "surface"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Card": diff --git a/reflex/components/radix/themes/components/checkbox.py b/reflex/components/radix/themes/components/checkbox.py index f191ce613..6ba1b04da 100644 --- a/reflex/components/radix/themes/components/checkbox.py +++ b/reflex/components/radix/themes/components/checkbox.py @@ -7,8 +7,7 @@ from reflex.components.core.breakpoints import Responsive from reflex.components.radix.themes.layout.flex import Flex from reflex.components.radix.themes.typography.text import Text from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index 0498f5a90..978c3e8c2 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -26,80 +25,80 @@ class Checkbox(RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -115,54 +114,42 @@ class Checkbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Checkbox": @@ -206,79 +193,79 @@ class HighLevelCheckbox(RadixThemesComponent): text: Optional[Union[Var[str], str]] = None, spacing: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, size: Optional[ - Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -294,54 +281,42 @@ class HighLevelCheckbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelCheckbox": @@ -382,79 +357,79 @@ class CheckboxNamespace(ComponentNamespace): text: Optional[Union[Var[str], str]] = None, spacing: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, size: Optional[ - Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -470,54 +445,42 @@ class CheckboxNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelCheckbox": diff --git a/reflex/components/radix/themes/components/checkbox_cards.py b/reflex/components/radix/themes/components/checkbox_cards.py index d5042c355..5f5fc3ae3 100644 --- a/reflex/components/radix/themes/components/checkbox_cards.py +++ b/reflex/components/radix/themes/components/checkbox_cards.py @@ -4,7 +4,7 @@ from types import SimpleNamespace from typing import Literal, Union from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/checkbox_cards.pyi b/reflex/components/radix/themes/components/checkbox_cards.pyi index 519a5587d..086630a3b 100644 --- a/reflex/components/radix/themes/components/checkbox_cards.pyi +++ b/reflex/components/radix/themes/components/checkbox_cards.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,83 +21,88 @@ class CheckboxCardsRoot(RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ - Union[Var[Literal["classic", "surface"]], Literal["classic", "surface"]] + Union[Literal["classic", "surface"], Var[Literal["classic", "surface"]]] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, columns: Optional[ Union[ + Breakpoints[ + str, + Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], + ], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -113,15 +117,15 @@ class CheckboxCardsRoot(RadixThemesComponent): ] ], str, - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[ - str, - Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], - ], ] ] = None, gap: Optional[ Union[ + Breakpoints[ + str, + Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], + ], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -136,11 +140,6 @@ class CheckboxCardsRoot(RadixThemesComponent): ] ], str, - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[ - str, - Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], - ], ] ] = None, style: Optional[Style] = None, @@ -148,51 +147,41 @@ class CheckboxCardsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxCardsRoot": @@ -233,51 +222,41 @@ class CheckboxCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxCardsItem": diff --git a/reflex/components/radix/themes/components/checkbox_group.py b/reflex/components/radix/themes/components/checkbox_group.py index 754f354b5..f6379e588 100644 --- a/reflex/components/radix/themes/components/checkbox_group.py +++ b/reflex/components/radix/themes/components/checkbox_group.py @@ -4,7 +4,7 @@ from types import SimpleNamespace from typing import List, Literal from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/checkbox_group.pyi b/reflex/components/radix/themes/components/checkbox_group.pyi index 080125f00..21f0ad23a 100644 --- a/reflex/components/radix/themes/components/checkbox_group.pyi +++ b/reflex/components/radix/themes/components/checkbox_group.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,136 +21,126 @@ class CheckboxGroupRoot(RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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_value: Optional[Union[Var[List[str]], List[str]]] = None, + default_value: Optional[Union[List[str], Var[List[str]]]] = None, name: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxGroupRoot": @@ -194,51 +183,41 @@ class CheckboxGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxGroupItem": diff --git a/reflex/components/radix/themes/components/context_menu.py b/reflex/components/radix/themes/components/context_menu.py index 95a0f2e74..c82f8e714 100644 --- a/reflex/components/radix/themes/components/context_menu.py +++ b/reflex/components/radix/themes/components/context_menu.py @@ -5,7 +5,7 @@ from typing import List, Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/context_menu.pyi b/reflex/components/radix/themes/components/context_menu.pyi index 49d703d13..6295ccb49 100644 --- a/reflex/components/radix/themes/components/context_menu.pyi +++ b/reflex/components/radix/themes/components/context_menu.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -26,54 +25,44 @@ class ContextMenuRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuRoot": @@ -110,51 +99,41 @@ class ContextMenuTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuTrigger": @@ -187,73 +166,73 @@ class ContextMenuContent(RadixThemesComponent): *children, size: Optional[ Union[ - Var[Union[Breakpoints[str, Literal["1", "2"]], Literal["1", "2"]]], - Literal["1", "2"], Breakpoints[str, Literal["1", "2"]], + Literal["1", "2"], + Var[Union[Breakpoints[str, Literal["1", "2"]], Literal["1", "2"]]], ] ] = None, variant: Optional[ - Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] + Union[Literal["soft", "solid"], Var[Literal["soft", "solid"]]] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -265,66 +244,56 @@ class ContextMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuContent": @@ -365,51 +334,41 @@ class ContextMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSub": @@ -445,51 +404,41 @@ class ContextMenuSubTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSubTrigger": @@ -526,63 +475,53 @@ class ContextMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSubContent": @@ -615,63 +554,63 @@ class ContextMenuItem(RadixThemesComponent): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -681,51 +620,41 @@ class ContextMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuItem": @@ -762,51 +691,41 @@ class ContextMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSeparator": diff --git a/reflex/components/radix/themes/components/data_list.py b/reflex/components/radix/themes/components/data_list.py index 8b95d24c6..05d4af074 100644 --- a/reflex/components/radix/themes/components/data_list.py +++ b/reflex/components/radix/themes/components/data_list.py @@ -4,7 +4,7 @@ from types import SimpleNamespace from typing import Literal from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/data_list.pyi b/reflex/components/radix/themes/components/data_list.pyi index a73a9264a..dafc0fa0b 100644 --- a/reflex/components/radix/themes/components/data_list.pyi +++ b/reflex/components/radix/themes/components/data_list.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,37 +21,37 @@ class DataListRoot(RadixThemesComponent): *children, orientation: Optional[ Union[ + Breakpoints[str, Literal["horizontal", "vertical"]], + Literal["horizontal", "vertical"], Var[ Union[ Breakpoints[str, Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], ] ], - Literal["horizontal", "vertical"], - Breakpoints[str, Literal["horizontal", "vertical"]], ] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, trim: Optional[ Union[ + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], Var[ Union[ - Breakpoints[str, Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], ] ], - Literal["normal", "start", "end", "both"], - Breakpoints[str, Literal["normal", "start", "end", "both"]], ] ] = None, style: Optional[Style] = None, @@ -60,51 +59,41 @@ class DataListRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListRoot": @@ -139,19 +128,19 @@ class DataListItem(RadixThemesComponent): *children, align: Optional[ Union[ + Breakpoints[ + str, Literal["baseline", "center", "end", "start", "stretch"] + ], + Literal["baseline", "center", "end", "start", "stretch"], Var[ Union[ Breakpoints[ str, - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ], - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ] ], - Literal["start", "center", "end", "baseline", "stretch"], - Breakpoints[ - str, Literal["start", "center", "end", "baseline", "stretch"] - ], ] ] = None, style: Optional[Style] = None, @@ -159,51 +148,41 @@ class DataListItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListItem": @@ -235,73 +214,73 @@ class DataListLabel(RadixThemesComponent): cls, *children, width: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, min_width: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, max_width: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -310,51 +289,41 @@ class DataListLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListLabel": @@ -393,51 +362,41 @@ class DataListValue(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListValue": diff --git a/reflex/components/radix/themes/components/dialog.py b/reflex/components/radix/themes/components/dialog.py index e0d7fae12..951e8506d 100644 --- a/reflex/components/radix/themes/components/dialog.py +++ b/reflex/components/radix/themes/components/dialog.py @@ -6,7 +6,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index eaae1bfee..827e50ea7 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent, RadixThemesTriggerComponent @@ -27,54 +26,44 @@ class DialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogRoot": @@ -110,51 +99,41 @@ class DialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogTrigger": @@ -180,51 +159,41 @@ class DialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogTitle": @@ -256,105 +225,95 @@ class DialogContent(elements.Div, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogContent": @@ -406,51 +365,41 @@ class DialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogDescription": @@ -485,51 +434,41 @@ class DialogClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogClose": @@ -561,54 +500,44 @@ class Dialog(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogRoot": diff --git a/reflex/components/radix/themes/components/dropdown_menu.py b/reflex/components/radix/themes/components/dropdown_menu.py index b425ef609..5ed1f9f64 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.py +++ b/reflex/components/radix/themes/components/dropdown_menu.py @@ -5,7 +5,7 @@ from typing import Dict, List, Literal, Union from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/dropdown_menu.pyi b/reflex/components/radix/themes/components/dropdown_menu.pyi index 2f324fa9a..0995ef2e4 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.pyi +++ b/reflex/components/radix/themes/components/dropdown_menu.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent, RadixThemesTriggerComponent @@ -30,60 +29,50 @@ class DropdownMenuRoot(RadixThemesComponent): default_open: Optional[Union[Var[bool], bool]] = None, open: Optional[Union[Var[bool], bool]] = None, modal: Optional[Union[Var[bool], bool]] = None, - dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuRoot": @@ -123,51 +112,41 @@ class DropdownMenuTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuTrigger": @@ -190,73 +169,73 @@ class DropdownMenuContent(RadixThemesComponent): *children, size: Optional[ Union[ - Var[Union[Breakpoints[str, Literal["1", "2"]], Literal["1", "2"]]], - Literal["1", "2"], Breakpoints[str, Literal["1", "2"]], + Literal["1", "2"], + Var[Union[Breakpoints[str, Literal["1", "2"]], Literal["1", "2"]]], ] ] = None, variant: Optional[ - Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] + Union[Literal["soft", "solid"], Var[Literal["soft", "solid"]]] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -266,30 +245,30 @@ class DropdownMenuContent(RadixThemesComponent): force_mount: Optional[Union[Var[bool], bool]] = None, side: Optional[ Union[ - Var[Literal["top", "right", "bottom", "left"]], - Literal["top", "right", "bottom", "left"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, side_offset: Optional[Union[Var[Union[float, int]], float, int]] = None, align: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, align_offset: Optional[Union[Var[Union[float, int]], float, int]] = None, avoid_collisions: Optional[Union[Var[bool], bool]] = None, collision_padding: Optional[ Union[ + Dict[str, Union[float, int]], Var[Union[Dict[str, Union[float, int]], float, int]], float, int, - Dict[str, Union[float, int]], ] ] = None, arrow_padding: Optional[Union[Var[Union[float, int]], float, int]] = None, sticky: Optional[ - Union[Var[Literal["partial", "always"]], Literal["partial", "always"]] + Union[Literal["always", "partial"], Var[Literal["always", "partial"]]] ] = None, hide_when_detached: Optional[Union[Var[bool], bool]] = None, style: Optional[Style] = None, @@ -297,66 +276,56 @@ class DropdownMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuContent": @@ -410,51 +379,41 @@ class DropdownMenuSubTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSubTrigger": @@ -482,54 +441,44 @@ class DropdownMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSub": @@ -569,15 +518,15 @@ class DropdownMenuSubContent(RadixThemesComponent): avoid_collisions: Optional[Union[Var[bool], bool]] = None, collision_padding: Optional[ Union[ + Dict[str, Union[float, int]], Var[Union[Dict[str, Union[float, int]], float, int]], float, int, - Dict[str, Union[float, int]], ] ] = None, arrow_padding: Optional[Union[Var[Union[float, int]], float, int]] = None, sticky: Optional[ - Union[Var[Literal["partial", "always"]], Literal["partial", "always"]] + Union[Literal["always", "partial"], Var[Literal["always", "partial"]]] ] = None, hide_when_detached: Optional[Union[Var[bool], bool]] = None, style: Optional[Style] = None, @@ -585,63 +534,53 @@ class DropdownMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSubContent": @@ -683,63 +622,63 @@ class DropdownMenuItem(RadixThemesComponent): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -752,54 +691,42 @@ class DropdownMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_select: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_select: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuItem": @@ -839,51 +766,41 @@ class DropdownMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSeparator": diff --git a/reflex/components/radix/themes/components/hover_card.py b/reflex/components/radix/themes/components/hover_card.py index a1c5c82d4..d67a0396a 100644 --- a/reflex/components/radix/themes/components/hover_card.py +++ b/reflex/components/radix/themes/components/hover_card.py @@ -6,7 +6,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/hover_card.pyi b/reflex/components/radix/themes/components/hover_card.pyi index dd575898d..966d66276 100644 --- a/reflex/components/radix/themes/components/hover_card.pyi +++ b/reflex/components/radix/themes/components/hover_card.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent, RadixThemesTriggerComponent @@ -30,54 +29,44 @@ class HoverCardRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardRoot": @@ -116,51 +105,41 @@ class HoverCardTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardTrigger": @@ -183,98 +162,88 @@ class HoverCardContent(elements.Div, RadixThemesComponent): *children, side: Optional[ Union[ + Breakpoints[str, Literal["bottom", "left", "right", "top"]], + Literal["bottom", "left", "right", "top"], Var[ Union[ - Breakpoints[str, Literal["top", "right", "bottom", "left"]], - Literal["top", "right", "bottom", "left"], + Breakpoints[str, Literal["bottom", "left", "right", "top"]], + Literal["bottom", "left", "right", "top"], ] ], - Literal["top", "right", "bottom", "left"], - Breakpoints[str, Literal["top", "right", "bottom", "left"]], ] ] = None, side_offset: Optional[Union[Var[int], int]] = None, align: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, avoid_collisions: Optional[Union[Var[bool], bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardContent": @@ -335,54 +304,44 @@ class HoverCard(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardRoot": diff --git a/reflex/components/radix/themes/components/icon_button.py b/reflex/components/radix/themes/components/icon_button.py index 8a39af0a7..2a32afe3a 100644 --- a/reflex/components/radix/themes/components/icon_button.py +++ b/reflex/components/radix/themes/components/icon_button.py @@ -9,9 +9,8 @@ from reflex.components.core.breakpoints import Responsive from reflex.components.core.match import Match from reflex.components.el import elements from reflex.components.lucide import Icon -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, @@ -83,7 +82,7 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): *[(size, px) for size, px in RADIX_TO_LUCIDE_SIZE.items()], 12, ) - if not isinstance(size_map_var, ImmutableVar): + if not isinstance(size_map_var, Var): raise ValueError(f"Match did not return a Var: {size_map_var}") children[0].size = size_map_var return super().create(*children, **props) diff --git a/reflex/components/radix/themes/components/icon_button.pyi b/reflex/components/radix/themes/components/icon_button.pyi index e8a2295b4..fe858aeca 100644 --- a/reflex/components/radix/themes/components/icon_button.pyi +++ b/reflex/components/radix/themes/components/icon_button.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixLoadingProp, @@ -28,181 +27,171 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], - Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "solid", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, - auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - form_action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_enc_type: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, form_no_validate: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - form_target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "IconButton": diff --git a/reflex/components/radix/themes/components/inset.py b/reflex/components/radix/themes/components/inset.py index 96f1f61ce..347b9f6b0 100644 --- a/reflex/components/radix/themes/components/inset.py +++ b/reflex/components/radix/themes/components/inset.py @@ -4,7 +4,7 @@ from typing import Literal, Union from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi index cefda619b..45e7d6434 100644 --- a/reflex/components/radix/themes/components/inset.pyi +++ b/reflex/components/radix/themes/components/inset.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -24,160 +23,150 @@ class Inset(elements.Div, RadixThemesComponent): *children, side: Optional[ Union[ + Breakpoints[str, Literal["bottom", "left", "right", "top", "x", "y"]], + Literal["bottom", "left", "right", "top", "x", "y"], Var[ Union[ Breakpoints[ - str, Literal["x", "y", "top", "bottom", "right", "left"] + str, Literal["bottom", "left", "right", "top", "x", "y"] ], - Literal["x", "y", "top", "bottom", "right", "left"], + Literal["bottom", "left", "right", "top", "x", "y"], ] ], - Literal["x", "y", "top", "bottom", "right", "left"], - Breakpoints[str, Literal["x", "y", "top", "bottom", "right", "left"]], ] ] = None, clip: Optional[ Union[ + Breakpoints[str, Literal["border-box", "padding-box"]], + Literal["border-box", "padding-box"], Var[ Union[ Breakpoints[str, Literal["border-box", "padding-box"]], Literal["border-box", "padding-box"], ] ], - Literal["border-box", "padding-box"], - Breakpoints[str, Literal["border-box", "padding-box"]], ] ] = None, p: Optional[ Union[ + Breakpoints[str, Union[int, str]], Var[Union[Breakpoints[str, Union[int, str]], int, str]], int, str, - Breakpoints[str, Union[int, str]], ] ] = None, px: Optional[ Union[ + Breakpoints[str, Union[int, str]], Var[Union[Breakpoints[str, Union[int, str]], int, str]], int, str, - Breakpoints[str, Union[int, str]], ] ] = None, py: Optional[ Union[ + Breakpoints[str, Union[int, str]], Var[Union[Breakpoints[str, Union[int, str]], int, str]], int, str, - Breakpoints[str, Union[int, str]], ] ] = None, pt: Optional[ Union[ + Breakpoints[str, Union[int, str]], Var[Union[Breakpoints[str, Union[int, str]], int, str]], int, str, - Breakpoints[str, Union[int, str]], ] ] = None, pr: Optional[ Union[ + Breakpoints[str, Union[int, str]], Var[Union[Breakpoints[str, Union[int, str]], int, str]], int, str, - Breakpoints[str, Union[int, str]], ] ] = None, pb: Optional[ Union[ + Breakpoints[str, Union[int, str]], Var[Union[Breakpoints[str, Union[int, str]], int, str]], int, str, - Breakpoints[str, Union[int, str]], ] ] = None, pl: Optional[ Union[ + Breakpoints[str, Union[int, str]], Var[Union[Breakpoints[str, Union[int, str]], int, str]], int, str, - Breakpoints[str, Union[int, str]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Inset": diff --git a/reflex/components/radix/themes/components/popover.py b/reflex/components/radix/themes/components/popover.py index 7c51cb53b..0297b2d99 100644 --- a/reflex/components/radix/themes/components/popover.py +++ b/reflex/components/radix/themes/components/popover.py @@ -6,7 +6,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index 4339a8c43..70349aea3 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent, RadixThemesTriggerComponent @@ -28,54 +27,44 @@ class PopoverRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverRoot": @@ -112,51 +101,41 @@ class PopoverTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverTrigger": @@ -179,123 +158,113 @@ class PopoverContent(elements.Div, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, side: Optional[ Union[ - Var[Literal["top", "right", "bottom", "left"]], - Literal["top", "right", "bottom", "left"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, side_offset: Optional[Union[Var[int], int]] = None, align: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, align_offset: Optional[Union[Var[int], int]] = None, avoid_collisions: Optional[Union[Var[bool], bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverContent": @@ -352,51 +321,41 @@ class PopoverClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverClose": diff --git a/reflex/components/radix/themes/components/progress.py b/reflex/components/radix/themes/components/progress.py index a122130c8..a5f1fa183 100644 --- a/reflex/components/radix/themes/components/progress.py +++ b/reflex/components/radix/themes/components/progress.py @@ -4,7 +4,7 @@ from typing import Literal from reflex.components.component import Component from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/progress.pyi b/reflex/components/radix/themes/components/progress.pyi index b3a4ce89d..8ef304915 100644 --- a/reflex/components/radix/themes/components/progress.pyi +++ b/reflex/components/radix/themes/components/progress.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -23,88 +22,88 @@ class Progress(RadixThemesComponent): max: Optional[Union[Var[int], int]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, duration: Optional[Union[Var[str], str]] = None, @@ -113,51 +112,41 @@ class Progress(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/themes/components/radio.py b/reflex/components/radix/themes/components/radio.py index 53cb35f32..fd24bb6b5 100644 --- a/reflex/components/radix/themes/components/radio.py +++ b/reflex/components/radix/themes/components/radio.py @@ -3,7 +3,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/radio.pyi b/reflex/components/radix/themes/components/radio.pyi index 06cb6bef3..a35ac33f3 100644 --- a/reflex/components/radix/themes/components/radio.pyi +++ b/reflex/components/radix/themes/components/radio.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -21,80 +20,80 @@ class Radio(RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -104,51 +103,41 @@ class Radio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Radio": diff --git a/reflex/components/radix/themes/components/radio_cards.py b/reflex/components/radix/themes/components/radio_cards.py index 88688521f..4c1a92aef 100644 --- a/reflex/components/radix/themes/components/radio_cards.py +++ b/reflex/components/radix/themes/components/radio_cards.py @@ -5,7 +5,7 @@ from typing import Literal, Union from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/radio_cards.pyi b/reflex/components/radix/themes/components/radio_cards.pyi index fac079ca9..f7cc97066 100644 --- a/reflex/components/radix/themes/components/radio_cards.pyi +++ b/reflex/components/radix/themes/components/radio_cards.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -23,83 +22,88 @@ class RadioCardsRoot(RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ - Union[Var[Literal["classic", "surface"]], Literal["classic", "surface"]] + Union[Literal["classic", "surface"], Var[Literal["classic", "surface"]]] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, columns: Optional[ Union[ + Breakpoints[ + str, + Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], + ], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -114,15 +118,15 @@ class RadioCardsRoot(RadixThemesComponent): ] ], str, - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[ - str, - Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], - ], ] ] = None, gap: Optional[ Union[ + Breakpoints[ + str, + Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], + ], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -137,11 +141,6 @@ class RadioCardsRoot(RadixThemesComponent): ] ], str, - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[ - str, - Union[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], str], - ], ] ] = None, default_value: Optional[Union[Var[str], str]] = None, @@ -151,65 +150,55 @@ class RadioCardsRoot(RadixThemesComponent): required: Optional[Union[Var[bool], bool]] = None, orientation: Optional[ Union[ - Var[Literal["horizontal", "vertical", "undefined"]], - Literal["horizontal", "vertical", "undefined"], + Literal["horizontal", "undefined", "vertical"], + Var[Literal["horizontal", "undefined", "vertical"]], ] ] = None, - dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None, loop: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioCardsRoot": @@ -262,51 +251,41 @@ class RadioCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioCardsItem": diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index 563f5d2dc..dcc74e040 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -10,10 +10,9 @@ from reflex.components.core.breakpoints import Responsive from reflex.components.radix.themes.layout.flex import Flex from reflex.components.radix.themes.typography.text import Text from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.ivars.sequence import StringVar from reflex.utils import types -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var +from reflex.vars.sequence import StringVar from ..base import ( LiteralAccentColor, @@ -146,13 +145,11 @@ class HighLevelRadioGroup(RadixThemesComponent): default_value = props.pop("default_value", "") if ( - not isinstance(items, (list, ImmutableVar)) - or isinstance(items, ImmutableVar) + not isinstance(items, (list, Var)) + or isinstance(items, Var) and not types._issubclass(items._var_type, list) ): - items_type = ( - type(items) if not isinstance(items, ImmutableVar) else items._var_type - ) + items_type = type(items) if not isinstance(items, Var) else items._var_type raise TypeError( f"The radio group component takes in a list, got {items_type} instead" ) @@ -162,13 +159,13 @@ class HighLevelRadioGroup(RadixThemesComponent): # convert only non-strings to json(JSON.stringify) so quotes are not rendered # for string literal types. if isinstance(default_value, str) or ( - isinstance(default_value, ImmutableVar) and default_value._var_type is str + isinstance(default_value, Var) and default_value._var_type is str ): default_value = LiteralVar.create(default_value) # type: ignore else: - default_value = ImmutableVar.create_safe(default_value).to_string() + default_value = LiteralVar.create(default_value).to_string() - def radio_group_item(value: ImmutableVar) -> Component: + def radio_group_item(value: Var) -> Component: item_value = rx.cond( value.js_type() == "string", value, diff --git a/reflex/components/radix/themes/components/radio_group.pyi b/reflex/components/radix/themes/components/radio_group.pyi index c8f8317ac..d255adcb1 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -24,80 +23,80 @@ class RadioGroupRoot(RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -112,54 +111,42 @@ class RadioGroupRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioGroupRoot": @@ -206,51 +193,41 @@ class RadioGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioGroupItem": @@ -283,87 +260,87 @@ class HighLevelRadioGroup(RadixThemesComponent): def create( # type: ignore cls, *children, - items: Optional[Union[Var[List[str]], List[str]]] = None, + items: Optional[Union[List[str], Var[List[str]]]] = None, direction: Optional[ Union[ - Var[Literal["row", "column", "row-reverse", "column-reverse"]], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], + Var[Literal["column", "column-reverse", "row", "row-reverse"]], ] ] = None, spacing: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, size: Optional[ - Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -378,51 +355,41 @@ class HighLevelRadioGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelRadioGroup": @@ -465,87 +432,87 @@ class RadioGroup(ComponentNamespace): @staticmethod def __call__( *children, - items: Optional[Union[Var[List[str]], List[str]]] = None, + items: Optional[Union[List[str], Var[List[str]]]] = None, direction: Optional[ Union[ - Var[Literal["row", "column", "row-reverse", "column-reverse"]], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], + Var[Literal["column", "column-reverse", "row", "row-reverse"]], ] ] = None, spacing: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, size: Optional[ - Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -560,51 +527,41 @@ class RadioGroup(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelRadioGroup": diff --git a/reflex/components/radix/themes/components/scroll_area.py b/reflex/components/radix/themes/components/scroll_area.py index 8920d81d6..bd58118dd 100644 --- a/reflex/components/radix/themes/components/scroll_area.py +++ b/reflex/components/radix/themes/components/scroll_area.py @@ -2,7 +2,7 @@ from typing import Literal -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/scroll_area.pyi b/reflex/components/radix/themes/components/scroll_area.pyi index 20c9c35af..583e97888 100644 --- a/reflex/components/radix/themes/components/scroll_area.pyi +++ b/reflex/components/radix/themes/components/scroll_area.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -20,14 +19,14 @@ class ScrollArea(RadixThemesComponent): *children, scrollbars: Optional[ Union[ - Var[Literal["vertical", "horizontal", "both"]], - Literal["vertical", "horizontal", "both"], + Literal["both", "horizontal", "vertical"], + Var[Literal["both", "horizontal", "vertical"]], ] ] = None, type: Optional[ Union[ - Var[Literal["auto", "always", "scroll", "hover"]], - Literal["auto", "always", "scroll", "hover"], + Literal["always", "auto", "hover", "scroll"], + Var[Literal["always", "auto", "hover", "scroll"]], ] ] = None, scroll_hide_delay: Optional[Union[Var[int], int]] = None, @@ -36,51 +35,41 @@ class ScrollArea(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ScrollArea": diff --git a/reflex/components/radix/themes/components/segmented_control.py b/reflex/components/radix/themes/components/segmented_control.py index 40beb603a..c9c6ea4c7 100644 --- a/reflex/components/radix/themes/components/segmented_control.py +++ b/reflex/components/radix/themes/components/segmented_control.py @@ -7,7 +7,7 @@ from typing import List, Literal, Union from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index b7511196f..6546f50d1 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,146 +21,134 @@ class SegmentedControlRoot(RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ - Union[Var[Literal["classic", "surface"]], Literal["classic", "surface"]] + Union[Literal["classic", "surface"], Var[Literal["classic", "surface"]]] ] = None, type: Optional[ - Union[Var[Literal["single", "multiple"]], Literal["single", "multiple"]] + Union[Literal["multiple", "single"], Var[Literal["multiple", "single"]]] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, default_value: Optional[ - Union[Var[Union[List[str], str]], str, List[str]] + Union[List[str], Var[Union[List[str], str]], str] ] = None, - value: Optional[Union[Var[Union[List[str], str]], str, List[str]]] = None, + value: Optional[Union[List[str], Var[Union[List[str], 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SegmentedControlRoot": @@ -202,51 +189,41 @@ class SegmentedControlItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SegmentedControlItem": diff --git a/reflex/components/radix/themes/components/select.py b/reflex/components/radix/themes/components/select.py index b2bd69e9a..9017ab5c7 100644 --- a/reflex/components/radix/themes/components/select.py +++ b/reflex/components/radix/themes/components/select.py @@ -5,8 +5,7 @@ from typing import List, Literal, Union import reflex as rx from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive -from reflex.ivars.base import ImmutableVar -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, @@ -217,7 +216,7 @@ class HighLevelSelect(SelectRoot): label = props.pop("label", None) - if isinstance(items, ImmutableVar): + if isinstance(items, Var): child = [ rx.foreach(items, lambda item: SelectItem.create(item, value=item)) ] diff --git a/reflex/components/radix/themes/components/select.pyi b/reflex/components/radix/themes/components/select.pyi index fa6149d0e..b6adac6e7 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,13 +21,13 @@ class SelectRoot(RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, default_value: Optional[Union[Var[str], str]] = None, @@ -43,57 +42,45 @@ class SelectRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectRoot": @@ -133,76 +120,76 @@ class SelectTrigger(RadixThemesComponent): *children, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft", "ghost"]], - Literal["classic", "surface", "soft", "ghost"], + Literal["classic", "ghost", "soft", "surface"], + Var[Literal["classic", "ghost", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, placeholder: Optional[Union[Var[str], str]] = None, @@ -211,51 +198,41 @@ class SelectTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectTrigger": @@ -290,88 +267,88 @@ class SelectContent(RadixThemesComponent): cls, *children, variant: Optional[ - Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] + Union[Literal["soft", "solid"], Var[Literal["soft", "solid"]]] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, position: Optional[ Union[ - Var[Literal["item-aligned", "popper"]], Literal["item-aligned", "popper"], + Var[Literal["item-aligned", "popper"]], ] ] = None, side: Optional[ Union[ - Var[Literal["top", "right", "bottom", "left"]], - Literal["top", "right", "bottom", "left"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, side_offset: Optional[Union[Var[int], int]] = None, align: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, align_offset: Optional[Union[Var[int], int]] = None, @@ -380,60 +357,50 @@ class SelectContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectContent": @@ -476,51 +443,41 @@ class SelectGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectGroup": @@ -557,51 +514,41 @@ class SelectItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectItem": @@ -638,51 +585,41 @@ class SelectLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectLabel": @@ -717,51 +654,41 @@ class SelectSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectSeparator": @@ -791,100 +718,100 @@ class HighLevelSelect(SelectRoot): def create( # type: ignore cls, *children, - items: Optional[Union[Var[List[str]], List[str]]] = None, + items: Optional[Union[List[str], Var[List[str]]]] = None, placeholder: Optional[Union[Var[str], str]] = None, label: Optional[Union[Var[str], str]] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft", "ghost"]], - Literal["classic", "surface", "soft", "ghost"], + Literal["classic", "ghost", "soft", "surface"], + Var[Literal["classic", "ghost", "soft", "surface"]], ] ] = None, radius: Optional[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, width: Optional[Union[Var[str], str]] = None, position: Optional[ Union[ - Var[Literal["item-aligned", "popper"]], Literal["item-aligned", "popper"], + Var[Literal["item-aligned", "popper"]], ] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, default_value: Optional[Union[Var[str], str]] = None, @@ -899,57 +826,45 @@ class HighLevelSelect(SelectRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelSelect": @@ -999,100 +914,100 @@ class Select(ComponentNamespace): @staticmethod def __call__( *children, - items: Optional[Union[Var[List[str]], List[str]]] = None, + items: Optional[Union[List[str], Var[List[str]]]] = None, placeholder: Optional[Union[Var[str], str]] = None, label: Optional[Union[Var[str], str]] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft", "ghost"]], - Literal["classic", "surface", "soft", "ghost"], + Literal["classic", "ghost", "soft", "surface"], + Var[Literal["classic", "ghost", "soft", "surface"]], ] ] = None, radius: Optional[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, width: Optional[Union[Var[str], str]] = None, position: Optional[ Union[ - Var[Literal["item-aligned", "popper"]], Literal["item-aligned", "popper"], + Var[Literal["item-aligned", "popper"]], ] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, default_value: Optional[Union[Var[str], str]] = None, @@ -1107,57 +1022,45 @@ class Select(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelSelect": diff --git a/reflex/components/radix/themes/components/separator.py b/reflex/components/radix/themes/components/separator.py index 81f83194b..1689717d2 100644 --- a/reflex/components/radix/themes/components/separator.py +++ b/reflex/components/radix/themes/components/separator.py @@ -3,8 +3,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive -from reflex.ivars.base import LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/separator.pyi b/reflex/components/radix/themes/components/separator.pyi index 13b3276d2..cd5f4abce 100644 --- a/reflex/components/radix/themes/components/separator.pyi +++ b/reflex/components/radix/themes/components/separator.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -23,88 +22,88 @@ class Separator(RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, orientation: Optional[ Union[ + Breakpoints[str, Literal["horizontal", "vertical"]], + Literal["horizontal", "vertical"], Var[ Union[ Breakpoints[str, Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], ] ], - Literal["horizontal", "vertical"], - Breakpoints[str, Literal["horizontal", "vertical"]], ] ] = None, decorative: Optional[Union[Var[bool], bool]] = None, @@ -113,51 +112,41 @@ class Separator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Separator": diff --git a/reflex/components/radix/themes/components/skeleton.py b/reflex/components/radix/themes/components/skeleton.py index 0738512aa..1fb6390a1 100644 --- a/reflex/components/radix/themes/components/skeleton.py +++ b/reflex/components/radix/themes/components/skeleton.py @@ -1,7 +1,7 @@ """Skeleton theme from Radix components.""" from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixLoadingProp, RadixThemesComponent diff --git a/reflex/components/radix/themes/components/skeleton.pyi b/reflex/components/radix/themes/components/skeleton.pyi index dcf0bd3c5..46d2697bf 100644 --- a/reflex/components/radix/themes/components/skeleton.pyi +++ b/reflex/components/radix/themes/components/skeleton.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixLoadingProp, RadixThemesComponent @@ -20,22 +19,22 @@ class Skeleton(RadixLoadingProp, RadixThemesComponent): cls, *children, width: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, min_width: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, max_width: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, height: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, min_height: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, max_height: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, loading: Optional[Union[Var[bool], bool]] = None, style: Optional[Style] = None, @@ -43,51 +42,41 @@ class Skeleton(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Skeleton": diff --git a/reflex/components/radix/themes/components/slider.py b/reflex/components/radix/themes/components/slider.py index 55b13a386..3cf2e172d 100644 --- a/reflex/components/radix/themes/components/slider.py +++ b/reflex/components/radix/themes/components/slider.py @@ -5,8 +5,7 @@ from typing import List, Literal, Optional, Union from reflex.components.component import Component from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, @@ -89,7 +88,7 @@ class Slider(RadixThemesComponent): """ default_value = props.pop("default_value", [50]) - if isinstance(default_value, ImmutableVar): + if isinstance(default_value, Var): if issubclass(default_value._var_type, (int, float)): default_value = [default_value] diff --git a/reflex/components/radix/themes/components/slider.pyi b/reflex/components/radix/themes/components/slider.pyi index 23e886f35..0157aaab0 100644 --- a/reflex/components/radix/themes/components/slider.pyi +++ b/reflex/components/radix/themes/components/slider.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -23,99 +22,99 @@ class Slider(RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "full"]], Literal["none", "small", "full"] + Literal["full", "none", "small"], Var[Literal["full", "none", "small"]] ] ] = None, default_value: Optional[ Union[ - Var[Union[List[Union[float, int]], float, int]], List[Union[float, int]], + Var[Union[List[Union[float, int]], float, int]], float, int, ] ] = None, value: Optional[ - Union[Var[List[Union[float, int]]], List[Union[float, int]]] + Union[List[Union[float, int]], Var[List[Union[float, int]]]] ] = None, name: Optional[Union[Var[str], str]] = None, min: Optional[Union[Var[Union[float, int]], float, int]] = None, @@ -124,8 +123,8 @@ class Slider(RadixThemesComponent): disabled: Optional[Union[Var[bool], bool]] = None, orientation: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, style: Optional[Style] = None, @@ -133,57 +132,45 @@ class Slider(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Slider": diff --git a/reflex/components/radix/themes/components/spinner.py b/reflex/components/radix/themes/components/spinner.py index 22f5bba0b..cc29d6091 100644 --- a/reflex/components/radix/themes/components/spinner.py +++ b/reflex/components/radix/themes/components/spinner.py @@ -3,7 +3,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixLoadingProp, diff --git a/reflex/components/radix/themes/components/spinner.pyi b/reflex/components/radix/themes/components/spinner.pyi index 5ae959339..b8f37d636 100644 --- a/reflex/components/radix/themes/components/spinner.pyi +++ b/reflex/components/radix/themes/components/spinner.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixLoadingProp, RadixThemesComponent @@ -23,13 +22,13 @@ class Spinner(RadixLoadingProp, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, loading: Optional[Union[Var[bool], bool]] = None, @@ -38,51 +37,41 @@ class Spinner(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Spinner": diff --git a/reflex/components/radix/themes/components/switch.py b/reflex/components/radix/themes/components/switch.py index f5109faf5..56951bc74 100644 --- a/reflex/components/radix/themes/components/switch.py +++ b/reflex/components/radix/themes/components/switch.py @@ -4,7 +4,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index 5e4b0b47e..013501313 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -30,87 +29,87 @@ class Switch(RadixThemesComponent): value: Optional[Union[Var[str], str]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ - Var[Literal["none", "small", "full"]], Literal["none", "small", "full"] + Literal["full", "none", "small"], Var[Literal["full", "none", "small"]] ] ] = None, style: Optional[Style] = None, @@ -118,54 +117,42 @@ class Switch(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Switch": diff --git a/reflex/components/radix/themes/components/table.py b/reflex/components/radix/themes/components/table.py index 27b0e3563..e1f03d4e2 100644 --- a/reflex/components/radix/themes/components/table.py +++ b/reflex/components/radix/themes/components/table.py @@ -5,7 +5,7 @@ from typing import List, Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index 5a872c7c8..69f94176b 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -23,94 +22,84 @@ class TableRoot(elements.Table, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ - Union[Var[Literal["surface", "ghost"]], Literal["surface", "ghost"]] + Union[Literal["ghost", "surface"], Var[Literal["ghost", "surface"]]] ] = None, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - summary: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + summary: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableRoot": @@ -160,81 +149,71 @@ class TableHeader(elements.Thead, RadixThemesComponent): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableHeader": @@ -283,84 +262,74 @@ class TableRow(elements.Tr, RadixThemesComponent): *children, align: Optional[ Union[ - Var[Literal["start", "center", "end", "baseline"]], - Literal["start", "center", "end", "baseline"], + Literal["baseline", "center", "end", "start"], + Var[Literal["baseline", "center", "end", "start"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableRow": @@ -409,89 +378,79 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): *children, justify: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - col_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - headers: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - row_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - scope: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + row_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + scope: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableColumnHeaderCell": @@ -543,81 +502,71 @@ class TableBody(elements.Tbody, RadixThemesComponent): def create( # type: ignore cls, *children, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableBody": @@ -666,88 +615,78 @@ class TableCell(elements.Td, RadixThemesComponent): *children, justify: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - col_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - headers: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - row_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + row_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableCell": @@ -800,89 +739,79 @@ class TableRowHeaderCell(elements.Th, RadixThemesComponent): *children, justify: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, - align: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - col_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - headers: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - row_span: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - scope: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + row_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + scope: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableRowHeaderCell": diff --git a/reflex/components/radix/themes/components/tabs.py b/reflex/components/radix/themes/components/tabs.py index 08e09262b..5560d44b0 100644 --- a/reflex/components/radix/themes/components/tabs.py +++ b/reflex/components/radix/themes/components/tabs.py @@ -8,7 +8,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.core.colors import color from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index 000eb05d9..8e3c29406 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -27,67 +26,55 @@ class TabsRoot(RadixThemesComponent): value: Optional[Union[Var[str], str]] = None, orientation: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None, activation_mode: Optional[ - Union[Var[Literal["automatic", "manual"]], Literal["automatic", "manual"]] + Union[Literal["automatic", "manual"], Var[Literal["automatic", "manual"]]] ] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsRoot": @@ -125,9 +112,9 @@ class TabsList(RadixThemesComponent): *children, size: Optional[ Union[ - Var[Union[Breakpoints[str, Literal["1", "2"]], Literal["1", "2"]]], - Literal["1", "2"], Breakpoints[str, Literal["1", "2"]], + Literal["1", "2"], + Var[Union[Breakpoints[str, Literal["1", "2"]], Literal["1", "2"]]], ] ] = None, loop: Optional[Union[Var[bool], bool]] = None, @@ -136,51 +123,41 @@ class TabsList(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsList": @@ -216,63 +193,63 @@ class TabsTrigger(RadixThemesComponent): disabled: Optional[Union[Var[bool], bool]] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -281,51 +258,41 @@ class TabsTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsTrigger": @@ -365,51 +332,41 @@ class TabsContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsContent": @@ -448,67 +405,55 @@ class Tabs(ComponentNamespace): value: Optional[Union[Var[str], str]] = None, orientation: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None, activation_mode: Optional[ - Union[Var[Literal["automatic", "manual"]], Literal["automatic", "manual"]] + Union[Literal["automatic", "manual"], Var[Literal["automatic", "manual"]]] ] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsRoot": diff --git a/reflex/components/radix/themes/components/text_area.py b/reflex/components/radix/themes/components/text_area.py index 5218f1d7b..8b3b531cb 100644 --- a/reflex/components/radix/themes/components/text_area.py +++ b/reflex/components/radix/themes/components/text_area.py @@ -7,7 +7,7 @@ from reflex.components.core.breakpoints import Responsive from reflex.components.core.debounce import DebounceInput from reflex.components.el import elements from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/text_area.pyi b/reflex/components/radix/themes/components/text_area.pyi index 561f041ab..c39be4b1f 100644 --- a/reflex/components/radix/themes/components/text_area.pyi +++ b/reflex/components/radix/themes/components/text_area.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -25,108 +24,108 @@ class TextArea(RadixThemesComponent, elements.Textarea): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, resize: Optional[ Union[ + Breakpoints[str, Literal["both", "horizontal", "none", "vertical"]], + Literal["both", "horizontal", "none", "vertical"], Var[ Union[ Breakpoints[ - str, Literal["none", "vertical", "horizontal", "both"] + str, Literal["both", "horizontal", "none", "vertical"] ], - Literal["none", "vertical", "horizontal", "both"], + Literal["both", "horizontal", "none", "vertical"], ] ], - Literal["none", "vertical", "horizontal", "both"], - Breakpoints[str, Literal["none", "vertical", "horizontal", "both"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, auto_complete: Optional[Union[Var[bool], bool]] = None, auto_focus: Optional[Union[Var[bool], bool]] = None, dirname: Optional[Union[Var[str], str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, - form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, max_length: Optional[Union[Var[int], int]] = None, min_length: Optional[Union[Var[int], int]] = None, name: Optional[Union[Var[str], str]] = None, @@ -137,91 +136,77 @@ class TextArea(RadixThemesComponent, elements.Textarea): value: Optional[Union[Var[str], str]] = None, wrap: Optional[Union[Var[str], str]] = None, auto_height: Optional[Union[Var[bool], bool]] = None, - cols: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cols: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_submit: Optional[Union[Var[bool], bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextArea": diff --git a/reflex/components/radix/themes/components/text_field.py b/reflex/components/radix/themes/components/text_field.py index 2ab850b13..6c3372985 100644 --- a/reflex/components/radix/themes/components/text_field.py +++ b/reflex/components/radix/themes/components/text_field.py @@ -9,7 +9,7 @@ from reflex.components.core.breakpoints import Responsive from reflex.components.core.debounce import DebounceInput from reflex.components.el import elements from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/components/text_field.pyi b/reflex/components/radix/themes/components/text_field.pyi index 9dbaa9692..ff5b79344 100644 --- a/reflex/components/radix/themes/components/text_field.pyi +++ b/reflex/components/radix/themes/components/text_field.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -26,87 +25,87 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, auto_complete: Optional[Union[Var[bool], bool]] = None, @@ -119,90 +118,76 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): read_only: Optional[Union[Var[bool], bool]] = None, required: Optional[Union[Var[bool], bool]] = None, type: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[Union[float, int, str]], str, int, float]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextFieldRoot": @@ -262,63 +247,63 @@ class TextFieldSlot(RadixThemesComponent): *children, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, @@ -327,51 +312,41 @@ class TextFieldSlot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextFieldSlot": @@ -404,87 +379,87 @@ class TextField(ComponentNamespace): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, variant: Optional[ Union[ - Var[Literal["classic", "surface", "soft"]], - Literal["classic", "surface", "soft"], + Literal["classic", "soft", "surface"], + Var[Literal["classic", "soft", "surface"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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[ Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], + Literal["full", "large", "medium", "none", "small"], + Var[Literal["full", "large", "medium", "none", "small"]], ] ] = None, auto_complete: Optional[Union[Var[bool], bool]] = None, @@ -497,90 +472,76 @@ class TextField(ComponentNamespace): read_only: Optional[Union[Var[bool], bool]] = None, required: Optional[Union[Var[bool], bool]] = None, type: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[Union[float, int, str]], str, int, float]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextFieldRoot": diff --git a/reflex/components/radix/themes/components/tooltip.py b/reflex/components/radix/themes/components/tooltip.py index 9a1355be5..f39de68a8 100644 --- a/reflex/components/radix/themes/components/tooltip.py +++ b/reflex/components/radix/themes/components/tooltip.py @@ -5,7 +5,7 @@ from typing import Dict, Literal, Union from reflex.components.component import Component from reflex.event import EventHandler from reflex.utils import format -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( RadixThemesComponent, diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index 80f483183..f886dc608 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -6,9 +6,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -27,30 +26,30 @@ class Tooltip(RadixThemesComponent): open: Optional[Union[Var[bool], bool]] = None, side: Optional[ Union[ - Var[Literal["top", "right", "bottom", "left"]], - Literal["top", "right", "bottom", "left"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, side_offset: Optional[Union[Var[Union[float, int]], float, int]] = None, align: Optional[ Union[ - Var[Literal["start", "center", "end"]], - Literal["start", "center", "end"], + Literal["center", "end", "start"], + Var[Literal["center", "end", "start"]], ] ] = None, align_offset: Optional[Union[Var[Union[float, int]], float, int]] = None, avoid_collisions: Optional[Union[Var[bool], bool]] = None, collision_padding: Optional[ Union[ + Dict[str, Union[float, int]], Var[Union[Dict[str, Union[float, int]], float, int]], float, int, - Dict[str, Union[float, int]], ] ] = None, arrow_padding: Optional[Union[Var[Union[float, int]], float, int]] = None, sticky: Optional[ - Union[Var[Literal["partial", "always"]], Literal["partial", "always"]] + Union[Literal["always", "partial"], Var[Literal["always", "partial"]]] ] = None, hide_when_detached: Optional[Union[Var[bool], bool]] = None, delay_duration: Optional[Union[Var[Union[float, int]], float, int]] = None, @@ -62,60 +61,50 @@ class Tooltip(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tooltip": diff --git a/reflex/components/radix/themes/layout/base.py b/reflex/components/radix/themes/layout/base.py index dd598538e..3ee78d209 100644 --- a/reflex/components/radix/themes/layout/base.py +++ b/reflex/components/radix/themes/layout/base.py @@ -5,7 +5,7 @@ from __future__ import annotations from typing import Literal from reflex.components.core.breakpoints import Responsive -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( CommonMarginProps, diff --git a/reflex/components/radix/themes/layout/base.pyi b/reflex/components/radix/themes/layout/base.pyi index dc557b5ee..4da48975b 100644 --- a/reflex/components/radix/themes/layout/base.pyi +++ b/reflex/components/radix/themes/layout/base.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import CommonMarginProps, RadixThemesComponent @@ -23,6 +22,10 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): *children, p: 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[ @@ -32,14 +35,14 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, px: 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[ @@ -49,14 +52,14 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, py: 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[ @@ -66,14 +69,14 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, pt: 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[ @@ -83,14 +86,14 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, 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[ @@ -100,14 +103,14 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, 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[ @@ -117,14 +120,14 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, 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[ @@ -134,66 +137,62 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, flex_shrink: Optional[ Union[ - Var[Union[Breakpoints[str, Literal["0", "1"]], Literal["0", "1"]]], - Literal["0", "1"], Breakpoints[str, Literal["0", "1"]], + Literal["0", "1"], + Var[Union[Breakpoints[str, Literal["0", "1"]], Literal["0", "1"]]], ] ] = None, flex_grow: Optional[ Union[ - Var[Union[Breakpoints[str, Literal["0", "1"]], Literal["0", "1"]]], - Literal["0", "1"], Breakpoints[str, Literal["0", "1"]], + Literal["0", "1"], + Var[Union[Breakpoints[str, Literal["0", "1"]], Literal["0", "1"]]], ] ] = None, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], 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[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], 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, @@ -201,51 +200,41 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LayoutComponent": diff --git a/reflex/components/radix/themes/layout/box.pyi b/reflex/components/radix/themes/layout/box.pyi index 4d7404af1..ba651b488 100644 --- a/reflex/components/radix/themes/layout/box.pyi +++ b/reflex/components/radix/themes/layout/box.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -19,80 +18,70 @@ class Box(elements.Div, RadixThemesComponent): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Box": diff --git a/reflex/components/radix/themes/layout/center.pyi b/reflex/components/radix/themes/layout/center.pyi index a015ab46c..e6a622c48 100644 --- a/reflex/components/radix/themes/layout/center.pyi +++ b/reflex/components/radix/themes/layout/center.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .flex import Flex @@ -23,64 +22,68 @@ class Center(Flex): as_child: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ + Breakpoints[ + str, Literal["column", "column-reverse", "row", "row-reverse"] + ], + Literal["column", "column-reverse", "row", "row-reverse"], Var[ Union[ Breakpoints[ str, - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ] ], - Literal["row", "column", "row-reverse", "column-reverse"], - Breakpoints[ - str, Literal["row", "column", "row-reverse", "column-reverse"] - ], ] ] = None, align: Optional[ Union[ + Breakpoints[ + str, Literal["baseline", "center", "end", "start", "stretch"] + ], + Literal["baseline", "center", "end", "start", "stretch"], Var[ Union[ Breakpoints[ str, - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ], - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ] ], - Literal["start", "center", "end", "baseline", "stretch"], - Breakpoints[ - str, Literal["start", "center", "end", "baseline", "stretch"] - ], ] ] = None, justify: Optional[ Union[ + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], Var[ Union[ - Breakpoints[str, Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], ] ], - Literal["start", "center", "end", "between"], - Breakpoints[str, Literal["start", "center", "end", "between"]], ] ] = None, wrap: Optional[ Union[ + Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], + Literal["nowrap", "wrap", "wrap-reverse"], Var[ Union[ Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], Literal["nowrap", "wrap", "wrap-reverse"], ] ], - Literal["nowrap", "wrap", "wrap-reverse"], - Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], ] ] = None, spacing: 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[ @@ -90,86 +93,72 @@ class Center(Flex): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Center": diff --git a/reflex/components/radix/themes/layout/container.py b/reflex/components/radix/themes/layout/container.py index 4ed18031d..b1d2fbed3 100644 --- a/reflex/components/radix/themes/layout/container.py +++ b/reflex/components/radix/themes/layout/container.py @@ -6,9 +6,8 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.ivars.base import LiteralVar from reflex.style import STACK_CHILDREN_FULL_WIDTH -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from ..base import RadixThemesComponent diff --git a/reflex/components/radix/themes/layout/container.pyi b/reflex/components/radix/themes/layout/container.pyi index 269af2e43..f4c92b085 100644 --- a/reflex/components/radix/themes/layout/container.pyi +++ b/reflex/components/radix/themes/layout/container.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -26,90 +25,80 @@ class Container(elements.Div, RadixThemesComponent): stack_children_full_width: Optional[bool] = False, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4"]], + Literal["1", "2", "3", "4"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"], ] ], - Literal["1", "2", "3", "4"], - Breakpoints[str, Literal["1", "2", "3", "4"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Container": diff --git a/reflex/components/radix/themes/layout/flex.py b/reflex/components/radix/themes/layout/flex.py index 825c84f42..8be16973d 100644 --- a/reflex/components/radix/themes/layout/flex.py +++ b/reflex/components/radix/themes/layout/flex.py @@ -6,7 +6,7 @@ from typing import Dict, Literal from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAlign, diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi index 1de96b339..be7d1ce55 100644 --- a/reflex/components/radix/themes/layout/flex.pyi +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -26,64 +25,68 @@ class Flex(elements.Div, RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ + Breakpoints[ + str, Literal["column", "column-reverse", "row", "row-reverse"] + ], + Literal["column", "column-reverse", "row", "row-reverse"], Var[ Union[ Breakpoints[ str, - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ] ], - Literal["row", "column", "row-reverse", "column-reverse"], - Breakpoints[ - str, Literal["row", "column", "row-reverse", "column-reverse"] - ], ] ] = None, align: Optional[ Union[ + Breakpoints[ + str, Literal["baseline", "center", "end", "start", "stretch"] + ], + Literal["baseline", "center", "end", "start", "stretch"], Var[ Union[ Breakpoints[ str, - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ], - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ] ], - Literal["start", "center", "end", "baseline", "stretch"], - Breakpoints[ - str, Literal["start", "center", "end", "baseline", "stretch"] - ], ] ] = None, justify: Optional[ Union[ + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], Var[ Union[ - Breakpoints[str, Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], ] ], - Literal["start", "center", "end", "between"], - Breakpoints[str, Literal["start", "center", "end", "between"]], ] ] = None, wrap: Optional[ Union[ + Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], + Literal["nowrap", "wrap", "wrap-reverse"], Var[ Union[ Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], Literal["nowrap", "wrap", "wrap-reverse"], ] ], - Literal["nowrap", "wrap", "wrap-reverse"], - Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], ] ] = None, spacing: 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[ @@ -93,86 +96,72 @@ class Flex(elements.Div, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Flex": diff --git a/reflex/components/radix/themes/layout/grid.py b/reflex/components/radix/themes/layout/grid.py index ab7fbdb3b..b9ac28d41 100644 --- a/reflex/components/radix/themes/layout/grid.py +++ b/reflex/components/radix/themes/layout/grid.py @@ -6,7 +6,7 @@ from typing import Dict, Literal from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAlign, diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi index 6ab8e7c60..124928198 100644 --- a/reflex/components/radix/themes/layout/grid.pyi +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -24,61 +23,65 @@ class Grid(elements.Div, RadixThemesComponent): *children, as_child: Optional[Union[Var[bool], bool]] = None, columns: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, rows: Optional[ - Union[Var[Union[Breakpoints[str, str], str]], str, Breakpoints[str, str]] + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] ] = None, flow: Optional[ Union[ + Breakpoints[ + str, Literal["column", "column-dense", "dense", "row", "row-dense"] + ], + Literal["column", "column-dense", "dense", "row", "row-dense"], Var[ Union[ Breakpoints[ str, Literal[ - "row", "column", "dense", "row-dense", "column-dense" + "column", "column-dense", "dense", "row", "row-dense" ], ], - Literal["row", "column", "dense", "row-dense", "column-dense"], + Literal["column", "column-dense", "dense", "row", "row-dense"], ] ], - Literal["row", "column", "dense", "row-dense", "column-dense"], - Breakpoints[ - str, Literal["row", "column", "dense", "row-dense", "column-dense"] - ], ] ] = None, align: Optional[ Union[ + Breakpoints[ + str, Literal["baseline", "center", "end", "start", "stretch"] + ], + Literal["baseline", "center", "end", "start", "stretch"], Var[ Union[ Breakpoints[ str, - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ], - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ] ], - Literal["start", "center", "end", "baseline", "stretch"], - Breakpoints[ - str, Literal["start", "center", "end", "baseline", "stretch"] - ], ] ] = None, justify: Optional[ Union[ + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], Var[ Union[ - Breakpoints[str, Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], ] ], - Literal["start", "center", "end", "between"], - Breakpoints[str, Literal["start", "center", "end", "between"]], ] ] = None, spacing: 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[ @@ -88,14 +91,14 @@ class Grid(elements.Div, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, spacing_x: 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[ @@ -105,14 +108,14 @@ class Grid(elements.Div, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, spacing_y: 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[ @@ -122,86 +125,72 @@ class Grid(elements.Div, RadixThemesComponent): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Grid": diff --git a/reflex/components/radix/themes/layout/list.py b/reflex/components/radix/themes/layout/list.py index cacba70db..699028380 100644 --- a/reflex/components/radix/themes/layout/list.py +++ b/reflex/components/radix/themes/layout/list.py @@ -9,8 +9,7 @@ from reflex.components.core.foreach import Foreach from reflex.components.el.elements.typography import Li, Ol, Ul from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.typography.text import Text -from reflex.ivars.base import ImmutableVar -from reflex.vars import Var +from reflex.vars.base import Var LiteralListStyleTypeUnordered = Literal[ "none", @@ -51,7 +50,7 @@ class BaseList(Component): def create( cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Var[Iterable]] = None, **props, ): """Create a list component. @@ -67,7 +66,7 @@ class BaseList(Component): """ list_style_type = props.pop("list_style_type", "none") if not children and items is not None: - if isinstance(items, ImmutableVar): + if isinstance(items, Var): children = [Foreach.create(items, ListItem.create)] else: children = [ListItem.create(item) for item in items] # type: ignore @@ -98,7 +97,7 @@ class UnorderedList(BaseList, Ul): def create( cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Var[Iterable]] = None, list_style_type: LiteralListStyleTypeUnordered = "disc", **props, ): @@ -129,7 +128,7 @@ class OrderedList(BaseList, Ol): def create( cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Var[Iterable]] = None, list_style_type: LiteralListStyleTypeOrdered = "decimal", **props, ): diff --git a/reflex/components/radix/themes/layout/list.pyi b/reflex/components/radix/themes/layout/list.pyi index c670608e7..a3ea33916 100644 --- a/reflex/components/radix/themes/layout/list.pyi +++ b/reflex/components/radix/themes/layout/list.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Iterable, Literal, Optional, Union, over from reflex.components.component import Component, ComponentNamespace from reflex.components.el.elements.typography import Li, Ol, Ul from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var LiteralListStyleTypeUnordered = Literal["none", "disc", "circle", "square"] LiteralListStyleTypeOrdered = Literal[ @@ -36,47 +35,47 @@ class BaseList(Component): def create( # type: ignore cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Iterable, Var[Iterable]]] = None, list_style_type: Optional[ Union[ + Literal[ + "armenian", + "decimal", + "decimal-leading-zero", + "georgian", + "hiragana", + "katakana", + "lower-alpha", + "lower-greek", + "lower-latin", + "lower-roman", + "none", + "upper-alpha", + "upper-latin", + "upper-roman", + ], + Literal["circle", "disc", "none", "square"], Var[ Union[ Literal[ - "none", + "armenian", "decimal", "decimal-leading-zero", - "lower-roman", - "upper-roman", - "lower-greek", - "lower-latin", - "upper-latin", - "armenian", "georgian", - "lower-alpha", - "upper-alpha", "hiragana", "katakana", + "lower-alpha", + "lower-greek", + "lower-latin", + "lower-roman", + "none", + "upper-alpha", + "upper-latin", + "upper-roman", ], - Literal["none", "disc", "circle", "square"], + Literal["circle", "disc", "none", "square"], ] ], - Literal["none", "disc", "circle", "square"], - Literal[ - "none", - "decimal", - "decimal-leading-zero", - "lower-roman", - "upper-roman", - "lower-greek", - "lower-latin", - "upper-latin", - "armenian", - "georgian", - "lower-alpha", - "upper-alpha", - "hiragana", - "katakana", - ], ] ] = None, style: Optional[Style] = None, @@ -84,51 +83,41 @@ class BaseList(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BaseList": @@ -160,82 +149,72 @@ class UnorderedList(BaseList, Ul): def create( # type: ignore cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Iterable, Var[Iterable]]] = None, list_style_type: Optional[LiteralListStyleTypeUnordered] = "disc", - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "UnorderedList": @@ -281,85 +260,75 @@ class OrderedList(BaseList, Ol): def create( # type: ignore cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Iterable, Var[Iterable]]] = None, list_style_type: Optional[LiteralListStyleTypeOrdered] = "decimal", - reversed: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - start: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + reversed: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + start: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "OrderedList": @@ -408,80 +377,70 @@ class ListItem(Li): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ListItem": @@ -527,47 +486,47 @@ class List(ComponentNamespace): @staticmethod def __call__( *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Iterable, Var[Iterable]]] = None, list_style_type: Optional[ Union[ + Literal[ + "armenian", + "decimal", + "decimal-leading-zero", + "georgian", + "hiragana", + "katakana", + "lower-alpha", + "lower-greek", + "lower-latin", + "lower-roman", + "none", + "upper-alpha", + "upper-latin", + "upper-roman", + ], + Literal["circle", "disc", "none", "square"], Var[ Union[ Literal[ - "none", + "armenian", "decimal", "decimal-leading-zero", - "lower-roman", - "upper-roman", - "lower-greek", - "lower-latin", - "upper-latin", - "armenian", "georgian", - "lower-alpha", - "upper-alpha", "hiragana", "katakana", + "lower-alpha", + "lower-greek", + "lower-latin", + "lower-roman", + "none", + "upper-alpha", + "upper-latin", + "upper-roman", ], - Literal["none", "disc", "circle", "square"], + Literal["circle", "disc", "none", "square"], ] ], - Literal["none", "disc", "circle", "square"], - Literal[ - "none", - "decimal", - "decimal-leading-zero", - "lower-roman", - "upper-roman", - "lower-greek", - "lower-latin", - "upper-latin", - "armenian", - "georgian", - "lower-alpha", - "upper-alpha", - "hiragana", - "katakana", - ], ] ] = None, style: Optional[Style] = None, @@ -575,51 +534,41 @@ class List(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BaseList": diff --git a/reflex/components/radix/themes/layout/section.py b/reflex/components/radix/themes/layout/section.py index a3e58be86..68a131751 100644 --- a/reflex/components/radix/themes/layout/section.py +++ b/reflex/components/radix/themes/layout/section.py @@ -6,8 +6,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.ivars.base import LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from ..base import RadixThemesComponent diff --git a/reflex/components/radix/themes/layout/section.pyi b/reflex/components/radix/themes/layout/section.pyi index 8556e079b..b949e5e05 100644 --- a/reflex/components/radix/themes/layout/section.pyi +++ b/reflex/components/radix/themes/layout/section.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -24,89 +23,79 @@ class Section(elements.Section, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3"]], + Literal["1", "2", "3"], Var[ Union[ Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] ] ], - Literal["1", "2", "3"], - Breakpoints[str, Literal["1", "2", "3"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Section": diff --git a/reflex/components/radix/themes/layout/spacer.pyi b/reflex/components/radix/themes/layout/spacer.pyi index dfd469b05..5a3775ef6 100644 --- a/reflex/components/radix/themes/layout/spacer.pyi +++ b/reflex/components/radix/themes/layout/spacer.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .flex import Flex @@ -23,64 +22,68 @@ class Spacer(Flex): as_child: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ + Breakpoints[ + str, Literal["column", "column-reverse", "row", "row-reverse"] + ], + Literal["column", "column-reverse", "row", "row-reverse"], Var[ Union[ Breakpoints[ str, - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ] ], - Literal["row", "column", "row-reverse", "column-reverse"], - Breakpoints[ - str, Literal["row", "column", "row-reverse", "column-reverse"] - ], ] ] = None, align: Optional[ Union[ + Breakpoints[ + str, Literal["baseline", "center", "end", "start", "stretch"] + ], + Literal["baseline", "center", "end", "start", "stretch"], Var[ Union[ Breakpoints[ str, - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ], - Literal["start", "center", "end", "baseline", "stretch"], + Literal["baseline", "center", "end", "start", "stretch"], ] ], - Literal["start", "center", "end", "baseline", "stretch"], - Breakpoints[ - str, Literal["start", "center", "end", "baseline", "stretch"] - ], ] ] = None, justify: Optional[ Union[ + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], Var[ Union[ - Breakpoints[str, Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], ] ], - Literal["start", "center", "end", "between"], - Breakpoints[str, Literal["start", "center", "end", "between"]], ] ] = None, wrap: Optional[ Union[ + Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], + Literal["nowrap", "wrap", "wrap-reverse"], Var[ Union[ Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], Literal["nowrap", "wrap", "wrap-reverse"], ] ], - Literal["nowrap", "wrap", "wrap-reverse"], - Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], ] ] = None, spacing: 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[ @@ -90,86 +93,72 @@ class Spacer(Flex): Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Spacer": diff --git a/reflex/components/radix/themes/layout/stack.py b/reflex/components/radix/themes/layout/stack.py index 13f80dc1e..cb513cbfb 100644 --- a/reflex/components/radix/themes/layout/stack.py +++ b/reflex/components/radix/themes/layout/stack.py @@ -3,7 +3,7 @@ from __future__ import annotations from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAlign, LiteralSpacing from .flex import Flex, LiteralFlexDirection diff --git a/reflex/components/radix/themes/layout/stack.pyi b/reflex/components/radix/themes/layout/stack.pyi index 8f0ad2a17..0547cbc8f 100644 --- a/reflex/components/radix/themes/layout/stack.pyi +++ b/reflex/components/radix/themes/layout/stack.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import LiteralAlign, LiteralSpacing from .flex import Flex @@ -25,119 +24,109 @@ class Stack(Flex): as_child: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ + Breakpoints[ + str, Literal["column", "column-reverse", "row", "row-reverse"] + ], + Literal["column", "column-reverse", "row", "row-reverse"], Var[ Union[ Breakpoints[ str, - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], ] ], - Literal["row", "column", "row-reverse", "column-reverse"], - Breakpoints[ - str, Literal["row", "column", "row-reverse", "column-reverse"] - ], ] ] = None, justify: Optional[ Union[ + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], Var[ Union[ - Breakpoints[str, Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], ] ], - Literal["start", "center", "end", "between"], - Breakpoints[str, Literal["start", "center", "end", "between"]], ] ] = None, wrap: Optional[ Union[ + Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], + Literal["nowrap", "wrap", "wrap-reverse"], Var[ Union[ Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], Literal["nowrap", "wrap", "wrap-reverse"], ] ], - Literal["nowrap", "wrap", "wrap-reverse"], - Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Stack": @@ -190,109 +179,99 @@ class VStack(Stack): align: Optional[LiteralAlign] = "start", direction: Optional[ Union[ - Var[Literal["row", "column", "row-reverse", "column-reverse"]], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], + Var[Literal["column", "column-reverse", "row", "row-reverse"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, justify: Optional[ Union[ + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], Var[ Union[ - Breakpoints[str, Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], ] ], - Literal["start", "center", "end", "between"], - Breakpoints[str, Literal["start", "center", "end", "between"]], ] ] = None, wrap: Optional[ Union[ + Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], + Literal["nowrap", "wrap", "wrap-reverse"], Var[ Union[ Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], Literal["nowrap", "wrap", "wrap-reverse"], ] ], - Literal["nowrap", "wrap", "wrap-reverse"], - Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "VStack": @@ -345,109 +324,99 @@ class HStack(Stack): align: Optional[LiteralAlign] = "start", direction: Optional[ Union[ - Var[Literal["row", "column", "row-reverse", "column-reverse"]], - Literal["row", "column", "row-reverse", "column-reverse"], + Literal["column", "column-reverse", "row", "row-reverse"], + Var[Literal["column", "column-reverse", "row", "row-reverse"]], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, justify: Optional[ Union[ + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], Var[ Union[ - Breakpoints[str, Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], + Breakpoints[str, Literal["between", "center", "end", "start"]], + Literal["between", "center", "end", "start"], ] ], - Literal["start", "center", "end", "between"], - Breakpoints[str, Literal["start", "center", "end", "between"]], ] ] = None, wrap: Optional[ Union[ + Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], + Literal["nowrap", "wrap", "wrap-reverse"], Var[ Union[ Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], Literal["nowrap", "wrap", "wrap-reverse"], ] ], - Literal["nowrap", "wrap", "wrap-reverse"], - Breakpoints[str, Literal["nowrap", "wrap", "wrap-reverse"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HStack": diff --git a/reflex/components/radix/themes/typography/blockquote.py b/reflex/components/radix/themes/typography/blockquote.py index a4f3069b8..a60c05471 100644 --- a/reflex/components/radix/themes/typography/blockquote.py +++ b/reflex/components/radix/themes/typography/blockquote.py @@ -7,7 +7,7 @@ from __future__ import annotations from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/typography/blockquote.pyi b/reflex/components/radix/themes/typography/blockquote.pyi index f367906be..3abf53fd6 100644 --- a/reflex/components/radix/themes/typography/blockquote.pyi +++ b/reflex/components/radix/themes/typography/blockquote.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,6 +21,8 @@ class Blockquote(elements.Blockquote, RadixThemesComponent): *children, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -30,160 +31,148 @@ class Blockquote(elements.Blockquote, RadixThemesComponent): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, weight: Optional[ Union[ + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], Var[ Union[ - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], ] ], - Literal["light", "regular", "medium", "bold"], - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - cite: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cite: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Blockquote": diff --git a/reflex/components/radix/themes/typography/code.py b/reflex/components/radix/themes/typography/code.py index 2c0212b8b..663f260da 100644 --- a/reflex/components/radix/themes/typography/code.py +++ b/reflex/components/radix/themes/typography/code.py @@ -7,7 +7,7 @@ from __future__ import annotations from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/typography/code.pyi b/reflex/components/radix/themes/typography/code.pyi index 25f30d072..1da91fc96 100644 --- a/reflex/components/radix/themes/typography/code.pyi +++ b/reflex/components/radix/themes/typography/code.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -22,12 +21,14 @@ class Code(elements.Code, RadixThemesComponent): *children, variant: Optional[ Union[ - Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], - Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + Literal["classic", "ghost", "outline", "soft", "solid", "surface"], + Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]], ] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -36,159 +37,147 @@ class Code(elements.Code, RadixThemesComponent): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, weight: Optional[ Union[ + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], Var[ Union[ - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], ] ], - Literal["light", "regular", "medium", "bold"], - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Code": diff --git a/reflex/components/radix/themes/typography/heading.py b/reflex/components/radix/themes/typography/heading.py index 374fe8dcc..f5fec8bb1 100644 --- a/reflex/components/radix/themes/typography/heading.py +++ b/reflex/components/radix/themes/typography/heading.py @@ -7,7 +7,7 @@ from __future__ import annotations from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/typography/heading.pyi b/reflex/components/radix/themes/typography/heading.pyi index 4dc44c1af..7b7c45fde 100644 --- a/reflex/components/radix/themes/typography/heading.pyi +++ b/reflex/components/radix/themes/typography/heading.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -24,6 +23,8 @@ class Heading(elements.H1, RadixThemesComponent): as_: Optional[Union[Var[str], str]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -32,183 +33,171 @@ class Heading(elements.H1, RadixThemesComponent): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, weight: Optional[ Union[ + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], Var[ Union[ - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], ] ], - Literal["light", "regular", "medium", "bold"], - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], ] ] = None, align: Optional[ Union[ + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], Var[ Union[ - Breakpoints[str, Literal["left", "center", "right"]], - Literal["left", "center", "right"], + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], ] ], - Literal["left", "center", "right"], - Breakpoints[str, Literal["left", "center", "right"]], ] ] = None, trim: Optional[ Union[ + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], Var[ Union[ - Breakpoints[str, Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], ] ], - Literal["normal", "start", "end", "both"], - Breakpoints[str, Literal["normal", "start", "end", "both"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Heading": diff --git a/reflex/components/radix/themes/typography/link.py b/reflex/components/radix/themes/typography/link.py index 92fa47173..e51209dce 100644 --- a/reflex/components/radix/themes/typography/link.py +++ b/reflex/components/radix/themes/typography/link.py @@ -14,7 +14,7 @@ from reflex.components.core.cond import cond from reflex.components.el.elements.inline import A from reflex.components.next.link import NextLink from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/typography/link.pyi b/reflex/components/radix/themes/typography/link.pyi index 12e698773..da715f73b 100644 --- a/reflex/components/radix/themes/typography/link.pyi +++ b/reflex/components/radix/themes/typography/link.pyi @@ -10,10 +10,9 @@ from reflex.components.core.breakpoints import Breakpoints from reflex.components.el.elements.inline import A from reflex.components.next.link import NextLink from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -30,6 +29,8 @@ class Link(RadixThemesComponent, A, MemoizationLeaf): as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -38,189 +39,177 @@ class Link(RadixThemesComponent, A, MemoizationLeaf): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, weight: Optional[ Union[ + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], Var[ Union[ - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], ] ], - Literal["light", "regular", "medium", "bold"], - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], ] ] = None, trim: Optional[ Union[ + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], Var[ Union[ - Breakpoints[str, Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], ] ], - Literal["normal", "start", "end", "both"], - Breakpoints[str, Literal["normal", "start", "end", "both"]], ] ] = None, underline: Optional[ Union[ - Var[Literal["auto", "hover", "always", "none"]], - Literal["auto", "hover", "always", "none"], + Literal["always", "auto", "hover", "none"], + Var[Literal["always", "auto", "hover", "none"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, is_external: Optional[Union[Var[bool], bool]] = None, - download: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - href: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - href_lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - ping: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + download: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + href: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + href_lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + media: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + ping: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, referrer_policy: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - rel: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - shape: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + rel: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + shape: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Link": diff --git a/reflex/components/radix/themes/typography/text.py b/reflex/components/radix/themes/typography/text.py index fe4b17afc..24b09c753 100644 --- a/reflex/components/radix/themes/typography/text.py +++ b/reflex/components/radix/themes/typography/text.py @@ -10,7 +10,7 @@ from typing import Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.vars import Var +from reflex.vars.base import Var from ..base import ( LiteralAccentColor, diff --git a/reflex/components/radix/themes/typography/text.pyi b/reflex/components/radix/themes/typography/text.pyi index 572922b5b..85f7754cc 100644 --- a/reflex/components/radix/themes/typography/text.pyi +++ b/reflex/components/radix/themes/typography/text.pyi @@ -9,9 +9,8 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from ..base import RadixThemesComponent @@ -45,52 +44,54 @@ class Text(elements.Span, RadixThemesComponent): as_child: Optional[Union[Var[bool], bool]] = None, as_: Optional[ Union[ - Var[ - Literal[ - "p", - "label", - "div", - "span", - "b", - "i", - "u", - "abbr", - "cite", - "del", - "em", - "ins", - "kbd", - "mark", - "s", - "samp", - "sub", - "sup", - ] - ], Literal[ - "p", - "label", - "div", - "span", - "b", - "i", - "u", "abbr", + "b", "cite", "del", + "div", "em", + "i", "ins", "kbd", + "label", "mark", + "p", "s", "samp", + "span", "sub", "sup", + "u", + ], + Var[ + Literal[ + "abbr", + "b", + "cite", + "del", + "div", + "em", + "i", + "ins", + "kbd", + "label", + "mark", + "p", + "s", + "samp", + "span", + "sub", + "sup", + "u", + ] ], ] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -99,183 +100,171 @@ class Text(elements.Span, RadixThemesComponent): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, weight: Optional[ Union[ + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], Var[ Union[ - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], ] ], - Literal["light", "regular", "medium", "bold"], - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], ] ] = None, align: Optional[ Union[ + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], Var[ Union[ - Breakpoints[str, Literal["left", "center", "right"]], - Literal["left", "center", "right"], + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], ] ], - Literal["left", "center", "right"], - Breakpoints[str, Literal["left", "center", "right"]], ] ] = None, trim: Optional[ Union[ + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], Var[ Union[ - Breakpoints[str, Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], ] ], - Literal["normal", "start", "end", "both"], - Breakpoints[str, Literal["normal", "start", "end", "both"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Text": @@ -331,53 +320,55 @@ class Span(Text): *children, as_: Optional[ Union[ - Var[ - Literal[ - "p", - "label", - "div", - "span", - "b", - "i", - "u", - "abbr", - "cite", - "del", - "em", - "ins", - "kbd", - "mark", - "s", - "samp", - "sub", - "sup", - ] - ], Literal[ - "p", - "label", - "div", - "span", - "b", - "i", - "u", "abbr", + "b", "cite", "del", + "div", "em", + "i", "ins", "kbd", + "label", "mark", + "p", "s", "samp", + "span", "sub", "sup", + "u", + ], + Var[ + Literal[ + "abbr", + "b", + "cite", + "del", + "div", + "em", + "i", + "ins", + "kbd", + "label", + "mark", + "p", + "s", + "samp", + "span", + "sub", + "sup", + "u", + ] ], ] ] = None, as_child: Optional[Union[Var[bool], bool]] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -386,183 +377,171 @@ class Span(Text): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, weight: Optional[ Union[ + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], Var[ Union[ - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], ] ], - Literal["light", "regular", "medium", "bold"], - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], ] ] = None, align: Optional[ Union[ + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], Var[ Union[ - Breakpoints[str, Literal["left", "center", "right"]], - Literal["left", "center", "right"], + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], ] ], - Literal["left", "center", "right"], - Breakpoints[str, Literal["left", "center", "right"]], ] ] = None, trim: Optional[ Union[ + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], Var[ Union[ - Breakpoints[str, Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], ] ], - Literal["normal", "start", "end", "both"], - Breakpoints[str, Literal["normal", "start", "end", "both"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Span": @@ -616,80 +595,70 @@ class Em(elements.Em, RadixThemesComponent): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Em": @@ -737,84 +706,74 @@ class Kbd(elements.Kbd, RadixThemesComponent): *children, size: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Kbd": @@ -861,81 +820,71 @@ class Quote(elements.Q, RadixThemesComponent): def create( # type: ignore cls, *children, - cite: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + cite: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Quote": @@ -982,80 +931,70 @@ class Strong(elements.Strong, RadixThemesComponent): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Strong": @@ -1108,52 +1047,54 @@ class TextNamespace(ComponentNamespace): as_child: Optional[Union[Var[bool], bool]] = None, as_: Optional[ Union[ - Var[ - Literal[ - "p", - "label", - "div", - "span", - "b", - "i", - "u", - "abbr", - "cite", - "del", - "em", - "ins", - "kbd", - "mark", - "s", - "samp", - "sub", - "sup", - ] - ], Literal[ - "p", - "label", - "div", - "span", - "b", - "i", - "u", "abbr", + "b", "cite", "del", + "div", "em", + "i", "ins", "kbd", + "label", "mark", + "p", "s", "samp", + "span", "sub", "sup", + "u", + ], + Var[ + Literal[ + "abbr", + "b", + "cite", + "del", + "div", + "em", + "i", + "ins", + "kbd", + "label", + "mark", + "p", + "s", + "samp", + "span", + "sub", + "sup", + "u", + ] ], ] ] = None, size: Optional[ Union[ + Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], Var[ Union[ Breakpoints[ @@ -1162,183 +1103,171 @@ class TextNamespace(ComponentNamespace): Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], ] ] = None, weight: Optional[ Union[ + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], Var[ Union[ - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Breakpoints[str, Literal["bold", "light", "medium", "regular"]], + Literal["bold", "light", "medium", "regular"], ] ], - Literal["light", "regular", "medium", "bold"], - Breakpoints[str, Literal["light", "regular", "medium", "bold"]], ] ] = None, align: Optional[ Union[ + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], Var[ Union[ - Breakpoints[str, Literal["left", "center", "right"]], - Literal["left", "center", "right"], + Breakpoints[str, Literal["center", "left", "right"]], + Literal["center", "left", "right"], ] ], - Literal["left", "center", "right"], - Breakpoints[str, Literal["left", "center", "right"]], ] ] = None, trim: Optional[ Union[ + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], Var[ Union[ - Breakpoints[str, Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], + Breakpoints[str, Literal["both", "end", "normal", "start"]], + Literal["both", "end", "normal", "start"], ] ], - Literal["normal", "start", "end", "both"], - Breakpoints[str, Literal["normal", "start", "end", "both"]], ] ] = None, color_scheme: Optional[ Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], Literal[ - "tomato", - "red", - "ruby", + "amber", + "blue", + "bronze", + "brown", "crimson", + "cyan", + "gold", + "grass", + "gray", + "green", + "indigo", + "iris", + "jade", + "lime", + "mint", + "orange", "pink", "plum", "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", + "red", + "ruby", "sky", - "mint", - "lime", + "teal", + "tomato", + "violet", "yellow", - "amber", - "gold", - "bronze", - "gray", + ], + 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, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Text": diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index d9d27be71..af5714148 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class Audio(ReactPlayer): pass @@ -33,99 +32,73 @@ class Audio(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_buffer: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_ended: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_pause: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_play: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_ready: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_seek: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Audio": diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index 1c9b20cea..08c6df017 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -4,7 +4,7 @@ from __future__ import annotations from reflex.components.component import NoSSRComponent from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class ReactPlayer(NoSSRComponent): diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 7991cadd7..4f466ea2d 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class ReactPlayer(NoSSRComponent): @overload @@ -31,99 +30,73 @@ class ReactPlayer(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_buffer: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_ended: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_pause: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_play: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_ready: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_seek: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReactPlayer": diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index 2e6fd3aed..e60f03920 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class Video(ReactPlayer): pass @@ -33,99 +32,73 @@ class Video(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_buffer: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_ended: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_pause: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_play: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_ready: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_seek: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Video": diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index a909ac6e7..4836e08be 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -7,8 +7,7 @@ from typing import Any, Dict, List, Union from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from .recharts import ( LiteralAnimationEasing, @@ -235,7 +234,7 @@ class Brush(Recharts): # The stroke color of brush stroke: Var[Union[str, Color]] - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index eead7204c..e7b186f6f 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .recharts import ( Recharts, @@ -21,12 +20,12 @@ class Axis(Recharts): def create( # type: ignore cls, *children, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, hide: Optional[Union[Var[bool], bool]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, str]] = None, type_: Optional[ - Union[Var[Literal["number", "category"]], Literal["number", "category"]] + Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, allow_decimals: Optional[Union[Var[bool], bool]] = None, allow_data_overflow: Optional[Union[Var[bool], bool]] = None, @@ -35,110 +34,100 @@ class Axis(Recharts): mirror: Optional[Union[Var[bool], bool]] = None, reversed: Optional[Union[Var[bool], bool]] = None, label: Optional[ - Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], int, str]], int, str] ] = None, scale: Optional[ Union[ + Literal[ + "auto", + "band", + "identity", + "linear", + "log", + "ordinal", + "point", + "pow", + "quantile", + "quantize", + "sequential", + "sqrt", + "threshold", + "time", + "utc", + ], Var[ Literal[ "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", "band", - "point", + "identity", + "linear", + "log", "ordinal", + "point", + "pow", "quantile", "quantize", - "utc", "sequential", + "sqrt", "threshold", + "time", + "utc", ] ], - Literal[ - "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", - "band", - "point", - "ordinal", - "quantile", - "quantize", - "utc", - "sequential", - "threshold", - ], ] ] = None, - unit: Optional[Union[Var[Union[int, str]], str, int]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, ticks: Optional[ - Union[Var[List[Union[int, str]]], List[Union[int, str]]] + Union[List[Union[int, str]], Var[List[Union[int, str]]]] ] = None, tick: Optional[Union[Var[bool], bool]] = None, tick_count: Optional[Union[Var[int], int]] = None, tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, text_anchor: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Axis": @@ -189,17 +178,17 @@ class XAxis(Axis): cls, *children, orientation: Optional[ - Union[Var[Literal["top", "bottom"]], Literal["top", "bottom"]] + Union[Literal["bottom", "top"], Var[Literal["bottom", "top"]]] ] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, include_hidden: Optional[Union[Var[bool], bool]] = None, - domain: Optional[Union[Var[List], List]] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + domain: Optional[Union[List, Var[List]]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, hide: Optional[Union[Var[bool], bool]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, str]] = None, type_: Optional[ - Union[Var[Literal["number", "category"]], Literal["number", "category"]] + Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, allow_decimals: Optional[Union[Var[bool], bool]] = None, allow_data_overflow: Optional[Union[Var[bool], bool]] = None, @@ -208,110 +197,100 @@ class XAxis(Axis): mirror: Optional[Union[Var[bool], bool]] = None, reversed: Optional[Union[Var[bool], bool]] = None, label: Optional[ - Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], int, str]], int, str] ] = None, scale: Optional[ Union[ + Literal[ + "auto", + "band", + "identity", + "linear", + "log", + "ordinal", + "point", + "pow", + "quantile", + "quantize", + "sequential", + "sqrt", + "threshold", + "time", + "utc", + ], Var[ Literal[ "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", "band", - "point", + "identity", + "linear", + "log", "ordinal", + "point", + "pow", "quantile", "quantize", - "utc", "sequential", + "sqrt", "threshold", + "time", + "utc", ] ], - Literal[ - "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", - "band", - "point", - "ordinal", - "quantile", - "quantize", - "utc", - "sequential", - "threshold", - ], ] ] = None, - unit: Optional[Union[Var[Union[int, str]], str, int]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, ticks: Optional[ - Union[Var[List[Union[int, str]]], List[Union[int, str]]] + Union[List[Union[int, str]], Var[List[Union[int, str]]]] ] = None, tick: Optional[Union[Var[bool], bool]] = None, tick_count: Optional[Union[Var[int], int]] = None, tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, text_anchor: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "XAxis": @@ -366,16 +345,16 @@ class YAxis(Axis): cls, *children, orientation: Optional[ - Union[Var[Literal["left", "right"]], Literal["left", "right"]] + Union[Literal["left", "right"], Var[Literal["left", "right"]]] ] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - domain: Optional[Union[Var[List], List]] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + domain: Optional[Union[List, Var[List]]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, hide: Optional[Union[Var[bool], bool]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, str]] = None, type_: Optional[ - Union[Var[Literal["number", "category"]], Literal["number", "category"]] + Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, allow_decimals: Optional[Union[Var[bool], bool]] = None, allow_data_overflow: Optional[Union[Var[bool], bool]] = None, @@ -384,110 +363,100 @@ class YAxis(Axis): mirror: Optional[Union[Var[bool], bool]] = None, reversed: Optional[Union[Var[bool], bool]] = None, label: Optional[ - Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], int, str]], int, str] ] = None, scale: Optional[ Union[ + Literal[ + "auto", + "band", + "identity", + "linear", + "log", + "ordinal", + "point", + "pow", + "quantile", + "quantize", + "sequential", + "sqrt", + "threshold", + "time", + "utc", + ], Var[ Literal[ "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", "band", - "point", + "identity", + "linear", + "log", "ordinal", + "point", + "pow", "quantile", "quantize", - "utc", "sequential", + "sqrt", "threshold", + "time", + "utc", ] ], - Literal[ - "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", - "band", - "point", - "ordinal", - "quantile", - "quantize", - "utc", - "sequential", - "threshold", - ], ] ] = None, - unit: Optional[Union[Var[Union[int, str]], str, int]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, ticks: Optional[ - Union[Var[List[Union[int, str]]], List[Union[int, str]]] + Union[List[Union[int, str]], Var[List[Union[int, str]]]] ] = None, tick: Optional[Union[Var[bool], bool]] = None, tick_count: Optional[Union[Var[int], int]] = None, tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, text_anchor: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "YAxis": @@ -540,48 +509,48 @@ class ZAxis(Recharts): def create( # type: ignore cls, *children, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, - range: Optional[Union[Var[List[int]], List[int]]] = None, - unit: Optional[Union[Var[Union[int, str]], str, int]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + range: Optional[Union[List[int], Var[List[int]]]] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, scale: Optional[ Union[ + Literal[ + "auto", + "band", + "identity", + "linear", + "log", + "ordinal", + "point", + "pow", + "quantile", + "quantize", + "sequential", + "sqrt", + "threshold", + "time", + "utc", + ], Var[ Literal[ "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", "band", - "point", + "identity", + "linear", + "log", "ordinal", + "point", + "pow", "quantile", "quantize", - "utc", "sequential", + "sqrt", "threshold", + "time", + "utc", ] ], - Literal[ - "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", - "band", - "point", - "ordinal", - "quantile", - "quantize", - "utc", - "sequential", - "threshold", - ], ] ] = None, style: Optional[Style] = None, @@ -589,51 +558,41 @@ class ZAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ZAxis": @@ -660,20 +619,20 @@ class ZAxis(Recharts): ... class Brush(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore cls, *children, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, x: Optional[Union[Var[int], int]] = None, y: Optional[Union[Var[int], int]] = None, width: Optional[Union[Var[int], int]] = None, height: Optional[Union[Var[int], int]] = None, - data: Optional[Union[Var[List[Any]], List[Any]]] = None, + data: Optional[Union[List[Any], Var[List[Any]]]] = None, traveller_width: Optional[Union[Var[int], int]] = None, gap: Optional[Union[Var[int], int]] = None, start_index: Optional[Union[Var[int], int]] = None, @@ -683,10 +642,8 @@ class Brush(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, **props, ) -> "Brush": """Create the component. @@ -726,42 +683,42 @@ class Cartesian(Recharts): *children, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, legend_type: Optional[ Union[ - Var[ - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - "none", - ] - ], Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "none", + "plainline", + "rect", + "square", "star", "triangle", "wye", - "none", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] ], ] ] = None, @@ -770,51 +727,41 @@ class Cartesian(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Cartesian": @@ -846,97 +793,97 @@ class Area(Cartesian): def create( # type: ignore cls, *children, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, stroke_width: Optional[Union[Var[int], int]] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, type_: Optional[ Union[ + Literal[ + "basis", + "basisClosed", + "basisOpen", + "bump", + "bumpX", + "bumpY", + "linear", + "linearClosed", + "monotone", + "monotoneX", + "monotoneY", + "natural", + "step", + "stepAfter", + "stepBefore", + ], Var[ Literal[ "basis", "basisClosed", "basisOpen", + "bump", "bumpX", "bumpY", - "bump", "linear", "linearClosed", - "natural", + "monotone", "monotoneX", "monotoneY", - "monotone", + "natural", "step", - "stepBefore", "stepAfter", + "stepBefore", ] ], - Literal[ - "basis", - "basisClosed", - "basisOpen", - "bumpX", - "bumpY", - "bump", - "linear", - "linearClosed", - "natural", - "monotoneX", - "monotoneY", - "monotone", - "step", - "stepBefore", - "stepAfter", - ], ] ] = None, dot: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, active_dot: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, label: Optional[Union[Var[bool], bool]] = None, - stack_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - unit: Optional[Union[Var[Union[int, str]], str, int]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + stack_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, legend_type: Optional[ Union[ - Var[ - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - "none", - ] - ], Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "none", + "plainline", + "rect", + "square", "star", "triangle", "wye", - "none", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] ], ] ] = None, @@ -945,51 +892,41 @@ class Area(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Area": @@ -1031,15 +968,15 @@ class Bar(Cartesian): def create( # type: ignore cls, *children, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, stroke_width: Optional[Union[Var[int], int]] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, background: Optional[Union[Var[bool], bool]] = None, label: Optional[Union[Var[bool], bool]] = None, stack_id: Optional[Union[Var[str], str]] = None, - unit: Optional[Union[Var[Union[int, str]], str, int]] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, min_point_size: Optional[Union[Var[int], int]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, bar_size: Optional[Union[Var[int], int]] = None, max_bar_size: Optional[Union[Var[int], int]] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, @@ -1047,48 +984,48 @@ class Bar(Cartesian): animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ Union[ - Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]], - Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"], + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], ] ] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, legend_type: Optional[ Union[ - Var[ - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - "none", - ] - ], Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "none", + "plainline", + "rect", + "square", "star", "triangle", "wye", - "none", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] ], ] ] = None, @@ -1097,57 +1034,47 @@ class Bar(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Bar": @@ -1196,95 +1123,95 @@ class Line(Cartesian): *children, type_: Optional[ Union[ + Literal[ + "basis", + "basisClosed", + "basisOpen", + "bump", + "bumpX", + "bumpY", + "linear", + "linearClosed", + "monotone", + "monotoneX", + "monotoneY", + "natural", + "step", + "stepAfter", + "stepBefore", + ], Var[ Literal[ "basis", "basisClosed", "basisOpen", + "bump", "bumpX", "bumpY", - "bump", "linear", "linearClosed", - "natural", + "monotone", "monotoneX", "monotoneY", - "monotone", + "natural", "step", - "stepBefore", "stepAfter", + "stepBefore", ] ], - Literal[ - "basis", - "basisClosed", - "basisOpen", - "bumpX", - "bumpY", - "bump", - "linear", - "linearClosed", - "natural", - "monotoneX", - "monotoneY", - "monotone", - "step", - "stepBefore", - "stepAfter", - ], ] ] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, stroke_width: Optional[Union[Var[int], int]] = None, dot: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, active_dot: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, label: Optional[Union[Var[bool], bool]] = None, hide: Optional[Union[Var[bool], bool]] = None, connect_nulls: Optional[Union[Var[bool], bool]] = None, - unit: Optional[Union[Var[Union[int, str]], str, int]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, legend_type: Optional[ Union[ - Var[ - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - "none", - ] - ], Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "none", + "plainline", + "rect", + "square", "star", "triangle", "wye", - "none", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] ], ] ] = None, @@ -1293,51 +1220,41 @@ class Line(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Line": @@ -1379,73 +1296,73 @@ class Scatter(Recharts): def create( # type: ignore cls, *children, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, legend_type: Optional[ Union[ - Var[ - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - "none", - ] - ], Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "none", + "plainline", + "rect", + "square", "star", "triangle", "wye", - "none", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] ], ] ] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, z_axis_id: Optional[Union[Var[str], str]] = None, line: Optional[Union[Var[bool], bool]] = None, shape: Optional[ Union[ + Literal[ + "circle", "cross", "diamond", "square", "star", "triangle", "wye" + ], Var[ Literal[ - "square", "circle", "cross", "diamond", + "square", "star", "triangle", "wye", ] ], - Literal[ - "square", "circle", "cross", "diamond", "star", "triangle", "wye" - ], ] ] = None, line_type: Optional[ - Union[Var[Literal["joint", "fitting"]], Literal["joint", "fitting"]] + Union[Literal["fitting", "joint"], Var[Literal["fitting", "joint"]]] ] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - name: Optional[Union[Var[Union[int, str]], str, int]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + name: Optional[Union[Var[Union[int, str]], int, str]] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_begin: Optional[Union[Var[int], int]] = None, animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ Union[ - Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]], - Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"], + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], ] ] = None, style: Optional[Style] = None, @@ -1453,51 +1370,41 @@ class Scatter(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Scatter": @@ -1538,38 +1445,38 @@ class Funnel(Recharts): def create( # type: ignore cls, *children, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, name_key: Optional[Union[Var[str], str]] = None, legend_type: Optional[ Union[ - Var[ - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - "none", - ] - ], Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "none", + "plainline", + "rect", + "square", "star", "triangle", "wye", - "none", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] ], ] ] = None, @@ -1578,67 +1485,57 @@ class Funnel(Recharts): animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ Union[ - Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]], - Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"], + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], ] ] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, 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[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Funnel": @@ -1675,62 +1572,52 @@ class ErrorBar(Recharts): cls, *children, direction: Optional[ - Union[Var[Literal["x", "y", "both"]], Literal["x", "y", "both"]] + Union[Literal["both", "x", "y"], Var[Literal["both", "x", "y"]]] ] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, width: Optional[Union[Var[int], int]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, stroke_width: Optional[Union[Var[int], int]] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ErrorBar": @@ -1762,66 +1649,56 @@ class Reference(Recharts): def create( # type: ignore cls, *children, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, if_overflow: Optional[ Union[ - Var[Literal["discard", "hidden", "visible", "extendDomain"]], - Literal["discard", "hidden", "visible", "extendDomain"], + Literal["discard", "extendDomain", "hidden", "visible"], + Var[Literal["discard", "extendDomain", "hidden", "visible"]], ] ] = None, - label: Optional[Union[Var[Union[int, str]], str, int]] = None, + label: Optional[Union[Var[Union[int, str]], int, str]] = None, is_front: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Reference": @@ -1853,71 +1730,61 @@ class ReferenceLine(Reference): def create( # type: ignore cls, *children, - x: Optional[Union[Var[Union[int, str]], str, int]] = None, - y: Optional[Union[Var[Union[int, str]], str, int]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - stroke_width: Optional[Union[Var[Union[int, str]], str, int]] = None, + x: Optional[Union[Var[Union[int, str]], int, str]] = None, + y: Optional[Union[Var[Union[int, str]], int, str]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + stroke_width: Optional[Union[Var[Union[int, str]], int, str]] = None, segment: Optional[List[Any]] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, if_overflow: Optional[ Union[ - Var[Literal["discard", "hidden", "visible", "extendDomain"]], - Literal["discard", "hidden", "visible", "extendDomain"], + Literal["discard", "extendDomain", "hidden", "visible"], + Var[Literal["discard", "extendDomain", "hidden", "visible"]], ] ] = None, - label: Optional[Union[Var[Union[int, str]], str, int]] = None, + label: Optional[Union[Var[Union[int, str]], int, str]] = None, is_front: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReferenceLine": @@ -1954,71 +1821,61 @@ class ReferenceDot(Reference): def create( # type: ignore cls, *children, - x: Optional[Union[Var[Union[int, str]], str, int]] = None, - y: Optional[Union[Var[Union[int, str]], str, int]] = None, + x: Optional[Union[Var[Union[int, str]], int, str]] = None, + y: Optional[Union[Var[Union[int, str]], int, str]] = None, r: Optional[Union[Var[int], int]] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, if_overflow: Optional[ Union[ - Var[Literal["discard", "hidden", "visible", "extendDomain"]], - Literal["discard", "hidden", "visible", "extendDomain"], + Literal["discard", "extendDomain", "hidden", "visible"], + Var[Literal["discard", "extendDomain", "hidden", "visible"]], ] ] = None, - label: Optional[Union[Var[Union[int, str]], str, int]] = None, + label: Optional[Union[Var[Union[int, str]], int, str]] = None, is_front: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReferenceDot": @@ -2055,19 +1912,19 @@ class ReferenceArea(Recharts): def create( # type: ignore cls, *children, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, fill_opacity: Optional[Union[Var[float], float]] = None, - x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None, - x1: Optional[Union[Var[Union[int, str]], str, int]] = None, - x2: Optional[Union[Var[Union[int, str]], str, int]] = None, - y1: Optional[Union[Var[Union[int, str]], str, int]] = None, - y2: Optional[Union[Var[Union[int, str]], str, int]] = None, + x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, + x1: Optional[Union[Var[Union[int, str]], int, str]] = None, + x2: Optional[Union[Var[Union[int, str]], int, str]] = None, + y1: Optional[Union[Var[Union[int, str]], int, str]] = None, + y2: Optional[Union[Var[Union[int, str]], int, str]] = None, if_overflow: Optional[ Union[ - Var[Literal["discard", "hidden", "visible", "extendDomain"]], - Literal["discard", "hidden", "visible", "extendDomain"], + Literal["discard", "extendDomain", "hidden", "visible"], + Var[Literal["discard", "extendDomain", "hidden", "visible"]], ] ] = None, is_front: Optional[Union[Var[bool], bool]] = None, @@ -2076,51 +1933,41 @@ class ReferenceArea(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReferenceArea": @@ -2167,51 +2014,41 @@ class Grid(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Grid": @@ -2245,15 +2082,15 @@ class CartesianGrid(Grid): horizontal: Optional[Union[Var[bool], bool]] = None, vertical: Optional[Union[Var[bool], bool]] = None, vertical_points: Optional[ - Union[Var[List[Union[int, str]]], List[Union[int, str]]] + Union[List[Union[int, str]], Var[List[Union[int, str]]]] ] = None, horizontal_points: Optional[ - Union[Var[List[Union[int, str]]], List[Union[int, str]]] + Union[List[Union[int, str]], Var[List[Union[int, str]]]] ] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, fill_opacity: Optional[Union[Var[float], float]] = None, stroke_dasharray: Optional[Union[Var[str], str]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, x: Optional[Union[Var[int], int]] = None, y: Optional[Union[Var[int], int]] = None, width: Optional[Union[Var[int], int]] = None, @@ -2263,51 +2100,41 @@ class CartesianGrid(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CartesianGrid": @@ -2348,8 +2175,8 @@ class CartesianAxis(Grid): *children, orientation: Optional[ Union[ - Var[Literal["top", "bottom", "left", "right"]], - Literal["top", "bottom", "left", "right"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, axis_line: Optional[Union[Var[bool], bool]] = None, @@ -2357,8 +2184,8 @@ class CartesianAxis(Grid): tick_size: Optional[Union[Var[int], int]] = None, interval: Optional[ Union[ - Var[Literal["preserveStart", "preserveEnd", "preserveStartEnd"]], - Literal["preserveStart", "preserveEnd", "preserveStartEnd"], + Literal["preserveEnd", "preserveStart", "preserveStartEnd"], + Var[Literal["preserveEnd", "preserveStart", "preserveStartEnd"]], ] ] = None, ticks: Optional[Union[Var[bool], bool]] = None, @@ -2374,51 +2201,41 @@ class CartesianAxis(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CartesianAxis": diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index ac46336f7..6f79a70ae 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -9,8 +9,7 @@ from reflex.components.recharts.general import ResponsiveContainer from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from .recharts import ( LiteralAnimationEasing, @@ -62,7 +61,7 @@ class ChartBase(RechartsCharts): return if isinstance(value, str) and value.endswith("%"): return - if isinstance(value, ImmutableVar) and issubclass(value._var_type, int): + if isinstance(value, Var) and issubclass(value._var_type, int): return raise ValueError( f"Chart {name} must be specified as int pixels or percentage, not {value!r}. " @@ -324,7 +323,7 @@ class RadarChart(ChartBase): "Radar", ] - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -413,7 +412,7 @@ class ScatterChart(ChartBase): "Scatter", ] - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 57ed0c407..2d5036656 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .recharts import ( RechartsCharts, @@ -21,58 +20,48 @@ class ChartBase(RechartsCharts): def create( # type: ignore cls, *children, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ChartBase": @@ -101,76 +90,66 @@ class CategoricalChartBase(ChartBase): def create( # type: ignore cls, *children, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, sync_id: Optional[Union[Var[str], str]] = None, sync_method: Optional[ - Union[Var[Literal["index", "value"]], Literal["index", "value"]] + Union[Literal["index", "value"], Var[Literal["index", "value"]]] ] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, stack_offset: Optional[ Union[ - Var[Literal["expand", "none", "wiggle", "silhouette"]], - Literal["expand", "none", "wiggle", "silhouette"], + Literal["expand", "none", "silhouette", "wiggle"], + Var[Literal["expand", "none", "silhouette", "wiggle"]], ] ] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CategoricalChartBase": @@ -207,81 +186,71 @@ class AreaChart(CategoricalChartBase): *children, base_value: Optional[ Union[ - Var[Union[Literal["dataMin", "dataMax", "auto"], int]], + Literal["auto", "dataMax", "dataMin"], + Var[Union[Literal["auto", "dataMax", "dataMin"], int]], int, - Literal["dataMin", "dataMax", "auto"], ] ] = None, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, sync_id: Optional[Union[Var[str], str]] = None, sync_method: Optional[ - Union[Var[Literal["index", "value"]], Literal["index", "value"]] + Union[Literal["index", "value"], Var[Literal["index", "value"]]] ] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, stack_offset: Optional[ Union[ - Var[Literal["expand", "none", "wiggle", "silhouette"]], - Literal["expand", "none", "wiggle", "silhouette"], + Literal["expand", "none", "silhouette", "wiggle"], + Var[Literal["expand", "none", "silhouette", "wiggle"]], ] ] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AreaChart": @@ -317,81 +286,71 @@ class BarChart(CategoricalChartBase): def create( # type: ignore cls, *children, - bar_category_gap: Optional[Union[Var[Union[int, str]], str, int]] = None, - bar_gap: Optional[Union[Var[Union[int, str]], str, int]] = None, + bar_category_gap: Optional[Union[Var[Union[int, str]], int, str]] = None, + bar_gap: Optional[Union[Var[Union[int, str]], int, str]] = None, bar_size: Optional[Union[Var[int], int]] = None, max_bar_size: Optional[Union[Var[int], int]] = None, stack_offset: Optional[ Union[ - Var[Literal["expand", "none", "wiggle", "silhouette"]], - Literal["expand", "none", "wiggle", "silhouette"], + Literal["expand", "none", "silhouette", "wiggle"], + Var[Literal["expand", "none", "silhouette", "wiggle"]], ] ] = None, reverse_stack_order: Optional[Union[Var[bool], bool]] = None, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, sync_id: Optional[Union[Var[str], str]] = None, sync_method: Optional[ - Union[Var[Literal["index", "value"]], Literal["index", "value"]] + Union[Literal["index", "value"], Var[Literal["index", "value"]]] ] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BarChart": @@ -431,76 +390,66 @@ class LineChart(CategoricalChartBase): def create( # type: ignore cls, *children, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, sync_id: Optional[Union[Var[str], str]] = None, sync_method: Optional[ - Union[Var[Literal["index", "value"]], Literal["index", "value"]] + Union[Literal["index", "value"], Var[Literal["index", "value"]]] ] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, stack_offset: Optional[ Union[ - Var[Literal["expand", "none", "wiggle", "silhouette"]], - Literal["expand", "none", "wiggle", "silhouette"], + Literal["expand", "none", "silhouette", "wiggle"], + Var[Literal["expand", "none", "silhouette", "wiggle"]], ] ] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LineChart": @@ -537,85 +486,75 @@ class ComposedChart(CategoricalChartBase): *children, base_value: Optional[ Union[ - Var[Union[Literal["dataMin", "dataMax", "auto"], int]], + Literal["auto", "dataMax", "dataMin"], + Var[Union[Literal["auto", "dataMax", "dataMin"], int]], int, - Literal["dataMin", "dataMax", "auto"], ] ] = None, - bar_category_gap: Optional[Union[Var[Union[int, str]], str, int]] = None, - bar_gap: Optional[Union[Var[Union[int, str]], str, int]] = None, + bar_category_gap: Optional[Union[Var[Union[int, str]], int, str]] = None, + bar_gap: Optional[Union[Var[Union[int, str]], int, str]] = None, bar_size: Optional[Union[Var[int], int]] = None, reverse_stack_order: Optional[Union[Var[bool], bool]] = None, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, sync_id: Optional[Union[Var[str], str]] = None, sync_method: Optional[ - Union[Var[Literal["index", "value"]], Literal["index", "value"]] + Union[Literal["index", "value"], Var[Literal["index", "value"]]] ] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, stack_offset: Optional[ Union[ - Var[Literal["expand", "none", "wiggle", "silhouette"]], - Literal["expand", "none", "wiggle", "silhouette"], + Literal["expand", "none", "silhouette", "wiggle"], + Var[Literal["expand", "none", "silhouette", "wiggle"]], ] ] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ComposedChart": @@ -655,59 +594,49 @@ class PieChart(ChartBase): def create( # type: ignore cls, *children, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PieChart": @@ -732,36 +661,34 @@ class PieChart(ChartBase): ... class RadarChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore cls, *children, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, cx: Optional[Union[Var[Union[int, str]], int, str]] = None, cy: Optional[Union[Var[Union[int, str]], int, str]] = None, start_angle: Optional[Union[Var[int], int]] = None, end_angle: Optional[Union[Var[int], int]] = None, inner_radius: Optional[Union[Var[Union[int, str]], int, str]] = None, outer_radius: Optional[Union[Var[Union[int, str]], int, str]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadarChart": @@ -798,8 +725,8 @@ class RadialBarChart(ChartBase): def create( # type: ignore cls, *children, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, cx: Optional[Union[Var[Union[int, str]], int, str]] = None, cy: Optional[Union[Var[Union[int, str]], int, str]] = None, start_angle: Optional[Union[Var[int], int]] = None, @@ -809,58 +736,48 @@ class RadialBarChart(ChartBase): bar_category_gap: Optional[Union[Var[Union[int, str]], int, str]] = None, bar_gap: Optional[Union[Var[str], str]] = None, bar_size: Optional[Union[Var[int], int]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadialBarChart": @@ -895,44 +812,42 @@ class RadialBarChart(ChartBase): ... class ScatterChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore cls, *children, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ScatterChart": @@ -963,60 +878,50 @@ class FunnelChart(ChartBase): cls, *children, layout: Optional[Union[Var[str], str]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FunnelChart": @@ -1048,18 +953,18 @@ class Treemap(RechartsCharts): def create( # type: ignore cls, *children, - width: Optional[Union[Var[Union[int, str]], str, int]] = None, - height: Optional[Union[Var[Union[int, str]], str, int]] = None, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + width: Optional[Union[Var[Union[int, str]], int, str]] = None, + height: Optional[Union[Var[Union[int, str]], int, str]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, aspect_ratio: Optional[Union[Var[int], int]] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_begin: Optional[Union[Var[int], int]] = None, animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ Union[ - Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]], - Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"], + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], ] ] = None, style: Optional[Style] = None, @@ -1067,57 +972,47 @@ class Treemap(RechartsCharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Treemap": diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index 4f81ea833..cc252de57 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -7,8 +7,7 @@ from typing import Any, Dict, List, Union from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from .recharts import ( LiteralAnimationEasing, diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index 2c4361ef7..0e21c8b85 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -8,9 +8,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .recharts import ( Recharts, @@ -33,51 +32,41 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ResponsiveContainer": @@ -114,106 +103,96 @@ class Legend(Recharts): height: Optional[Union[Var[int], int]] = None, layout: Optional[ Union[ - Var[Literal["horizontal", "vertical"]], Literal["horizontal", "vertical"], + Var[Literal["horizontal", "vertical"]], ] ] = None, align: Optional[ Union[ - Var[Literal["left", "center", "right"]], - Literal["left", "center", "right"], + Literal["center", "left", "right"], + Var[Literal["center", "left", "right"]], ] ] = None, vertical_align: Optional[ Union[ - Var[Literal["top", "middle", "bottom"]], - Literal["top", "middle", "bottom"], + Literal["bottom", "middle", "top"], + Var[Literal["bottom", "middle", "top"]], ] ] = None, icon_size: Optional[Union[Var[int], int]] = None, icon_type: Optional[ Union[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ], Var[ Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "plainline", + "rect", + "square", "star", "triangle", "wye", ] ], - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - ], ] ] = None, chart_width: Optional[Union[Var[int], int]] = None, chart_height: Optional[Union[Var[int], int]] = None, - margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Legend": @@ -254,25 +233,25 @@ class GraphingTooltip(Recharts): offset: Optional[Union[Var[int], int]] = None, filter_null: Optional[Union[Var[bool], bool]] = None, cursor: Optional[ - Union[Var[Union[Dict[str, Any], bool]], Dict[str, Any], bool] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, - view_box: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - item_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - wrapper_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - content_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - label_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + view_box: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + item_style: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + wrapper_style: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + content_style: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + label_style: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, allow_escape_view_box: Optional[ - Union[Var[Dict[str, bool]], Dict[str, bool]] + Union[Dict[str, bool], Var[Dict[str, bool]]] ] = None, active: Optional[Union[Var[bool], bool]] = None, - position: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, - coordinate: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + position: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, + coordinate: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ Union[ - Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]], - Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"], + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], ] ] = None, style: Optional[Style] = None, @@ -280,51 +259,41 @@ class GraphingTooltip(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "GraphingTooltip": @@ -367,52 +336,52 @@ class Label(Recharts): def create( # type: ignore cls, *children, - view_box: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None, + view_box: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, value: Optional[Union[Var[str], str]] = None, offset: Optional[Union[Var[int], int]] = None, position: Optional[ Union[ - Var[ - Literal[ - "top", - "left", - "right", - "bottom", - "inside", - "outside", - "insideLeft", - "insideRight", - "insideTop", - "insideBottom", - "insideTopLeft", - "insideBottomLeft", - "insideTopRight", - "insideBottomRight", - "insideStart", - "insideEnd", - "end", - "center", - ] - ], Literal[ - "top", - "left", - "right", "bottom", + "center", + "end", "inside", - "outside", + "insideBottom", + "insideBottomLeft", + "insideBottomRight", + "insideEnd", "insideLeft", "insideRight", - "insideTop", - "insideBottom", - "insideTopLeft", - "insideBottomLeft", - "insideTopRight", - "insideBottomRight", "insideStart", - "insideEnd", - "end", - "center", + "insideTop", + "insideTopLeft", + "insideTopRight", + "left", + "outside", + "right", + "top", + ], + Var[ + Literal[ + "bottom", + "center", + "end", + "inside", + "insideBottom", + "insideBottomLeft", + "insideBottomRight", + "insideEnd", + "insideLeft", + "insideRight", + "insideStart", + "insideTop", + "insideTopLeft", + "insideTopRight", + "left", + "outside", + "right", + "top", + ] ], ] ] = None, @@ -421,51 +390,41 @@ class Label(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Label": @@ -496,106 +455,96 @@ class LabelList(Recharts): def create( # type: ignore cls, *children, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, position: Optional[ Union[ - Var[ - Literal[ - "top", - "left", - "right", - "bottom", - "inside", - "outside", - "insideLeft", - "insideRight", - "insideTop", - "insideBottom", - "insideTopLeft", - "insideBottomLeft", - "insideTopRight", - "insideBottomRight", - "insideStart", - "insideEnd", - "end", - "center", - ] - ], Literal[ - "top", - "left", - "right", "bottom", + "center", + "end", "inside", - "outside", + "insideBottom", + "insideBottomLeft", + "insideBottomRight", + "insideEnd", "insideLeft", "insideRight", - "insideTop", - "insideBottom", - "insideTopLeft", - "insideBottomLeft", - "insideTopRight", - "insideBottomRight", "insideStart", - "insideEnd", - "end", - "center", + "insideTop", + "insideTopLeft", + "insideTopRight", + "left", + "outside", + "right", + "top", + ], + Var[ + Literal[ + "bottom", + "center", + "end", + "inside", + "insideBottom", + "insideBottomLeft", + "insideBottomRight", + "insideEnd", + "insideLeft", + "insideRight", + "insideStart", + "insideTop", + "insideTopLeft", + "insideTopRight", + "left", + "outside", + "right", + "top", + ] ], ] ] = None, offset: Optional[Union[Var[int], int]] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + stroke: Optional[Union[Color, Var[Union[Color, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LabelList": diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 3333a41be..adeb0eb91 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -7,8 +7,7 @@ from typing import Any, Dict, List, Union from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var from .recharts import ( LiteralAnimationEasing, @@ -78,7 +77,7 @@ class Pie(Recharts): # Fill color fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 3)) - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -175,7 +174,7 @@ class RadialBar(Recharts): # Valid children components _valid_children: List[str] = ["Cell", "LabelList"] - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -348,7 +347,7 @@ class PolarRadiusAxis(Recharts): # The stroke color of axis stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 1b10758ed..9d793f3da 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -7,23 +7,22 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var from .recharts import ( Recharts, ) class Pie(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore cls, *children, - data: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, cx: Optional[Union[Var[Union[int, str]], int, str]] = None, cy: Optional[Union[Var[Union[int, str]], int, str]] = None, inner_radius: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -35,63 +34,61 @@ class Pie(Recharts): name_key: Optional[Union[Var[str], str]] = None, legend_type: Optional[ Union[ - Var[ - Literal[ - "line", - "plainline", - "square", - "rect", - "circle", - "cross", - "diamond", - "star", - "triangle", - "wye", - "none", - ] - ], Literal[ - "line", - "plainline", - "square", - "rect", "circle", "cross", "diamond", + "line", + "none", + "plainline", + "rect", + "square", "star", "triangle", "wye", - "none", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] ], ] ] = None, label: Optional[Union[Var[bool], bool]] = None, label_line: Optional[Union[Var[bool], bool]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, - fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + fill: Optional[Union[Color, Var[Union[Color, 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[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Pie": @@ -134,10 +131,10 @@ class Radar(Recharts): def create( # type: ignore cls, *children, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, - points: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + points: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, dot: Optional[Union[Var[bool], bool]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, fill: Optional[Union[Var[str], str]] = None, fill_opacity: Optional[Union[Var[float], float]] = None, legend_type: Optional[Union[Var[str], str]] = None, @@ -146,8 +143,8 @@ class Radar(Recharts): animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ Union[ - Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]], - Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"], + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], ] ] = None, style: Optional[Style] = None, @@ -155,51 +152,41 @@ class Radar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Radar": @@ -232,28 +219,28 @@ class Radar(Recharts): ... class RadialBar(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore cls, *children, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, min_angle: Optional[Union[Var[int], int]] = None, legend_type: Optional[Union[Var[str], str]] = None, label: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, background: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_begin: Optional[Union[Var[int], int]] = None, animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ Union[ - Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]], - Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"], + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], ] ] = None, style: Optional[Style] = None, @@ -261,30 +248,28 @@ class RadialBar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadialBar": @@ -320,72 +305,62 @@ class PolarAngleAxis(Recharts): def create( # type: ignore cls, *children, - data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, + data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, cx: Optional[Union[Var[Union[int, str]], int, str]] = None, cy: Optional[Union[Var[Union[int, str]], int, str]] = None, radius: Optional[Union[Var[Union[int, str]], int, str]] = None, axis_line: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, axis_line_type: Optional[Union[Var[str], str]] = None, tick_line: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, tick: Optional[Union[Var[Union[int, str]], int, str]] = None, - ticks: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None, + ticks: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, orient: Optional[Union[Var[str], str]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, allow_duplicated_category: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PolarAngleAxis": @@ -428,62 +403,52 @@ class PolarGrid(Recharts): cy: Optional[Union[Var[Union[int, str]], int, str]] = None, inner_radius: Optional[Union[Var[Union[int, str]], int, str]] = None, outer_radius: Optional[Union[Var[Union[int, str]], int, str]] = None, - polar_angles: Optional[Union[Var[List[int]], List[int]]] = None, - polar_radius: Optional[Union[Var[List[int]], List[int]]] = None, + polar_angles: Optional[Union[List[int], Var[List[int]]]] = None, + polar_radius: Optional[Union[List[int], Var[List[int]]]] = None, grid_type: Optional[ - Union[Var[Literal["polygon", "circle"]], Literal["polygon", "circle"]] + Union[Literal["circle", "polygon"], Var[Literal["circle", "polygon"]]] ] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Color, Var[Union[Color, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PolarGrid": @@ -513,7 +478,7 @@ class PolarGrid(Recharts): ... class PolarRadiusAxis(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -521,7 +486,7 @@ class PolarRadiusAxis(Recharts): *children, angle: Optional[Union[Var[int], int]] = None, type_: Optional[ - Union[Var[Literal["number", "category"]], Literal["number", "category"]] + Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, allow_duplicated_category: Optional[Union[Var[bool], bool]] = None, cx: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -529,75 +494,73 @@ class PolarRadiusAxis(Recharts): reversed: Optional[Union[Var[bool], bool]] = None, orientation: Optional[Union[Var[str], str]] = None, axis_line: Optional[ - Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]] + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, tick: Optional[Union[Var[Union[int, str]], int, str]] = None, tick_count: Optional[Union[Var[int], int]] = None, scale: Optional[ Union[ + Literal[ + "auto", + "band", + "identity", + "linear", + "log", + "ordinal", + "point", + "pow", + "quantile", + "quantize", + "sequential", + "sqrt", + "threshold", + "time", + "utc", + ], Var[ Literal[ "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", "band", - "point", + "identity", + "linear", + "log", "ordinal", + "point", + "pow", "quantile", "quantize", - "utc", "sequential", + "sqrt", "threshold", + "time", + "utc", ] ], - Literal[ - "auto", - "linear", - "pow", - "sqrt", - "log", - "identity", - "time", - "band", - "point", - "ordinal", - "quantile", - "quantize", - "utc", - "sequential", - "threshold", - ], ] ] = None, - domain: Optional[Union[Var[List[int]], List[int]]] = None, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + domain: Optional[Union[List[int], Var[List[int]]]] = None, + stroke: Optional[Union[Color, Var[Union[Color, 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[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PolarRadiusAxis": diff --git a/reflex/components/recharts/recharts.pyi b/reflex/components/recharts/recharts.pyi index 7ca618918..1f1937dc6 100644 --- a/reflex/components/recharts/recharts.pyi +++ b/reflex/components/recharts/recharts.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style +from reflex.vars.base import Var class Recharts(Component): def render(self) -> Dict: ... @@ -22,51 +22,41 @@ class Recharts(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Recharts": @@ -98,51 +88,41 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RechartsCharts": diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index c93b07044..c797d7f84 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -14,12 +14,12 @@ from reflex.event import ( EventSpec, call_script, ) -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style, resolved_color_mode from reflex.utils import format from reflex.utils.imports import ImportVar from reflex.utils.serializers import serialize, serializer -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var LiteralPosition = Literal[ "top-left", @@ -30,7 +30,7 @@ LiteralPosition = Literal[ "bottom-right", ] -toast_ref = ImmutableVar.create_safe("refs['__toast']") +toast_ref = Var(_js_expr="refs['__toast']") class ToastAction(Base): @@ -56,7 +56,7 @@ def serialize_action(action: ToastAction) -> dict: } -def _toast_callback_signature(toast: Var) -> list[ImmutableVar]: +def _toast_callback_signature(toast: Var) -> list[Var]: """The signature for the toast callback, stripping out unserializable keys. Args: @@ -66,8 +66,8 @@ def _toast_callback_signature(toast: Var) -> list[ImmutableVar]: A function call stripping non-serializable members of the toast object. """ return [ - ImmutableVar.create_safe( - f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {str(toast)}; return rest}})()" + Var( + _js_expr=f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {str(toast)}; return rest}})()" ) ] @@ -76,10 +76,10 @@ class ToastProps(PropsBase): """Props for the toast component.""" # Toast's title, renders above the description. - title: Optional[Union[str, ImmutableVar]] + title: Optional[Union[str, Var]] # Toast's description, renders underneath the title. - description: Optional[Union[str, ImmutableVar]] + description: Optional[Union[str, Var]] # Whether to show the close button. close_button: Optional[bool] @@ -111,7 +111,7 @@ class ToastProps(PropsBase): cancel: Optional[ToastAction] # Custom id for the toast. - id: Optional[Union[str, ImmutableVar]] + id: Optional[Union[str, Var]] # Removes the default styling, which allows for easier customization. unstyled: Optional[bool] @@ -241,14 +241,14 @@ class Toaster(Component): # Marked True when any Toast component is created. is_used: ClassVar[bool] = False - def add_hooks(self) -> list[ImmutableVar | str]: + def add_hooks(self) -> list[Var | str]: """Add hooks for the toaster component. Returns: The hooks for the toaster component. """ - hook = ImmutableVar.create_safe( - f"{toast_ref} = toast", + hook = Var( + _js_expr=f"{toast_ref} = toast", _var_data=VarData( imports={ "/utils/state": [ImportVar(tag="refs")], @@ -286,7 +286,7 @@ class Toaster(Component): else: toast = f"{toast_command}(`{message}`)" - toast_action = ImmutableVar.create_safe(toast) + toast_action = Var(_js_expr=toast) return call_script(toast_action) @staticmethod @@ -353,16 +353,15 @@ class Toaster(Component): """ dismiss_var_data = None - if isinstance(id, ImmutableVar): + if isinstance(id, Var): dismiss = f"{toast_ref}.dismiss({str(id)})" dismiss_var_data = id._get_all_var_data() elif isinstance(id, str): dismiss = f"{toast_ref}.dismiss('{id}')" else: dismiss = f"{toast_ref}.dismiss()" - dismiss_action = ImmutableVar.create_safe( - dismiss, - _var_data=VarData.merge(dismiss_var_data), + dismiss_action = Var( + _js_expr=dismiss, _var_data=VarData.merge(dismiss_var_data) ) return call_script(dismiss_action) diff --git a/reflex/components/sonner/toast.pyi b/reflex/components/sonner/toast.pyi index d18f5a3a9..67f826164 100644 --- a/reflex/components/sonner/toast.pyi +++ b/reflex/components/sonner/toast.pyi @@ -10,10 +10,9 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.props import PropsBase from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.serializers import serializer -from reflex.vars import Var +from reflex.vars.base import Var LiteralPosition = Literal[ "top-left", @@ -23,7 +22,7 @@ LiteralPosition = Literal[ "bottom-center", "bottom-right", ] -toast_ref = ImmutableVar.create_safe("refs['__toast']") +toast_ref = Var(_js_expr="refs['__toast']") class ToastAction(Base): label: str @@ -33,8 +32,8 @@ class ToastAction(Base): def serialize_action(action: ToastAction) -> dict: ... class ToastProps(PropsBase): - title: Optional[Union[str, ImmutableVar]] - description: Optional[Union[str, ImmutableVar]] + title: Optional[Union[str, Var]] + description: Optional[Union[str, Var]] close_button: Optional[bool] invert: Optional[bool] important: Optional[bool] @@ -43,7 +42,7 @@ class ToastProps(PropsBase): dismissible: Optional[bool] action: Optional[ToastAction] cancel: Optional[ToastAction] - id: Optional[Union[str, ImmutableVar]] + id: Optional[Union[str, Var]] unstyled: Optional[bool] style: Optional[Style] action_button_styles: Optional[Style] @@ -61,7 +60,7 @@ class ToastProps(PropsBase): class Toaster(Component): is_used: ClassVar[bool] = False - def add_hooks(self) -> list[ImmutableVar | str]: ... + def add_hooks(self) -> list[Var | str]: ... @staticmethod def send_toast( message: str = "", level: str | None = None, **props @@ -87,24 +86,24 @@ class Toaster(Component): visible_toasts: Optional[Union[Var[int], int]] = None, position: Optional[ Union[ + Literal[ + "bottom-center", + "bottom-left", + "bottom-right", + "top-center", + "top-left", + "top-right", + ], Var[ Literal[ - "top-left", - "top-center", - "top-right", - "bottom-left", "bottom-center", + "bottom-left", "bottom-right", + "top-center", + "top-left", + "top-right", ] ], - Literal[ - "top-left", - "top-center", - "top-right", - "bottom-left", - "bottom-center", - "bottom-right", - ], ] ] = None, close_button: Optional[Union[Var[bool], bool]] = None, @@ -112,60 +111,50 @@ class Toaster(Component): dir: Optional[Union[Var[str], str]] = None, hotkey: Optional[Union[Var[str], str]] = None, invert: Optional[Union[Var[bool], bool]] = None, - toast_options: Optional[Union[Var[ToastProps], ToastProps]] = None, + toast_options: Optional[Union[ToastProps, Var[ToastProps]]] = None, gap: Optional[Union[Var[int], int]] = None, - loading_icon: Optional[Union[Var[Icon], Icon]] = None, + loading_icon: Optional[Union[Icon, Var[Icon]]] = None, pause_when_page_is_hidden: 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Toaster": diff --git a/reflex/components/suneditor/editor.py b/reflex/components/suneditor/editor.py index d768d79f8..6f5b6e4b4 100644 --- a/reflex/components/suneditor/editor.py +++ b/reflex/components/suneditor/editor.py @@ -8,10 +8,9 @@ from typing import Dict, List, Literal, Optional, Union from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.event import EventHandler -from reflex.ivars.base import ImmutableVar from reflex.utils.format import to_camel_case from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars import Var +from reflex.vars.base import Var class EditorButtonList(list, enum.Enum): @@ -235,7 +234,7 @@ class Editor(NoSSRComponent): ValueError: If set_options is a state Var. """ if set_options is not None: - if isinstance(set_options, ImmutableVar): + if isinstance(set_options, Var): raise ValueError("EditorOptions cannot be a state Var") props["set_options"] = { to_camel_case(k): v diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index 63a8032b9..8fb92b51a 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -9,10 +9,9 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var class EditorButtonList(list, enum.Enum): BASIC = [["font", "fontSize"], ["fontColor"], ["horizontalRule"], ["link", "image"]] @@ -54,51 +53,51 @@ class Editor(NoSSRComponent): *children, lang: Optional[ Union[ + Literal[ + "ckb", + "da", + "de", + "en", + "es", + "fr", + "he", + "it", + "ja", + "ko", + "lv", + "pl", + "pt_br", + "ro", + "ru", + "se", + "ua", + "zh_cn", + ], Var[ Union[ Literal[ - "en", + "ckb", "da", "de", + "en", "es", "fr", - "ja", - "ko", - "pt_br", - "ru", - "zh_cn", - "ro", - "pl", - "ckb", - "lv", - "se", - "ua", "he", "it", + "ja", + "ko", + "lv", + "pl", + "pt_br", + "ro", + "ru", + "se", + "ua", + "zh_cn", ], dict, ] ], - Literal[ - "en", - "da", - "de", - "es", - "fr", - "ja", - "ko", - "pt_br", - "ru", - "zh_cn", - "ro", - "pl", - "ckb", - "lv", - "se", - "ua", - "he", - "it", - ], dict, ] ] = None, @@ -108,7 +107,7 @@ class Editor(NoSSRComponent): height: Optional[Union[Var[str], str]] = None, placeholder: Optional[Union[Var[str], str]] = None, auto_focus: Optional[Union[Var[bool], bool]] = None, - set_options: Optional[Union[Var[Dict], Dict]] = None, + set_options: Optional[Union[Dict, Var[Dict]]] = None, set_all_plugins: Optional[Union[Var[bool], bool]] = None, set_contents: Optional[Union[Var[str], str]] = None, append_contents: Optional[Union[Var[str], str]] = None, @@ -122,78 +121,56 @@ class Editor(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_copy: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_cut: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_copy: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_cut: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_input: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_load: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_input: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_paste: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_resize_editor: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, toggle_code_view: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, toggle_full_screen: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Editor": diff --git a/reflex/components/tags/cond_tag.py b/reflex/components/tags/cond_tag.py index 7bdf9a3c7..b4d0fe469 100644 --- a/reflex/components/tags/cond_tag.py +++ b/reflex/components/tags/cond_tag.py @@ -4,8 +4,7 @@ import dataclasses from typing import Any, Dict, Optional from reflex.components.tags.tag import Tag -from reflex.ivars.base import LiteralVar -from reflex.vars import Var +from reflex.vars.base import Var @dataclasses.dataclass() @@ -13,7 +12,7 @@ class CondTag(Tag): """A conditional tag.""" # The condition to determine which component to render. - cond: Var[Any] = dataclasses.field(default_factory=lambda: LiteralVar.create(True)) + cond: Var[Any] = dataclasses.field(default_factory=lambda: Var.create(True)) # The code to render if the condition is true. true_value: Dict = dataclasses.field(default_factory=dict) diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index ff6925f56..e998fc41a 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -4,12 +4,19 @@ from __future__ import annotations import dataclasses import inspect -from typing import TYPE_CHECKING, Any, Callable, List, Tuple, Type, Union, get_args +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Iterable, + Tuple, + Type, + Union, + get_args, +) from reflex.components.tags.tag import Tag -from reflex.ivars.base import ImmutableVar -from reflex.ivars.sequence import LiteralArrayVar -from reflex.vars import Var, get_unique_variable_name +from reflex.vars import LiteralArrayVar, Var, get_unique_variable_name if TYPE_CHECKING: from reflex.components.component import Component @@ -20,7 +27,7 @@ class IterTag(Tag): """An iterator tag.""" # The var to iterate over. - iterable: Var[List] = dataclasses.field( + iterable: Var[Iterable] = dataclasses.field( default_factory=lambda: LiteralArrayVar.create([]) ) @@ -39,7 +46,7 @@ class IterTag(Tag): Returns: The type of the iterable var. """ - iterable = self.iterable.upcast() + iterable = self.iterable try: if iterable._var_type.mro()[0] == dict: # Arg is a tuple of (key, value). @@ -60,8 +67,8 @@ class IterTag(Tag): Returns: The index var. """ - return ImmutableVar( - _var_name=self.index_var_name, + return Var( + _js_expr=self.index_var_name, _var_type=int, ).guess_type() @@ -73,8 +80,8 @@ class IterTag(Tag): Returns: The arg var. """ - return ImmutableVar( - _var_name=self.arg_var_name, + return Var( + _js_expr=self.arg_var_name, _var_type=self.get_iterable_var_type(), ).guess_type() @@ -86,8 +93,8 @@ class IterTag(Tag): Returns: The index var. """ - return ImmutableVar( - _var_name=self.index_var_name, + return Var( + _js_expr=self.index_var_name, _var_type=int, ).guess_type() @@ -99,8 +106,8 @@ class IterTag(Tag): Returns: The arg var. """ - return ImmutableVar( - _var_name=self.arg_var_name, + return Var( + _js_expr=self.arg_var_name, _var_type=self.get_iterable_var_type(), ).guess_type() diff --git a/reflex/components/tags/match_tag.py b/reflex/components/tags/match_tag.py index b67ed62cc..01eedb296 100644 --- a/reflex/components/tags/match_tag.py +++ b/reflex/components/tags/match_tag.py @@ -4,8 +4,7 @@ import dataclasses from typing import Any, List from reflex.components.tags.tag import Tag -from reflex.ivars.base import LiteralVar -from reflex.vars import Var +from reflex.vars.base import Var @dataclasses.dataclass() @@ -13,10 +12,10 @@ class MatchTag(Tag): """A match tag.""" # The condition to determine which case to match. - cond: Var[Any] = dataclasses.field(default_factory=lambda: LiteralVar.create(True)) + cond: Var[Any] = dataclasses.field(default_factory=lambda: Var.create(True)) # The list of match cases to be matched. match_cases: List[Any] = dataclasses.field(default_factory=list) # The catchall case to match. - default: Any = dataclasses.field(default=LiteralVar.create(None)) + default: Any = dataclasses.field(default=Var.create(None)) diff --git a/reflex/components/tags/tag.py b/reflex/components/tags/tag.py index 8c97d72c5..d577abc6e 100644 --- a/reflex/components/tags/tag.py +++ b/reflex/components/tags/tag.py @@ -6,8 +6,8 @@ import dataclasses from typing import Any, Dict, List, Optional, Tuple, Union from reflex.event import EventChain -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import format, types +from reflex.vars.base import LiteralVar, Var @dataclasses.dataclass() @@ -27,7 +27,7 @@ class Tag: args: Optional[Tuple[str, ...]] = None # Special props that aren't key value pairs. - special_props: List[ImmutableVar] = dataclasses.field(default_factory=list) + special_props: List[Var] = dataclasses.field(default_factory=list) # The children components. children: List[Any] = dataclasses.field(default_factory=list) @@ -109,7 +109,7 @@ class Tag: return self @staticmethod - def is_valid_prop(prop: Optional[ImmutableVar]) -> bool: + def is_valid_prop(prop: Optional[Var]) -> bool: """Check if the prop is valid. Args: diff --git a/reflex/event.py b/reflex/event.py index 73fecfc03..ac0c713ab 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -19,13 +19,13 @@ from typing import ( ) from reflex import constants -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.ivars.function import FunctionStringVar, FunctionVar -from reflex.ivars.object import ObjectVar from reflex.utils import format from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.types import ArgsSpec -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var +from reflex.vars.function import FunctionStringVar, FunctionVar +from reflex.vars.object import ObjectVar try: from typing import Annotated @@ -201,7 +201,7 @@ class EventHandler(EventActionsMixin): # Get the function args. fn_args = inspect.getfullargspec(self.fn).args[1:] - fn_args = (ImmutableVar.create_safe(arg) for arg in fn_args) + fn_args = (Var(_js_expr=arg) for arg in fn_args) # Construct the payload. values = [] @@ -243,16 +243,14 @@ class EventSpec(EventActionsMixin): client_handler_name: str = dataclasses.field(default="") # The arguments to pass to the function. - args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] = dataclasses.field( - default_factory=tuple - ) + args: Tuple[Tuple[Var, Var], ...] = dataclasses.field(default_factory=tuple) def __init__( self, handler: EventHandler, event_actions: Dict[str, Union[bool, int]] | None = None, client_handler_name: str = "", - args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] = tuple(), + args: Tuple[Tuple[Var, Var], ...] = tuple(), ): """Initialize an EventSpec. @@ -269,9 +267,7 @@ class EventSpec(EventActionsMixin): object.__setattr__(self, "client_handler_name", client_handler_name) object.__setattr__(self, "args", args or tuple()) - def with_args( - self, args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] - ) -> EventSpec: + def with_args(self, args: Tuple[Tuple[Var, Var], ...]) -> EventSpec: """Copy the event spec, with updated args. Args: @@ -287,7 +283,7 @@ class EventSpec(EventActionsMixin): event_actions=self.event_actions.copy(), ) - def add_args(self, *args: ImmutableVar) -> EventSpec: + def add_args(self, *args: Var) -> EventSpec: """Add arguments to the event spec. Args: @@ -303,7 +299,7 @@ class EventSpec(EventActionsMixin): # Get the remaining unfilled function args. fn_args = inspect.getfullargspec(self.handler.fn).args[1 + len(self.args) :] - fn_args = (ImmutableVar.create_safe(arg) for arg in fn_args) + fn_args = (Var(_js_expr=arg) for arg in fn_args) # Construct the payload. values = [] @@ -449,15 +445,15 @@ class FileUpload: upload_id = self.upload_id or DEFAULT_UPLOAD_ID spec_args = [ ( - ImmutableVar.create_safe("files"), - ImmutableVar( - _var_name="filesById", + Var(_js_expr="files"), + Var( + _js_expr="filesById", _var_type=Dict[str, Any], _var_data=VarData.merge(upload_files_context_var_data), ).to(ObjectVar)[LiteralVar.create(upload_id)], ), ( - ImmutableVar.create_safe("upload_id"), + Var(_js_expr="upload_id"), LiteralVar.create(upload_id), ), ] @@ -477,7 +473,7 @@ class FileUpload: ) # type: ignore else: raise ValueError(f"{on_upload_progress} is not a valid event handler.") - if isinstance(events, ImmutableVar): + if isinstance(events, Var): raise ValueError(f"{on_upload_progress} cannot return a var {events}.") on_upload_progress_chain = EventChain( events=events, @@ -486,7 +482,7 @@ class FileUpload: formatted_chain = str(format.format_prop(on_upload_progress_chain)) spec_args.append( ( - ImmutableVar.create_safe("on_upload_progress"), + Var(_js_expr="on_upload_progress"), FunctionStringVar( formatted_chain.strip("{}"), ).to(FunctionVar, EventChain), @@ -526,7 +522,7 @@ def server_side(name: str, sig: inspect.Signature, **kwargs) -> EventSpec: handler=EventHandler(fn=fn), args=tuple( ( - ImmutableVar.create_safe(k), + Var(_js_expr=k), LiteralVar.create(v), ) for k, v in kwargs.items() @@ -732,9 +728,9 @@ def set_clipboard(content: str) -> EventSpec: def download( - url: str | ImmutableVar | None = None, - filename: Optional[str | ImmutableVar] = None, - data: str | bytes | ImmutableVar | None = None, + url: str | Var | None = None, + filename: Optional[str | Var] = None, + data: str | bytes | Var | None = None, ) -> EventSpec: """Download the file at a given path or with the specified data. @@ -770,7 +766,7 @@ def download( if isinstance(data, str): # Caller provided a plain text string to download. url = "data:text/plain," + urllib.parse.quote(data) - elif isinstance(data, ImmutableVar): + elif isinstance(data, Var): # Need to check on the frontend if the Var already looks like a data: URI. is_data_url = (data.js_type() == "string") & ( @@ -927,15 +923,13 @@ def parse_args_spec(arg_spec: ArgsSpec): annotations = get_type_hints(arg_spec) return arg_spec( *[ - ImmutableVar(f"_{l_arg}").to( - ObjectVar, annotations.get(l_arg, FrontendEvent) - ) + Var(f"_{l_arg}").to(annotations.get(l_arg, FrontendEvent)) for l_arg in spec.args ] ) -def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | ImmutableVar: +def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: """Call a function to a list of event specs. The function should return a single EventSpec, a list of EventSpecs, or a @@ -976,7 +970,7 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Immutab out = fn(*parsed_args) # If the function returns a Var, assume it's an EventChain and render it directly. - if isinstance(out, ImmutableVar): + if isinstance(out, Var): return out # Convert the output to a list. @@ -1005,7 +999,7 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Immutab def get_handler_args( event_spec: EventSpec, -) -> tuple[tuple[ImmutableVar, ImmutableVar], ...]: +) -> tuple[tuple[Var, Var], ...]: """Get the handler args for the given event spec. Args: @@ -1056,7 +1050,7 @@ def fix_events( e = e() assert isinstance(e, EventSpec), f"Unexpected event type, {type(e)}." name = format.format_event_handler(e.handler) - payload = {k._var_name: v._decode() for k, v in e.args} # type: ignore + payload = {k._js_expr: v._decode() for k, v in e.args} # type: ignore # Filter router_data to reduce payload size event_router_data = { diff --git a/reflex/experimental/client_state.py b/reflex/experimental/client_state.py index db5a21600..9601ca58b 100644 --- a/reflex/experimental/client_state.py +++ b/reflex/experimental/client_state.py @@ -8,13 +8,13 @@ from typing import Any, Callable, Union from reflex import constants from reflex.event import EventChain, EventHandler, EventSpec, call_script -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.ivars.function import FunctionVar from reflex.utils.imports import ImportVar from reflex.vars import ( VarData, get_unique_variable_name, ) +from reflex.vars.base import LiteralVar, Var +from reflex.vars.function import FunctionVar NoValue = object() @@ -41,7 +41,7 @@ def _client_state_ref(var_name: str) -> str: frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ClientStateVar(ImmutableVar): +class ClientStateVar(Var): """A Var that exists on the client via useState.""" # Track the names of the getters and setters @@ -58,7 +58,7 @@ class ClientStateVar(ImmutableVar): The hash of the var. """ return hash( - (self._var_name, str(self._var_type), self._getter_name, self._setter_name) + (self._js_expr, str(self._var_type), self._getter_name, self._setter_name) ) @classmethod @@ -97,10 +97,8 @@ class ClientStateVar(ImmutableVar): var_name = get_unique_variable_name() assert isinstance(var_name, str), "var_name must be a string." if default is NoValue: - default_var = ImmutableVar.create_safe( - "", _var_is_local=False, _var_is_string=False - ) - elif not isinstance(default, ImmutableVar): + default_var = Var(_js_expr="") + elif not isinstance(default, Var): default_var = LiteralVar.create(default) else: default_var = default @@ -116,7 +114,7 @@ class ClientStateVar(ImmutableVar): hooks[f"{_client_state_ref(setter_name)} = {setter_name}"] = None imports.update(_refs_import) return cls( - _var_name="", + _js_expr="", _setter_name=setter_name, _getter_name=var_name, _global_ref=global_ref, @@ -131,7 +129,7 @@ class ClientStateVar(ImmutableVar): ) @property - def value(self) -> ImmutableVar: + def value(self) -> Var: """Get a placeholder for the Var. This property can only be rendered on the frontend. @@ -142,10 +140,12 @@ class ClientStateVar(ImmutableVar): an accessor for the client state variable. """ return ( - ImmutableVar.create_safe( - _client_state_ref(self._getter_name) - if self._global_ref - else self._getter_name + Var( + _js_expr=( + _client_state_ref(self._getter_name) + if self._global_ref + else self._getter_name + ) ) .to(self._var_type) ._replace( @@ -155,7 +155,7 @@ class ClientStateVar(ImmutableVar): ) ) - def set_value(self, value: Any = NoValue) -> ImmutableVar: + def set_value(self, value: Any = NoValue) -> Var: """Set the value of the client state variable. This property can only be attached to a frontend event trigger. @@ -183,13 +183,13 @@ class ClientStateVar(ImmutableVar): arg = re.sub(r"\[\".*\"\]", "", value_str) setter = f"({arg}) => {setter}({str(value)})" - return ImmutableVar( - _var_name=setter, + return Var( + _js_expr=setter, _var_data=VarData(imports=_refs_import if self._global_ref else {}), ).to(FunctionVar, EventChain) @property - def set(self) -> ImmutableVar: + def set(self) -> Var: """Set the value of the client state variable. This property can only be attached to a frontend event trigger. diff --git a/reflex/experimental/hooks.py b/reflex/experimental/hooks.py index b977e85b7..7d648225a 100644 --- a/reflex/experimental/hooks.py +++ b/reflex/experimental/hooks.py @@ -2,16 +2,16 @@ from __future__ import annotations -from reflex.ivars.base import ImmutableVar from reflex.utils.imports import ImportVar from reflex.vars import VarData +from reflex.vars.base import Var def _compose_react_imports(tags: list[str]) -> dict[str, list[ImportVar]]: return {"react": [ImportVar(tag=tag) for tag in tags]} -def const(name, value) -> ImmutableVar: +def const(name, value) -> Var: """Create a constant Var. Args: @@ -22,11 +22,11 @@ def const(name, value) -> ImmutableVar: The constant Var. """ if isinstance(name, list): - return ImmutableVar.create_safe(f"const [{', '.join(name)}] = {value}") - return ImmutableVar.create_safe(f"const {name} = {value}") + return Var(_js_expr=f"const [{', '.join(name)}] = {value}") + return Var(_js_expr=f"const {name} = {value}") -def useCallback(func, deps) -> ImmutableVar: +def useCallback(func, deps) -> Var: """Create a useCallback hook with a function and dependencies. Args: @@ -36,13 +36,13 @@ def useCallback(func, deps) -> ImmutableVar: Returns: The useCallback hook. """ - return ImmutableVar.create_safe( - f"useCallback({func}, {deps})" if deps else f"useCallback({func})", + return Var( + _js_expr=f"useCallback({func}, {deps})" if deps else f"useCallback({func})", _var_data=VarData(imports=_compose_react_imports(["useCallback"])), ) -def useContext(context) -> ImmutableVar: +def useContext(context) -> Var: """Create a useContext hook with a context. Args: @@ -51,13 +51,13 @@ def useContext(context) -> ImmutableVar: Returns: The useContext hook. """ - return ImmutableVar.create_safe( - f"useContext({context})", + return Var( + _js_expr=f"useContext({context})", _var_data=VarData(imports=_compose_react_imports(["useContext"])), ) -def useRef(default) -> ImmutableVar: +def useRef(default) -> Var: """Create a useRef hook with a default value. Args: @@ -66,13 +66,13 @@ def useRef(default) -> ImmutableVar: Returns: The useRef hook. """ - return ImmutableVar.create_safe( - f"useRef({default})", + return Var( + _js_expr=f"useRef({default})", _var_data=VarData(imports=_compose_react_imports(["useRef"])), ) -def useState(var_name, default=None) -> ImmutableVar: +def useState(var_name, default=None) -> Var: """Create a useState hook with a variable name and setter name. Args: @@ -84,8 +84,8 @@ def useState(var_name, default=None) -> ImmutableVar: """ return const( [var_name, f"set{var_name.capitalize()}"], - ImmutableVar.create_safe( - f"useState({default})", + Var( + _js_expr=f"useState({default})", _var_data=VarData(imports=_compose_react_imports(["useState"])), ), ) diff --git a/reflex/experimental/layout.py b/reflex/experimental/layout.py index abe871fa4..a3b76581a 100644 --- a/reflex/experimental/layout.py +++ b/reflex/experimental/layout.py @@ -14,9 +14,9 @@ from reflex.components.radix.themes.layout.container import Container from reflex.components.radix.themes.layout.stack import HStack from reflex.event import call_script from reflex.experimental import hooks -from reflex.ivars.base import ImmutableVar from reflex.state import ComponentState from reflex.style import Style +from reflex.vars.base import Var class Sidebar(Box, MemoizationLeaf): @@ -55,7 +55,7 @@ class Sidebar(Box, MemoizationLeaf): open = ( self.State.open # type: ignore if self.State - else ImmutableVar.create_safe("open") + else Var(_js_expr="open") ) sidebar.style["display"] = spacer.style["display"] = cond(open, "block", "none") @@ -69,7 +69,7 @@ class Sidebar(Box, MemoizationLeaf): } ) - def add_hooks(self) -> List[ImmutableVar]: + def add_hooks(self) -> List[Var]: """Get the hooks to render. Returns: @@ -172,8 +172,8 @@ class SidebarTrigger(Fragment): open, toggle = sidebar.State.open, sidebar.State.toggle # type: ignore else: open, toggle = ( - ImmutableVar.create_safe("open"), - call_script(ImmutableVar.create_safe("setOpen(!open)")), + Var(_js_expr="open"), + call_script(Var(_js_expr="setOpen(!open)")), ) trigger_props["left"] = cond(open, f"calc({sidebar_width} - 32px)", "0") diff --git a/reflex/experimental/layout.pyi b/reflex/experimental/layout.pyi index 58ff2fa8b..d9b576eeb 100644 --- a/reflex/experimental/layout.pyi +++ b/reflex/experimental/layout.pyi @@ -11,10 +11,9 @@ from reflex.components.component import Component, ComponentNamespace, Memoizati from reflex.components.radix.primitives.drawer import DrawerRoot from reflex.components.radix.themes.layout.box import Box from reflex.event import EventHandler, EventSpec -from reflex.ivars.base import ImmutableVar from reflex.state import ComponentState from reflex.style import Style -from reflex.vars import Var +from reflex.vars.base import Var class Sidebar(Box, MemoizationLeaf): @overload @@ -22,80 +21,70 @@ class Sidebar(Box, MemoizationLeaf): def create( # type: ignore cls, *children, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Sidebar": @@ -111,7 +100,7 @@ class Sidebar(Box, MemoizationLeaf): ... def add_style(self) -> dict[str, Any] | None: ... - def add_hooks(self) -> List[ImmutableVar]: ... + def add_hooks(self) -> List[Var]: ... class StatefulSidebar(ComponentState): open: bool @@ -135,8 +124,8 @@ class DrawerSidebar(DrawerRoot): modal: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ - Var[Literal["top", "bottom", "left", "right"]], - Literal["top", "bottom", "left", "right"], + Literal["bottom", "left", "right", "top"], + Var[Literal["bottom", "left", "right", "top"]], ] ] = None, preventScrollRestoration: Optional[Union[Var[bool], bool]] = None, @@ -146,54 +135,44 @@ class DrawerSidebar(DrawerRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerSidebar": @@ -227,51 +206,41 @@ class SidebarTrigger(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SidebarTrigger": @@ -293,80 +262,70 @@ class Layout(Box): cls, *children, sidebar: Optional[Component] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Layout": @@ -391,80 +350,70 @@ class LayoutNamespace(ComponentNamespace): def __call__( *children, sidebar: Optional[Component] = None, - access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] + Union[Var[Union[bool, int, str]], bool, int, str] ] = None, - hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Layout": diff --git a/reflex/state.py b/reflex/state.py index dd69522fa..45866a69e 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -36,11 +36,11 @@ import dill from sqlalchemy.orm import DeclarativeBase from reflex.config import get_config -from reflex.ivars.base import ( +from reflex.vars.base import ( + ComputedVar, DynamicRouteVar, - ImmutableComputedVar, - ImmutableVar, - immutable_computed_var, + Var, + computed_var, is_computed_var, ) @@ -78,7 +78,7 @@ if TYPE_CHECKING: Delta = Dict[str, Any] -var = immutable_computed_var +var = computed_var # If the state is this large, it's considered a performance issue. @@ -359,16 +359,16 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """The state of the app.""" # A map from the var name to the var. - vars: ClassVar[Dict[str, ImmutableVar]] = {} + vars: ClassVar[Dict[str, Var]] = {} # The base vars of the class. - base_vars: ClassVar[Dict[str, ImmutableVar]] = {} + base_vars: ClassVar[Dict[str, Var]] = {} # The computed vars of the class. - computed_vars: ClassVar[Dict[str, ImmutableComputedVar]] = {} + computed_vars: ClassVar[Dict[str, ComputedVar]] = {} # Vars inherited by the parent state. - inherited_vars: ClassVar[Dict[str, ImmutableVar]] = {} + inherited_vars: ClassVar[Dict[str, Var]] = {} # Backend base vars that are never sent to the client. backend_vars: ClassVar[Dict[str, Any]] = {} @@ -478,7 +478,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): return f"{self.__class__.__name__}({self.dict()})" @classmethod - def _get_computed_vars(cls) -> list[ImmutableComputedVar]: + def _get_computed_vars(cls) -> list[ComputedVar]: """Helper function to get all computed vars of a instance. Returns: @@ -575,8 +575,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): # Set the base and computed vars. cls.base_vars = { - f.name: ImmutableVar( - _var_name=format.format_state_name(cls.get_full_name()) + "." + f.name, + f.name: Var( + _js_expr=format.format_state_name(cls.get_full_name()) + "." + f.name, _var_type=f.outer_type_, _var_data=VarData.from_state(cls), ).guess_type() @@ -584,7 +584,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if f.name not in cls.get_skip_vars() } cls.computed_vars = { - v._var_name: v._replace(merge_var_data=VarData.from_state(cls)) + v._js_expr: v._replace(merge_var_data=VarData.from_state(cls)) for v in computed_vars } cls.vars = { @@ -614,8 +614,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): newcv = value._replace(fget=fget, _var_data=VarData.from_state(cls)) # cleanup refs to mixin cls in var_data setattr(cls, name, newcv) - cls.computed_vars[newcv._var_name] = newcv - cls.vars[newcv._var_name] = newcv + cls.computed_vars[newcv._js_expr] = newcv + cls.vars[newcv._js_expr] = newcv continue if types.is_backend_base_variable(name, mixin): cls.backend_vars[name] = copy.deepcopy(value) @@ -781,9 +781,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): NameError: When a computed var shadows a base var. """ for computed_var_ in cls._get_computed_vars(): - if computed_var_._var_name in cls.__annotations__: + if computed_var_._js_expr in cls.__annotations__: raise NameError( - f"The computed var name `{computed_var_._var_name}` shadows a base var in {cls.__module__}.{cls.__name__}; use a different name instead" + f"The computed var name `{computed_var_._js_expr}` shadows a base var in {cls.__module__}.{cls.__name__}; use a different name instead" ) @classmethod @@ -796,10 +796,10 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for name, cv in cls.__dict__.items(): if not is_computed_var(cv): continue - name = cv._var_name + name = cv._js_expr if name in cls.inherited_vars or name in cls.inherited_backend_vars: raise NameError( - f"The computed var name `{cv._var_name}` shadows a var in {cls.__module__}.{cls.__name__}; use a different name instead" + f"The computed var name `{cv._js_expr}` shadows a var in {cls.__module__}.{cls.__name__}; use a different name instead" ) @classmethod @@ -921,7 +921,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): return getattr(substate, name) @classmethod - def _init_var(cls, prop: ImmutableVar): + def _init_var(cls, prop: Var): """Initialize a variable. Args: @@ -937,7 +937,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): "State vars must be primitive Python types, " "Plotly figures, Pandas dataframes, " "or subclasses of rx.Base. " - f'Found var "{prop._var_name}" with type {prop._var_type}.' + f'Found var "{prop._js_expr}" with type {prop._var_type}.' ) cls._set_var(prop) cls._create_setter(prop) @@ -964,8 +964,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): ) # create the variable based on name and type - var = ImmutableVar( - _var_name=format.format_state_name(cls.get_full_name()) + "." + name, + var = Var( + _js_expr=format.format_state_name(cls.get_full_name()) + "." + name, _var_type=type_, _var_data=VarData.from_state(cls), ).guess_type() @@ -987,16 +987,14 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): cls._init_var_dependency_dicts() @classmethod - def _set_var(cls, prop: ImmutableVar): + def _set_var(cls, prop: Var): """Set the var as a class member. Args: prop: The var instance to set. """ acutal_var_name = ( - prop._var_name - if "." not in prop._var_name - else prop._var_name.split(".")[-1] + prop._js_expr if "." not in prop._js_expr else prop._js_expr.split(".")[-1] ) setattr(cls, acutal_var_name, prop) @@ -1018,7 +1016,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): cls.setvar = cls.event_handlers["setvar"] = EventHandlerSetVar(state_cls=cls) @classmethod - def _create_setter(cls, prop: ImmutableVar): + def _create_setter(cls, prop: Var): """Create a setter for the var. Args: @@ -1031,17 +1029,17 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): setattr(cls, setter_name, event_handler) @classmethod - def _set_default_value(cls, prop: ImmutableVar): + def _set_default_value(cls, prop: Var): """Set the default value for the var. Args: prop: The var to set the default value for. """ # Get the pydantic field for the var. - if "." in prop._var_name: - field = cls.get_fields()[prop._var_name.split(".")[-1]] + if "." in prop._js_expr: + field = cls.get_fields()[prop._js_expr.split(".")[-1]] else: - field = cls.get_fields()[prop._var_name] + field = cls.get_fields()[prop._js_expr] if field.required: default_value = prop.get_default_value() if default_value is not None: @@ -1100,7 +1098,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): else: continue # to allow passing as a prop, evade python frozen rules (bad practice) - object.__setattr__(func, "_var_name", param) + object.__setattr__(func, "_js_expr", param) # cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore cls.vars[param] = cls.computed_vars[param] = func._replace( _var_data=VarData.from_state(cls) diff --git a/reflex/style.py b/reflex/style.py index 5e5503e66..e63cb820f 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -7,12 +7,12 @@ from typing import Any, Literal, Tuple, Type from reflex import constants from reflex.components.core.breakpoints import Breakpoints, breakpoints_values from reflex.event import EventChain, EventHandler -from reflex.ivars.base import ImmutableCallableVar, ImmutableVar, LiteralVar -from reflex.ivars.function import FunctionVar from reflex.utils import format from reflex.utils.exceptions import ReflexError from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import CallableVar, LiteralVar, Var +from reflex.vars.function import FunctionVar SYSTEM_COLOR_MODE: str = "system" LIGHT_COLOR_MODE: str = "light" @@ -26,30 +26,30 @@ color_mode_imports = { } -def _color_mode_var(_var_name: str, _var_type: Type = str) -> ImmutableVar: - """Create a Var that destructs the _var_name from ColorModeContext. +def _color_mode_var(_js_expr: str, _var_type: Type = str) -> Var: + """Create a Var that destructs the _js_expr from ColorModeContext. Args: - _var_name: The name of the variable to get from ColorModeContext. + _js_expr: The name of the variable to get from ColorModeContext. _var_type: The type of the Var. Returns: The Var that resolves to the color mode. """ - return ImmutableVar( - _var_name=_var_name, + return Var( + _js_expr=_js_expr, _var_type=_var_type, _var_data=VarData( imports=color_mode_imports, - hooks={f"const {{ {_var_name} }} = useContext(ColorModeContext)": None}, + hooks={f"const {{ {_js_expr} }} = useContext(ColorModeContext)": None}, ), ).guess_type() -@ImmutableCallableVar +@CallableVar def set_color_mode( new_color_mode: LiteralColorMode | Var[LiteralColorMode] | None = None, -) -> ImmutableVar[EventChain]: +) -> Var[EventChain]: """Create an EventChain Var that sets the color mode to a specific value. Note: `set_color_mode` is not a real event and cannot be triggered from a @@ -62,16 +62,16 @@ def set_color_mode( The EventChain Var that can be passed to an event trigger. """ base_setter = _color_mode_var( - _var_name=constants.ColorMode.SET, + _js_expr=constants.ColorMode.SET, _var_type=EventChain, ) if new_color_mode is None: return base_setter - if not isinstance(new_color_mode, ImmutableVar): + if not isinstance(new_color_mode, Var): new_color_mode = LiteralVar.create(new_color_mode) - return ImmutableVar( + return Var( f"() => {str(base_setter)}({str(new_color_mode)})", _var_data=VarData.merge( base_setter._get_all_var_data(), new_color_mode._get_all_var_data() @@ -80,12 +80,12 @@ def set_color_mode( # Var resolves to the current color mode for the app ("light", "dark" or "system") -color_mode = _color_mode_var(_var_name=constants.ColorMode.NAME) +color_mode = _color_mode_var(_js_expr=constants.ColorMode.NAME) # Var resolves to the resolved color mode for the app ("light" or "dark") -resolved_color_mode = _color_mode_var(_var_name=constants.ColorMode.RESOLVED_NAME) +resolved_color_mode = _color_mode_var(_js_expr=constants.ColorMode.RESOLVED_NAME) # Var resolves to a function invocation that toggles the color mode toggle_color_mode = _color_mode_var( - _var_name=constants.ColorMode.TOGGLE, + _js_expr=constants.ColorMode.TOGGLE, _var_type=EventChain, ) @@ -115,7 +115,7 @@ def media_query(breakpoint_expr: str): def convert_item( style_item: int | str | Var, -) -> tuple[str | Var, VarData | VarData | None]: +) -> tuple[str | Var, VarData | None]: """Format a single value in a style dictionary. Args: @@ -133,7 +133,7 @@ def convert_item( "Please use a Var or a literal value." ) - if isinstance(style_item, ImmutableVar): + if isinstance(style_item, Var): return style_item, style_item._get_all_var_data() # if isinstance(style_item, str) and REFLEX_VAR_OPENING_TAG not in style_item: @@ -146,7 +146,7 @@ def convert_item( def convert_list( - responsive_list: list[str | dict | ImmutableVar], + responsive_list: list[str | dict | Var], ) -> tuple[list[str | dict[str, Var | list | dict]], VarData | None]: """Format a responsive value list. @@ -189,7 +189,7 @@ def convert( for key, value in style_dict.items(): keys = format_style_key(key) - if isinstance(value, ImmutableVar): + if isinstance(value, Var): return_val = value new_var_data = value._get_all_var_data() update_out_dict(return_val, keys) diff --git a/reflex/utils/format.py b/reflex/utils/format.py index ddfb6b05a..39f886f93 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -11,7 +11,6 @@ from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union from reflex import constants from reflex.utils import exceptions, types -from reflex.vars import Var if TYPE_CHECKING: from reflex.components.component import ComponentStyle @@ -299,9 +298,9 @@ def format_route(route: str, format_case=True) -> str: def format_match( - cond: str | ImmutableVar, - match_cases: List[List[ImmutableVar]], - default: ImmutableVar, + cond: str | Var, + match_cases: List[List[Var]], + default: Var, ) -> str: """Format a match expression whose return type is a Var. @@ -333,7 +332,7 @@ def format_match( def format_prop( - prop: Union[ImmutableVar, EventChain, ComponentStyle, str], + prop: Union[Var, EventChain, ComponentStyle, str], ) -> Union[int, float, str]: """Format a prop. @@ -349,12 +348,12 @@ def format_prop( """ # import here to avoid circular import. from reflex.event import EventChain - from reflex.ivars import ImmutableVar from reflex.utils import serializers + from reflex.vars import Var try: # Handle var props. - if isinstance(prop, ImmutableVar): + if isinstance(prop, Var): return str(prop) # Handle event props. @@ -407,14 +406,14 @@ def format_props(*single_props, **key_value_props) -> list[str]: The formatted props list. """ # Format all the props. - from reflex.ivars.base import ImmutableVar, LiteralVar + from reflex.vars.base import LiteralVar, Var return [ ( f"{name}={format_prop(prop)}" - if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) + if isinstance(prop, Var) and not isinstance(prop, Var) else ( - f"{name}={{{format_prop(prop if isinstance(prop, ImmutableVar) else LiteralVar.create(prop))}}}" + f"{name}={{{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}}}" ) ) for name, prop in sorted(key_value_props.items()) @@ -422,7 +421,7 @@ def format_props(*single_props, **key_value_props) -> list[str]: ] + [ ( str(prop) - if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) + if isinstance(prop, Var) and not isinstance(prop, Var) else f"{str(LiteralVar.create(prop))}" ) for prop in single_props @@ -487,10 +486,10 @@ def format_event(event_spec: EventSpec) -> str: [ ":".join( ( - name._var_name, + name._js_expr, ( wrap( - json.dumps(val._var_name).strip('"').replace("`", "\\`"), + json.dumps(val._js_expr).strip('"').replace("`", "\\`"), "`", ) if val._var_is_string @@ -512,7 +511,7 @@ def format_event(event_spec: EventSpec) -> str: if TYPE_CHECKING: - from reflex.ivars import ImmutableVar + from reflex.vars import Var def format_queue_events( @@ -524,7 +523,7 @@ def format_queue_events( | None ) = None, args_spec: Optional[ArgsSpec] = None, -) -> ImmutableVar[EventChain]: +) -> Var[EventChain]: """Format a list of event handler / event spec as a javascript callback. The resulting code can be passed to interfaces that expect a callback @@ -550,10 +549,10 @@ def format_queue_events( call_event_fn, call_event_handler, ) - from reflex.ivars import FunctionVar, ImmutableVar + from reflex.vars import FunctionVar, Var if not events: - return ImmutableVar("(() => null)").to(FunctionVar, EventChain) # type: ignore + return Var("(() => null)").to(FunctionVar, EventChain) # type: ignore # If no spec is provided, the function will take no arguments. def _default_args_spec(): @@ -578,7 +577,7 @@ def format_queue_events( specs = [call_event_handler(spec, args_spec or _default_args_spec)] elif isinstance(spec, type(lambda: None)): specs = call_event_fn(spec, args_spec or _default_args_spec) # type: ignore - if isinstance(specs, ImmutableVar): + if isinstance(specs, Var): raise ValueError( f"Invalid event spec: {specs}. Expected a list of EventSpecs." ) @@ -586,7 +585,7 @@ def format_queue_events( # Return the final code snippet, expecting queueEvents, processEvent, and socket to be in scope. # Typically this snippet will _only_ run from within an rx.call_script eval context. - return ImmutableVar( + return Var( f"{arg_def} => {{queueEvents([{','.join(payloads)}], {constants.CompileVars.SOCKET}); " f"processEvent({constants.CompileVars.SOCKET})}}", ).to(FunctionVar, EventChain) # type: ignore @@ -736,7 +735,7 @@ def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]: return collapsed -def format_array_ref(refs: str, idx: ImmutableVar | None) -> str: +def format_array_ref(refs: str, idx: Var | None) -> str: """Format a ref accessed by array. Args: @@ -765,7 +764,7 @@ def format_data_editor_column(col: str | dict): Returns: The formatted column. """ - from reflex.ivars import ImmutableVar + from reflex.vars import Var if isinstance(col, str): return {"title": col, "id": col.lower(), "type": "str"} @@ -779,7 +778,7 @@ def format_data_editor_column(col: str | dict): col["overlayIcon"] = None return col - if isinstance(col, ImmutableVar): + if isinstance(col, Var): return col raise ValueError( @@ -796,9 +795,9 @@ def format_data_editor_cell(cell: Any): Returns: The formatted cell. """ - from reflex.ivars.base import ImmutableVar + from reflex.vars.base import Var return { - "kind": ImmutableVar.create("GridCellKind.Text"), + "kind": Var(_js_expr="GridCellKind.Text"), "data": cell, } diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index bd0d9f118..3c00b0427 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -19,8 +19,8 @@ from types import ModuleType, SimpleNamespace from typing import Any, Callable, Iterable, Type, get_args from reflex.components.component import Component -from reflex.ivars.base import ImmutableVar from reflex.utils import types as rx_types +from reflex.vars.base import Var logger = logging.getLogger("pyi_generator") @@ -69,11 +69,10 @@ DEFAULT_TYPING_IMPORTS = { # TODO: fix import ordering and unused imports with ruff later DEFAULT_IMPORTS = { "typing": sorted(DEFAULT_TYPING_IMPORTS), - "reflex.vars": ["Var"], "reflex.components.core.breakpoints": ["Breakpoints"], "reflex.event": ["EventChain", "EventHandler", "EventSpec"], "reflex.style": ["Style"], - "reflex.ivars.base": ["ImmutableVar"], + "reflex.vars.base": ["Var"], } @@ -151,7 +150,7 @@ def _get_type_hint(value, type_hint_globals, is_optional=True) -> str: if args: inner_container_type_args = ( - [repr(arg) for arg in args] + sorted((repr(arg) for arg in args)) if rx_types.is_literal(value) else [ _get_type_hint(arg, type_hint_globals, is_optional=False) @@ -185,7 +184,7 @@ def _get_type_hint(value, type_hint_globals, is_optional=True) -> str: if arg is not type(None) ] if len(types) > 1: - res = ", ".join(types) + res = ", ".join(sorted(types)) res = f"Union[{res}]" elif isinstance(value, str): ev = eval(value, type_hint_globals) @@ -356,7 +355,7 @@ def _extract_class_props_as_ast_nodes( with contextlib.suppress(AttributeError, KeyError): # Try to get default from pydantic field definition. default = target_class.__fields__[name].default - if isinstance(default, ImmutableVar): + if isinstance(default, Var): default = default._decode() # type: ignore kwargs.append( @@ -434,7 +433,7 @@ def _generate_component_create_functiondef( ast.arg( arg=trigger, annotation=ast.Name( - id="Optional[Union[EventHandler, EventSpec, list, Callable, ImmutableVar]]" + id="Optional[Union[EventHandler, EventSpec, list, Callable, Var]]" ), ), ast.Constant(value=None), diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index 0b94be511..c5cded3b6 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -249,14 +249,9 @@ def serialize_base(value: Base) -> str: Returns: The serialized Base. """ - from reflex.ivars import LiteralObjectVar + from reflex.vars import LiteralVar - return str( - LiteralObjectVar.create( - {k: (None if callable(v) else v) for k, v in value.dict().items()}, - _var_type=type(value), - ) - ) + return str(LiteralVar.create(value)) @serializer @@ -269,7 +264,7 @@ def serialize_list(value: Union[List, Tuple, Set]) -> str: Returns: The serialized list. """ - from reflex.ivars import LiteralArrayVar + from reflex.vars import LiteralArrayVar return str(LiteralArrayVar.create(value)) @@ -284,7 +279,7 @@ def serialize_dict(prop: Dict[str, Any]) -> str: Returns: The serialized dictionary. """ - from reflex.ivars import LiteralObjectVar + from reflex.vars import LiteralObjectVar return str(LiteralObjectVar.create(prop)) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index ba58408ff..63238f67b 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -96,7 +96,7 @@ PrimitiveType = Union[int, float, bool, str, list, dict, set, tuple] StateVar = Union[PrimitiveType, Base, None] StateIterVar = Union[list, set, tuple] -# ArgsSpec = Callable[[ImmutableVar], list[ImmutableVar]] +# ArgsSpec = Callable[[Var], list[Var]] ArgsSpec = Callable @@ -519,7 +519,7 @@ def is_backend_base_variable(name: str, cls: Type) -> bool: if name in cls.inherited_backend_vars: return False - from reflex.ivars.base import is_computed_var + from reflex.vars.base import is_computed_var if name in cls.__dict__: value = cls.__dict__[name] @@ -595,11 +595,11 @@ def validate_literal(key: str, value: Any, expected_type: Type, comp_name: str): Raises: ValueError: When the value is not a valid literal. """ - from reflex.ivars import ImmutableVar + from reflex.vars import Var if ( is_literal(expected_type) - and not isinstance(value, ImmutableVar) # validating vars is not supported yet. + and not isinstance(value, Var) # validating vars is not supported yet. and not is_encoded_fstring(value) # f-strings are not supported. and value not in expected_type.__args__ ): diff --git a/reflex/vars.py b/reflex/vars.py deleted file mode 100644 index 86816433e..000000000 --- a/reflex/vars.py +++ /dev/null @@ -1,501 +0,0 @@ -"""Define a state var.""" - -from __future__ import annotations - -import contextlib -import dataclasses -import random -import re -import string -from typing import ( - TYPE_CHECKING, - Any, - Dict, - Iterable, - Optional, - Tuple, - Type, - _GenericAlias, # type: ignore -) - -from reflex import constants -from reflex.utils import imports -from reflex.utils.exceptions import ( - VarTypeError, -) - -# This module used to export ImportVar itself, so we still import it for export here -from reflex.utils.imports import ( - ImmutableParsedImportDict, - ImportDict, - ImportVar, - ParsedImportDict, - parse_imports, -) - -if TYPE_CHECKING: - from reflex.ivars import ImmutableVar - from reflex.state import BaseState - - -# Set of unique variable names. -USED_VARIABLES = set() - - -# These names were changed in reflex 0.3.0 -REPLACED_NAMES = { - "full_name": "_var_full_name", - "name": "_var_name", - "state": "_var_data.state", - "type_": "_var_type", - "is_local": "_var_is_local", - "is_string": "_var_is_string", - "set_state": "_var_set_state", - "deps": "_deps", -} - - -def get_unique_variable_name() -> str: - """Get a unique variable name. - - Returns: - The unique variable name. - """ - name = "".join([random.choice(string.ascii_lowercase) for _ in range(8)]) - if name not in USED_VARIABLES: - USED_VARIABLES.add(name) - return name - return get_unique_variable_name() - - -@dataclasses.dataclass( - eq=True, - frozen=True, -) -class VarData: - """Metadata associated with a Var.""" - - # The name of the enclosing state. - state: str = dataclasses.field(default="") - - # Imports needed to render this var - imports: ImmutableParsedImportDict = dataclasses.field(default_factory=tuple) - - # Hooks that need to be present in the component to render this var - hooks: Tuple[str, ...] = dataclasses.field(default_factory=tuple) - - def __init__( - self, - state: str = "", - imports: ImportDict | ParsedImportDict | None = None, - hooks: dict[str, None] | None = None, - ): - """Initialize the var data. - - Args: - state: The name of the enclosing state. - imports: Imports needed to render this var. - hooks: Hooks that need to be present in the component to render this var. - """ - immutable_imports: ImmutableParsedImportDict = tuple( - sorted( - ((k, tuple(sorted(v))) for k, v in parse_imports(imports or {}).items()) - ) - ) - object.__setattr__(self, "state", state) - object.__setattr__(self, "imports", immutable_imports) - object.__setattr__(self, "hooks", tuple(hooks or {})) - - def old_school_imports(self) -> ImportDict: - """Return the imports as a mutable dict. - - Returns: - The imports as a mutable dict. - """ - return dict((k, list(v)) for k, v in self.imports) - - @classmethod - def merge(cls, *others: VarData | None) -> VarData | None: - """Merge multiple var data objects. - - Args: - *others: The var data objects to merge. - - Returns: - The merged var data object. - """ - state = "" - _imports = {} - hooks = {} - for var_data in others: - if var_data is None: - continue - state = state or var_data.state - _imports = imports.merge_imports(_imports, var_data.imports) - hooks.update( - var_data.hooks - if isinstance(var_data.hooks, dict) - else {k: None for k in var_data.hooks} - ) - - if state or _imports or hooks: - return VarData( - state=state, - imports=_imports, - hooks=hooks, - ) - return None - - def __bool__(self) -> bool: - """Check if the var data is non-empty. - - Returns: - True if any field is set to a non-default value. - """ - return bool(self.state or self.imports or self.hooks) - - def __eq__(self, other: Any) -> bool: - """Check if two var data objects are equal. - - Args: - other: The other var data object to compare. - - Returns: - True if all fields are equal and collapsed imports are equal. - """ - if not isinstance(other, VarData): - return False - - # Don't compare interpolations - that's added in by the decoder, and - # not part of the vardata itself. - return ( - self.state == other.state - and self.hooks - == ( - other.hooks if isinstance(other, VarData) else tuple(other.hooks.keys()) - ) - and imports.collapse_imports(self.imports) - == imports.collapse_imports(other.imports) - ) - - @classmethod - def from_state(cls, state: Type[BaseState] | str) -> VarData: - """Set the state of the var. - - Args: - state: The state to set or the full name of the state. - - Returns: - The var with the set state. - """ - from reflex.utils import format - - state_name = state if isinstance(state, str) else state.get_full_name() - new_var_data = VarData( - state=state_name, - hooks={ - "const {0} = useContext(StateContexts.{0})".format( - format.format_state_name(state_name) - ): None - }, - imports={ - f"/{constants.Dirs.CONTEXTS_PATH}": [ImportVar(tag="StateContexts")], - "react": [ImportVar(tag="useContext")], - }, - ) - return new_var_data - - -def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: - """Decode the state name from a formatted var. - - Args: - value: The value to extract the state name from. - - Returns: - The extracted state name and the value without the state name. - """ - var_datas = [] - if isinstance(value, str): - # fast path if there is no encoded VarData - if constants.REFLEX_VAR_OPENING_TAG not in value: - return None, value - - offset = 0 - - # Find all tags. - while m := _decode_var_pattern.search(value): - start, end = m.span() - value = value[:start] + value[end:] - - serialized_data = m.group(1) - - if serialized_data.isnumeric() or ( - serialized_data[0] == "-" and serialized_data[1:].isnumeric() - ): - # This is a global immutable var. - var = _global_vars[int(serialized_data)] - var_data = var._get_all_var_data() - - if var_data is not None: - var_datas.append(var_data) - offset += end - start - - return VarData.merge(*var_datas) if var_datas else None, value - - -# Compile regex for finding reflex var tags. -_decode_var_pattern_re = ( - rf"{constants.REFLEX_VAR_OPENING_TAG}(.*?){constants.REFLEX_VAR_CLOSING_TAG}" -) -_decode_var_pattern = re.compile(_decode_var_pattern_re, flags=re.DOTALL) - -# Defined global immutable vars. -_global_vars: Dict[int, ImmutableVar] = {} - - -def _extract_var_data(value: Iterable) -> list[VarData | None]: - """Extract the var imports and hooks from an iterable containing a Var. - - Args: - value: The iterable to extract the VarData from - - Returns: - The extracted VarDatas. - """ - from reflex.ivars import ImmutableVar - from reflex.style import Style - - var_datas = [] - with contextlib.suppress(TypeError): - for sub in value: - if isinstance(sub, ImmutableVar): - var_datas.append(sub._var_data) - elif not isinstance(sub, str): - # Recurse into dict values. - if hasattr(sub, "values") and callable(sub.values): - var_datas.extend(_extract_var_data(sub.values())) - # Recurse into iterable values (or dict keys). - var_datas.extend(_extract_var_data(sub)) - - # Style objects should already have _var_data. - if isinstance(value, Style): - var_datas.append(value._var_data) - else: - # Recurse when value is a dict itself. - values = getattr(value, "values", None) - if callable(values): - var_datas.extend(_extract_var_data(values())) - return var_datas - - -class Var: - """An abstract var.""" - - @classmethod - def create( - cls, - value: Any, - _var_is_local: bool = True, - _var_is_string: bool | None = None, - _var_data: Optional[VarData] = None, - ) -> ImmutableVar | None: - """Create a var from a value. - - Args: - value: The value to create the var from. - _var_is_local: Whether the var is local. - _var_is_string: Whether the var is a string literal. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The var. - """ - from reflex.ivars import ImmutableVar, LiteralVar - - # Check for none values. - if value is None: - return None - - # If the value is already a var, do nothing. - if isinstance(value, ImmutableVar): - return value - - # If the value is not a string, create a LiteralVar. - if not isinstance(value, str): - return LiteralVar.create( - value, - _var_data=_var_data, - ) - - # if _var_is_string is provided, use that - if _var_is_string is False: - return ImmutableVar.create( - value, - _var_data=_var_data, - ) - if _var_is_string is True: - return LiteralVar.create( - value, - _var_data=_var_data, - ) - - # Otherwise, rely on _var_is_local - if _var_is_local is True: - return LiteralVar.create( - value, - _var_data=_var_data, - ) - - return ImmutableVar.create( - value, - _var_data=_var_data, - ) - - @classmethod - def create_safe( - cls, - value: Any, - _var_is_local: bool = True, - _var_is_string: bool | None = None, - _var_data: Optional[VarData] = None, - ) -> ImmutableVar: - """Create a var from a value, asserting that it is not None. - - Args: - value: The value to create the var from. - _var_is_local: Whether the var is local. - _var_is_string: Whether the var is a string literal. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The var. - """ - var = cls.create( - value, - _var_is_local=_var_is_local, - _var_is_string=_var_is_string, - _var_data=_var_data, - ) - assert var is not None - return var - - @classmethod - def __class_getitem__(cls, type_: str) -> _GenericAlias: - """Get a typed var. - - Args: - type_: The type of the var. - - Returns: - The var class item. - """ - return _GenericAlias(cls, type_) - - def __bool__(self) -> bool: - """Raise exception if using Var in a boolean context. - - Raises: - VarTypeError: when attempting to bool-ify the Var. - """ - raise VarTypeError( - f"Cannot convert Var {str(self)!r} to bool for use with `if`, `and`, `or`, and `not`. " - "Instead use `rx.cond` and bitwise operators `&` (and), `|` (or), `~` (invert)." - ) - - def __iter__(self) -> Any: - """Raise exception if using Var in an iterable context. - - Raises: - VarTypeError: when attempting to iterate over the Var. - """ - raise VarTypeError( - f"Cannot iterate over Var {str(self)!r}. Instead use `rx.foreach`." - ) - - def __contains__(self, _: Any) -> ImmutableVar: - """Override the 'in' operator to alert the user that it is not supported. - - Raises: - VarTypeError: the operation is not supported - """ - raise VarTypeError( - "'in' operator not supported for Var types, use Var.contains() instead." - ) - - def __get__(self, instance: Any, owner: Any) -> ImmutableVar: - """Return the value of the Var. - - Args: - instance: The instance of the Var. - owner: The owner of the Var. - - Returns: - The value of the Var. - """ - return self # type: ignore - - @classmethod - def range( - cls, - v1: ImmutableVar | int = 0, - v2: ImmutableVar | int | None = None, - step: ImmutableVar | int | None = None, - ) -> ImmutableVar: - """Return an iterator over indices from v1 to v2 (or 0 to v1). - - Args: - v1: The start of the range or end of range if v2 is not given. - v2: The end of the range. - step: The number of numbers between each item. - - Returns: - A var representing range operation. - """ - from reflex.ivars import ArrayVar - - return ArrayVar.range(v1, v2, step) # type: ignore - - def upcast(self) -> ImmutableVar: - """Upcast a Var to an ImmutableVar. - - Returns: - The upcasted Var. - """ - return self # type: ignore - - def json(self) -> str: - """Serialize the var to a JSON string. - - Raises: - NotImplementedError: If the method is not implemented. - """ - raise NotImplementedError("Var subclasses must implement the json method.") - - -def get_uuid_string_var() -> ImmutableVar: - """Return a Var that generates a single memoized UUID via .web/utils/state.js. - - useMemo with an empty dependency array ensures that the generated UUID is - consistent across re-renders of the component. - - Returns: - A Var that generates a UUID at runtime. - """ - from reflex.ivars import ImmutableVar - from reflex.utils.imports import ImportVar - - unique_uuid_var = get_unique_variable_name() - unique_uuid_var_data = VarData( - imports={ - f"/{constants.Dirs.STATE_PATH}": {ImportVar(tag="generateUUID")}, # type: ignore - "react": "useMemo", - }, - hooks={f"const {unique_uuid_var} = useMemo(generateUUID, [])": None}, - ) - - return ImmutableVar( - _var_name=unique_uuid_var, - _var_type=str, - _var_data=unique_uuid_var_data, - ) diff --git a/reflex/ivars/__init__.py b/reflex/vars/__init__.py similarity index 73% rename from reflex/ivars/__init__.py rename to reflex/vars/__init__.py index 2c1837510..56d304cd6 100644 --- a/reflex/ivars/__init__.py +++ b/reflex/vars/__init__.py @@ -1,8 +1,12 @@ -"""Experimental Immutable-Based Var System.""" +"""Immutable-Based Var System.""" -from .base import ImmutableVar as ImmutableVar from .base import LiteralVar as LiteralVar +from .base import Var as Var +from .base import VarData as VarData +from .base import get_unique_variable_name as get_unique_variable_name +from .base import get_uuid_string_var as get_uuid_string_var from .base import var_operation as var_operation +from .base import var_operation_return as var_operation_return from .function import FunctionStringVar as FunctionStringVar from .function import FunctionVar as FunctionVar from .function import VarOperationCall as VarOperationCall diff --git a/reflex/ivars/base.py b/reflex/vars/base.py similarity index 75% rename from reflex/ivars/base.py rename to reflex/vars/base.py index 3e2d282cd..fe7be726c 100644 --- a/reflex/ivars/base.py +++ b/reflex/vars/base.py @@ -9,6 +9,9 @@ import dis import functools import inspect import json +import random +import re +import string import sys from types import CodeType, FunctionType from typing import ( @@ -17,6 +20,7 @@ from typing import ( Callable, Dict, Generic, + Iterable, List, Literal, NoReturn, @@ -43,15 +47,14 @@ from reflex.utils.exceptions import ( VarValueError, ) from reflex.utils.format import format_state_name -from reflex.utils.types import GenericType, Self, get_origin -from reflex.vars import ( - REPLACED_NAMES, - Var, - VarData, - _decode_var_immutable, - _extract_var_data, - _global_vars, +from reflex.utils.imports import ( + ImmutableParsedImportDict, + ImportDict, + ImportVar, + ParsedImportDict, + parse_imports, ) +from reflex.utils.types import GenericType, Self, get_origin if TYPE_CHECKING: from reflex.state import BaseState @@ -67,19 +70,18 @@ if TYPE_CHECKING: from .sequence import ArrayVar, StringVar, ToArrayOperation, ToStringOperation -VAR_TYPE = TypeVar("VAR_TYPE") +VAR_TYPE = TypeVar("VAR_TYPE", covariant=True) @dataclasses.dataclass( eq=False, frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ImmutableVar(Var, Generic[VAR_TYPE]): +class Var(Generic[VAR_TYPE]): """Base class for immutable vars.""" # The name of the var. - _var_name: str = dataclasses.field() + _js_expr: str = dataclasses.field() # The type of the var. _var_type: types.GenericType = dataclasses.field(default=Any) @@ -93,7 +95,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): Returns: The name of the var. """ - return self._var_name + return self._js_expr @property def _var_is_local(self) -> bool: @@ -104,6 +106,16 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return False + @property + @deprecated("Use `_js_expr` instead.") + def _var_name(self) -> str: + """The name of the var. + + Returns: + The name of the var. + """ + return self._js_expr + @property def _var_is_string(self) -> bool: """Whether the var is a string literal. @@ -116,11 +128,11 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): def __post_init__(self): """Post-initialize the var.""" # Decode any inline Var markup and apply it to the instance - _var_data, _var_name = _decode_var_immutable(self._var_name) + _var_data, _js_expr = _decode_var_immutable(self._js_expr) - if _var_data or _var_name != self._var_name: + if _var_data or _js_expr != self._js_expr: self.__init__( - _var_name=_var_name, + _js_expr=_js_expr, _var_type=self._var_type, _var_data=VarData.merge(self._var_data, _var_data), ) @@ -131,7 +143,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): Returns: The hash of the var. """ - return hash((self._var_name, self._var_type, self._var_data)) + return hash((self._js_expr, self._var_type, self._var_data)) def _get_all_var_data(self) -> VarData | None: """Get all VarData associated with the Var. @@ -141,7 +153,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return self._var_data - def equals(self, other: ImmutableVar) -> bool: + def equals(self, other: Var) -> bool: """Check if two vars are equal. Args: @@ -151,7 +163,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): Whether the vars are equal. """ return ( - self._var_name == other._var_name + self._js_expr == other._js_expr and self._var_type == other._var_type and self._get_all_var_data() == other._get_all_var_data() ) @@ -164,24 +176,20 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): **kwargs: Var fields to update. Returns: - A new ImmutableVar with the updated fields overwriting the corresponding fields in this Var. + A new Var with the updated fields overwriting the corresponding fields in this Var. Raises: TypeError: If _var_is_local, _var_is_string, or _var_full_name_needs_state_prefix is not None. """ if kwargs.get("_var_is_local", False) is not False: - raise TypeError( - "The _var_is_local argument is not supported for ImmutableVar." - ) + raise TypeError("The _var_is_local argument is not supported for Var.") if kwargs.get("_var_is_string", False) is not False: - raise TypeError( - "The _var_is_string argument is not supported for ImmutableVar." - ) + raise TypeError("The _var_is_string argument is not supported for Var.") if kwargs.get("_var_full_name_needs_state_prefix", False) is not False: raise TypeError( - "The _var_full_name_needs_state_prefix argument is not supported for ImmutableVar." + "The _var_full_name_needs_state_prefix argument is not supported for Var." ) return dataclasses.replace( @@ -199,7 +207,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _var_is_local: bool | None = None, _var_is_string: bool | None = None, _var_data: VarData | None = None, - ) -> ImmutableVar | None: + ) -> Var: """Create a var from a value. Args: @@ -210,80 +218,57 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): Returns: The var. - - Raises: - VarTypeError: If the value is JSON-unserializable. - TypeError: If _var_is_local or _var_is_string is not None. """ if _var_is_local is not None: - raise TypeError( - "The _var_is_local argument is not supported for ImmutableVar." + console.deprecate( + feature_name="_var_is_local", + reason="The _var_is_local argument is not supported for Var." + "If you want to create a Var from a raw Javascript expression, use the constructor directly", + deprecation_version="0.6.0", + removal_version="0.7.0", ) - if _var_is_string is not None: - raise TypeError( - "The _var_is_string argument is not supported for ImmutableVar." + console.deprecate( + feature_name="_var_is_string", + reason="The _var_is_string argument is not supported for Var." + "If you want to create a Var from a raw Javascript expression, use the constructor directly", + deprecation_version="0.6.0", + removal_version="0.7.0", ) - from reflex.utils import format - - # Check for none values. - if value is None: - return None - # If the value is already a var, do nothing. - if isinstance(value, ImmutableVar): + if isinstance(value, Var): return value # Try to pull the imports and hooks from contained values. if not isinstance(value, str): - _var_data = VarData.merge(*_extract_var_data(value), _var_data) + return LiteralVar.create(value) - # Try to serialize the value. - type_ = type(value) - if type_ in types.JSONType: - name = value - else: - name, _serialized_type = serializers.serialize(value, get_type=True) - if name is None: - raise VarTypeError( - f"No JSON serializer found for var {value} of type {type_}." + if _var_is_string is False or _var_is_local is True: + return cls( + _js_expr=value, + _var_data=_var_data, ) - name = name if isinstance(name, str) else format.json_dumps(name) - return cls( - _var_name=name, - _var_type=type_, - _var_data=_var_data, - ) + return LiteralVar.create(value, _var_data=_var_data) @classmethod + @deprecated("Use `.create()` instead.") def create_safe( cls, - value: Any, - _var_is_local: bool | None = None, - _var_is_string: bool | None = None, - _var_data: VarData | None = None, - ) -> ImmutableVar: - """Create a var from a value, asserting that it is not None. + *args: Any, + **kwargs: Any, + ) -> Var: + """Create a var from a value. Args: - value: The value to create the var from. - _var_is_local: Whether the var is local. Deprecated. - _var_is_string: Whether the var is a string literal. Deprecated. - _var_data: Additional hooks and imports associated with the Var. + *args: The arguments to create the var from. + **kwargs: The keyword arguments to create the var from. Returns: The var. """ - var = cls.create( - value, - _var_is_local=_var_is_local, - _var_is_string=_var_is_string, - _var_data=_var_data, - ) - assert var is not None - return var + return cls.create(*args, **kwargs) def __format__(self, format_spec: str) -> str: """Format the var into a Javascript equivalent to an f-string. @@ -299,7 +284,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _global_vars[hashed_var] = self # Encode the _var_data into the formatted output for tracking purposes. - return f"{constants.REFLEX_VAR_OPENING_TAG}{hashed_var}{constants.REFLEX_VAR_CLOSING_TAG}{self._var_name}" + return f"{constants.REFLEX_VAR_OPENING_TAG}{hashed_var}{constants.REFLEX_VAR_CLOSING_TAG}{self._js_expr}" @overload def to(self, output: Type[StringVar]) -> ToStringOperation: ... @@ -343,7 +328,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): self, output: Type[OUTPUT] | types.GenericType, var_type: types.GenericType | None = None, - ) -> ImmutableVar: + ) -> Var: """Convert the var to a different type. Args: @@ -387,6 +372,12 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return self.to(BooleanVar, output) if fixed_output_type is None: return ToNoneOperation.create(self) + if issubclass(fixed_output_type, Base): + return self.to(ObjectVar, output) + if dataclasses.is_dataclass(fixed_output_type) and not issubclass( + fixed_output_type, Var + ): + return self.to(ObjectVar, output) if issubclass(output, BooleanVar): return ToBooleanVarOperation.create(self) @@ -450,11 +441,11 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return self - def guess_type(self) -> ImmutableVar: + def guess_type(self) -> Var: """Guesses the type of the variable based on its `_var_type` attribute. Returns: - ImmutableVar: The guessed type of the variable. + Var: The guessed type of the variable. Raises: TypeError: If the type is not supported for guessing. @@ -562,7 +553,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): Returns: The name of the setter function. """ - var_name_parts = self._var_name.split(".") + var_name_parts = self._js_expr.split(".") setter = constants.SETTER_PREFIX + var_name_parts[-1] var_data = self._get_all_var_data() if var_data is None: @@ -577,7 +568,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): Returns: A function that that creates a setter for the var. """ - actual_name = self._var_name.split(".")[-1] + actual_name = self._js_expr.split(".")[-1] def setter(state: BaseState, value: Any): """Get the setter for the var. @@ -592,7 +583,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): setattr(state, actual_name, value) except ValueError: console.debug( - f"{type(state).__name__}.{self._var_name}: Failed conversion of {value} to '{self._var_type.__name__}'. Value not set.", + f"{type(state).__name__}.{self._js_expr}: Failed conversion of {value} to '{self._var_type.__name__}'. Value not set.", ) else: setattr(state, actual_name, value) @@ -622,11 +613,11 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _var_data=VarData.merge(VarData.from_state(state), self._var_data), ).guess_type() - def __eq__(self, other: ImmutableVar | Any) -> BooleanVar: + def __eq__(self, other: Var | Any) -> BooleanVar: """Check if the current variable is equal to the given variable. Args: - other (ImmutableVar | Any): The variable to compare with. + other (Var | Any): The variable to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the equality check. @@ -635,11 +626,11 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return equal_operation(self, other) - def __ne__(self, other: ImmutableVar | Any) -> BooleanVar: + def __ne__(self, other: Var | Any) -> BooleanVar: """Check if the current object is not equal to the given object. Parameters: - other (ImmutableVar | Any): The object to compare with. + other (Var | Any): The object to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the comparison. @@ -658,7 +649,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return boolify(self) - def __and__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __and__(self, other: Var | Any) -> Var: """Perform a logical AND operation on the current instance and another variable. Args: @@ -669,7 +660,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return and_operation(self, other) - def __rand__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __rand__(self, other: Var | Any) -> Var: """Perform a logical AND operation on the current instance and another variable. Args: @@ -680,7 +671,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return and_operation(other, self) - def __or__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __or__(self, other: Var | Any) -> Var: """Perform a logical OR operation on the current instance and another variable. Args: @@ -691,7 +682,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ return or_operation(self, other) - def __ror__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __ror__(self, other: Var | Any) -> Var: """Perform a logical OR operation on the current instance and another variable. Args: @@ -721,7 +712,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): return JSON_STRINGIFY.call(self).to(StringVar) - def as_ref(self) -> ImmutableVar: + def as_ref(self) -> Var: """Get a reference to the var. Returns: @@ -729,14 +720,14 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): """ from .object import ObjectVar - refs = ImmutableVar( - _var_name="refs", + refs = Var( + _js_expr="refs", _var_data=VarData( imports={ f"/{constants.Dirs.STATE_PATH}": [imports.ImportVar(tag="refs")] } ), - ).to(ObjectVar) + ).to(ObjectVar, Dict[str, str]) return refs[LiteralVar.create(str(self))] @deprecated("Use `.js_type()` instead.") @@ -822,7 +813,8 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): TypeError: If the var type is Any. """ if name.startswith("_"): - return super(ImmutableVar, self).__getattribute__(name) + return self.__getattribute__(name) + if self._var_type is Any: raise TypeError( f"You must provide an annotation for the state var `{str(self)}`. Annotation cannot be `{self._var_type}`." @@ -866,11 +858,85 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): var_data = self._get_all_var_data() return var_data.state if var_data else "" + @overload + @classmethod + def range(cls, stop: int | NumberVar, /) -> ArrayVar[List[int]]: ... -OUTPUT = TypeVar("OUTPUT", bound=ImmutableVar) + @overload + @classmethod + def range( + cls, + start: int | NumberVar, + end: int | NumberVar, + step: int | NumberVar = 1, + /, + ) -> ArrayVar[List[int]]: ... + + @classmethod + def range( + cls, + first_endpoint: int | NumberVar, + second_endpoint: int | NumberVar | None = None, + step: int | NumberVar | None = None, + ) -> ArrayVar[List[int]]: + """Create a range of numbers. + + Args: + first_endpoint: The end of the range if second_endpoint is not provided, otherwise the start of the range. + second_endpoint: The end of the range. + step: The step of the range. + + Returns: + The range of numbers. + """ + from .sequence import ArrayVar + + return ArrayVar.range(first_endpoint, second_endpoint, step) + + def __bool__(self) -> bool: + """Raise exception if using Var in a boolean context. + + Raises: + VarTypeError: when attempting to bool-ify the Var. + """ + raise VarTypeError( + f"Cannot convert Var {str(self)!r} to bool for use with `if`, `and`, `or`, and `not`. " + "Instead use `rx.cond` and bitwise operators `&` (and), `|` (or), `~` (invert)." + ) + + def __iter__(self) -> Any: + """Raise exception if using Var in an iterable context. + + Raises: + VarTypeError: when attempting to iterate over the Var. + """ + raise VarTypeError( + f"Cannot iterate over Var {str(self)!r}. Instead use `rx.foreach`." + ) + + def __contains__(self, _: Any) -> Var: + """Override the 'in' operator to alert the user that it is not supported. + + Raises: + VarTypeError: the operation is not supported + """ + raise VarTypeError( + "'in' operator not supported for Var types, use Var.contains() instead." + ) + + def json(self) -> str: + """Serialize the var to a JSON string. + + Raises: + NotImplementedError: If the method is not implemented. + """ + raise NotImplementedError("Var subclasses must implement the json method.") -def _encode_var(value: ImmutableVar) -> str: +OUTPUT = TypeVar("OUTPUT", bound=Var) + + +def _encode_var(value: Var) -> str: """Encode the state name into a formatted var. Args: @@ -885,7 +951,7 @@ def _encode_var(value: ImmutableVar) -> str: serializers.serializer(_encode_var) -class LiteralVar(ImmutableVar): +class LiteralVar(Var): """Base class for immutable literal vars.""" @classmethod @@ -893,7 +959,7 @@ class LiteralVar(ImmutableVar): cls, value: Any, _var_data: VarData | None = None, - ) -> ImmutableVar: + ) -> Var: """Create a var from a value. Args: @@ -910,7 +976,7 @@ class LiteralVar(ImmutableVar): from .object import LiteralObjectVar from .sequence import LiteralArrayVar, LiteralStringVar - if isinstance(value, ImmutableVar): + if isinstance(value, Var): if _var_data is None: return value return value._replace(merge_var_data=_var_data) @@ -933,7 +999,7 @@ class LiteralVar(ImmutableVar): if value is None: return LiteralNoneVar.create(_var_data=_var_data) - from reflex.event import EventChain, EventSpec + from reflex.event import EventChain, EventHandler, EventSpec from reflex.utils.format import get_event_handler_parts from .function import ArgsFunctionOperation, FunctionStringVar @@ -957,14 +1023,12 @@ class LiteralVar(ImmutableVar): sig = inspect.signature(value.args_spec) # type: ignore if sig.parameters: arg_def = tuple((f"_{p}" for p in sig.parameters)) - arg_def_expr = LiteralVar.create( - [ImmutableVar.create_safe(arg) for arg in arg_def] - ) + arg_def_expr = LiteralVar.create([Var(_js_expr=arg) for arg in arg_def]) else: # add a default argument for addEvents if none were specified in value.args_spec # used to trigger the preventDefault() on the event. arg_def = ("...args",) - arg_def_expr = ImmutableVar.create_safe("args") + arg_def_expr = Var(_js_expr="args") return ArgsFunctionOperation.create( arg_def, @@ -977,9 +1041,20 @@ class LiteralVar(ImmutableVar): ), ) + if isinstance(value, EventHandler): + return Var(_js_expr=".".join(filter(None, get_event_handler_parts(value)))) + if isinstance(value, Base): + # get the fields of the pydantic class + fields = value.__fields__.keys() + one_level_dict = {field: getattr(value, field) for field in fields} + return LiteralObjectVar.create( - {k: (None if callable(v) else v) for k, v in value.dict().items()}, + { + field: value + for field, value in one_level_dict.items() + if not callable(value) + }, _var_type=type(value), _var_data=_var_data, ) @@ -1030,7 +1105,7 @@ T = TypeVar("T") @overload def var_operation( func: Callable[P, CustomVarOperationReturn[NoReturn]], -) -> Callable[P, ImmutableVar]: ... +) -> Callable[P, Var]: ... @overload @@ -1074,7 +1149,7 @@ def var_operation( def var_operation( func: Callable[P, CustomVarOperationReturn[T]], -) -> Callable[P, ImmutableVar[T]]: +) -> Callable[P, Var[T]]: """Decorator for creating a var operation. Example: @@ -1092,18 +1167,14 @@ def var_operation( """ @functools.wraps(func) - def wrapper(*args: P.args, **kwargs: P.kwargs) -> ImmutableVar[T]: + def wrapper(*args: P.args, **kwargs: P.kwargs) -> Var[T]: func_args = list(inspect.signature(func).parameters) args_vars = { - func_args[i]: ( - LiteralVar.create(arg) if not isinstance(arg, ImmutableVar) else arg - ) + func_args[i]: (LiteralVar.create(arg) if not isinstance(arg, Var) else arg) for i, arg in enumerate(args) } kwargs_vars = { - key: LiteralVar.create(value) - if not isinstance(value, ImmutableVar) - else value + key: LiteralVar.create(value) if not isinstance(value, Var) else value for key, value in kwargs.items() } @@ -1152,7 +1223,7 @@ def figure_out_type(value: Any) -> types.GenericType: unionize(*(figure_out_type(k) for k in value)), unionize(*(figure_out_type(v) for v in value.values())), ] - if isinstance(value, ImmutableVar): + if isinstance(value, Var): return value._var_type return type(value) @@ -1175,7 +1246,7 @@ class CachedVarOperation: def __post_init__(self): """Post-initialize the CachedVarOperation.""" - object.__delattr__(self, "_var_name") + object.__delattr__(self, "_js_expr") def __getattr__(self, name: str) -> Any: """Get an attribute of the var. @@ -1186,7 +1257,7 @@ class CachedVarOperation: Returns: The attribute. """ - if name == "_var_name": + if name == "_js_expr": return self._cached_var_name parent_classes = inspect.getmro(self.__class__) @@ -1213,9 +1284,7 @@ class CachedVarOperation: return VarData.merge( *map( lambda value: ( - value._get_all_var_data() - if isinstance(value, ImmutableVar) - else None + value._get_all_var_data() if isinstance(value, Var) else None ), map( lambda field: getattr(self, field.name), @@ -1237,13 +1306,13 @@ class CachedVarOperation: *[ getattr(self, field.name) for field in dataclasses.fields(self) # type: ignore - if field.name not in ["_var_name", "_var_data", "_var_type"] + if field.name not in ["_js_expr", "_var_data", "_var_type"] ], ) ) -def and_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: +def and_operation(a: Var | Any, b: Var | Any) -> Var: """Perform a logical AND operation on two variables. Args: @@ -1257,7 +1326,7 @@ def and_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: @var_operation -def _and_operation(a: ImmutableVar, b: ImmutableVar): +def _and_operation(a: Var, b: Var): """Perform a logical AND operation on two variables. Args: @@ -1273,7 +1342,7 @@ def _and_operation(a: ImmutableVar, b: ImmutableVar): ) -def or_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: +def or_operation(a: Var | Any, b: Var | Any) -> Var: """Perform a logical OR operation on two variables. Args: @@ -1287,7 +1356,7 @@ def or_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: @var_operation -def _or_operation(a: ImmutableVar, b: ImmutableVar): +def _or_operation(a: Var, b: Var): """Perform a logical OR operation on two variables. Args: @@ -1308,36 +1377,36 @@ def _or_operation(a: ImmutableVar, b: ImmutableVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ImmutableCallableVar(ImmutableVar): +class CallableVar(Var): """Decorate a Var-returning function to act as both a Var and a function. This is used as a compatibility shim for replacing Var objects in the API with functions that return a family of Var. """ - fn: Callable[..., ImmutableVar] = dataclasses.field( - default_factory=lambda: lambda: ImmutableVar(_var_name="undefined") + fn: Callable[..., Var] = dataclasses.field( + default_factory=lambda: lambda: Var(_js_expr="undefined") ) - original_var: ImmutableVar = dataclasses.field( - default_factory=lambda: ImmutableVar(_var_name="undefined") + original_var: Var = dataclasses.field( + default_factory=lambda: Var(_js_expr="undefined") ) - def __init__(self, fn: Callable[..., ImmutableVar]): + def __init__(self, fn: Callable[..., Var]): """Initialize a CallableVar. Args: fn: The function to decorate (must return Var) """ original_var = fn() - super(ImmutableCallableVar, self).__init__( - _var_name=original_var._var_name, + super(CallableVar, self).__init__( + _js_expr=original_var._js_expr, _var_type=original_var._var_type, _var_data=VarData.merge(original_var._get_all_var_data()), ) object.__setattr__(self, "fn", fn) object.__setattr__(self, "original_var", original_var) - def __call__(self, *args, **kwargs) -> ImmutableVar: + def __call__(self, *args, **kwargs) -> Var: """Call the decorated function. Args: @@ -1366,13 +1435,13 @@ DICT_VAL = TypeVar("DICT_VAL") LIST_INSIDE = TypeVar("LIST_INSIDE") -class FakeComputedVarBaseClass(Var, property): +class FakeComputedVarBaseClass(property): """A fake base class for ComputedVar to avoid inheriting from property.""" __pydantic_run_validation__ = False -def is_computed_var(obj: Any) -> TypeGuard[ImmutableComputedVar]: +def is_computed_var(obj: Any) -> TypeGuard[ComputedVar]: """Check if the object is a ComputedVar. Args: @@ -1389,7 +1458,7 @@ def is_computed_var(obj: Any) -> TypeGuard[ImmutableComputedVar]: frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): +class ComputedVar(Var[RETURN_TYPE]): """A field with computed getters.""" # Whether to track dependencies and cache computed values @@ -1419,7 +1488,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): fget: Callable[[BASE_STATE], RETURN_TYPE], initial_value: RETURN_TYPE | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[int, datetime.timedelta]] = None, backend: bool | None = None, @@ -1443,12 +1512,12 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): hints = get_type_hints(fget) hint = hints.get("return", Any) - kwargs["_var_name"] = kwargs.pop("_var_name", fget.__name__) + kwargs["_js_expr"] = kwargs.pop("_js_expr", fget.__name__) kwargs["_var_type"] = kwargs.pop("_var_type", hint) - ImmutableVar.__init__( + Var.__init__( self, - _var_name=kwargs.pop("_var_name"), + _js_expr=kwargs.pop("_js_expr"), _var_type=kwargs.pop("_var_type"), _var_data=kwargs.pop("_var_data", None), ) @@ -1469,7 +1538,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): deps = [] else: for dep in deps: - if isinstance(dep, ImmutableVar): + if isinstance(dep, Var): continue if isinstance(dep, str) and dep != "": continue @@ -1479,7 +1548,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): object.__setattr__( self, "_static_deps", - {dep._var_name if isinstance(dep, ImmutableVar) else dep for dep in deps}, + {dep._js_expr if isinstance(dep, Var) else dep for dep in deps}, ) object.__setattr__(self, "_auto_deps", auto_deps) @@ -1507,7 +1576,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): auto_deps=kwargs.pop("auto_deps", self._auto_deps), interval=kwargs.pop("interval", self._update_interval), backend=kwargs.pop("backend", self._backend), - _var_name=kwargs.pop("_var_name", self._var_name), + _js_expr=kwargs.pop("_js_expr", self._js_expr), _var_type=kwargs.pop("_var_type", self._var_type), _var_data=kwargs.pop( "_var_data", VarData.merge(self._var_data, merge_var_data) @@ -1527,7 +1596,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): Returns: An attribute name. """ - return f"__cached_{self._var_name}" + return f"__cached_{self._js_expr}" @property def _last_updated_attr(self) -> str: @@ -1536,7 +1605,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): Returns: An attribute name. """ - return f"__last_updated_{self._var_name}" + return f"__last_updated_{self._js_expr}" def needs_update(self, instance: BaseState) -> bool: """Check if the computed var needs to be updated. @@ -1556,50 +1625,48 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): @overload def __get__( - self: ImmutableComputedVar[int] | ImmutableComputedVar[float], + self: ComputedVar[int] | ComputedVar[float], instance: None, owner: Type, ) -> NumberVar: ... @overload def __get__( - self: ImmutableComputedVar[str], + self: ComputedVar[str], instance: None, owner: Type, ) -> StringVar: ... @overload def __get__( - self: ImmutableComputedVar[dict[DICT_KEY, DICT_VAL]], + self: ComputedVar[dict[DICT_KEY, DICT_VAL]], instance: None, owner: Type, ) -> ObjectVar[dict[DICT_KEY, DICT_VAL]]: ... @overload def __get__( - self: ImmutableComputedVar[list[LIST_INSIDE]], + self: ComputedVar[list[LIST_INSIDE]], instance: None, owner: Type, ) -> ArrayVar[list[LIST_INSIDE]]: ... @overload def __get__( - self: ImmutableComputedVar[set[LIST_INSIDE]], + self: ComputedVar[set[LIST_INSIDE]], instance: None, owner: Type, ) -> ArrayVar[set[LIST_INSIDE]]: ... @overload def __get__( - self: ImmutableComputedVar[tuple[LIST_INSIDE, ...]], + self: ComputedVar[tuple[LIST_INSIDE, ...]], instance: None, owner: Type, ) -> ArrayVar[tuple[LIST_INSIDE, ...]]: ... @overload - def __get__( - self, instance: None, owner: Type - ) -> ImmutableComputedVar[RETURN_TYPE]: ... + def __get__(self, instance: None, owner: Type) -> ComputedVar[RETURN_TYPE]: ... @overload def __get__(self, instance: BaseState, owner: Type) -> RETURN_TYPE: ... @@ -1622,9 +1689,9 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): state_where_defined = state_where_defined.get_parent_state() return self._replace( - _var_name=format_state_name(state_where_defined.get_full_name()) + _js_expr=format_state_name(state_where_defined.get_full_name()) + "." - + self._var_name, + + self._js_expr, merge_var_data=VarData.from_state(state_where_defined), ).guess_type() @@ -1724,7 +1791,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): ) # recurse into property fget functions elif isinstance(ref_obj, property) and not isinstance( - ref_obj, ImmutableComputedVar + ref_obj, ComputedVar ): d.update( self._deps( @@ -1792,7 +1859,7 @@ class ImmutableComputedVar(ImmutableVar[RETURN_TYPE]): return self._fget -class DynamicRouteVar(ImmutableComputedVar[Union[str, List[str]]]): +class DynamicRouteVar(ComputedVar[Union[str, List[str]]]): """A ComputedVar that represents a dynamic route.""" pass @@ -1803,45 +1870,41 @@ if TYPE_CHECKING: @overload -def immutable_computed_var( +def computed_var( fget: None = None, initial_value: Any | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, **kwargs, -) -> Callable[ - [Callable[[BASE_STATE], RETURN_TYPE]], ImmutableComputedVar[RETURN_TYPE] -]: ... +) -> Callable[[Callable[[BASE_STATE], RETURN_TYPE]], ComputedVar[RETURN_TYPE]]: ... @overload -def immutable_computed_var( +def computed_var( fget: Callable[[BASE_STATE], RETURN_TYPE], initial_value: RETURN_TYPE | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, **kwargs, -) -> ImmutableComputedVar[RETURN_TYPE]: ... +) -> ComputedVar[RETURN_TYPE]: ... -def immutable_computed_var( +def computed_var( fget: Callable[[BASE_STATE], Any] | None = None, initial_value: Any | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, **kwargs, -) -> ( - ImmutableComputedVar | Callable[[Callable[[BASE_STATE], Any]], ImmutableComputedVar] -): +) -> ComputedVar | Callable[[Callable[[BASE_STATE], Any]], ComputedVar]: """A ComputedVar decorator with or without kwargs. Args: @@ -1868,10 +1931,10 @@ def immutable_computed_var( raise VarDependencyError("Cannot track dependencies without caching.") if fget is not None: - return ImmutableComputedVar(fget, cache=cache) + return ComputedVar(fget, cache=cache) - def wrapper(fget: Callable[[BASE_STATE], Any]) -> ImmutableComputedVar: - return ImmutableComputedVar( + def wrapper(fget: Callable[[BASE_STATE], Any]) -> ComputedVar: + return ComputedVar( fget, initial_value=initial_value, cache=cache, @@ -1888,7 +1951,7 @@ def immutable_computed_var( RETURN = TypeVar("RETURN") -class CustomVarOperationReturn(ImmutableVar[RETURN]): +class CustomVarOperationReturn(Var[RETURN]): """Base class for custom var operations.""" @classmethod @@ -1909,7 +1972,7 @@ class CustomVarOperationReturn(ImmutableVar[RETURN]): The CustomVarOperation. """ return CustomVarOperationReturn( - _var_name=js_expression, + _js_expr=js_expression, _var_type=_var_type or Any, _var_data=_var_data, ) @@ -1936,12 +1999,10 @@ def var_operation_return( frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): +class CustomVarOperation(CachedVarOperation, Var[T]): """Base class for custom var operations.""" - _args: Tuple[Tuple[str, ImmutableVar], ...] = dataclasses.field( - default_factory=tuple - ) + _args: Tuple[Tuple[str, Var], ...] = dataclasses.field(default_factory=tuple) _return: CustomVarOperationReturn[T] = dataclasses.field( default_factory=lambda: CustomVarOperationReturn.create("") @@ -1975,7 +2036,7 @@ class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): @classmethod def create( cls, - args: Tuple[Tuple[str, ImmutableVar], ...], + args: Tuple[Tuple[str, Var], ...], return_var: CustomVarOperationReturn[T], _var_data: VarData | None = None, ) -> CustomVarOperation[T]: @@ -1990,7 +2051,7 @@ class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): The CustomVarOperation. """ return CustomVarOperation( - _var_name="", + _js_expr="", _var_type=return_var._var_type, _var_data=_var_data, _args=args, @@ -1998,7 +2059,7 @@ class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): ) -class NoneVar(ImmutableVar[None]): +class NoneVar(Var[None]): """A var representing None.""" @@ -2027,7 +2088,7 @@ class LiteralNoneVar(LiteralVar, NoneVar): The var. """ return LiteralNoneVar( - _var_name="null", + _js_expr="null", _var_type=None, _var_data=_var_data, ) @@ -2070,7 +2131,7 @@ class ToNoneOperation(CachedVarOperation, NoneVar): The ToNoneOperation. """ return ToNoneOperation( - _var_name="", + _js_expr="", _var_type=None, _var_data=_var_data, _original_var=var, @@ -2082,7 +2143,7 @@ class ToNoneOperation(CachedVarOperation, NoneVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class StateOperation(CachedVarOperation, ImmutableVar): +class StateOperation(CachedVarOperation, Var): """A var operation that accesses a field on an object.""" _state_name: str = dataclasses.field(default="") @@ -2106,7 +2167,7 @@ class StateOperation(CachedVarOperation, ImmutableVar): Returns: The attribute. """ - if name == "_var_name": + if name == "_js_expr": return self._cached_var_name return getattr(self._field, name) @@ -2115,7 +2176,7 @@ class StateOperation(CachedVarOperation, ImmutableVar): def create( cls, state_name: str, - field: ImmutableVar, + field: Var, _var_data: VarData | None = None, ) -> StateOperation: """Create a DotOperation. @@ -2129,7 +2190,7 @@ class StateOperation(CachedVarOperation, ImmutableVar): The DotOperation. """ return StateOperation( - _var_name="", + _js_expr="", _var_type=field._var_type, _var_data=_var_data, _state_name=state_name, @@ -2153,7 +2214,7 @@ class ToOperation: def __post_init__(self): """Post initialization.""" - object.__delattr__(self, "_var_name") + object.__delattr__(self, "_js_expr") def __hash__(self) -> int: """Calculate the hash value of the object. @@ -2192,8 +2253,287 @@ class ToOperation: The ToOperation. """ return cls( - _var_name="", # type: ignore + _js_expr="", # type: ignore _var_data=_var_data, # type: ignore _var_type=_var_type or cls._default_var_type, # type: ignore _original=value, # type: ignore ) + + +def get_uuid_string_var() -> Var: + """Return a Var that generates a single memoized UUID via .web/utils/state.js. + + useMemo with an empty dependency array ensures that the generated UUID is + consistent across re-renders of the component. + + Returns: + A Var that generates a UUID at runtime. + """ + from reflex.utils.imports import ImportVar + from reflex.vars import Var + + unique_uuid_var = get_unique_variable_name() + unique_uuid_var_data = VarData( + imports={ + f"/{constants.Dirs.STATE_PATH}": {ImportVar(tag="generateUUID")}, # type: ignore + "react": "useMemo", + }, + hooks={f"const {unique_uuid_var} = useMemo(generateUUID, [])": None}, + ) + + return Var( + _js_expr=unique_uuid_var, + _var_type=str, + _var_data=unique_uuid_var_data, + ) + + +# Set of unique variable names. +USED_VARIABLES = set() + + +def get_unique_variable_name() -> str: + """Get a unique variable name. + + Returns: + The unique variable name. + """ + name = "".join([random.choice(string.ascii_lowercase) for _ in range(8)]) + if name not in USED_VARIABLES: + USED_VARIABLES.add(name) + return name + return get_unique_variable_name() + + +@dataclasses.dataclass( + eq=True, + frozen=True, +) +class VarData: + """Metadata associated with a x.""" + + # The name of the enclosing state. + state: str = dataclasses.field(default="") + + # Imports needed to render this var + imports: ImmutableParsedImportDict = dataclasses.field(default_factory=tuple) + + # Hooks that need to be present in the component to render this var + hooks: Tuple[str, ...] = dataclasses.field(default_factory=tuple) + + def __init__( + self, + state: str = "", + imports: ImportDict | ParsedImportDict | None = None, + hooks: dict[str, None] | None = None, + ): + """Initialize the var data. + + Args: + state: The name of the enclosing state. + imports: Imports needed to render this var. + hooks: Hooks that need to be present in the component to render this var. + """ + immutable_imports: ImmutableParsedImportDict = tuple( + sorted( + ((k, tuple(sorted(v))) for k, v in parse_imports(imports or {}).items()) + ) + ) + object.__setattr__(self, "state", state) + object.__setattr__(self, "imports", immutable_imports) + object.__setattr__(self, "hooks", tuple(hooks or {})) + + def old_school_imports(self) -> ImportDict: + """Return the imports as a mutable dict. + + Returns: + The imports as a mutable dict. + """ + return dict((k, list(v)) for k, v in self.imports) + + @classmethod + def merge(cls, *others: VarData | None) -> VarData | None: + """Merge multiple var data objects. + + Args: + *others: The var data objects to merge. + + Returns: + The merged var data object. + """ + state = "" + _imports = {} + hooks = {} + for var_data in others: + if var_data is None: + continue + state = state or var_data.state + _imports = imports.merge_imports(_imports, var_data.imports) + hooks.update( + var_data.hooks + if isinstance(var_data.hooks, dict) + else {k: None for k in var_data.hooks} + ) + + if state or _imports or hooks: + return VarData( + state=state, + imports=_imports, + hooks=hooks, + ) + return None + + def __bool__(self) -> bool: + """Check if the var data is non-empty. + + Returns: + True if any field is set to a non-default value. + """ + return bool(self.state or self.imports or self.hooks) + + def __eq__(self, other: Any) -> bool: + """Check if two var data objects are equal. + + Args: + other: The other var data object to compare. + + Returns: + True if all fields are equal and collapsed imports are equal. + """ + if not isinstance(other, VarData): + return False + + # Don't compare interpolations - that's added in by the decoder, and + # not part of the vardata itself. + return ( + self.state == other.state + and self.hooks + == ( + other.hooks if isinstance(other, VarData) else tuple(other.hooks.keys()) + ) + and imports.collapse_imports(self.imports) + == imports.collapse_imports(other.imports) + ) + + @classmethod + def from_state(cls, state: Type[BaseState] | str) -> VarData: + """Set the state of the var. + + Args: + state: The state to set or the full name of the state. + + Returns: + The var with the set state. + """ + from reflex.utils import format + + state_name = state if isinstance(state, str) else state.get_full_name() + new_var_data = VarData( + state=state_name, + hooks={ + "const {0} = useContext(StateContexts.{0})".format( + format.format_state_name(state_name) + ): None + }, + imports={ + f"/{constants.Dirs.CONTEXTS_PATH}": [ImportVar(tag="StateContexts")], + "react": [ImportVar(tag="useContext")], + }, + ) + return new_var_data + + +def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: + """Decode the state name from a formatted var. + + Args: + value: The value to extract the state name from. + + Returns: + The extracted state name and the value without the state name. + """ + var_datas = [] + if isinstance(value, str): + # fast path if there is no encoded VarData + if constants.REFLEX_VAR_OPENING_TAG not in value: + return None, value + + offset = 0 + + # Find all tags. + while m := _decode_var_pattern.search(value): + start, end = m.span() + value = value[:start] + value[end:] + + serialized_data = m.group(1) + + if serialized_data.isnumeric() or ( + serialized_data[0] == "-" and serialized_data[1:].isnumeric() + ): + # This is a global immutable var. + var = _global_vars[int(serialized_data)] + var_data = var._get_all_var_data() + + if var_data is not None: + var_datas.append(var_data) + offset += end - start + + return VarData.merge(*var_datas) if var_datas else None, value + + +# Compile regex for finding reflex var tags. +_decode_var_pattern_re = ( + rf"{constants.REFLEX_VAR_OPENING_TAG}(.*?){constants.REFLEX_VAR_CLOSING_TAG}" +) +_decode_var_pattern = re.compile(_decode_var_pattern_re, flags=re.DOTALL) + +# Defined global immutable vars. +_global_vars: Dict[int, Var] = {} + + +def _extract_var_data(value: Iterable) -> list[VarData | None]: + """Extract the var imports and hooks from an iterable containing a Var. + + Args: + value: The iterable to extract the VarData from + + Returns: + The extracted VarDatas. + """ + from reflex.style import Style + from reflex.vars import Var + + var_datas = [] + with contextlib.suppress(TypeError): + for sub in value: + if isinstance(sub, Var): + var_datas.append(sub._var_data) + elif not isinstance(sub, str): + # Recurse into dict values. + if hasattr(sub, "values") and callable(sub.values): + var_datas.extend(_extract_var_data(sub.values())) + # Recurse into iterable values (or dict keys). + var_datas.extend(_extract_var_data(sub)) + + # Style objects should already have _var_data. + if isinstance(value, Style): + var_datas.append(value._var_data) + else: + # Recurse when value is a dict itself. + values = getattr(value, "values", None) + if callable(values): + var_datas.extend(_extract_var_data(values())) + return var_datas + + +# These names were changed in reflex 0.3.0 +REPLACED_NAMES = { + "full_name": "_var_full_name", + "name": "_js_expr", + "state": "_var_data.state", + "type_": "_var_type", + "is_local": "_var_is_local", + "is_string": "_var_is_string", + "set_state": "_var_set_state", + "deps": "_deps", +} diff --git a/reflex/ivars/function.py b/reflex/vars/function.py similarity index 85% rename from reflex/ivars/function.py rename to reflex/vars/function.py index 4fec96b70..a512432b9 100644 --- a/reflex/ivars/function.py +++ b/reflex/vars/function.py @@ -7,21 +7,21 @@ import sys from typing import Any, Callable, ClassVar, Optional, Tuple, Type, Union from reflex.utils.types import GenericType -from reflex.vars import VarData from .base import ( CachedVarOperation, - ImmutableVar, LiteralVar, ToOperation, + Var, + VarData, cached_property_no_lock, ) -class FunctionVar(ImmutableVar[Callable]): +class FunctionVar(Var[Callable]): """Base class for immutable function vars.""" - def __call__(self, *args: ImmutableVar | Any) -> ArgsFunctionOperation: + def __call__(self, *args: Var | Any) -> ArgsFunctionOperation: """Call the function with the given arguments. Args: @@ -32,10 +32,10 @@ class FunctionVar(ImmutableVar[Callable]): """ return ArgsFunctionOperation.create( ("...args",), - VarOperationCall.create(self, *args, ImmutableVar.create_safe("...args")), + VarOperationCall.create(self, *args, Var(_js_expr="...args")), ) - def call(self, *args: ImmutableVar | Any) -> VarOperationCall: + def call(self, *args: Var | Any) -> VarOperationCall: """Call the function with the given arguments. Args: @@ -67,7 +67,7 @@ class FunctionStringVar(FunctionVar): The function var. """ return cls( - _var_name=func, + _js_expr=func, _var_type=_var_type, _var_data=_var_data, ) @@ -78,13 +78,11 @@ class FunctionStringVar(FunctionVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class VarOperationCall(CachedVarOperation, ImmutableVar): +class VarOperationCall(CachedVarOperation, Var): """Base class for immutable vars that are the result of a function call.""" _func: Optional[FunctionVar] = dataclasses.field(default=None) - _args: Tuple[Union[ImmutableVar, Any], ...] = dataclasses.field( - default_factory=tuple - ) + _args: Tuple[Union[Var, Any], ...] = dataclasses.field(default_factory=tuple) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -112,7 +110,7 @@ class VarOperationCall(CachedVarOperation, ImmutableVar): def create( cls, func: FunctionVar, - *args: ImmutableVar | Any, + *args: Var | Any, _var_type: GenericType = Any, _var_data: VarData | None = None, ) -> VarOperationCall: @@ -127,7 +125,7 @@ class VarOperationCall(CachedVarOperation, ImmutableVar): The function call var. """ return cls( - _var_name="", + _js_expr="", _var_type=_var_type, _var_data=_var_data, _func=func, @@ -144,7 +142,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): """Base class for immutable function defined via arguments and return expression.""" _args_names: Tuple[str, ...] = dataclasses.field(default_factory=tuple) - _return_expr: Union[ImmutableVar, Any] = dataclasses.field(default=None) + _return_expr: Union[Var, Any] = dataclasses.field(default=None) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -159,7 +157,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): def create( cls, args_names: Tuple[str, ...], - return_expr: ImmutableVar | Any, + return_expr: Var | Any, _var_type: GenericType = Callable, _var_data: VarData | None = None, ) -> ArgsFunctionOperation: @@ -174,7 +172,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): The function var. """ return cls( - _var_name="", + _js_expr="", _var_type=_var_type, _var_data=_var_data, _args_names=args_names, @@ -190,9 +188,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): class ToFunctionOperation(ToOperation, FunctionVar): """Base class of converting a var to a function.""" - _original: ImmutableVar = dataclasses.field( - default_factory=lambda: LiteralVar.create(None) - ) + _original: Var = dataclasses.field(default_factory=lambda: LiteralVar.create(None)) _default_var_type: ClassVar[GenericType] = Callable diff --git a/reflex/ivars/number.py b/reflex/vars/number.py similarity index 96% rename from reflex/ivars/number.py rename to reflex/vars/number.py index 764aa9e24..31778a25d 100644 --- a/reflex/ivars/number.py +++ b/reflex/vars/number.py @@ -18,14 +18,14 @@ from typing import ( ) from reflex.utils.exceptions import VarTypeError -from reflex.vars import Var, VarData from .base import ( CustomVarOperationReturn, - ImmutableVar, LiteralNoneVar, LiteralVar, ToOperation, + Var, + VarData, unionize, var_operation, var_operation_return, @@ -54,7 +54,7 @@ def raise_unsupported_operand_types( ) -class NumberVar(ImmutableVar[NUMBER_T]): +class NumberVar(Var[NUMBER_T]): """Base class for immutable number vars.""" @overload @@ -848,8 +848,8 @@ def boolean_to_number_operation(value: BooleanVar): def comparison_operator( - func: Callable[[ImmutableVar, ImmutableVar], str], -) -> Callable[[ImmutableVar | Any, ImmutableVar | Any], BooleanVar]: + func: Callable[[Var, Var], str], +) -> Callable[[Var | Any, Var | Any], BooleanVar]: """Decorator to create a comparison operation. Args: @@ -860,13 +860,13 @@ def comparison_operator( """ @var_operation - def operation(lhs: ImmutableVar, rhs: ImmutableVar): + def operation(lhs: Var, rhs: Var): return var_operation_return( js_expression=func(lhs, rhs), var_type=bool, ) - def wrapper(lhs: ImmutableVar | Any, rhs: ImmutableVar | Any) -> BooleanVar: + def wrapper(lhs: Var | Any, rhs: Var | Any) -> BooleanVar: """Create the comparison operation. Args: @@ -882,7 +882,7 @@ def comparison_operator( @comparison_operator -def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def greater_than_operation(lhs: Var, rhs: Var): """Greater than comparison. Args: @@ -896,7 +896,7 @@ def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def greater_than_or_equal_operation(lhs: Var, rhs: Var): """Greater than or equal comparison. Args: @@ -910,7 +910,7 @@ def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def less_than_operation(lhs: Var, rhs: Var): """Less than comparison. Args: @@ -924,7 +924,7 @@ def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def less_than_or_equal_operation(lhs: Var, rhs: Var): """Less than or equal comparison. Args: @@ -938,7 +938,7 @@ def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def equal_operation(lhs: Var, rhs: Var): """Equal comparison. Args: @@ -952,7 +952,7 @@ def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def not_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def not_equal_operation(lhs: Var, rhs: Var): """Not equal comparison. Args: @@ -1016,7 +1016,7 @@ class LiteralBooleanVar(LiteralVar, BooleanVar): The boolean var. """ return cls( - _var_name="true" if value else "false", + _js_expr="true" if value else "false", _var_type=bool, _var_data=_var_data, _var_value=value, @@ -1061,7 +1061,7 @@ class LiteralNumberVar(LiteralVar, NumberVar): The number var. """ return cls( - _var_name=str(value), + _js_expr=str(value), _var_type=type(value), _var_data=_var_data, _var_value=value, @@ -1115,9 +1115,7 @@ def boolify(value: Var): @var_operation -def ternary_operation( - condition: BooleanVar, if_true: ImmutableVar, if_false: ImmutableVar -): +def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): """Create a ternary operation. Args: diff --git a/reflex/ivars/object.py b/reflex/vars/object.py similarity index 91% rename from reflex/ivars/object.py rename to reflex/vars/object.py index 687083fcb..1158bba9a 100644 --- a/reflex/ivars/object.py +++ b/reflex/vars/object.py @@ -23,13 +23,13 @@ from typing import ( from reflex.utils import types from reflex.utils.exceptions import VarAttributeError from reflex.utils.types import GenericType, get_attribute_access_type, get_origin -from reflex.vars import VarData from .base import ( CachedVarOperation, - ImmutableVar, LiteralVar, ToOperation, + Var, + VarData, cached_property_no_lock, figure_out_type, var_operation, @@ -48,7 +48,7 @@ ARRAY_INNER_TYPE = TypeVar("ARRAY_INNER_TYPE") OTHER_KEY_TYPE = TypeVar("OTHER_KEY_TYPE") -class ObjectVar(ImmutableVar[OBJECT_TYPE]): +class ObjectVar(Var[OBJECT_TYPE]): """Base class for immutable object vars.""" def _key_type(self) -> Type: @@ -134,8 +134,8 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, NoReturn]], - key: ImmutableVar | Any, - ) -> ImmutableVar: ... + key: Var | Any, + ) -> Var: ... @overload def __getitem__( @@ -144,40 +144,40 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): | ObjectVar[Dict[KEY_TYPE, float]] | ObjectVar[Dict[KEY_TYPE, int | float]] ), - key: ImmutableVar | Any, + key: Var | Any, ) -> NumberVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, str]], - key: ImmutableVar | Any, + key: Var | Any, ) -> StringVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, list[ARRAY_INNER_TYPE]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ArrayVar[list[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, set[ARRAY_INNER_TYPE]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ArrayVar[set[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, tuple[ARRAY_INNER_TYPE, ...]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ArrayVar[tuple[ARRAY_INNER_TYPE, ...]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, dict[OTHER_KEY_TYPE, VALUE_TYPE]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ObjectVar[dict[OTHER_KEY_TYPE, VALUE_TYPE]]: ... - def __getitem__(self, key: ImmutableVar | Any) -> ImmutableVar: + def __getitem__(self, key: Var | Any) -> Var: """Get an item from the object. Args: @@ -197,7 +197,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): def __getattr__( self: ObjectVar[Dict[KEY_TYPE, NoReturn]], name: str, - ) -> ImmutableVar: ... + ) -> Var: ... @overload def __getattr__( @@ -239,7 +239,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): name: str, ) -> ObjectVar[dict[OTHER_KEY_TYPE, VALUE_TYPE]]: ... - def __getattr__(self, name) -> ImmutableVar: + def __getattr__(self, name) -> Var: """Get an attribute of the var. Args: @@ -271,7 +271,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): else: return ObjectItemOperation.create(self, name).guess_type() - def contains(self, key: ImmutableVar | Any) -> BooleanVar: + def contains(self, key: Var | Any) -> BooleanVar: """Check if the object contains a key. Args: @@ -291,8 +291,8 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]): class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): """Base class for immutable literal object vars.""" - _var_value: Dict[Union[ImmutableVar, Any], Union[ImmutableVar, Any]] = ( - dataclasses.field(default_factory=dict) + _var_value: Dict[Union[Var, Any], Union[Var, Any]] = dataclasses.field( + default_factory=dict ) def _key_type(self) -> Type: @@ -354,7 +354,7 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): Returns: The hash of the var. """ - return hash((self.__class__.__name__, self._var_name)) + return hash((self.__class__.__name__, self._js_expr)) @cached_property_no_lock def _cached_get_all_var_data(self) -> VarData | None: @@ -390,7 +390,7 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): The literal object var. """ return LiteralObjectVar( - _var_name="", + _js_expr="", _var_type=(figure_out_type(_var_value) if _var_type is None else _var_type), _var_data=_var_data, _var_value=_var_value, @@ -470,15 +470,13 @@ def object_merge_operation(lhs: ObjectVar, rhs: ObjectVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ObjectItemOperation(CachedVarOperation, ImmutableVar): +class ObjectItemOperation(CachedVarOperation, Var): """Operation to get an item from an object.""" _object: ObjectVar = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) - _key: ImmutableVar | Any = dataclasses.field( - default_factory=lambda: LiteralVar.create(None) - ) + _key: Var | Any = dataclasses.field(default_factory=lambda: LiteralVar.create(None)) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -495,7 +493,7 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): def create( cls, object: ObjectVar, - key: ImmutableVar | Any, + key: Var | Any, _var_type: GenericType | None = None, _var_data: VarData | None = None, ) -> ObjectItemOperation: @@ -511,11 +509,11 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): The object item operation. """ return cls( - _var_name="", + _js_expr="", _var_type=object._value_type() if _var_type is None else _var_type, _var_data=_var_data, _object=object, - _key=key if isinstance(key, ImmutableVar) else LiteralVar.create(key), + _key=key if isinstance(key, Var) else LiteralVar.create(key), ) @@ -527,7 +525,7 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): class ToObjectOperation(ToOperation, ObjectVar): """Operation to convert a var to an object.""" - _original: ImmutableVar = dataclasses.field( + _original: Var = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) @@ -542,13 +540,13 @@ class ToObjectOperation(ToOperation, ObjectVar): Returns: The attribute of the var. """ - if name == "_var_name": - return self._original._var_name + if name == "_js_expr": + return self._original._js_expr return ObjectVar.__getattr__(self, name) @var_operation -def object_has_own_property_operation(object: ObjectVar, key: ImmutableVar): +def object_has_own_property_operation(object: ObjectVar, key: Var): """Check if an object has a key. Args: diff --git a/reflex/ivars/sequence.py b/reflex/vars/sequence.py similarity index 96% rename from reflex/ivars/sequence.py rename to reflex/vars/sequence.py index 3b6da46c2..192a969e5 100644 --- a/reflex/ivars/sequence.py +++ b/reflex/vars/sequence.py @@ -28,22 +28,19 @@ from reflex import constants from reflex.constants.base import REFLEX_VAR_OPENING_TAG from reflex.utils.exceptions import VarTypeError from reflex.utils.types import GenericType, get_origin -from reflex.vars import ( - Var, - VarData, - _global_vars, - get_unique_variable_name, -) from .base import ( CachedVarOperation, CustomVarOperationReturn, - ImmutableVar, LiteralNoneVar, LiteralVar, ToOperation, + Var, + VarData, + _global_vars, cached_property_no_lock, figure_out_type, + get_unique_variable_name, unionize, var_operation, var_operation_return, @@ -59,7 +56,7 @@ if TYPE_CHECKING: from .object import ObjectVar -class StringVar(ImmutableVar[str]): +class StringVar(Var[str]): """Base class for immutable string vars.""" @overload @@ -568,7 +565,7 @@ class LiteralStringVar(LiteralVar, StringVar): The var. """ if REFLEX_VAR_OPENING_TAG in value: - strings_and_vals: list[ImmutableVar | str] = [] + strings_and_vals: list[Var | str] = [] offset = 0 # Find all tags @@ -585,14 +582,14 @@ class LiteralStringVar(LiteralVar, StringVar): # This is a global immutable var. var = _global_vars[int(serialized_data)] strings_and_vals.append(var) - value = value[(end + len(var._var_name)) :] + value = value[(end + len(var._js_expr)) :] offset += end - start strings_and_vals.append(value) filtered_strings_and_vals = [ - s for s in strings_and_vals if isinstance(s, ImmutableVar) or s + s for s in strings_and_vals if isinstance(s, Var) or s ] if len(filtered_strings_and_vals) == 1: @@ -604,7 +601,7 @@ class LiteralStringVar(LiteralVar, StringVar): ) return LiteralStringVar( - _var_name=json.dumps(value), + _js_expr=json.dumps(value), _var_type=str, _var_data=_var_data, _var_value=value, @@ -635,7 +632,7 @@ class LiteralStringVar(LiteralVar, StringVar): class ConcatVarOperation(CachedVarOperation, StringVar): """Representing a concatenation of literal string vars.""" - _var_value: Tuple[ImmutableVar, ...] = dataclasses.field(default_factory=tuple) + _var_value: Tuple[Var, ...] = dataclasses.field(default_factory=tuple) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -644,7 +641,7 @@ class ConcatVarOperation(CachedVarOperation, StringVar): Returns: The name of the var. """ - list_of_strs: List[Union[str, ImmutableVar]] = [] + list_of_strs: List[Union[str, Var]] = [] last_string = "" for var in self._var_value: if isinstance(var, LiteralStringVar): @@ -659,9 +656,7 @@ class ConcatVarOperation(CachedVarOperation, StringVar): list_of_strs.append(last_string) list_of_strs_filtered = [ - str(LiteralVar.create(s)) - for s in list_of_strs - if isinstance(s, ImmutableVar) or s + str(LiteralVar.create(s)) for s in list_of_strs if isinstance(s, Var) or s ] if len(list_of_strs_filtered) == 1: @@ -680,7 +675,7 @@ class ConcatVarOperation(CachedVarOperation, StringVar): *[ var._get_all_var_data() for var in self._var_value - if isinstance(var, ImmutableVar) + if isinstance(var, Var) ], self._var_data, ) @@ -701,7 +696,7 @@ class ConcatVarOperation(CachedVarOperation, StringVar): The var. """ return cls( - _var_name="", + _js_expr="", _var_type=str, _var_data=_var_data, _var_value=tuple(map(LiteralVar.create, value)), @@ -718,7 +713,7 @@ KEY_TYPE = TypeVar("KEY_TYPE") VALUE_TYPE = TypeVar("VALUE_TYPE") -class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): +class ArrayVar(Var[ARRAY_VAR_TYPE]): """Base class for immutable array vars.""" @overload @@ -856,9 +851,9 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): ) -> ObjectVar[Dict[KEY_TYPE, VALUE_TYPE]]: ... @overload - def __getitem__(self, i: int | NumberVar) -> ImmutableVar: ... + def __getitem__(self, i: int | NumberVar) -> Var: ... - def __getitem__(self, i: Any) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: + def __getitem__(self, i: Any) -> ArrayVar[ARRAY_VAR_TYPE] | Var: """Get a slice of the array. Args: @@ -897,6 +892,15 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): /, ) -> ArrayVar[List[int]]: ... + @overload + @classmethod + def range( + cls, + first_endpoint: int | NumberVar, + second_endpoint: int | NumberVar | None = None, + step: int | NumberVar | None = None, + ) -> ArrayVar[List[int]]: ... + @classmethod def range( cls, @@ -1096,15 +1100,15 @@ class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): function_var = ArgsFunctionOperation.create(tuple(), return_value) else: # generic number var - number_var = ImmutableVar("").to(NumberVar) + number_var = Var("").to(NumberVar) first_arg_type = self[number_var]._var_type arg_name = get_unique_variable_name() # get first argument type - first_arg = ImmutableVar( - _var_name=arg_name, + first_arg = Var( + _js_expr=arg_name, _var_type=first_arg_type, ).guess_type() @@ -1131,9 +1135,9 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): """Base class for immutable literal array vars.""" _var_value: Union[ - List[Union[ImmutableVar, Any]], - Set[Union[ImmutableVar, Any]], - Tuple[Union[ImmutableVar, Any], ...], + List[Union[Var, Any]], + Set[Union[Var, Any]], + Tuple[Union[Var, Any], ...], ] = dataclasses.field(default_factory=list) @cached_property_no_lock @@ -1172,7 +1176,7 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): Returns: The hash of the var. """ - return hash((self.__class__.__name__, self._var_name)) + return hash((self.__class__.__name__, self._js_expr)) def json(self) -> str: """Get the JSON representation of the var. @@ -1205,7 +1209,7 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): The var. """ return cls( - _var_name="", + _js_expr="", _var_type=figure_out_type(value) if _var_type is None else _var_type, _var_data=_var_data, _var_value=value, @@ -1256,18 +1260,14 @@ class ArraySliceOperation(CachedVarOperation, ArrayVar): start, end, step = self._start, self._stop, self._step normalized_start = ( - LiteralVar.create(start) - if start is not None - else ImmutableVar.create_safe("undefined") + LiteralVar.create(start) if start is not None else Var(_js_expr="undefined") ) normalized_end = ( - LiteralVar.create(end) - if end is not None - else ImmutableVar.create_safe("undefined") + LiteralVar.create(end) if end is not None else Var(_js_expr="undefined") ) if step is None: return f"{str(self._array)}.slice({str(normalized_start)}, {str(normalized_end)})" - if not isinstance(step, ImmutableVar): + if not isinstance(step, Var): if step < 0: actual_start = end + 1 if end is not None else 0 actual_end = start + 1 if start is not None else self._array.length() @@ -1299,7 +1299,7 @@ class ArraySliceOperation(CachedVarOperation, ArrayVar): The var. """ return cls( - _var_name="", + _js_expr="", _var_type=array._var_type, _var_data=_var_data, _array=array, diff --git a/tests/components/base/test_bare.py b/tests/components/base/test_bare.py index adc7ac1b0..c30ffaf15 100644 --- a/tests/components/base/test_bare.py +++ b/tests/components/base/test_bare.py @@ -1,9 +1,9 @@ import pytest from reflex.components.base.bare import Bare -from reflex.ivars.base import ImmutableVar +from reflex.vars.base import Var -STATE_VAR = ImmutableVar.create_safe("default_state.name") +STATE_VAR = Var(_js_expr="default_state.name") @pytest.mark.parametrize( diff --git a/tests/components/core/test_colors.py b/tests/components/core/test_colors.py index 4907bb486..f12c01372 100644 --- a/tests/components/core/test_colors.py +++ b/tests/components/core/test_colors.py @@ -3,7 +3,7 @@ import pytest import reflex as rx from reflex.components.datadisplay.code import CodeBlock from reflex.constants.colors import Color -from reflex.ivars.base import LiteralVar +from reflex.vars.base import LiteralVar class ColorState(rx.State): diff --git a/tests/components/core/test_cond.py b/tests/components/core/test_cond.py index eb2fe200a..f5b6c0895 100644 --- a/tests/components/core/test_cond.py +++ b/tests/components/core/test_cond.py @@ -6,9 +6,9 @@ import pytest from reflex.components.base.fragment import Fragment from reflex.components.core.cond import Cond, cond from reflex.components.radix.themes.typography.text import Text -from reflex.ivars.base import ImmutableVar, LiteralVar, immutable_computed_var from reflex.state import BaseState, State from reflex.utils.format import format_state_name +from reflex.vars.base import LiteralVar, Var, computed_var @pytest.fixture @@ -91,10 +91,10 @@ def test_prop_cond(c1: Any, c2: Any): c2, ) - assert isinstance(prop_cond, ImmutableVar) - if not isinstance(c1, ImmutableVar): + assert isinstance(prop_cond, Var) + if not isinstance(c1, Var): c1 = json.dumps(c1) - if not isinstance(c2, ImmutableVar): + if not isinstance(c2, Var): c2 = json.dumps(c2) assert str(prop_cond) == f"(true ? {str(c1)} : {str(c2)})" @@ -125,18 +125,18 @@ def test_cond_computed_var(): """Test if cond works with computed vars.""" class CondStateComputed(State): - @immutable_computed_var + @computed_var def computed_int(self) -> int: return 0 - @immutable_computed_var + @computed_var def computed_str(self) -> str: return "a string" comp = cond(True, CondStateComputed.computed_int, CondStateComputed.computed_str) # TODO: shouln't this be a ComputedVar? - assert isinstance(comp, ImmutableVar) + assert isinstance(comp, Var) state_name = format_state_name(CondStateComputed.get_full_name()) assert ( diff --git a/tests/components/core/test_debounce.py b/tests/components/core/test_debounce.py index c4a18e610..656f26c1f 100644 --- a/tests/components/core/test_debounce.py +++ b/tests/components/core/test_debounce.py @@ -4,8 +4,8 @@ import pytest import reflex as rx from reflex.components.core.debounce import DEFAULT_DEBOUNCE_TIMEOUT -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState +from reflex.vars.base import LiteralVar, Var def test_create_no_child(): @@ -57,7 +57,7 @@ def test_render_child_props(): on_change=S.on_change, ) )._render() - assert "css" in tag.props and isinstance(tag.props["css"], rx.Var) + assert "css" in tag.props and isinstance(tag.props["css"], rx.vars.Var) for prop in ["foo", "bar", "baz", "quuc"]: assert prop in str(tag.props["css"]) assert tag.props["value"].equals(LiteralVar.create("real")) @@ -73,7 +73,7 @@ def test_render_with_class_name(): class_name="foo baz", ) )._render() - assert isinstance(tag.props["className"], rx.Var) + assert isinstance(tag.props["className"], rx.vars.Var) assert "foo baz" in str(tag.props["className"]) @@ -84,7 +84,7 @@ def test_render_with_ref(): id="foo_bar", ) )._render() - assert isinstance(tag.props["inputRef"], rx.Var) + assert isinstance(tag.props["inputRef"], rx.vars.Var) assert "foo_bar" in str(tag.props["inputRef"]) @@ -95,12 +95,12 @@ def test_render_with_key(): key="foo_bar", ) )._render() - assert isinstance(tag.props["key"], rx.Var) + assert isinstance(tag.props["key"], rx.vars.Var) assert "foo_bar" in str(tag.props["key"]) def test_render_with_special_props(): - special_prop = ImmutableVar.create_safe("{foo_bar}") + special_prop = Var(_js_expr="{foo_bar}") tag = rx.debounce_input( rx.input( on_change=S.on_change, @@ -149,13 +149,13 @@ def test_render_child_props_recursive(): ), force_notify_by_enter=False, )._render() - assert "css" in tag.props and isinstance(tag.props["css"], rx.Var) + assert "css" in tag.props and isinstance(tag.props["css"], rx.vars.Var) for prop in ["foo", "bar", "baz", "quuc"]: assert prop in str(tag.props["css"]) assert tag.props["value"].equals(LiteralVar.create("outer")) - assert tag.props["forceNotifyOnBlur"]._var_name == "false" - assert tag.props["forceNotifyByEnter"]._var_name == "false" - assert tag.props["debounceTimeout"]._var_name == "42" + assert tag.props["forceNotifyOnBlur"]._js_expr == "false" + assert tag.props["forceNotifyByEnter"]._js_expr == "false" + assert tag.props["debounceTimeout"]._js_expr == "42" assert len(tag.props["onChange"].events) == 1 assert tag.props["onChange"].events[0].handler == S.on_change assert tag.contents == "" @@ -167,7 +167,7 @@ def test_full_control_implicit_debounce(): value=S.value, on_change=S.on_change, )._render() - assert tag.props["debounceTimeout"]._var_name == str(DEFAULT_DEBOUNCE_TIMEOUT) + assert tag.props["debounceTimeout"]._js_expr == str(DEFAULT_DEBOUNCE_TIMEOUT) assert len(tag.props["onChange"].events) == 1 assert tag.props["onChange"].events[0].handler == S.on_change assert tag.contents == "" @@ -179,7 +179,7 @@ def test_full_control_implicit_debounce_text_area(): value=S.value, on_change=S.on_change, )._render() - assert tag.props["debounceTimeout"]._var_name == str(DEFAULT_DEBOUNCE_TIMEOUT) + assert tag.props["debounceTimeout"]._js_expr == str(DEFAULT_DEBOUNCE_TIMEOUT) assert len(tag.props["onChange"].events) == 1 assert tag.props["onChange"].events[0].handler == S.on_change assert tag.contents == "" diff --git a/tests/components/core/test_foreach.py b/tests/components/core/test_foreach.py index 53459f92d..43b9d8d55 100644 --- a/tests/components/core/test_foreach.py +++ b/tests/components/core/test_foreach.py @@ -12,10 +12,10 @@ from reflex.components.core.foreach import ( ) from reflex.components.radix.themes.layout.box import box from reflex.components.radix.themes.typography.text import text -from reflex.ivars.base import ImmutableVar -from reflex.ivars.number import NumberVar -from reflex.ivars.sequence import ArrayVar from reflex.state import BaseState, ComponentState +from reflex.vars.base import Var +from reflex.vars.number import NumberVar +from reflex.vars.sequence import ArrayVar class ForEachState(BaseState): @@ -238,10 +238,10 @@ def test_foreach_render(state_var, render_fn, render_dict): # Make sure the index vars are unique. arg_index = rend["arg_index"] - assert isinstance(arg_index, ImmutableVar) - assert arg_index._var_name not in seen_index_vars + assert isinstance(arg_index, Var) + assert arg_index._js_expr not in seen_index_vars assert arg_index._var_type == int - seen_index_vars.add(arg_index._var_name) + seen_index_vars.add(arg_index._js_expr) def test_foreach_bad_annotations(): diff --git a/tests/components/core/test_match.py b/tests/components/core/test_match.py index f2cc97f25..583bfa1e2 100644 --- a/tests/components/core/test_match.py +++ b/tests/components/core/test_match.py @@ -4,9 +4,9 @@ import pytest import reflex as rx from reflex.components.core.match import Match -from reflex.ivars.base import ImmutableVar from reflex.state import BaseState from reflex.utils.exceptions import MatchTypeError +from reflex.vars.base import Var class MatchState(BaseState): @@ -40,39 +40,39 @@ def test_match_components(): match_cases = match_child["match_cases"] assert len(match_cases) == 6 - assert match_cases[0][0]._var_name == "1" + assert match_cases[0][0]._js_expr == "1" assert match_cases[0][0]._var_type == int first_return_value_render = match_cases[0][1].render() assert first_return_value_render["name"] == "RadixThemesText" assert first_return_value_render["children"][0]["contents"] == '{"first value"}' - assert match_cases[1][0]._var_name == "2" + assert match_cases[1][0]._js_expr == "2" assert match_cases[1][0]._var_type == int - assert match_cases[1][1]._var_name == "3" + assert match_cases[1][1]._js_expr == "3" assert match_cases[1][1]._var_type == int second_return_value_render = match_cases[1][2].render() assert second_return_value_render["name"] == "RadixThemesText" assert second_return_value_render["children"][0]["contents"] == '{"second value"}' - assert match_cases[2][0]._var_name == "[1, 2]" + assert match_cases[2][0]._js_expr == "[1, 2]" assert match_cases[2][0]._var_type == List[int] third_return_value_render = match_cases[2][1].render() assert third_return_value_render["name"] == "RadixThemesText" assert third_return_value_render["children"][0]["contents"] == '{"third value"}' - assert match_cases[3][0]._var_name == '"random"' + assert match_cases[3][0]._js_expr == '"random"' assert match_cases[3][0]._var_type == str fourth_return_value_render = match_cases[3][1].render() assert fourth_return_value_render["name"] == "RadixThemesText" assert fourth_return_value_render["children"][0]["contents"] == '{"fourth value"}' - assert match_cases[4][0]._var_name == '({ ["foo"] : "bar" })' + assert match_cases[4][0]._js_expr == '({ ["foo"] : "bar" })' assert match_cases[4][0]._var_type == Dict[str, str] fifth_return_value_render = match_cases[4][1].render() assert fifth_return_value_render["name"] == "RadixThemesText" assert fifth_return_value_render["children"][0]["contents"] == '{"fifth value"}' - assert match_cases[5][0]._var_name == f"({MatchState.get_name()}.num + 1)" + assert match_cases[5][0]._js_expr == f"({MatchState.get_name()}.num + 1)" assert match_cases[5][0]._var_type == int fifth_return_value_render = match_cases[5][1].render() assert fifth_return_value_render["name"] == "RadixThemesText" @@ -135,7 +135,7 @@ def test_match_vars(cases, expected): expected: The expected var full name. """ match_comp = Match.create(MatchState.value, *cases) - assert isinstance(match_comp, ImmutableVar) + assert isinstance(match_comp, Var) assert str(match_comp) == expected @@ -248,7 +248,7 @@ def test_match_case_tuple_elements(match_case): rx.text("default value"), ), 'Match cases should have the same return types. Case 3 with return value `"red"` of type ' - " is not ", + " is not ", ), ( ( @@ -261,7 +261,7 @@ def test_match_case_tuple_elements(match_case): rx.text("default value"), ), 'Match cases should have the same return types. Case 3 with return value ` {"first value"} ` ' - "of type is not ", + "of type is not ", ), ], ) diff --git a/tests/components/core/test_upload.py b/tests/components/core/test_upload.py index cf7bafcd3..83f04b3e6 100644 --- a/tests/components/core/test_upload.py +++ b/tests/components/core/test_upload.py @@ -7,8 +7,8 @@ from reflex.components.core.upload import ( get_upload_url, ) from reflex.event import EventSpec -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import State +from reflex.vars.base import LiteralVar, Var class TestUploadState(State): @@ -38,7 +38,7 @@ def test_cancel_upload(): def test_get_upload_url(): url = get_upload_url("foo_file") - assert isinstance(url, ImmutableVar) + assert isinstance(url, Var) def test__on_drop_spec(): diff --git a/tests/components/datadisplay/test_code.py b/tests/components/datadisplay/test_code.py index 49fbae09f..000ae2d26 100644 --- a/tests/components/datadisplay/test_code.py +++ b/tests/components/datadisplay/test_code.py @@ -9,7 +9,7 @@ from reflex.components.datadisplay.code import CodeBlock def test_code_light_dark_theme(theme, expected): code_block = CodeBlock.create(theme=theme) - assert code_block.theme._var_name == expected # type: ignore + assert code_block.theme._js_expr == expected # type: ignore def generate_custom_code(language, expected_case): diff --git a/tests/components/forms/test_form.py b/tests/components/forms/test_form.py index 0611c6994..3cbbab3b8 100644 --- a/tests/components/forms/test_form.py +++ b/tests/components/forms/test_form.py @@ -1,12 +1,12 @@ from reflex.components.radix.primitives.form import Form from reflex.event import EventChain -from reflex.ivars.base import ImmutableVar +from reflex.vars.base import Var def test_render_on_submit(): """Test that on_submit event chain is rendered as a separate function.""" - submit_it = ImmutableVar( - _var_name="submit_it", + submit_it = Var( + _js_expr="submit_it", _var_type=EventChain, ) f = Form.create(on_submit=submit_it) diff --git a/tests/components/media/test_image.py b/tests/components/media/test_image.py index ba8353260..e3d924235 100644 --- a/tests/components/media/test_image.py +++ b/tests/components/media/test_image.py @@ -6,8 +6,8 @@ from PIL.Image import Image as Img import reflex as rx from reflex.components.next.image import Image # type: ignore -from reflex.ivars.sequence import StringVar from reflex.utils.serializers import serialize, serialize_image +from reflex.vars.sequence import StringVar @pytest.fixture @@ -53,7 +53,7 @@ def test_set_src_img(pil_image: Img): pil_image: The image to serialize. """ image = Image.create(src=pil_image) - assert str(image.src._var_name) == '"' + serialize_image(pil_image) + '"' # type: ignore + assert str(image.src._js_expr) == '"' + serialize_image(pil_image) + '"' # type: ignore def test_render(pil_image: Img): diff --git a/tests/components/radix/test_icon_button.py b/tests/components/radix/test_icon_button.py index b80611c02..8047cf7b2 100644 --- a/tests/components/radix/test_icon_button.py +++ b/tests/components/radix/test_icon_button.py @@ -2,8 +2,8 @@ import pytest from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.icon_button import IconButton -from reflex.ivars.base import LiteralVar from reflex.style import Style +from reflex.vars.base import LiteralVar def test_icon_button(): diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 79a72b997..4dda81896 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -17,13 +17,13 @@ from reflex.components.component import ( from reflex.components.radix.themes.layout.box import Box from reflex.constants import EventTriggers from reflex.event import EventChain, EventHandler, parse_args_spec -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.style import Style from reflex.utils import imports from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.imports import ImportDict, ImportVar, ParsedImportDict, parse_imports -from reflex.vars import Var, VarData +from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var @pytest.fixture @@ -275,19 +275,19 @@ def test_create_component(component1): ), pytest.param( "text", - ImmutableVar(_var_name="hello", _var_type=Optional[str]), + Var(_js_expr="hello", _var_type=Optional[str]), None, id="text-optional", ), pytest.param( "text", - ImmutableVar(_var_name="hello", _var_type=Union[str, None]), + Var(_js_expr="hello", _var_type=Union[str, None]), None, id="text-union-str-none", ), pytest.param( "text", - ImmutableVar(_var_name="hello", _var_type=Union[None, str]), + Var(_js_expr="hello", _var_type=Union[None, str]), None, id="text-union-none-str", ), @@ -305,19 +305,19 @@ def test_create_component(component1): ), pytest.param( "number", - ImmutableVar(_var_name="1", _var_type=Optional[int]), + Var(_js_expr="1", _var_type=Optional[int]), None, id="number-optional", ), pytest.param( "number", - ImmutableVar(_var_name="1", _var_type=Union[int, None]), + Var(_js_expr="1", _var_type=Union[int, None]), None, id="number-union-int-none", ), pytest.param( "number", - ImmutableVar(_var_name="1", _var_type=Union[None, int]), + Var(_js_expr="1", _var_type=Union[None, int]), None, id="number-union-none-int", ), @@ -341,37 +341,37 @@ def test_create_component(component1): ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Optional[str]), + Var(_js_expr="hello", _var_type=Optional[str]), None, id="text_or_number-optional-str", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Union[str, None]), + Var(_js_expr="hello", _var_type=Union[str, None]), None, id="text_or_number-union-str-none", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Union[None, str]), + Var(_js_expr="hello", _var_type=Union[None, str]), None, id="text_or_number-union-none-str", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="1", _var_type=Optional[int]), + Var(_js_expr="1", _var_type=Optional[int]), None, id="text_or_number-optional-int", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="1", _var_type=Union[int, None]), + Var(_js_expr="1", _var_type=Union[int, None]), None, id="text_or_number-union-int-none", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="1", _var_type=Union[None, int]), + Var(_js_expr="1", _var_type=Union[None, int]), None, id="text_or_number-union-none-int", ), @@ -383,7 +383,7 @@ def test_create_component(component1): ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Optional[Union[str, int]]), + Var(_js_expr="hello", _var_type=Optional[Union[str, int]]), None, id="text_or_number-optional-union-str-int", ), @@ -392,7 +392,7 @@ def test_create_component(component1): def test_create_component_prop_validation( component1: Type[Component], prop_name: str, - var: Union[ImmutableVar, str, int], + var: Union[Var, str, int], expected: Type[Exception], ): """Test that component props are validated correctly. @@ -1177,9 +1177,9 @@ TEST_VAR = LiteralVar.create("test")._replace( ) ) FORMATTED_TEST_VAR = LiteralVar.create(f"foo{TEST_VAR}bar") -STYLE_VAR = TEST_VAR._replace(_var_name="style") +STYLE_VAR = TEST_VAR._replace(_js_expr="style") EVENT_CHAIN_VAR = TEST_VAR._replace(_var_type=EventChain) -ARG_VAR = ImmutableVar.create_safe("arg") +ARG_VAR = Var(_js_expr="arg") TEST_VAR_DICT_OF_DICT = LiteralVar.create({"a": {"b": "test"}})._replace( merge_var_data=TEST_VAR._var_data @@ -1397,12 +1397,12 @@ class EventState(rx.State): ), ) def test_get_vars(component, exp_vars): - comp_vars = sorted(component._get_vars(), key=lambda v: v._var_name) + comp_vars = sorted(component._get_vars(), key=lambda v: v._js_expr) assert len(comp_vars) == len(exp_vars) print(comp_vars, exp_vars) for comp_var, exp_var in zip( comp_vars, - sorted(exp_vars, key=lambda v: v._var_name), + sorted(exp_vars, key=lambda v: v._js_expr), ): # print(str(comp_var), str(exp_var)) # print(comp_var._get_all_var_data(), exp_var._get_all_var_data()) @@ -2028,8 +2028,8 @@ def test_component_add_hooks_var(): return [ "const hook3 = useRef(null)", "const hook1 = 42", - ImmutableVar.create( - "useEffect(() => () => {}, [])", + Var( + _js_expr="useEffect(() => () => {}, [])", _var_data=VarData( hooks={ "const hook2 = 43": None, @@ -2038,11 +2038,9 @@ def test_component_add_hooks_var(): imports={"react": [ImportVar(tag="useEffect")]}, ), ), - ImmutableVar.create( - "const hook3 = useRef(null)", - _var_data=VarData( - imports={"react": [ImportVar(tag="useRef")]}, - ), + Var( + _js_expr="const hook3 = useRef(null)", + _var_data=VarData(imports={"react": [ImportVar(tag="useRef")]}), ), ] @@ -2151,9 +2149,7 @@ class TriggerState(rx.State): rx.text("random text", on_click=TriggerState.do_something), rx.text( "random text", - on_click=ImmutableVar( - _var_name="toggleColorMode", _var_type=EventChain - ), + on_click=Var(_js_expr="toggleColorMode", _var_type=EventChain), ), ), True, @@ -2163,9 +2159,7 @@ class TriggerState(rx.State): rx.text("random text", on_click=rx.console_log("log")), rx.text( "random text", - on_click=ImmutableVar( - _var_name="toggleColorMode", _var_type=EventChain - ), + on_click=Var(_js_expr="toggleColorMode", _var_type=EventChain), ), ), False, diff --git a/tests/components/test_tag.py b/tests/components/test_tag.py index b4b37cc28..c41246e3f 100644 --- a/tests/components/test_tag.py +++ b/tests/components/test_tag.py @@ -3,7 +3,7 @@ from typing import Dict, List import pytest from reflex.components.tags import CondTag, Tag, tagless -from reflex.ivars.base import ImmutableVar, LiteralVar +from reflex.vars.base import LiteralVar, Var @pytest.mark.parametrize( @@ -16,7 +16,7 @@ from reflex.ivars.base import ImmutableVar, LiteralVar ({"key": True, "key2": "value2"}, ["key={true}", 'key2={"value2"}']), ], ) -def test_format_props(props: Dict[str, ImmutableVar], test_props: List): +def test_format_props(props: Dict[str, Var], test_props: List): """Test that the formatted props are correct. Args: @@ -40,7 +40,7 @@ def test_format_props(props: Dict[str, ImmutableVar], test_props: List): (None, False), ], ) -def test_is_valid_prop(prop: ImmutableVar, valid: bool): +def test_is_valid_prop(prop: Var, valid: bool): """Test that the prop is valid. Args: @@ -110,7 +110,7 @@ def test_format_cond_tag(): tag = CondTag( true_value=dict(Tag(name="h1", contents="True content")), false_value=dict(Tag(name="h2", contents="False content")), - cond=ImmutableVar(_var_name="logged_in", _var_type=bool), + cond=Var(_js_expr="logged_in", _var_type=bool), ) tag_dict = dict(tag) cond, true_value, false_value = ( @@ -118,7 +118,7 @@ def test_format_cond_tag(): tag_dict["true_value"], tag_dict["false_value"], ) - assert cond._var_name == "logged_in" + assert cond._js_expr == "logged_in" assert cond._var_type == bool assert true_value["name"] == "h1" diff --git a/tests/test_app.py b/tests/test_app.py index a2a0cede7..88655d7de 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -35,7 +35,6 @@ from reflex.components.base.fragment import Fragment from reflex.components.core.cond import Cond from reflex.components.radix.themes.typography.text import Text from reflex.event import Event -from reflex.ivars.base import immutable_computed_var from reflex.middleware import HydrateMiddleware from reflex.model import Model from reflex.state import ( @@ -51,6 +50,7 @@ from reflex.state import ( ) from reflex.style import Style from reflex.utils import exceptions, format +from reflex.vars.base import computed_var from .conftest import chdir from .states import ( @@ -904,7 +904,7 @@ class DynamicState(BaseState): """Increment the counter var.""" self.counter = self.counter + 1 - @immutable_computed_var(cache=True) + @computed_var(cache=True) def comp_dynamic(self) -> str: """A computed var that depends on the dynamic var. @@ -1541,11 +1541,11 @@ def test_app_with_valid_var_dependencies(compilable_app: tuple[App, Path]): base: int = 0 _backend: int = 0 - @immutable_computed_var(cache=True) + @computed_var(cache=True) def foo(self) -> str: return "foo" - @immutable_computed_var(deps=["_backend", "base", foo], cache=True) + @computed_var(deps=["_backend", "base", foo], cache=True) def bar(self) -> str: return "bar" @@ -1557,7 +1557,7 @@ def test_app_with_invalid_var_dependencies(compilable_app: tuple[App, Path]): app, _ = compilable_app class InvalidDepState(BaseState): - @immutable_computed_var(deps=["foolksjdf"], cache=True) + @computed_var(deps=["foolksjdf"], cache=True) def bar(self) -> str: return "bar" diff --git a/tests/test_event.py b/tests/test_event.py index c538ce069..a152c3749 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -4,12 +4,12 @@ import pytest from reflex import event from reflex.event import Event, EventHandler, EventSpec, call_event_handler, fix_events -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.utils import format +from reflex.vars.base import LiteralVar, Var -def make_var(value) -> ImmutableVar: +def make_var(value) -> Var: """Make a variable. Args: @@ -18,7 +18,7 @@ def make_var(value) -> ImmutableVar: Returns: The var. """ - return ImmutableVar.create_safe(value) + return Var(_js_expr=value) def test_create_event(): @@ -54,10 +54,10 @@ def test_call_event_handler(): # Test passing vars as args. assert event_spec.handler == handler - assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) - assert event_spec.args[0][1].equals(ImmutableVar.create_safe("first")) - assert event_spec.args[1][0].equals(ImmutableVar.create_safe("arg2")) - assert event_spec.args[1][1].equals(ImmutableVar.create_safe("second")) + assert event_spec.args[0][0].equals(Var(_js_expr="arg1")) + assert event_spec.args[0][1].equals(Var(_js_expr="first")) + assert event_spec.args[1][0].equals(Var(_js_expr="arg2")) + assert event_spec.args[1][1].equals(Var(_js_expr="second")) assert ( format.format_event(event_spec) == 'Event("test_fn_with_args", {arg1:first,arg2:second})' @@ -79,9 +79,9 @@ def test_call_event_handler(): ) assert event_spec.handler == handler - assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec.args[0][0].equals(Var(_js_expr="arg1")) assert event_spec.args[0][1].equals(LiteralVar.create(first)) - assert event_spec.args[1][0].equals(ImmutableVar.create_safe("arg2")) + assert event_spec.args[1][0].equals(Var(_js_expr="arg2")) assert event_spec.args[1][1].equals(LiteralVar.create(second)) handler = EventHandler(fn=test_fn_with_args) @@ -106,17 +106,17 @@ def test_call_event_handler_partial(): assert event_spec.handler == handler assert len(event_spec.args) == 1 - assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) - assert event_spec.args[0][1].equals(ImmutableVar.create_safe("first")) + assert event_spec.args[0][0].equals(Var(_js_expr="arg1")) + assert event_spec.args[0][1].equals(Var(_js_expr="first")) assert format.format_event(event_spec) == 'Event("test_fn_with_args", {arg1:first})' assert event_spec2 is not event_spec assert event_spec2.handler == handler assert len(event_spec2.args) == 2 - assert event_spec2.args[0][0].equals(ImmutableVar.create_safe("arg1")) - assert event_spec2.args[0][1].equals(ImmutableVar.create_safe("first")) - assert event_spec2.args[1][0].equals(ImmutableVar.create_safe("arg2")) - assert event_spec2.args[1][1].equals(ImmutableVar.create_safe("_a2")) + assert event_spec2.args[0][0].equals(Var(_js_expr="arg1")) + assert event_spec2.args[0][1].equals(Var(_js_expr="first")) + assert event_spec2.args[1][0].equals(Var(_js_expr="arg2")) + assert event_spec2.args[1][1].equals(Var(_js_expr="_a2", _var_type=str)) assert ( format.format_event(event_spec2) == 'Event("test_fn_with_args", {arg1:first,arg2:_a2})' @@ -168,7 +168,7 @@ def test_fix_events(arg1, arg2): 'Event("_redirect", {path:"/path",external:false,replace:false})', ), ( - (ImmutableVar.create_safe("path"), None, None), + (Var(_js_expr="path"), None, None), 'Event("_redirect", {path:path,external:false,replace:false})', ), ( @@ -199,8 +199,8 @@ def test_event_redirect(input, output): assert spec.handler.fn.__qualname__ == "_redirect" # this asserts need comment about what it's testing (they fail with Var as input) - # assert spec.args[0][0].equals(Var.create_safe("path")) - # assert spec.args[0][1].equals(Var.create_safe("/path")) + # assert spec.args[0][0].equals(Var(_js_expr="path")) + # assert spec.args[0][1].equals(Var(_js_expr="/path")) assert format.format_event(spec) == output @@ -210,10 +210,10 @@ def test_event_console_log(): spec = event.console_log("message") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_console" - assert spec.args[0][0].equals(ImmutableVar(_var_name="message", _var_type=str)) + assert spec.args[0][0].equals(Var(_js_expr="message")) assert spec.args[0][1].equals(LiteralVar.create("message")) assert format.format_event(spec) == 'Event("_console", {message:"message"})' - spec = event.console_log(ImmutableVar.create_safe("message")) + spec = event.console_log(Var(_js_expr="message")) assert format.format_event(spec) == 'Event("_console", {message:message})' @@ -222,10 +222,10 @@ def test_event_window_alert(): spec = event.window_alert("message") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_alert" - assert spec.args[0][0].equals(ImmutableVar(_var_name="message", _var_type=str)) + assert spec.args[0][0].equals(Var(_js_expr="message")) assert spec.args[0][1].equals(LiteralVar.create("message")) assert format.format_event(spec) == 'Event("_alert", {message:"message"})' - spec = event.window_alert(ImmutableVar.create_safe("message")) + spec = event.window_alert(Var(_js_expr="message")) assert format.format_event(spec) == 'Event("_alert", {message:message})' @@ -234,7 +234,7 @@ def test_set_focus(): spec = event.set_focus("input1") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_set_focus" - assert spec.args[0][0].equals(ImmutableVar.create_safe("ref")) + assert spec.args[0][0].equals(Var(_js_expr="ref")) assert spec.args[0][1].equals(LiteralVar.create("ref_input1")) assert format.format_event(spec) == 'Event("_set_focus", {ref:"ref_input1"})' spec = event.set_focus("input1") @@ -246,14 +246,14 @@ def test_set_value(): spec = event.set_value("input1", "") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_set_value" - assert spec.args[0][0].equals(ImmutableVar.create_safe("ref")) + assert spec.args[0][0].equals(Var(_js_expr="ref")) assert spec.args[0][1].equals(LiteralVar.create("ref_input1")) - assert spec.args[1][0].equals(ImmutableVar.create_safe("value")) + assert spec.args[1][0].equals(Var(_js_expr="value")) assert spec.args[1][1].equals(LiteralVar.create("")) assert ( format.format_event(spec) == 'Event("_set_value", {ref:"ref_input1",value:""})' ) - spec = event.set_value("input1", ImmutableVar.create_safe("message")) + spec = event.set_value("input1", Var(_js_expr="message")) assert ( format.format_event(spec) == 'Event("_set_value", {ref:"ref_input1",value:message})' @@ -265,9 +265,9 @@ def test_remove_cookie(): spec = event.remove_cookie("testkey") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_cookie" - assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) + assert spec.args[0][0].equals(Var(_js_expr="key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) + assert spec.args[1][0].equals(Var(_js_expr="options")) assert spec.args[1][1].equals(LiteralVar.create({"path": "/"})) assert ( format.format_event(spec) @@ -286,9 +286,9 @@ def test_remove_cookie_with_options(): spec = event.remove_cookie("testkey", options) assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_cookie" - assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) + assert spec.args[0][0].equals(Var(_js_expr="key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) + assert spec.args[1][0].equals(Var(_js_expr="options")) assert spec.args[1][1].equals(LiteralVar.create(options)) assert ( format.format_event(spec) @@ -310,7 +310,7 @@ def test_remove_local_storage(): spec = event.remove_local_storage("testkey") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_local_storage" - assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) + assert spec.args[0][0].equals(Var(_js_expr="key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) assert ( format.format_event(spec) == 'Event("_remove_local_storage", {key:"testkey"})' diff --git a/tests/test_state.py b/tests/test_state.py index 3da74fc89..d12727615 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -23,7 +23,6 @@ from reflex.base import Base from reflex.components.sonner.toast import Toaster from reflex.constants import CompileVars, RouteVar, SocketEvent from reflex.event import Event, EventHandler -from reflex.ivars.base import ImmutableComputedVar, ImmutableVar from reflex.state import ( BaseState, ImmutableStateError, @@ -43,6 +42,7 @@ from reflex.state import ( from reflex.testing import chdir from reflex.utils import format, prerequisites, types from reflex.utils.format import json_dumps +from reflex.vars.base import ComputedVar, Var from tests.states.mutation import MutableSQLAModel, MutableTestState from .states import GenState @@ -104,7 +104,7 @@ class TestState(BaseState): fig: Figure = Figure() dt: datetime.datetime = datetime.datetime.fromisoformat("1989-11-09T18:53:00+01:00") - @ImmutableComputedVar + @ComputedVar def sum(self) -> float: """Dynamically sum the numbers. @@ -113,7 +113,7 @@ class TestState(BaseState): """ return self.num1 + self.num2 - @ImmutableComputedVar + @ComputedVar def upper(self) -> str: """Uppercase the key. @@ -269,8 +269,8 @@ def test_base_class_vars(test_state): if field in test_state.get_skip_vars(): continue prop = getattr(cls, field) - assert isinstance(prop, ImmutableVar) - assert prop._var_name.split(".")[-1] == field + assert isinstance(prop, Var) + assert prop._js_expr.split(".")[-1] == field assert cls.num1._var_type == int assert cls.num2._var_type == float @@ -284,7 +284,7 @@ def test_computed_class_var(test_state): test_state: A state. """ cls = type(test_state) - vars = [(prop._var_name, prop._var_type) for prop in cls.computed_vars.values()] + vars = [(prop._js_expr, prop._var_type) for prop in cls.computed_vars.values()] assert ("sum", float) in vars assert ("upper", str) in vars @@ -519,11 +519,9 @@ def test_set_class_var(): """Test setting the var of a class.""" with pytest.raises(AttributeError): TestState.num3 # type: ignore - TestState._set_var( - ImmutableVar(_var_name="num3", _var_type=int)._var_set_state(TestState) - ) + TestState._set_var(Var(_js_expr="num3", _var_type=int)._var_set_state(TestState)) var = TestState.num3 # type: ignore - assert var._var_name == TestState.get_full_name() + ".num3" + assert var._js_expr == TestState.get_full_name() + ".num3" assert var._var_type == int assert var._var_state == TestState.get_full_name() @@ -1106,7 +1104,7 @@ def test_child_state(): v: int = 2 class ChildState(MainState): - @ImmutableComputedVar + @ComputedVar def rendered_var(self): return self.v @@ -1125,7 +1123,7 @@ def test_conditional_computed_vars(): t1: str = "a" t2: str = "b" - @ImmutableComputedVar + @ComputedVar def rendered_var(self) -> str: if self.flag: return self.t1 @@ -3074,12 +3072,12 @@ def test_potentially_dirty_substates(): """ class State(RxState): - @ImmutableComputedVar + @ComputedVar def foo(self) -> str: return "" class C1(State): - @ImmutableComputedVar + @ComputedVar def bar(self) -> str: return "" diff --git a/tests/test_style.py b/tests/test_style.py index e170fe614..19106df75 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -7,9 +7,9 @@ import pytest import reflex as rx from reflex import style from reflex.components.component import evaluate_style_namespaces -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.vars import VarData +from reflex.vars.base import LiteralVar, Var test_style = [ ({"a": 1}, {"a": 1}), @@ -81,7 +81,7 @@ def compare_dict_of_var(d1: dict[str, Any], d2: dict[str, Any]): assert key in d2 if isinstance(value, dict): compare_dict_of_var(value, d2[key]) - elif isinstance(value, ImmutableVar): + elif isinstance(value, Var): assert value.equals(d2[key]) else: assert value == d2[key] @@ -377,8 +377,8 @@ class StyleState(rx.State): ( {"color": f"dark{StyleState.color}"}, { - "css": ImmutableVar.create_safe( - f'({{ ["color"] : ("dark"+{StyleState.color}) }})' + "css": Var( + _js_expr=f'({{ ["color"] : ("dark"+{StyleState.color}) }})' ).to(Dict[str, str]) }, ), diff --git a/tests/test_var.py b/tests/test_var.py index 460cee39e..e73407bb0 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -8,40 +8,37 @@ from pandas import DataFrame from reflex.base import Base from reflex.constants.base import REFLEX_VAR_CLOSING_TAG, REFLEX_VAR_OPENING_TAG -from reflex.ivars.base import ( - ImmutableComputedVar, - ImmutableVar, +from reflex.state import BaseState +from reflex.utils.imports import ImportVar +from reflex.vars import VarData +from reflex.vars.base import ( + ComputedVar, LiteralVar, - immutable_computed_var, + Var, + computed_var, var_operation, var_operation_return, ) -from reflex.ivars.function import ArgsFunctionOperation, FunctionStringVar -from reflex.ivars.number import ( +from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar +from reflex.vars.number import ( LiteralBooleanVar, LiteralNumberVar, NumberVar, ) -from reflex.ivars.object import LiteralObjectVar, ObjectVar -from reflex.ivars.sequence import ( +from reflex.vars.object import LiteralObjectVar, ObjectVar +from reflex.vars.sequence import ( ArrayVar, ConcatVarOperation, LiteralArrayVar, LiteralStringVar, ) -from reflex.state import BaseState -from reflex.utils.imports import ImportVar -from reflex.vars import ( - Var, - VarData, -) test_vars = [ - ImmutableVar(_var_name="prop1", _var_type=int), - ImmutableVar(_var_name="key", _var_type=str), - ImmutableVar(_var_name="value", _var_type=str)._var_set_state("state"), - ImmutableVar(_var_name="local", _var_type=str)._var_set_state("state"), - ImmutableVar(_var_name="local2", _var_type=str), + Var(_js_expr="prop1", _var_type=int), + Var(_js_expr="key", _var_type=str), + Var(_js_expr="value", _var_type=str)._var_set_state("state"), + Var(_js_expr="local", _var_type=str)._var_set_state("state"), + Var(_js_expr="local2", _var_type=str), ] @@ -67,7 +64,7 @@ def ParentState(TestObj): foo: int bar: int - @immutable_computed_var + @computed_var def var_without_annotation(self): return TestObj @@ -77,7 +74,7 @@ def ParentState(TestObj): @pytest.fixture def ChildState(ParentState, TestObj): class ChildState(ParentState): - @immutable_computed_var + @computed_var def var_without_annotation(self): """This shadows ParentState.var_without_annotation. @@ -92,7 +89,7 @@ def ChildState(ParentState, TestObj): @pytest.fixture def GrandChildState(ChildState, TestObj): class GrandChildState(ChildState): - @immutable_computed_var + @computed_var def var_without_annotation(self): """This shadows ChildState.var_without_annotation. @@ -107,7 +104,7 @@ def GrandChildState(ChildState, TestObj): @pytest.fixture def StateWithAnyVar(TestObj): class StateWithAnyVar(BaseState): - @immutable_computed_var + @computed_var def var_without_annotation(self) -> typing.Any: return TestObj @@ -117,7 +114,7 @@ def StateWithAnyVar(TestObj): @pytest.fixture def StateWithCorrectVarAnnotation(): class StateWithCorrectVarAnnotation(BaseState): - @immutable_computed_var + @computed_var def var_with_annotation(self) -> str: return "Correct annotation" @@ -127,7 +124,7 @@ def StateWithCorrectVarAnnotation(): @pytest.fixture def StateWithWrongVarAnnotation(TestObj): class StateWithWrongVarAnnotation(BaseState): - @immutable_computed_var + @computed_var def var_with_annotation(self) -> str: return TestObj @@ -137,7 +134,7 @@ def StateWithWrongVarAnnotation(TestObj): @pytest.fixture def StateWithInitialComputedVar(): class StateWithInitialComputedVar(BaseState): - @immutable_computed_var(initial_value="Initial value") + @computed_var(initial_value="Initial value") def var_with_initial_value(self) -> str: return "Runtime value" @@ -147,7 +144,7 @@ def StateWithInitialComputedVar(): @pytest.fixture def ChildWithInitialComputedVar(StateWithInitialComputedVar): class ChildWithInitialComputedVar(StateWithInitialComputedVar): - @immutable_computed_var(initial_value="Initial value") + @computed_var(initial_value="Initial value") def var_with_initial_value_child(self) -> str: return "Runtime value" @@ -157,7 +154,7 @@ def ChildWithInitialComputedVar(StateWithInitialComputedVar): @pytest.fixture def StateWithRuntimeOnlyVar(): class StateWithRuntimeOnlyVar(BaseState): - @immutable_computed_var(initial_value=None) + @computed_var(initial_value=None) def var_raises_at_runtime(self) -> str: raise ValueError("So nicht, mein Freund") @@ -167,7 +164,7 @@ def StateWithRuntimeOnlyVar(): @pytest.fixture def ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): class ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): - @immutable_computed_var(initial_value="Initial value") + @computed_var(initial_value="Initial value") def var_raises_at_runtime_child(self) -> str: raise ValueError("So nicht, mein Freund") @@ -217,14 +214,14 @@ def test_str(prop, expected): @pytest.mark.parametrize( "prop,expected", [ - (ImmutableVar(_var_name="p", _var_type=int), 0), - (ImmutableVar(_var_name="p", _var_type=float), 0.0), - (ImmutableVar(_var_name="p", _var_type=str), ""), - (ImmutableVar(_var_name="p", _var_type=bool), False), - (ImmutableVar(_var_name="p", _var_type=list), []), - (ImmutableVar(_var_name="p", _var_type=dict), {}), - (ImmutableVar(_var_name="p", _var_type=tuple), ()), - (ImmutableVar(_var_name="p", _var_type=set), set()), + (Var(_js_expr="p", _var_type=int), 0), + (Var(_js_expr="p", _var_type=float), 0.0), + (Var(_js_expr="p", _var_type=str), ""), + (Var(_js_expr="p", _var_type=bool), False), + (Var(_js_expr="p", _var_type=list), []), + (Var(_js_expr="p", _var_type=dict), {}), + (Var(_js_expr="p", _var_type=tuple), ()), + (Var(_js_expr="p", _var_type=set), set()), ], ) def test_default_value(prop, expected): @@ -263,16 +260,14 @@ def test_get_setter(prop, expected): @pytest.mark.parametrize( "value,expected", [ - (None, ImmutableVar(_var_name="null", _var_type=None)), - (1, ImmutableVar(_var_name="1", _var_type=int)), - ("key", ImmutableVar(_var_name='"key"', _var_type=str)), - (3.14, ImmutableVar(_var_name="3.14", _var_type=float)), - ([1, 2, 3], ImmutableVar(_var_name="[1, 2, 3]", _var_type=List[int])), + (None, Var(_js_expr="null", _var_type=None)), + (1, Var(_js_expr="1", _var_type=int)), + ("key", Var(_js_expr='"key"', _var_type=str)), + (3.14, Var(_js_expr="3.14", _var_type=float)), + ([1, 2, 3], Var(_js_expr="[1, 2, 3]", _var_type=List[int])), ( {"a": 1, "b": 2}, - ImmutableVar( - _var_name='({ ["a"] : 1, ["b"] : 2 })', _var_type=Dict[str, int] - ), + Var(_js_expr='({ ["a"] : 1, ["b"] : 2 })', _var_type=Dict[str, int]), ), ], ) @@ -299,7 +294,7 @@ def test_create_type_error(): LiteralVar.create(value) -def v(value) -> ImmutableVar: +def v(value) -> Var: return LiteralVar.create(value) @@ -330,30 +325,20 @@ def test_basic_operations(TestObj): == '({ ["a"] : 1, ["b"] : 2 })["a"]' ) assert str(v("foo") == v("bar")) == '("foo" === "bar")' - assert ( - str(ImmutableVar.create("foo") == ImmutableVar.create("bar")) == "(foo === bar)" - ) + assert str(Var(_js_expr="foo") == Var(_js_expr="bar")) == "(foo === bar)" assert ( str(LiteralVar.create("foo") == LiteralVar.create("bar")) == '("foo" === "bar")' ) - print(ImmutableVar(_var_name="foo").to(ObjectVar, TestObj)._var_set_state("state")) + print(Var(_js_expr="foo").to(ObjectVar, TestObj)._var_set_state("state")) assert ( str( - ImmutableVar(_var_name="foo") - .to(ObjectVar, TestObj) - ._var_set_state("state") - .bar + Var(_js_expr="foo").to(ObjectVar, TestObj)._var_set_state("state").bar == LiteralVar.create("bar") ) == '(state.foo["bar"] === "bar")' ) assert ( - str( - ImmutableVar(_var_name="foo") - .to(ObjectVar, TestObj) - ._var_set_state("state") - .bar - ) + str(Var(_js_expr="foo").to(ObjectVar, TestObj)._var_set_state("state").bar) == 'state.foo["bar"]' ) assert str(abs(LiteralNumberVar.create(1))) == "Math.abs(1)" @@ -373,15 +358,11 @@ def test_basic_operations(TestObj): == '["1", "2", "3"].slice().reverse()' ) assert ( - str(ImmutableVar(_var_name="foo")._var_set_state("state").to(list).reverse()) + str(Var(_js_expr="foo")._var_set_state("state").to(list).reverse()) == "state.foo.slice().reverse()" ) - assert ( - str(ImmutableVar(_var_name="foo").to(list).reverse()) == "foo.slice().reverse()" - ) - assert ( - str(ImmutableVar(_var_name="foo", _var_type=str).js_type()) == "(typeof(foo))" - ) + assert str(Var(_js_expr="foo").to(list).reverse()) == "foo.slice().reverse()" + assert str(Var(_js_expr="foo", _var_type=str).js_type()) == "(typeof(foo))" @pytest.mark.parametrize( @@ -391,17 +372,17 @@ def test_basic_operations(TestObj): (v(set([1, 2, 3])), "[1, 2, 3]"), (v(["1", "2", "3"]), '["1", "2", "3"]'), ( - ImmutableVar(_var_name="foo")._var_set_state("state").to(list), + Var(_js_expr="foo")._var_set_state("state").to(list), "state.foo", ), - (ImmutableVar(_var_name="foo").to(list), "foo"), + (Var(_js_expr="foo").to(list), "foo"), (v((1, 2, 3)), "[1, 2, 3]"), (v(("1", "2", "3")), '["1", "2", "3"]'), ( - ImmutableVar(_var_name="foo")._var_set_state("state").to(tuple), + Var(_js_expr="foo")._var_set_state("state").to(tuple), "state.foo", ), - (ImmutableVar(_var_name="foo").to(tuple), "foo"), + (Var(_js_expr="foo").to(tuple), "foo"), ], ) def test_list_tuple_contains(var, expected): @@ -409,10 +390,8 @@ def test_list_tuple_contains(var, expected): assert str(var.contains("1")) == f'{expected}.includes("1")' assert str(var.contains(v(1))) == f"{expected}.includes(1)" assert str(var.contains(v("1"))) == f'{expected}.includes("1")' - other_state_var = ImmutableVar(_var_name="other", _var_type=str)._var_set_state( - "state" - ) - other_var = ImmutableVar(_var_name="other", _var_type=str) + other_state_var = Var(_js_expr="other", _var_type=str)._var_set_state("state") + other_var = Var(_js_expr="other", _var_type=str) assert str(var.contains(other_state_var)) == f"{expected}.includes(state.other)" assert str(var.contains(other_var)) == f"{expected}.includes(other)" @@ -421,15 +400,15 @@ def test_list_tuple_contains(var, expected): "var, expected", [ (v("123"), json.dumps("123")), - (ImmutableVar(_var_name="foo")._var_set_state("state").to(str), "state.foo"), - (ImmutableVar(_var_name="foo").to(str), "foo"), + (Var(_js_expr="foo")._var_set_state("state").to(str), "state.foo"), + (Var(_js_expr="foo").to(str), "foo"), ], ) def test_str_contains(var, expected): assert str(var.contains("1")) == f'{expected}.includes("1")' assert str(var.contains(v("1"))) == f'{expected}.includes("1")' - other_state_var = ImmutableVar(_var_name="other")._var_set_state("state").to(str) - other_var = ImmutableVar(_var_name="other").to(str) + other_state_var = Var(_js_expr="other")._var_set_state("state").to(str) + other_var = Var(_js_expr="other").to(str) assert str(var.contains(other_state_var)) == f"{expected}.includes(state.other)" assert str(var.contains(other_var)) == f"{expected}.includes(other)" assert ( @@ -442,8 +421,8 @@ def test_str_contains(var, expected): "var, expected", [ (v({"a": 1, "b": 2}), '({ ["a"] : 1, ["b"] : 2 })'), - (ImmutableVar(_var_name="foo")._var_set_state("state").to(dict), "state.foo"), - (ImmutableVar(_var_name="foo").to(dict), "foo"), + (Var(_js_expr="foo")._var_set_state("state").to(dict), "state.foo"), + (Var(_js_expr="foo").to(dict), "foo"), ], ) def test_dict_contains(var, expected): @@ -451,8 +430,8 @@ def test_dict_contains(var, expected): assert str(var.contains("1")) == f'{expected}.hasOwnProperty("1")' assert str(var.contains(v(1))) == f"{expected}.hasOwnProperty(1)" assert str(var.contains(v("1"))) == f'{expected}.hasOwnProperty("1")' - other_state_var = ImmutableVar(_var_name="other")._var_set_state("state").to(str) - other_var = ImmutableVar(_var_name="other").to(str) + other_state_var = Var(_js_expr="other")._var_set_state("state").to(str) + other_var = Var(_js_expr="other").to(str) assert ( str(var.contains(other_state_var)) == f"{expected}.hasOwnProperty(state.other)" ) @@ -462,9 +441,9 @@ def test_dict_contains(var, expected): @pytest.mark.parametrize( "var", [ - ImmutableVar(_var_name="list", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="tuple", _var_type=Tuple[int, int]).guess_type(), - ImmutableVar(_var_name="str", _var_type=str).guess_type(), + Var(_js_expr="list", _var_type=List[int]).guess_type(), + Var(_js_expr="tuple", _var_type=Tuple[int, int]).guess_type(), + Var(_js_expr="str", _var_type=str).guess_type(), ], ) def test_var_indexing_lists(var): @@ -474,19 +453,19 @@ def test_var_indexing_lists(var): var : The str, list or tuple base var. """ # Test basic indexing. - assert str(var[0]) == f"{var._var_name}.at(0)" - assert str(var[1]) == f"{var._var_name}.at(1)" + assert str(var[0]) == f"{var._js_expr}.at(0)" + assert str(var[1]) == f"{var._js_expr}.at(1)" # Test negative indexing. - assert str(var[-1]) == f"{var._var_name}.at(-1)" + assert str(var[-1]) == f"{var._js_expr}.at(-1)" @pytest.mark.parametrize( "var, type_", [ - (ImmutableVar(_var_name="list", _var_type=List[int]).guess_type(), [int, int]), + (Var(_js_expr="list", _var_type=List[int]).guess_type(), [int, int]), ( - ImmutableVar(_var_name="tuple", _var_type=Tuple[int, str]).guess_type(), + Var(_js_expr="tuple", _var_type=Tuple[int, str]).guess_type(), [int, str], ), ], @@ -505,10 +484,10 @@ def test_var_indexing_types(var, type_): def test_var_indexing_str(): """Test that we can index into str vars.""" - str_var = ImmutableVar(_var_name="str").to(str) + str_var = Var(_js_expr="str").to(str) # Test that indexing gives a type of Var[str]. - assert isinstance(str_var[0], ImmutableVar) + assert isinstance(str_var[0], Var) assert str_var[0]._var_type == str # Test basic indexing. @@ -522,8 +501,8 @@ def test_var_indexing_str(): @pytest.mark.parametrize( "var", [ - (ImmutableVar(_var_name="foo", _var_type=int).guess_type()), - (ImmutableVar(_var_name="bar", _var_type=float).guess_type()), + (Var(_js_expr="foo", _var_type=int).guess_type()), + (Var(_js_expr="bar", _var_type=float).guess_type()), ], ) def test_var_replace_with_invalid_kwargs(var): @@ -533,7 +512,7 @@ def test_var_replace_with_invalid_kwargs(var): def test_computed_var_replace_with_invalid_kwargs(): - @immutable_computed_var(initial_value=1) + @computed_var(initial_value=1) def test_var(state) -> int: return 1 @@ -545,65 +524,65 @@ def test_computed_var_replace_with_invalid_kwargs(): @pytest.mark.parametrize( "var, index", [ - (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), [1, 2]), + (Var(_js_expr="lst", _var_type=List[int]).guess_type(), [1, 2]), ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), {"name": "dict"}, ), - (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), {"set"}), + (Var(_js_expr="lst", _var_type=List[int]).guess_type(), {"set"}), ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), ( 1, 2, ), ), - (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), 1.5), - (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), "str"), + (Var(_js_expr="lst", _var_type=List[int]).guess_type(), 1.5), + (Var(_js_expr="lst", _var_type=List[int]).guess_type(), "str"), ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="string_var", _var_type=str).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="float_var", _var_type=float).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="list_var", _var_type=List[int]).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="set_var", _var_type=Set[str]).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="dict_var", _var_type=Dict[str, str]).guess_type(), ), - (ImmutableVar(_var_name="str", _var_type=str).guess_type(), [1, 2]), - (ImmutableVar(_var_name="lst", _var_type=str).guess_type(), {"name": "dict"}), - (ImmutableVar(_var_name="lst", _var_type=str).guess_type(), {"set"}), + (Var(_js_expr="str", _var_type=str).guess_type(), [1, 2]), + (Var(_js_expr="lst", _var_type=str).guess_type(), {"name": "dict"}), + (Var(_js_expr="lst", _var_type=str).guess_type(), {"set"}), ( - ImmutableVar(_var_name="lst", _var_type=str).guess_type(), - ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), + Var(_js_expr="lst", _var_type=str).guess_type(), + Var(_js_expr="string_var", _var_type=str).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=str).guess_type(), - ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), + Var(_js_expr="lst", _var_type=str).guess_type(), + Var(_js_expr="float_var", _var_type=float).guess_type(), ), - (ImmutableVar(_var_name="str", _var_type=Tuple[str]).guess_type(), [1, 2]), + (Var(_js_expr="str", _var_type=Tuple[str]).guess_type(), [1, 2]), ( - ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), + Var(_js_expr="lst", _var_type=Tuple[str]).guess_type(), {"name": "dict"}, ), - (ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), {"set"}), + (Var(_js_expr="lst", _var_type=Tuple[str]).guess_type(), {"set"}), ( - ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), - ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), + Var(_js_expr="lst", _var_type=Tuple[str]).guess_type(), + Var(_js_expr="string_var", _var_type=str).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), - ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), + Var(_js_expr="lst", _var_type=Tuple[str]).guess_type(), + Var(_js_expr="float_var", _var_type=float).guess_type(), ), ], ) @@ -621,8 +600,8 @@ def test_var_unsupported_indexing_lists(var, index): @pytest.mark.parametrize( "var", [ - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="tuple", _var_type=Tuple[int, int]).guess_type(), + Var(_js_expr="lst", _var_type=List[int]).guess_type(), + Var(_js_expr="tuple", _var_type=Tuple[int, int]).guess_type(), ], ) def test_var_list_slicing(var): @@ -631,17 +610,17 @@ def test_var_list_slicing(var): Args: var : The str, list or tuple base var. """ - assert str(var[:1]) == f"{var._var_name}.slice(undefined, 1)" - assert str(var[1:]) == f"{var._var_name}.slice(1, undefined)" - assert str(var[:]) == f"{var._var_name}.slice(undefined, undefined)" + assert str(var[:1]) == f"{var._js_expr}.slice(undefined, 1)" + assert str(var[1:]) == f"{var._js_expr}.slice(1, undefined)" + assert str(var[:]) == f"{var._js_expr}.slice(undefined, undefined)" def test_str_var_slicing(): """Test that we can slice into str vars.""" - str_var = ImmutableVar(_var_name="str").to(str) + str_var = Var(_js_expr="str").to(str) # Test that slicing gives a type of Var[str]. - assert isinstance(str_var[:1], ImmutableVar) + assert isinstance(str_var[:1], Var) assert str_var[:1]._var_type == str # Test basic slicing. @@ -659,7 +638,7 @@ def test_str_var_slicing(): def test_dict_indexing(): """Test that we can index into dict vars.""" - dct = ImmutableVar(_var_name="dct").to(ObjectVar, Dict[str, str]) + dct = Var(_js_expr="dct").to(ObjectVar, Dict[str, str]) # Check correct indexing. assert str(dct["a"]) == 'dct["a"]' @@ -670,66 +649,66 @@ def test_dict_indexing(): "var, index", [ ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="dict", _var_type=Dict[str, str]).guess_type(), [1, 2], ), ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="dict", _var_type=Dict[str, str]).guess_type(), {"name": "dict"}, ), ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="dict", _var_type=Dict[str, str]).guess_type(), {"set"}, ), ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="dict", _var_type=Dict[str, str]).guess_type(), ( 1, 2, ), ), ( - ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), - ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), + Var(_js_expr="lst", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="list_var", _var_type=List[int]).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), - ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), + Var(_js_expr="lst", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="set_var", _var_type=Set[str]).guess_type(), ), ( - ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), - ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="lst", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="dict_var", _var_type=Dict[str, str]).guess_type(), ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + Var(_js_expr="df", _var_type=DataFrame).guess_type(), [1, 2], ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + Var(_js_expr="df", _var_type=DataFrame).guess_type(), {"name": "dict"}, ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + Var(_js_expr="df", _var_type=DataFrame).guess_type(), {"set"}, ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + Var(_js_expr="df", _var_type=DataFrame).guess_type(), ( 1, 2, ), ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), - ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), + Var(_js_expr="df", _var_type=DataFrame).guess_type(), + Var(_js_expr="list_var", _var_type=List[int]).guess_type(), ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), - ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), + Var(_js_expr="df", _var_type=DataFrame).guess_type(), + Var(_js_expr="set_var", _var_type=Set[str]).guess_type(), ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), - ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), + Var(_js_expr="df", _var_type=DataFrame).guess_type(), + Var(_js_expr="dict_var", _var_type=Dict[str, str]).guess_type(), ), ], ) @@ -899,8 +878,8 @@ def test_function_var(): manual_addition_func = ArgsFunctionOperation.create( ("a", "b"), { - "args": [ImmutableVar.create_safe("a"), ImmutableVar.create_safe("b")], - "result": ImmutableVar.create_safe("a + b"), + "args": [Var(_js_expr="a"), Var(_js_expr="b")], + "result": Var(_js_expr="a + b"), }, ) assert ( @@ -915,7 +894,7 @@ def test_function_var(): ) create_hello_statement = ArgsFunctionOperation.create( - ("name",), f"Hello, {ImmutableVar.create_safe('name')}!" + ("name",), f"Hello, {Var(_js_expr='name')}!" ) first_name = LiteralStringVar.create("Steven") last_name = LiteralStringVar.create("Universe") @@ -1090,7 +1069,7 @@ def nested_base(): def test_retrival(): - var_without_data = ImmutableVar.create("test") + var_without_data = Var(_js_expr="test") assert var_without_data is not None original_var_data = VarData( @@ -1107,7 +1086,7 @@ def test_retrival(): assert REFLEX_VAR_CLOSING_TAG in f_string result_var_data = LiteralVar.create(f_string)._get_all_var_data() - result_immutable_var_data = ImmutableVar.create_safe(f_string)._var_data + result_immutable_var_data = Var(_js_expr=f_string)._var_data assert result_var_data is not None and result_immutable_var_data is not None assert ( result_var_data.state @@ -1131,8 +1110,8 @@ def test_fstring_concat(): "imagination", _var_data=VarData(state="fear") ) - immutable_var_with_data = ImmutableVar.create_safe( - "consequences", + immutable_var_with_data = Var( + _js_expr="consequences", _var_data=VarData( imports={ "react": [ImportVar(tag="useRef")], @@ -1162,9 +1141,9 @@ def test_fstring_concat(): ) -var = ImmutableVar(_var_name="var", _var_type=str) -myvar = ImmutableVar(_var_name="myvar", _var_type=int)._var_set_state("state") -x = ImmutableVar(_var_name="x", _var_type=str) +var = Var(_js_expr="var", _var_type=str) +myvar = Var(_js_expr="myvar", _var_type=int)._var_set_state("state") +x = Var(_js_expr="x", _var_type=str) @pytest.mark.parametrize( @@ -1219,7 +1198,7 @@ def test_fstring_roundtrip(value): Args: value: The value to create a Var from. """ - var = ImmutableVar.create_safe(value)._var_set_state("state") + var = Var(_js_expr=value)._var_set_state("state") rt_var = LiteralVar.create(f"{var}") assert var._var_state == rt_var._var_state assert str(rt_var) == str(var) @@ -1228,12 +1207,12 @@ def test_fstring_roundtrip(value): @pytest.mark.parametrize( "var", [ - ImmutableVar(_var_name="var", _var_type=int).guess_type(), - ImmutableVar(_var_name="var", _var_type=float).guess_type(), - ImmutableVar(_var_name="var", _var_type=str).guess_type(), - ImmutableVar(_var_name="var", _var_type=bool).guess_type(), - ImmutableVar(_var_name="var", _var_type=dict).guess_type(), - ImmutableVar(_var_name="var", _var_type=None).guess_type(), + Var(_js_expr="var", _var_type=int).guess_type(), + Var(_js_expr="var", _var_type=float).guess_type(), + Var(_js_expr="var", _var_type=str).guess_type(), + Var(_js_expr="var", _var_type=bool).guess_type(), + Var(_js_expr="var", _var_type=dict).guess_type(), + Var(_js_expr="var", _var_type=None).guess_type(), ], ) def test_unsupported_types_for_reverse(var): @@ -1250,10 +1229,10 @@ def test_unsupported_types_for_reverse(var): @pytest.mark.parametrize( "var", [ - ImmutableVar(_var_name="var", _var_type=int).guess_type(), - ImmutableVar(_var_name="var", _var_type=float).guess_type(), - ImmutableVar(_var_name="var", _var_type=bool).guess_type(), - ImmutableVar(_var_name="var", _var_type=None).guess_type(), + Var(_js_expr="var", _var_type=int).guess_type(), + Var(_js_expr="var", _var_type=float).guess_type(), + Var(_js_expr="var", _var_type=bool).guess_type(), + Var(_js_expr="var", _var_type=None).guess_type(), ], ) def test_unsupported_types_for_contains(var): @@ -1273,18 +1252,18 @@ def test_unsupported_types_for_contains(var): @pytest.mark.parametrize( "other", [ - ImmutableVar(_var_name="other", _var_type=int).guess_type(), - ImmutableVar(_var_name="other", _var_type=float).guess_type(), - ImmutableVar(_var_name="other", _var_type=bool).guess_type(), - ImmutableVar(_var_name="other", _var_type=list).guess_type(), - ImmutableVar(_var_name="other", _var_type=dict).guess_type(), - ImmutableVar(_var_name="other", _var_type=tuple).guess_type(), - ImmutableVar(_var_name="other", _var_type=set).guess_type(), + Var(_js_expr="other", _var_type=int).guess_type(), + Var(_js_expr="other", _var_type=float).guess_type(), + Var(_js_expr="other", _var_type=bool).guess_type(), + Var(_js_expr="other", _var_type=list).guess_type(), + Var(_js_expr="other", _var_type=dict).guess_type(), + Var(_js_expr="other", _var_type=tuple).guess_type(), + Var(_js_expr="other", _var_type=set).guess_type(), ], ) def test_unsupported_types_for_string_contains(other): with pytest.raises(TypeError) as err: - assert ImmutableVar(_var_name="var").to(str).contains(other) + assert Var(_js_expr="var").to(str).contains(other) assert ( err.value.args[0] == f"Unsupported Operand type(s) for contains: ToStringOperation, {type(other).__name__}" @@ -1293,7 +1272,7 @@ def test_unsupported_types_for_string_contains(other): def test_unsupported_default_contains(): with pytest.raises(TypeError) as err: - assert 1 in ImmutableVar(_var_name="var", _var_type=str).guess_type() + assert 1 in Var(_js_expr="var", _var_type=str).guess_type() assert ( err.value.args[0] == "'in' operator not supported for Var types, use Var.contains() instead." @@ -1725,11 +1704,11 @@ def cv_fget(state: BaseState) -> int: [ (["a"], {"a"}), (["b"], {"b"}), - ([ImmutableComputedVar(fget=cv_fget)], {"cv_fget"}), + ([ComputedVar(fget=cv_fget)], {"cv_fget"}), ], ) -def test_computed_var_deps(deps: List[Union[str, ImmutableVar]], expected: Set[str]): - @immutable_computed_var( +def test_computed_var_deps(deps: List[Union[str, Var]], expected: Set[str]): + @computed_var( deps=deps, cache=True, ) @@ -1750,7 +1729,7 @@ def test_computed_var_deps(deps: List[Union[str, ImmutableVar]], expected: Set[s def test_invalid_computed_var_deps(deps: List): with pytest.raises(TypeError): - @immutable_computed_var( + @computed_var( deps=deps, cache=True, ) @@ -1772,5 +1751,5 @@ def test_to_string_operation(): assert my_state.optional_email is None assert my_state.email == "test@reflex.dev" - assert cast(ImmutableVar, TestState.email)._var_type == Email - assert cast(ImmutableVar, TestState.optional_email)._var_type == Optional[Email] + assert cast(Var, TestState.email)._var_type == Email + assert cast(Var, TestState.optional_email)._var_type == Optional[Email] diff --git a/tests/utils/test_format.py b/tests/utils/test_format.py index 286748943..ec5eabb73 100644 --- a/tests/utils/test_format.py +++ b/tests/utils/test_format.py @@ -8,12 +8,11 @@ import pytest from reflex.components.tags.tag import Tag from reflex.event import EventChain, EventHandler, EventSpec, FrontendEvent -from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.ivars.object import ObjectVar from reflex.style import Style from reflex.utils import format from reflex.utils.serializers import serialize_figure -from reflex.vars import Var +from reflex.vars.base import LiteralVar, Var +from reflex.vars.object import ObjectVar from tests.test_state import ( ChildState, ChildState2, @@ -274,12 +273,8 @@ def test_format_string(input: str, output: str): @pytest.mark.parametrize( "input,output", [ - (Var.create(value="test"), '"test"'), - (Var.create(value="test", _var_is_local=True), '"test"'), - (Var.create(value="test", _var_is_local=False), "test"), - (Var.create(value="test", _var_is_string=True), '"test"'), - (Var.create(value='"test"', _var_is_string=False), '"test"'), - (Var.create(value="test", _var_is_local=False, _var_is_string=False), "test"), + (LiteralVar.create(value="test"), '"test"'), + (Var(_js_expr="test"), "test"), ], ) def test_format_var(input: Var, output: str): @@ -338,8 +333,8 @@ def test_format_route(route: str, format_case: bool, expected: bool): ) def test_format_match( condition: str, - match_cases: List[List[ImmutableVar]], - default: ImmutableVar, + match_cases: List[List[Var]], + default: Var, expected: str, ): """Test formatting a match statement. @@ -369,7 +364,7 @@ def test_format_match( ( { "a": 'foo "{ "bar" }" baz', - "b": ImmutableVar(_var_name="val", _var_type=str).guess_type(), + "b": Var(_js_expr="val", _var_type=str).guess_type(), }, r'{({ ["a"] : "foo \"{ \"bar\" }\" baz", ["b"] : val })}', ), @@ -388,8 +383,8 @@ def test_format_match( args=( ( LiteralVar.create("arg"), - ImmutableVar( - _var_name="_e", + Var( + _js_expr="_e", ) .to(ObjectVar, FrontendEvent) .target.value, @@ -418,46 +413,42 @@ def test_format_match( '{(...args) => addEvents([Event("mock_event", {})], args, {"preventDefault": true})}', ), ({"a": "red", "b": "blue"}, '{({ ["a"] : "red", ["b"] : "blue" })}'), - (ImmutableVar(_var_name="var", _var_type=int).guess_type(), "var"), + (Var(_js_expr="var", _var_type=int).guess_type(), "var"), ( - ImmutableVar( - _var_name="_", + Var( + _js_expr="_", _var_type=Any, ), "_", ), ( - ImmutableVar(_var_name='state.colors["a"]', _var_type=str).guess_type(), + Var(_js_expr='state.colors["a"]', _var_type=str).guess_type(), 'state.colors["a"]', ), ( - {"a": ImmutableVar(_var_name="val", _var_type=str).guess_type()}, + {"a": Var(_js_expr="val", _var_type=str).guess_type()}, '{({ ["a"] : val })}', ), ( - {"a": ImmutableVar(_var_name='"val"', _var_type=str).guess_type()}, + {"a": Var(_js_expr='"val"', _var_type=str).guess_type()}, '{({ ["a"] : "val" })}', ), ( - { - "a": ImmutableVar( - _var_name='state.colors["val"]', _var_type=str - ).guess_type() - }, + {"a": Var(_js_expr='state.colors["val"]', _var_type=str).guess_type()}, '{({ ["a"] : state.colors["val"] })}', ), # tricky real-world case from markdown component ( { - "h1": ImmutableVar.create_safe( - f"(({{node, ...props}}) => )" - ) + "h1": Var( + _js_expr=f"(({{node, ...props}}) => )" + ), }, '{({ ["h1"] : (({node, ...props}) => ) })}', ), ], ) -def test_format_prop(prop: ImmutableVar, formatted: str): +def test_format_prop(prop: Var, formatted: str): """Test that the formatted value of an prop is correct. Args: @@ -471,7 +462,7 @@ def test_format_prop(prop: ImmutableVar, formatted: str): "single_props,key_value_props,output", [ ( - [ImmutableVar.create_safe("{...props}")], + [Var(_js_expr="{...props}")], {"key": 42}, ["key={42}", "{...props}"], ), diff --git a/tests/utils/test_serializers.py b/tests/utils/test_serializers.py index 7f5c2bc66..2605edba9 100644 --- a/tests/utils/test_serializers.py +++ b/tests/utils/test_serializers.py @@ -7,8 +7,8 @@ import pytest from reflex.base import Base from reflex.components.core.colors import Color -from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import serializers +from reflex.vars.base import LiteralVar, Var @pytest.mark.parametrize( @@ -154,16 +154,16 @@ class BaseSubclass(Base): '({ ["ts"] : "1 day, 0:00:01.000001" })', ), ( - [1, LiteralVar.create("hi"), ImmutableVar.create("bye")], + [1, LiteralVar.create("hi"), Var(_js_expr="bye")], '[1, "hi", bye]', ), ( - (1, LiteralVar.create("hi"), ImmutableVar.create("bye")), + (1, LiteralVar.create("hi"), Var(_js_expr="bye")), '[1, "hi", bye]', ), ({1: 2, 3: 4}, "({ [1] : 2, [3] : 4 })"), ( - {1: LiteralVar.create("hi"), 3: ImmutableVar.create("bye")}, + {1: LiteralVar.create("hi"), 3: Var(_js_expr="bye")}, '({ [1] : "hi", [3] : bye })', ), (datetime.datetime(2021, 1, 1, 1, 1, 1, 1), "2021-01-01 01:01:01.000001"), diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 654bd4c90..5cdd846fe 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -19,7 +19,7 @@ from reflex.utils import ( ) from reflex.utils import exec as utils_exec from reflex.utils.exceptions import ReflexError -from reflex.vars import Var +from reflex.vars.base import Var def mock_event(arg): From 8328a622a2cc3e6cef8140789474e3474b5b219b Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 16 Sep 2024 11:12:51 -0700 Subject: [PATCH 021/201] Fix string color (#3922) --- reflex/vars/base.py | 4 ++++ reflex/vars/sequence.py | 19 +++++++++++++++---- tests/components/core/test_colors.py | 23 +++++++++++++---------- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index fe7be726c..d0d14a825 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1067,6 +1067,10 @@ class LiteralVar(Var): _var_type=type(value), _var_data=_var_data, ) + if isinstance(serialized_value, str): + return LiteralStringVar.create( + serialized_value, _var_type=type(value), _var_data=_var_data + ) return LiteralVar.create(serialized_value, _var_data=_var_data) if dataclasses.is_dataclass(value) and not isinstance(value, type): diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 192a969e5..ca8967d33 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -553,12 +553,14 @@ class LiteralStringVar(LiteralVar, StringVar): def create( cls, value: str, + _var_type: GenericType | None = str, _var_data: VarData | None = None, ) -> StringVar: """Create a var from a string value. Args: value: The value to create the var from. + _var_type: The type of the var. _var_data: Additional hooks and imports associated with the Var. Returns: @@ -591,18 +593,27 @@ class LiteralStringVar(LiteralVar, StringVar): filtered_strings_and_vals = [ s for s in strings_and_vals if isinstance(s, Var) or s ] - if len(filtered_strings_and_vals) == 1: - return LiteralVar.create(filtered_strings_and_vals[0]).to(StringVar) + only_string = filtered_strings_and_vals[0] + if isinstance(only_string, str): + return LiteralVar.create(only_string).to(StringVar, _var_type) + else: + return only_string.to(StringVar, only_string._var_type) - return ConcatVarOperation.create( + concat_result = ConcatVarOperation.create( *filtered_strings_and_vals, _var_data=_var_data, ) + return ( + concat_result + if _var_type is str + else concat_result.to(StringVar, _var_type) + ) + return LiteralStringVar( _js_expr=json.dumps(value), - _var_type=str, + _var_type=_var_type, _var_data=_var_data, _var_value=value, ) diff --git a/tests/components/core/test_colors.py b/tests/components/core/test_colors.py index f12c01372..a6175d56a 100644 --- a/tests/components/core/test_colors.py +++ b/tests/components/core/test_colors.py @@ -1,3 +1,5 @@ +from typing import Type, Union + import pytest import reflex as rx @@ -22,44 +24,45 @@ def create_color_var(color): @pytest.mark.parametrize( - "color, expected", + "color, expected, expected_type", [ - (create_color_var(rx.color("mint")), '"var(--mint-7)"'), - (create_color_var(rx.color("mint", 3)), '"var(--mint-3)"'), - (create_color_var(rx.color("mint", 3, True)), '"var(--mint-a3)"'), + (create_color_var(rx.color("mint")), '"var(--mint-7)"', Color), + (create_color_var(rx.color("mint", 3)), '"var(--mint-3)"', Color), + (create_color_var(rx.color("mint", 3, True)), '"var(--mint-a3)"', Color), ( create_color_var(rx.color(ColorState.color, ColorState.shade)), # type: ignore f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + Color, ), ( create_color_var(rx.color(f"{ColorState.color}", f"{ColorState.shade}")), # type: ignore f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + Color, ), ( create_color_var( rx.color(f"{ColorState.color_part}ato", f"{ColorState.shade}") # type: ignore ), f'("var(--"+{str(color_state_name)}.color_part+"ato-"+{str(color_state_name)}.shade+")")', + Color, ), ( create_color_var(f'{rx.color(ColorState.color, f"{ColorState.shade}")}'), # type: ignore f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + str, ), ( create_color_var( f'{rx.color(f"{ColorState.color}", f"{ColorState.shade}")}' # type: ignore ), f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + str, ), ], ) -def test_color(color, expected): - assert color._var_type is str +def test_color(color, expected, expected_type: Union[Type[str], Type[Color]]): + assert color._var_type is expected_type assert str(color) == expected - if color._var_type == Color: - assert str(color) == f"{{`{expected}`}}" - else: - assert str(color) == expected @pytest.mark.parametrize( From 8260ebb32fe3e72c67a8840c95cf0a304e839597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 16 Sep 2024 23:32:10 +0200 Subject: [PATCH 022/201] fix template fetch during init (#3932) * fix template fetch during init * use masen suggestion --- reflex/utils/prerequisites.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 78139034b..6433cd346 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -1280,11 +1280,16 @@ def fetch_app_templates(version: str) -> dict[str, Template]: ), None, ) - return { - tp["name"]: Template(**tp) - for tp in templates_data - if not tp["hidden"] and tp["code_url"] is not None - } + + filtered_templates = {} + for tp in templates_data: + if tp["hidden"] or tp["code_url"] is None: + continue + known_fields = set(f.name for f in dataclasses.fields(Template)) + filtered_templates[tp["name"]] = Template( + **{k: v for k, v in tp.items() if k in known_fields} + ) + return filtered_templates def create_config_init_app_from_remote_template(app_name: str, template_url: str): From da973299f205e0a3dcf862e3c78ccbee9650965e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 16 Sep 2024 23:33:42 +0200 Subject: [PATCH 023/201] better errors in state.py (#3929) --- reflex/state.py | 15 +++++++++------ reflex/utils/exceptions.py | 12 ++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 45866a69e..4581bbae1 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -64,7 +64,10 @@ from reflex.event import ( ) from reflex.utils import console, format, path_ops, prerequisites, types from reflex.utils.exceptions import ( + ComputedVarShadowsBaseVars, + ComputedVarShadowsStateVar, DynamicRouteArgShadowsStateVar, + EventHandlerShadowsBuiltInStateMethod, ImmutableStateError, LockExpiredError, ) @@ -755,7 +758,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """Check for shadow methods and raise error if any. Raises: - NameError: When an event handler shadows an inbuilt state method. + EventHandlerShadowsBuiltInStateMethod: When an event handler shadows an inbuilt state method. """ overridden_methods = set() state_base_functions = cls._get_base_functions() @@ -769,7 +772,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): overridden_methods.add(method.__name__) for method_name in overridden_methods: - raise NameError( + raise EventHandlerShadowsBuiltInStateMethod( f"The event handler name `{method_name}` shadows a builtin State method; use a different name instead" ) @@ -778,11 +781,11 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """Check for shadow base vars and raise error if any. Raises: - NameError: When a computed var shadows a base var. + ComputedVarShadowsBaseVars: When a computed var shadows a base var. """ for computed_var_ in cls._get_computed_vars(): if computed_var_._js_expr in cls.__annotations__: - raise NameError( + raise ComputedVarShadowsBaseVars( f"The computed var name `{computed_var_._js_expr}` shadows a base var in {cls.__module__}.{cls.__name__}; use a different name instead" ) @@ -791,14 +794,14 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """Check for shadow computed vars and raise error if any. Raises: - NameError: When a computed var shadows another. + ComputedVarShadowsStateVar: When a computed var shadows another. """ for name, cv in cls.__dict__.items(): if not is_computed_var(cv): continue name = cv._js_expr if name in cls.inherited_vars or name in cls.inherited_backend_vars: - raise NameError( + raise ComputedVarShadowsStateVar( f"The computed var name `{cv._js_expr}` shadows a var in {cls.__module__}.{cls.__name__}; use a different name instead" ) diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 891ebe047..8a527e113 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -93,5 +93,17 @@ class DynamicRouteArgShadowsStateVar(ReflexError, NameError): """Raised when a dynamic route arg shadows a state var.""" +class ComputedVarShadowsStateVar(ReflexError, NameError): + """Raised when a computed var shadows a state var.""" + + +class ComputedVarShadowsBaseVars(ReflexError, NameError): + """Raised when a computed var shadows a base var.""" + + +class EventHandlerShadowsBuiltInStateMethod(ReflexError, NameError): + """Raised when an event handler shadows a built-in state method.""" + + class GeneratedCodeHasNoFunctionDefs(ReflexError): """Raised when refactored code generated with flexgen has no functions defined.""" From 37920d6a838d5ba5727c0b25217774dd1e0534a5 Mon Sep 17 00:00:00 2001 From: elvis kahoro Date: Mon, 16 Sep 2024 14:42:28 -0700 Subject: [PATCH 024/201] fix: Adding in-line comments for the segmented control: value and (#3933) on_change --- reflex/components/radix/themes/components/segmented_control.py | 2 ++ reflex/components/radix/themes/components/segmented_control.pyi | 1 + 2 files changed, 3 insertions(+) diff --git a/reflex/components/radix/themes/components/segmented_control.py b/reflex/components/radix/themes/components/segmented_control.py index c9c6ea4c7..3f71c1328 100644 --- a/reflex/components/radix/themes/components/segmented_control.py +++ b/reflex/components/radix/themes/components/segmented_control.py @@ -34,8 +34,10 @@ class SegmentedControlRoot(RadixThemesComponent): # The default value of the segmented control. default_value: Var[Union[str, List[str]]] + # The current value of the segmented control. value: Var[Union[str, List[str]]] + # Handles the `onChange` event for the SegmentedControl component. on_change: EventHandler[lambda e0: [e0]] _rename_props = {"onChange": "onValueChange"} diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index 6546f50d1..4bbcaf87f 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -164,6 +164,7 @@ class SegmentedControlRoot(RadixThemesComponent): color_scheme: Override theme color for button radius: The radius of the segmented control: "none" | "small" | "medium" | "large" | "full" default_value: The default value of the segmented control. + value: The current value of the segmented control. style: The style of the component. key: A unique key for the component. id: The id for the component. From a57095ffe8302b8522c60d11dba9eab43217f721 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 16 Sep 2024 16:36:01 -0700 Subject: [PATCH 025/201] use serializer for state update and rework serializers (#3934) * use serializer for state update and rework serializers * format --- reflex/state.py | 24 +------------- reflex/utils/format.py | 24 ++------------ reflex/utils/serializers.py | 29 +++++++--------- reflex/vars/base.py | 28 ++++++++-------- tests/utils/test_format.py | 42 +++++++++++------------ tests/utils/test_serializers.py | 59 +++++++++++++++++++-------------- 6 files changed, 84 insertions(+), 122 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 4581bbae1..fbef6dd4a 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -8,7 +8,6 @@ import copy import dataclasses import functools import inspect -import json import os import uuid from abc import ABC, abstractmethod @@ -206,27 +205,6 @@ class RouterData: object.__setattr__(self, "headers", HeaderData(router_data)) object.__setattr__(self, "page", PageData(router_data)) - def toJson(self) -> str: - """Convert the object to a JSON string. - - Returns: - The JSON string. - """ - return json.dumps(dataclasses.asdict(self)) - - -@serializer -def serialize_routerdata(value: RouterData) -> str: - """Serialize a RouterData instance. - - Args: - value: The RouterData to serialize. - - Returns: - The serialized RouterData. - """ - return value.toJson() - def _no_chain_background_task( state_cls: Type["BaseState"], name: str, fn: Callable @@ -2415,7 +2393,7 @@ class StateUpdate: Returns: The state update as a JSON string. """ - return json.dumps(dataclasses.asdict(self)) + return format.json_dumps(dataclasses.asdict(self)) class StateManager(Base, ABC): diff --git a/reflex/utils/format.py b/reflex/utils/format.py index 39f886f93..e8b040230 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -2,7 +2,6 @@ from __future__ import annotations -import dataclasses import inspect import json import os @@ -410,22 +409,11 @@ def format_props(*single_props, **key_value_props) -> list[str]: return [ ( - f"{name}={format_prop(prop)}" - if isinstance(prop, Var) and not isinstance(prop, Var) - else ( - f"{name}={{{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}}}" - ) + f"{name}={{{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}}}" ) for name, prop in sorted(key_value_props.items()) if prop is not None - ] + [ - ( - str(prop) - if isinstance(prop, Var) and not isinstance(prop, Var) - else f"{str(LiteralVar.create(prop))}" - ) - for prop in single_props - ] + ] + [(f"{str(LiteralVar.create(prop))}") for prop in single_props] def get_event_handler_parts(handler: EventHandler) -> tuple[str, str]: @@ -623,14 +611,6 @@ def format_state(value: Any, key: Optional[str] = None) -> Any: if isinstance(value, dict): return {k: format_state(v, k) for k, v in value.items()} - # Hand dataclasses. - if dataclasses.is_dataclass(value): - if isinstance(value, type): - raise TypeError( - f"Cannot format state of type {type(value)}. Please provide an instance of the dataclass." - ) - return {k: format_state(v, k) for k, v in dataclasses.asdict(value).items()} - # Handle lists, sets, typles. if isinstance(value, types.StateIterBases): return [format_state(v) for v in value] diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index c5cded3b6..42fb82916 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -2,6 +2,7 @@ from __future__ import annotations +import dataclasses import functools import json import warnings @@ -29,7 +30,7 @@ from reflex.utils import types # Mapping from type to a serializer. # The serializer should convert the type to a JSON object. -SerializedType = Union[str, bool, int, float, list, dict] +SerializedType = Union[str, bool, int, float, list, dict, None] Serializer = Callable[[Type], SerializedType] @@ -124,6 +125,8 @@ def serialize( # If there is no serializer, return None. if serializer is None: + if dataclasses.is_dataclass(value) and not isinstance(value, type): + return serialize(dataclasses.asdict(value)) if get_type: return None, None return None @@ -225,7 +228,7 @@ def serialize_str(value: str) -> str: @serializer -def serialize_primitive(value: Union[bool, int, float, None]) -> str: +def serialize_primitive(value: Union[bool, int, float, None]): """Serialize a primitive type. Args: @@ -234,13 +237,11 @@ def serialize_primitive(value: Union[bool, int, float, None]) -> str: Returns: The serialized number/bool/None. """ - from reflex.utils import format - - return format.json_dumps(value) + return value @serializer -def serialize_base(value: Base) -> str: +def serialize_base(value: Base) -> dict: """Serialize a Base instance. Args: @@ -249,13 +250,11 @@ def serialize_base(value: Base) -> str: Returns: The serialized Base. """ - from reflex.vars import LiteralVar - - return str(LiteralVar.create(value)) + return {k: serialize(v) for k, v in value.dict().items() if not callable(v)} @serializer -def serialize_list(value: Union[List, Tuple, Set]) -> str: +def serialize_list(value: Union[List, Tuple, Set]) -> list: """Serialize a list to a JSON string. Args: @@ -264,13 +263,11 @@ def serialize_list(value: Union[List, Tuple, Set]) -> str: Returns: The serialized list. """ - from reflex.vars import LiteralArrayVar - - return str(LiteralArrayVar.create(value)) + return [serialize(item) for item in value] @serializer -def serialize_dict(prop: Dict[str, Any]) -> str: +def serialize_dict(prop: Dict[str, Any]) -> dict: """Serialize a dictionary to a JSON string. Args: @@ -279,9 +276,7 @@ def serialize_dict(prop: Dict[str, Any]) -> str: Returns: The serialized dictionary. """ - from reflex.vars import LiteralObjectVar - - return str(LiteralObjectVar.create(prop)) + return {k: serialize(v) for k, v in prop.items()} @serializer(to=str) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index d0d14a825..4a7584258 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -936,21 +936,6 @@ class Var(Generic[VAR_TYPE]): OUTPUT = TypeVar("OUTPUT", bound=Var) -def _encode_var(value: Var) -> str: - """Encode the state name into a formatted var. - - Args: - value: The value to encode the state name into. - - Returns: - The encoded var. - """ - return f"{value}" - - -serializers.serializer(_encode_var) - - class LiteralVar(Var): """Base class for immutable literal vars.""" @@ -1101,6 +1086,19 @@ class LiteralVar(Var): ) +@serializers.serializer +def serialize_literal(value: LiteralVar): + """Serialize a Literal type. + + Args: + value: The Literal to serialize. + + Returns: + The serialized Literal. + """ + return serializers.serialize(value._var_value) + + P = ParamSpec("P") T = TypeVar("T") diff --git a/tests/utils/test_format.py b/tests/utils/test_format.py index ec5eabb73..b108f9dc2 100644 --- a/tests/utils/test_format.py +++ b/tests/utils/test_format.py @@ -352,28 +352,28 @@ def test_format_match( "prop,formatted", [ ("string", '"string"'), - ("{wrapped_string}", "{wrapped_string}"), - (True, "{true}"), - (False, "{false}"), - (123, "{123}"), - (3.14, "{3.14}"), - ([1, 2, 3], "{[1, 2, 3]}"), - (["a", "b", "c"], '{["a", "b", "c"]}'), - ({"a": 1, "b": 2, "c": 3}, '{({ ["a"] : 1, ["b"] : 2, ["c"] : 3 })}'), - ({"a": 'foo "bar" baz'}, r'{({ ["a"] : "foo \"bar\" baz" })}'), + ("{wrapped_string}", '"{wrapped_string}"'), + (True, "true"), + (False, "false"), + (123, "123"), + (3.14, "3.14"), + ([1, 2, 3], "[1, 2, 3]"), + (["a", "b", "c"], '["a", "b", "c"]'), + ({"a": 1, "b": 2, "c": 3}, '({ ["a"] : 1, ["b"] : 2, ["c"] : 3 })'), + ({"a": 'foo "bar" baz'}, r'({ ["a"] : "foo \"bar\" baz" })'), ( { "a": 'foo "{ "bar" }" baz', "b": Var(_js_expr="val", _var_type=str).guess_type(), }, - r'{({ ["a"] : "foo \"{ \"bar\" }\" baz", ["b"] : val })}', + r'({ ["a"] : "foo \"{ \"bar\" }\" baz", ["b"] : val })', ), ( EventChain( events=[EventSpec(handler=EventHandler(fn=mock_event))], args_spec=lambda: [], ), - '{(...args) => addEvents([Event("mock_event", {})], args, {})}', + '((...args) => ((addEvents([(Event("mock_event", ({ })))], args, ({ })))))', ), ( EventChain( @@ -382,7 +382,7 @@ def test_format_match( handler=EventHandler(fn=mock_event), args=( ( - LiteralVar.create("arg"), + Var(_js_expr="arg"), Var( _js_expr="_e", ) @@ -394,7 +394,7 @@ def test_format_match( ], args_spec=lambda e: [e.target.value], ), - '{(_e) => addEvents([Event("mock_event", {"arg":_e["target"]["value"]})], [_e], {})}', + '((_e) => ((addEvents([(Event("mock_event", ({ ["arg"] : _e["target"]["value"] })))], [_e], ({ })))))', ), ( EventChain( @@ -402,7 +402,7 @@ def test_format_match( args_spec=lambda: [], event_actions={"stopPropagation": True}, ), - '{(...args) => addEvents([Event("mock_event", {})], args, {"stopPropagation": true})}', + '((...args) => ((addEvents([(Event("mock_event", ({ })))], args, ({ ["stopPropagation"] : true })))))', ), ( EventChain( @@ -410,9 +410,9 @@ def test_format_match( args_spec=lambda: [], event_actions={"preventDefault": True}, ), - '{(...args) => addEvents([Event("mock_event", {})], args, {"preventDefault": true})}', + '((...args) => ((addEvents([(Event("mock_event", ({ })))], args, ({ ["preventDefault"] : true })))))', ), - ({"a": "red", "b": "blue"}, '{({ ["a"] : "red", ["b"] : "blue" })}'), + ({"a": "red", "b": "blue"}, '({ ["a"] : "red", ["b"] : "blue" })'), (Var(_js_expr="var", _var_type=int).guess_type(), "var"), ( Var( @@ -427,15 +427,15 @@ def test_format_match( ), ( {"a": Var(_js_expr="val", _var_type=str).guess_type()}, - '{({ ["a"] : val })}', + '({ ["a"] : val })', ), ( {"a": Var(_js_expr='"val"', _var_type=str).guess_type()}, - '{({ ["a"] : "val" })}', + '({ ["a"] : "val" })', ), ( {"a": Var(_js_expr='state.colors["val"]', _var_type=str).guess_type()}, - '{({ ["a"] : state.colors["val"] })}', + '({ ["a"] : state.colors["val"] })', ), # tricky real-world case from markdown component ( @@ -444,7 +444,7 @@ def test_format_match( _js_expr=f"(({{node, ...props}}) => )" ), }, - '{({ ["h1"] : (({node, ...props}) => ) })}', + '({ ["h1"] : (({node, ...props}) => ) })', ), ], ) @@ -455,7 +455,7 @@ def test_format_prop(prop: Var, formatted: str): prop: The prop to test. formatted: The expected formatted value. """ - assert format.format_prop(prop) == formatted + assert format.format_prop(LiteralVar.create(prop)) == formatted @pytest.mark.parametrize( diff --git a/tests/utils/test_serializers.py b/tests/utils/test_serializers.py index 2605edba9..97da98792 100644 --- a/tests/utils/test_serializers.py +++ b/tests/utils/test_serializers.py @@ -8,7 +8,7 @@ import pytest from reflex.base import Base from reflex.components.core.colors import Color from reflex.utils import serializers -from reflex.vars.base import LiteralVar, Var +from reflex.vars.base import LiteralVar @pytest.mark.parametrize( @@ -123,48 +123,59 @@ class BaseSubclass(Base): "value,expected", [ ("test", "test"), - (1, "1"), - (1.0, "1.0"), - (True, "true"), - (False, "false"), - (None, "null"), - ([1, 2, 3], "[1, 2, 3]"), - ([1, "2", 3.0], '[1, "2", 3.0]'), - ([{"key": 1}, {"key": 2}], '[({ ["key"] : 1 }), ({ ["key"] : 2 })]'), + (1, 1), + (1.0, 1.0), + (True, True), + (False, False), + (None, None), + ([1, 2, 3], [1, 2, 3]), + ([1, "2", 3.0], [1, "2", 3.0]), + ([{"key": 1}, {"key": 2}], [{"key": 1}, {"key": 2}]), (StrEnum.FOO, "foo"), - ([StrEnum.FOO, StrEnum.BAR], '["foo", "bar"]'), + ([StrEnum.FOO, StrEnum.BAR], ["foo", "bar"]), ( {"key1": [1, 2, 3], "key2": [StrEnum.FOO, StrEnum.BAR]}, - '({ ["key1"] : [1, 2, 3], ["key2"] : ["foo", "bar"] })', + { + "key1": [1, 2, 3], + "key2": ["foo", "bar"], + }, ), (EnumWithPrefix.FOO, "prefix_foo"), - ([EnumWithPrefix.FOO, EnumWithPrefix.BAR], '["prefix_foo", "prefix_bar"]'), + ([EnumWithPrefix.FOO, EnumWithPrefix.BAR], ["prefix_foo", "prefix_bar"]), ( {"key1": EnumWithPrefix.FOO, "key2": EnumWithPrefix.BAR}, - '({ ["key1"] : "prefix_foo", ["key2"] : "prefix_bar" })', + { + "key1": "prefix_foo", + "key2": "prefix_bar", + }, ), (TestEnum.FOO, "foo"), - ([TestEnum.FOO, TestEnum.BAR], '["foo", "bar"]'), + ([TestEnum.FOO, TestEnum.BAR], ["foo", "bar"]), ( {"key1": TestEnum.FOO, "key2": TestEnum.BAR}, - '({ ["key1"] : "foo", ["key2"] : "bar" })', + { + "key1": "foo", + "key2": "bar", + }, ), ( BaseSubclass(ts=datetime.timedelta(1, 1, 1)), - '({ ["ts"] : "1 day, 0:00:01.000001" })', + { + "ts": "1 day, 0:00:01.000001", + }, ), ( - [1, LiteralVar.create("hi"), Var(_js_expr="bye")], - '[1, "hi", bye]', + [1, LiteralVar.create("hi")], + [1, "hi"], ), ( - (1, LiteralVar.create("hi"), Var(_js_expr="bye")), - '[1, "hi", bye]', + (1, LiteralVar.create("hi")), + [1, "hi"], ), - ({1: 2, 3: 4}, "({ [1] : 2, [3] : 4 })"), + ({1: 2, 3: 4}, {1: 2, 3: 4}), ( - {1: LiteralVar.create("hi"), 3: Var(_js_expr="bye")}, - '({ [1] : "hi", [3] : bye })', + {1: LiteralVar.create("hi")}, + {1: "hi"}, ), (datetime.datetime(2021, 1, 1, 1, 1, 1, 1), "2021-01-01 01:01:01.000001"), (datetime.date(2021, 1, 1), "2021-01-01"), @@ -172,7 +183,7 @@ class BaseSubclass(Base): (datetime.timedelta(1, 1, 1), "1 day, 0:00:01.000001"), ( [datetime.timedelta(1, 1, 1), datetime.timedelta(1, 1, 2)], - '["1 day, 0:00:01.000001", "1 day, 0:00:01.000002"]', + ["1 day, 0:00:01.000001", "1 day, 0:00:01.000002"], ), (Color(color="slate", shade=1), "var(--slate-1)"), (Color(color="orange", shade=1, alpha=True), "var(--orange-a1)"), From fe9f3a70882f14acb7a048a95f2f0a8d11a3dcb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 17 Sep 2024 01:36:17 +0200 Subject: [PATCH 026/201] expose radix primitive progress under rx.radix.primitives.progress (#3930) --- reflex/__init__.py | 9 ++++++++- reflex/__init__.pyi | 1 + reflex/components/radix/primitives/__init__.pyi | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/reflex/__init__.py b/reflex/__init__.py index d396bc97c..63de1f386 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -206,6 +206,13 @@ RADIX_PRIMITIVES_MAPPING: dict = { "components.radix.primitives.form": [ "form", ], + "components.radix.primitives.progress": [ + "progress", + ], +} + +RADIX_PRIMITIVES_SHORTCUT_MAPPING: dict = { + k: v for k, v in RADIX_PRIMITIVES_MAPPING.items() if "progress" not in k } COMPONENTS_CORE_MAPPING: dict = { @@ -248,7 +255,7 @@ RADIX_MAPPING: dict = { **RADIX_THEMES_COMPONENTS_MAPPING, **RADIX_THEMES_TYPOGRAPHY_MAPPING, **RADIX_THEMES_LAYOUT_MAPPING, - **RADIX_PRIMITIVES_MAPPING, + **RADIX_PRIMITIVES_SHORTCUT_MAPPING, } _MAPPING: dict = { diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index 54329a6eb..ef5bcfd8f 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -197,6 +197,7 @@ RADIX_THEMES_COMPONENTS_MAPPING: dict RADIX_THEMES_LAYOUT_MAPPING: dict RADIX_THEMES_TYPOGRAPHY_MAPPING: dict RADIX_PRIMITIVES_MAPPING: dict +RADIX_PRIMITIVES_SHORTCUT_MAPPING: dict COMPONENTS_CORE_MAPPING: dict COMPONENTS_BASE_MAPPING: dict RADIX_MAPPING: dict diff --git a/reflex/components/radix/primitives/__init__.pyi b/reflex/components/radix/primitives/__init__.pyi index 0fec0fc40..e7461e9a7 100644 --- a/reflex/components/radix/primitives/__init__.pyi +++ b/reflex/components/radix/primitives/__init__.pyi @@ -6,3 +6,4 @@ from .accordion import accordion as accordion from .drawer import drawer as drawer from .form import form as form +from .progress import progress as progress From 5f12243fe4861c4515ee83929be1763c646307ba Mon Sep 17 00:00:00 2001 From: elvis kahoro Date: Mon, 16 Sep 2024 17:42:45 -0700 Subject: [PATCH 027/201] fix: Adding code comments for segmented control type (#3935) * fix: Adding code comments for segmented control type * fix: Manually adding info about type --- reflex/components/radix/themes/components/segmented_control.py | 1 + reflex/components/radix/themes/components/segmented_control.pyi | 1 + 2 files changed, 2 insertions(+) diff --git a/reflex/components/radix/themes/components/segmented_control.py b/reflex/components/radix/themes/components/segmented_control.py index 3f71c1328..21b50f03e 100644 --- a/reflex/components/radix/themes/components/segmented_control.py +++ b/reflex/components/radix/themes/components/segmented_control.py @@ -23,6 +23,7 @@ class SegmentedControlRoot(RadixThemesComponent): # Variant of button: "classic" | "surface" variant: Var[Literal["classic", "surface"]] + # The type of the segmented control, either "single" for selecting one option or "multiple" for selecting multiple options. type: Var[Literal["single", "multiple"]] # Override theme color for button diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index 4bbcaf87f..171fc490a 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -161,6 +161,7 @@ class SegmentedControlRoot(RadixThemesComponent): *children: Child components. size: The size of the segmented control: "1" | "2" | "3" variant: Variant of button: "classic" | "surface" + type: The type of the segmented control, either "single" for selecting one option or "multiple" for selecting multiple options. color_scheme: Override theme color for button radius: The radius of the segmented control: "none" | "small" | "medium" | "large" | "full" default_value: The default value of the segmented control. From 16d39625892bf2c86468a595eb0618fc4e37d77f Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 17 Sep 2024 10:43:33 -0700 Subject: [PATCH 028/201] [0.6.0 blocker] state: update inherited_vars and tracking dicts when adding vars (#2822) * state: update inherited_vars and tracking dicts when adding vars Ensure that dynamically added vars are accounted for in dependency and inheritence tree to avoid unrenderable or stale data. * Regression test for dynamic route args and inherited_vars * [flexgen] Initialize app from refactored code Use the new /api/gen/{hash}/refactored endpoint to get refactored reflex code. * Use _js_expr instead of _var_name --- integration/test_dynamic_routes.py | 105 +++++++++++++++++++++++++++++ reflex/state.py | 44 +++++++++--- reflex/vars/base.py | 2 +- 3 files changed, 140 insertions(+), 11 deletions(-) diff --git a/integration/test_dynamic_routes.py b/integration/test_dynamic_routes.py index dc75eac6f..5ba0b7bda 100644 --- a/integration/test_dynamic_routes.py +++ b/integration/test_dynamic_routes.py @@ -66,6 +66,64 @@ def DynamicRoute(): ), ) + class ArgState(rx.State): + """The app state.""" + + @rx.var + def arg(self) -> int: + return int(self.arg_str or 0) + + class ArgSubState(ArgState): + @rx.var(cache=True) + def cached_arg(self) -> int: + return self.arg + + @rx.var(cache=True) + def cached_arg_str(self) -> str: + return self.arg_str + + @rx.page(route="/arg/[arg_str]") + def arg() -> rx.Component: + return rx.vstack( + rx.data_list.root( + rx.data_list.item( + rx.data_list.label("rx.State.arg_str (dynamic)"), + rx.data_list.value(rx.State.arg_str, id="state-arg_str"), # type: ignore + ), + rx.data_list.item( + rx.data_list.label("ArgState.arg_str (dynamic) (inherited)"), + rx.data_list.value(ArgState.arg_str, id="argstate-arg_str"), # type: ignore + ), + rx.data_list.item( + rx.data_list.label("ArgState.arg"), + rx.data_list.value(ArgState.arg, id="argstate-arg"), + ), + rx.data_list.item( + rx.data_list.label("ArgSubState.arg_str (dynamic) (inherited)"), + rx.data_list.value(ArgSubState.arg_str, id="argsubstate-arg_str"), # type: ignore + ), + rx.data_list.item( + rx.data_list.label("ArgSubState.arg (inherited)"), + rx.data_list.value(ArgSubState.arg, id="argsubstate-arg"), + ), + rx.data_list.item( + rx.data_list.label("ArgSubState.cached_arg"), + rx.data_list.value( + ArgSubState.cached_arg, id="argsubstate-cached_arg" + ), + ), + rx.data_list.item( + rx.data_list.label("ArgSubState.cached_arg_str"), + rx.data_list.value( + ArgSubState.cached_arg_str, id="argsubstate-cached_arg_str" + ), + ), + ), + rx.link("+", href=f"/arg/{ArgState.arg + 1}", id="next-page"), + align="center", + height="100vh", + ) + @rx.page(route="/redirect-page/[page_id]", on_load=DynamicState.on_load_redir) # type: ignore def redirect_page(): return rx.fragment(rx.text("redirecting...")) @@ -302,3 +360,50 @@ async def test_on_load_navigate_non_dynamic( link.click() assert urlsplit(driver.current_url).path == "/static/x/" await poll_for_order(["/static/x-no page id", "/static/x-no page id"]) + + +@pytest.mark.asyncio +async def test_render_dynamic_arg( + dynamic_route: AppHarness, + driver: WebDriver, +): + """Assert that dynamic arg var is rendered correctly in different contexts. + + Args: + dynamic_route: harness for DynamicRoute app. + driver: WebDriver instance. + """ + assert dynamic_route.app_instance is not None + with poll_for_navigation(driver): + driver.get(f"{dynamic_route.frontend_url}/arg/0") + + def assert_content(expected: str, expect_not: str): + ids = [ + "state-arg_str", + "argstate-arg", + "argstate-arg_str", + "argsubstate-arg_str", + "argsubstate-arg", + "argsubstate-cached_arg", + "argsubstate-cached_arg_str", + ] + for id in ids: + el = driver.find_element(By.ID, id) + assert el + assert ( + dynamic_route.poll_for_content(el, exp_not_equal=expect_not) == expected + ) + + assert_content("0", "") + next_page_link = driver.find_element(By.ID, "next-page") + assert next_page_link + with poll_for_navigation(driver): + next_page_link.click() + assert driver.current_url == f"{dynamic_route.frontend_url}/arg/1/" + assert_content("1", "0") + next_page_link = driver.find_element(By.ID, "next-page") + assert next_page_link + with poll_for_navigation(driver): + next_page_link.click() + assert driver.current_url == f"{dynamic_route.frontend_url}/arg/2/" + assert_content("2", "1") diff --git a/reflex/state.py b/reflex/state.py index fbef6dd4a..6dac48d8f 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1047,6 +1047,27 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if not func[0].startswith("__") } + @classmethod + def _update_substate_inherited_vars(cls, vars_to_add: dict[str, Var]): + """Update the inherited vars of substates recursively when new vars are added. + + Also updates the var dependency tracking dicts after adding vars. + + Args: + vars_to_add: names to Var instances to add to substates + """ + for substate_class in cls.class_subclasses: + for name, var in vars_to_add.items(): + if types.is_backend_base_variable(name, cls): + substate_class.backend_vars.setdefault(name, var) + substate_class.inherited_backend_vars.setdefault(name, var) + else: + substate_class.vars.setdefault(name, var) + substate_class.inherited_vars.setdefault(name, var) + substate_class._update_substate_inherited_vars(vars_to_add) + # Reinitialize dependency tracking dicts. + cls._init_var_dependency_dicts() + @classmethod def setup_dynamic_args(cls, args: dict[str, str]): """Set up args for easy access in renderer. @@ -1063,14 +1084,15 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): def inner_func(self) -> str: return self.router.page.params.get(param, "") - return DynamicRouteVar(fget=inner_func, cache=True) + return inner_func def arglist_factory(param): def inner_func(self) -> List[str]: return self.router.page.params.get(param, []) - return DynamicRouteVar(fget=inner_func, cache=True) + return inner_func + dynamic_vars = {} for param, value in args.items(): if value == constants.RouteArgType.SINGLE: func = argsingle_factory(param) @@ -1078,16 +1100,18 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): func = arglist_factory(param) else: continue - # to allow passing as a prop, evade python frozen rules (bad practice) - object.__setattr__(func, "_js_expr", param) - # cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore - cls.vars[param] = cls.computed_vars[param] = func._replace( - _var_data=VarData.from_state(cls) + dynamic_vars[param] = DynamicRouteVar( + fget=func, + cache=True, + _js_expr=param, + _var_data=VarData.from_state(cls), ) - setattr(cls, param, func) + setattr(cls, param, dynamic_vars[param]) - # Reinitialize dependency tracking dicts. - cls._init_var_dependency_dicts() + # Update tracking dicts. + cls.computed_vars.update(dynamic_vars) + cls.vars.update(dynamic_vars) + cls._update_substate_inherited_vars(dynamic_vars) @classmethod def _check_overwritten_dynamic_args(cls, args: list[str]): diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 4a7584258..9738ed0da 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1687,7 +1687,7 @@ class ComputedVar(Var[RETURN_TYPE]): """ if instance is None: state_where_defined = owner - while self.fget.__name__ in state_where_defined.inherited_vars: + while self._js_expr in state_where_defined.inherited_vars: state_where_defined = state_where_defined.get_parent_state() return self._replace( From abb884c156dc940fd12b6040aa2da8c39b086422 Mon Sep 17 00:00:00 2001 From: wassaf shahzad Date: Wed, 18 Sep 2024 00:08:15 +0200 Subject: [PATCH 029/201] Added fill color for progress (#3926) * Added fill color for progress * updated pyi file --- .../radix/themes/components/progress.py | 22 +++++++++++++++++++ .../radix/themes/components/progress.pyi | 2 ++ 2 files changed, 24 insertions(+) diff --git a/reflex/components/radix/themes/components/progress.py b/reflex/components/radix/themes/components/progress.py index a5f1fa183..e9fe168c6 100644 --- a/reflex/components/radix/themes/components/progress.py +++ b/reflex/components/radix/themes/components/progress.py @@ -4,6 +4,7 @@ from typing import Literal from reflex.components.component import Component from reflex.components.core.breakpoints import Responsive +from reflex.style import Style from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent @@ -38,6 +39,21 @@ class Progress(RadixThemesComponent): # The duration of the progress bar animation. Once the duration times out, the progress bar will start an indeterminate animation. duration: Var[str] + # The color of the progress bar fill animation. + fill_color: Var[str] + + @staticmethod + def _color_selector(color: str) -> Style: + """Return a style object with the correct color and css selector. + + Args: + color: Color of the fill part. + + Returns: + Style: Style object with the correct css selector and color. + """ + return Style({".rt-ProgressIndicator": {"background_color": color}}) + @classmethod def create(cls, *children, **props) -> Component: """Create a Progress component. @@ -50,6 +66,12 @@ class Progress(RadixThemesComponent): The Progress Component. """ props.setdefault("width", "100%") + if "fill_color" in props: + color = props.get("fill_color", "") + style = props.get("style", {}) + style = style | cls._color_selector(color) + props["style"] = style + return super().create(*children, **props) diff --git a/reflex/components/radix/themes/components/progress.pyi b/reflex/components/radix/themes/components/progress.pyi index 8ef304915..f2e89526a 100644 --- a/reflex/components/radix/themes/components/progress.pyi +++ b/reflex/components/radix/themes/components/progress.pyi @@ -107,6 +107,7 @@ class Progress(RadixThemesComponent): ] ] = None, duration: Optional[Union[Var[str], str]] = None, + fill_color: Optional[Union[Var[str], str]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -162,6 +163,7 @@ class Progress(RadixThemesComponent): high_contrast: Whether to render the progress bar with higher contrast color against background radius: Override theme radius for progress bar: "none" | "small" | "medium" | "large" | "full" duration: The duration of the progress bar animation. Once the duration times out, the progress bar will start an indeterminate animation. + fill_color: The color of the progress bar fill animation. style: The style of the component. key: A unique key for the component. id: The id for the component. From d81faf7dad5c85137d3ac78033e328e3bc0087f2 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 18 Sep 2024 11:32:47 -0700 Subject: [PATCH 030/201] use is true (#3946) --- reflex/vars/base.py | 8 +++++++- reflex/vars/number.py | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 9738ed0da..0cd939548 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1983,17 +1983,23 @@ class CustomVarOperationReturn(Var[RETURN]): def var_operation_return( js_expression: str, var_type: Type[RETURN] | None = None, + var_data: VarData | None = None, ) -> CustomVarOperationReturn[RETURN]: """Shortcut for creating a CustomVarOperationReturn. Args: js_expression: The JavaScript expression to evaluate. var_type: The type of the var. + var_data: Additional hooks and imports associated with the Var. Returns: The CustomVarOperationReturn. """ - return CustomVarOperationReturn.create(js_expression, var_type) + return CustomVarOperationReturn.create( + js_expression, + var_type, + var_data, + ) @dataclasses.dataclass( diff --git a/reflex/vars/number.py b/reflex/vars/number.py index 31778a25d..38ab15f91 100644 --- a/reflex/vars/number.py +++ b/reflex/vars/number.py @@ -17,7 +17,9 @@ from typing import ( overload, ) +from reflex.constants.base import Dirs from reflex.utils.exceptions import VarTypeError +from reflex.utils.imports import ImportDict, ImportVar from .base import ( CustomVarOperationReturn, @@ -1098,6 +1100,11 @@ class ToBooleanVarOperation(ToOperation, BooleanVar): _default_var_type: ClassVar[Type] = bool +_IS_TRUE_IMPORT: ImportDict = { + f"/{Dirs.STATE_PATH}": [ImportVar(tag="isTrue")], +} + + @var_operation def boolify(value: Var): """Convert the value to a boolean. @@ -1109,8 +1116,9 @@ def boolify(value: Var): The boolean value. """ return var_operation_return( - js_expression=f"Boolean({value})", + js_expression=f"isTrue({value})", var_type=bool, + var_data=VarData(imports=_IS_TRUE_IMPORT), ) From a8734d7392b09a58aedb84f0cf61424eccdc431e Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 18 Sep 2024 13:10:18 -0700 Subject: [PATCH 031/201] add few test cases for bool (#3949) * add few test cases for bool * use parametrize * use a tuple of strings Co-authored-by: Masen Furer --------- Co-authored-by: Masen Furer --- tests/test_var.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_var.py b/tests/test_var.py index e73407bb0..b6f82a3ea 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -958,6 +958,21 @@ def test_all_number_operations(): ) +@pytest.mark.parametrize( + ("var", "expected"), + [ + (Var.create(False), "false"), + (Var.create(True), "true"), + (Var.create("false"), '("false".split("").length !== 0)'), + (Var.create([1, 2, 3]), "isTrue([1, 2, 3])"), + (Var.create({"a": 1, "b": 2}), 'isTrue(({ ["a"] : 1, ["b"] : 2 }))'), + (Var("mysterious_var"), "isTrue(mysterious_var)"), + ], +) +def test_boolify_operations(var, expected): + assert str(var.bool()) == expected + + def test_index_operation(): array_var = LiteralArrayVar.create([1, 2, 3, 4, 5]) assert str(array_var[0]) == "[1, 2, 3, 4, 5].at(0)" From 91b50d713eb386373e7fb443312b5c10b680f346 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 18 Sep 2024 13:10:32 -0700 Subject: [PATCH 032/201] add special handling for infinity and nan (#3943) * add special handling for infinity and nan * use custom exception * add test for inf and nan --- reflex/utils/exceptions.py | 4 ++++ reflex/vars/number.py | 19 +++++++++++++++++-- tests/test_var.py | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 8a527e113..95d68c3b8 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -107,3 +107,7 @@ class EventHandlerShadowsBuiltInStateMethod(ReflexError, NameError): class GeneratedCodeHasNoFunctionDefs(ReflexError): """Raised when refactored code generated with flexgen has no functions defined.""" + + +class PrimitiveUnserializableToJSON(ReflexError, ValueError): + """Raised when a primitive type is unserializable to JSON. Usually with NaN and Infinity.""" diff --git a/reflex/vars/number.py b/reflex/vars/number.py index 38ab15f91..9a899f220 100644 --- a/reflex/vars/number.py +++ b/reflex/vars/number.py @@ -4,6 +4,7 @@ from __future__ import annotations import dataclasses import json +import math import sys from typing import ( TYPE_CHECKING, @@ -18,7 +19,7 @@ from typing import ( ) from reflex.constants.base import Dirs -from reflex.utils.exceptions import VarTypeError +from reflex.utils.exceptions import PrimitiveUnserializableToJSON, VarTypeError from reflex.utils.imports import ImportDict, ImportVar from .base import ( @@ -1040,7 +1041,14 @@ class LiteralNumberVar(LiteralVar, NumberVar): Returns: The JSON representation of the var. + + Raises: + PrimitiveUnserializableToJSON: If the var is unserializable to JSON. """ + if math.isinf(self._var_value) or math.isnan(self._var_value): + raise PrimitiveUnserializableToJSON( + f"No valid JSON representation for {self}" + ) return json.dumps(self._var_value) def __hash__(self) -> int: @@ -1062,8 +1070,15 @@ class LiteralNumberVar(LiteralVar, NumberVar): Returns: The number var. """ + if math.isinf(value): + js_expr = "Infinity" if value > 0 else "-Infinity" + elif math.isnan(value): + js_expr = "NaN" + else: + js_expr = str(value) + return cls( - _js_expr=str(value), + _js_expr=js_expr, _var_type=type(value), _var_data=_var_data, _var_value=value, diff --git a/tests/test_var.py b/tests/test_var.py index b6f82a3ea..90bf3ee05 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -9,6 +9,7 @@ from pandas import DataFrame from reflex.base import Base from reflex.constants.base import REFLEX_VAR_CLOSING_TAG, REFLEX_VAR_OPENING_TAG from reflex.state import BaseState +from reflex.utils.exceptions import PrimitiveUnserializableToJSON from reflex.utils.imports import ImportVar from reflex.vars import VarData from reflex.vars.base import ( @@ -989,6 +990,22 @@ def test_index_operation(): assert str(array_var[0].to(NumberVar) + 9) == "([1, 2, 3, 4, 5].at(0) + 9)" +@pytest.mark.parametrize( + "var, expected_js", + [ + (Var.create(float("inf")), "Infinity"), + (Var.create(-float("inf")), "-Infinity"), + (Var.create(float("nan")), "NaN"), + ], +) +def test_inf_and_nan(var, expected_js): + assert str(var) == expected_js + assert isinstance(var, NumberVar) + assert isinstance(var, LiteralVar) + with pytest.raises(PrimitiveUnserializableToJSON): + var.json() + + def test_array_operations(): array_var = LiteralArrayVar.create([1, 2, 3, 4, 5]) From 44a89b2e870b4cc8864462eea15a057e146396f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 18 Sep 2024 22:50:54 +0200 Subject: [PATCH 033/201] fix unionize recursion (#3948) * fix unionize recursion * merging --------- Co-authored-by: Khaleel Al-Adhami --- reflex/vars/base.py | 11 +++++++---- tests/vars/test_base.py | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 tests/vars/test_base.py diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 0cd939548..887928e3c 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1199,10 +1199,13 @@ def unionize(*args: Type) -> Type: """ if not args: return Any - first, *rest = args - if not rest: - return first - return Union[first, unionize(*rest)] + if len(args) == 1: + return args[0] + # We are bisecting the args list here to avoid hitting the recursion limit + # In Python versions >= 3.11, we can simply do `return Union[*args]` + midpoint = len(args) // 2 + first_half, second_half = args[:midpoint], args[midpoint:] + return Union[unionize(*first_half), unionize(*second_half)] def figure_out_type(value: Any) -> types.GenericType: diff --git a/tests/vars/test_base.py b/tests/vars/test_base.py new file mode 100644 index 000000000..f83d79373 --- /dev/null +++ b/tests/vars/test_base.py @@ -0,0 +1,21 @@ +from typing import Dict, List, Union + +import pytest + +from reflex.vars.base import figure_out_type + + +@pytest.mark.parametrize( + ("value", "expected"), + [ + (1, int), + (1.0, float), + ("a", str), + ([1, 2, 3], List[int]), + ([1, 2.0, "a"], List[Union[int, float, str]]), + ({"a": 1, "b": 2}, Dict[str, int]), + ({"a": 1, 2: "b"}, Dict[Union[int, str], Union[str, int]]), + ], +) +def test_figure_out_type(value, expected): + assert figure_out_type(value) == expected From cf69964cd61861ae4efab5ade4d7484e940cd25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 18 Sep 2024 23:44:59 +0200 Subject: [PATCH 034/201] add some unit tests for coverage (#3947) * add some unit tests for coverage * add test for page decorator * bump coverage threshold * check content --- .coveragerc | 2 +- reflex/components/recharts/cartesian.py | 2 +- reflex/page.py | 12 ----- tests/components/base/test_link.py | 15 +++++++ tests/components/recharts/test_cartesian.py | 50 +++++++++++++++++++++ tests/test_page.py | 50 +++++++++++++++++++++ 6 files changed, 117 insertions(+), 14 deletions(-) create mode 100644 tests/components/base/test_link.py create mode 100644 tests/components/recharts/test_cartesian.py create mode 100644 tests/test_page.py diff --git a/.coveragerc b/.coveragerc index 9e66f2146..d505ff27e 100644 --- a/.coveragerc +++ b/.coveragerc @@ -11,7 +11,7 @@ omit = [report] show_missing = true # TODO bump back to 79 -fail_under = 60 +fail_under = 70 precision = 2 # Regexes for lines to exclude from consideration diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 4836e08be..06ca80dc5 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -167,7 +167,7 @@ class ZAxis(Recharts): tag = "ZAxis" - alias = "RechartszAxis" + alias = "RechartsZAxis" # The key of data displayed in the axis. data_key: Var[Union[str, int]] diff --git a/reflex/page.py b/reflex/page.py index 1e5e8603d..27a3c4fa8 100644 --- a/reflex/page.py +++ b/reflex/page.py @@ -63,15 +63,3 @@ def page( return render_fn return decorator - - -def get_decorated_pages() -> list[dict]: - """Get the decorated pages. - - Returns: - The decorated pages. - """ - return sorted( - [page_data for _, page_data in DECORATED_PAGES[get_config().app_name]], - key=lambda x: x["route"], - ) diff --git a/tests/components/base/test_link.py b/tests/components/base/test_link.py new file mode 100644 index 000000000..7713330c4 --- /dev/null +++ b/tests/components/base/test_link.py @@ -0,0 +1,15 @@ +from reflex.components.base.link import RawLink, ScriptTag + + +def test_raw_link(): + raw_link = RawLink.create("https://example.com").render() + assert raw_link["name"] == "link" + assert raw_link["children"][0]["contents"] == '{"https://example.com"}' + + +def test_script_tag(): + script_tag = ScriptTag.create("console.log('Hello, world!');").render() + assert script_tag["name"] == "script" + assert ( + script_tag["children"][0]["contents"] == "{\"console.log('Hello, world!');\"}" + ) diff --git a/tests/components/recharts/test_cartesian.py b/tests/components/recharts/test_cartesian.py new file mode 100644 index 000000000..3337427bd --- /dev/null +++ b/tests/components/recharts/test_cartesian.py @@ -0,0 +1,50 @@ +from reflex.components.recharts import ( + Area, + Bar, + Brush, + Line, + Scatter, + XAxis, + YAxis, + ZAxis, +) + + +def test_xaxis(): + x_axis = XAxis.create("x").render() + assert x_axis["name"] == "RechartsXAxis" + + +def test_yaxis(): + x_axis = YAxis.create("y").render() + assert x_axis["name"] == "RechartsYAxis" + + +def test_zaxis(): + x_axis = ZAxis.create("z").render() + assert x_axis["name"] == "RechartsZAxis" + + +def test_brush(): + brush = Brush.create().render() + assert brush["name"] == "RechartsBrush" + + +def test_area(): + area = Area.create().render() + assert area["name"] == "RechartsArea" + + +def test_bar(): + bar = Bar.create().render() + assert bar["name"] == "RechartsBar" + + +def test_line(): + line = Line.create().render() + assert line["name"] == "RechartsLine" + + +def test_scatter(): + scatter = Scatter.create().render() + assert scatter["name"] == "RechartsScatter" diff --git a/tests/test_page.py b/tests/test_page.py new file mode 100644 index 000000000..9cbd2886d --- /dev/null +++ b/tests/test_page.py @@ -0,0 +1,50 @@ +from reflex import text +from reflex.config import get_config +from reflex.page import DECORATED_PAGES, page + + +def test_page_decorator(): + def foo_(): + return text("foo") + + assert len(DECORATED_PAGES) == 0 + decorated_foo_ = page()(foo_) + assert decorated_foo_ == foo_ + assert len(DECORATED_PAGES) == 1 + page_data = DECORATED_PAGES.get(get_config().app_name, [])[0][1] + assert page_data == {} + DECORATED_PAGES.clear() + + +def test_page_decorator_with_kwargs(): + def foo_(): + return text("foo") + + def load_foo(): + return [] + + DECORATED_PAGES.clear() + assert len(DECORATED_PAGES) == 0 + decorated_foo_ = page( + route="foo", + title="Foo", + image="foo.png", + description="Foo description", + meta=["foo-meta"], + script_tags=["foo-script"], + on_load=load_foo, + )(foo_) + assert decorated_foo_ == foo_ + assert len(DECORATED_PAGES) == 1 + page_data = DECORATED_PAGES.get(get_config().app_name, [])[0][1] + assert page_data == { + "description": "Foo description", + "image": "foo.png", + "meta": ["foo-meta"], + "on_load": load_foo, + "route": "foo", + "script_tags": ["foo-script"], + "title": "Foo", + } + + DECORATED_PAGES.clear() From 22237658badf8e871b41b98246f8f3739d4dcb06 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 18 Sep 2024 14:52:18 -0700 Subject: [PATCH 035/201] always print passed_type (#3950) --- reflex/components/component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/components/component.py b/reflex/components/component.py index 164ae479e..7497eec78 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -452,7 +452,7 @@ class Component(BaseComponent, ABC): ): value_name = value._js_expr if isinstance(value, Var) else value raise TypeError( - f"Invalid var passed for prop {type(self).__name__}.{key}, expected type {expected_type}, got value {value_name} of type {passed_types or passed_type}." + f"Invalid var passed for prop {type(self).__name__}.{key}, expected type {expected_type}, got value {value_name} of type {passed_type}." ) # Check if the key is an event trigger. if key in component_specific_triggers: From c46d1d9c7ecad8f5fe901873ad61c754b5673c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 19 Sep 2024 02:21:07 +0200 Subject: [PATCH 036/201] move the filterwarning to appropriate file (#3952) --- reflex/components/component.py | 3 --- reflex/vars/base.py | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reflex/components/component.py b/reflex/components/component.py index 7497eec78..d3ae05c89 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -4,7 +4,6 @@ from __future__ import annotations import copy import typing -import warnings from abc import ABC, abstractmethod from functools import lru_cache, wraps from hashlib import md5 @@ -170,8 +169,6 @@ ComponentStyle = Dict[ ] ComponentChild = Union[types.PrimitiveType, Var, BaseComponent] -warnings.filterwarnings("ignore", message="fields may not start with an underscore") - class Component(BaseComponent, ABC): """A component with style, event trigger and other props.""" diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 887928e3c..62dd5ed01 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -13,6 +13,7 @@ import random import re import string import sys +import warnings from types import CodeType, FunctionType from typing import ( TYPE_CHECKING, @@ -72,6 +73,8 @@ if TYPE_CHECKING: VAR_TYPE = TypeVar("VAR_TYPE", covariant=True) +warnings.filterwarnings("ignore", message="fields may not start with an underscore") + @dataclasses.dataclass( eq=False, From 5f296eec38b274800e7c37ab1a3d179f549e88d7 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Wed, 18 Sep 2024 21:33:50 -0700 Subject: [PATCH 037/201] [ENG-3817] deprecate _var_name_unwrapped (instead of removing it) (#3951) some components and code examples used `_var_name_unwrapped`, so map this property back to `_js_expr` and deprecate it. --- reflex/vars/base.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 62dd5ed01..37498911f 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -119,6 +119,16 @@ class Var(Generic[VAR_TYPE]): """ return self._js_expr + @property + @deprecated("Use `_js_expr` instead.") + def _var_name_unwrapped(self) -> str: + """The name of the var without extra curly braces. + + Returns: + The name of the var. + """ + return self._js_expr + @property def _var_is_string(self) -> bool: """Whether the var is a string literal. From ef38ac29ea690a15c661101c990c6c9780058f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 19 Sep 2024 20:32:29 +0200 Subject: [PATCH 038/201] remove unused badge (#3955) --- README.md | 1 - docs/de/README.md | 1 - docs/in/README.md | 1 - docs/it/README.md | 1 - docs/ja/README.md | 1 - docs/kr/README.md | 1 - docs/pe/README.md | 1 - docs/tr/README.md | 1 - docs/zh/zh_cn/README.md | 1 - docs/zh/zh_tw/README.md | 1 - 10 files changed, 10 deletions(-) diff --git a/README.md b/README.md index 2c5b14087..f7a3e5dc8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ ### **✨ Performant, customizable web apps in pure Python. Deploy in seconds. ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentation](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/de/README.md b/docs/de/README.md index 6a27037bc..719940202 100644 --- a/docs/de/README.md +++ b/docs/de/README.md @@ -10,7 +10,6 @@ ### **✨ Performante, anpassbare Web-Apps in purem Python. Bereitstellung in Sekunden. ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentation](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/in/README.md b/docs/in/README.md index 3b470e640..e13a5563e 100644 --- a/docs/in/README.md +++ b/docs/in/README.md @@ -11,7 +11,6 @@ Pynecone की तलाश हैं? आप सही रेपो में ### **✨ प्रदर्शनकारी, अनुकूलित वेब ऐप्स, शुद्ध Python में। सेकंडों में तैनात करें। ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentaiton](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/it/README.md b/docs/it/README.md index 22866d931..8324743fc 100644 --- a/docs/it/README.md +++ b/docs/it/README.md @@ -10,7 +10,6 @@ ### **✨ App web performanti e personalizzabili in puro Python. Distribuisci in pochi secondi. ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentaiton](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/ja/README.md b/docs/ja/README.md index 47b2d2b3a..f58fb70ad 100644 --- a/docs/ja/README.md +++ b/docs/ja/README.md @@ -11,7 +11,6 @@ ### **✨ 即時デプロイが可能な、Pure Python で作ったパフォーマンスと汎用性が高い Web アプリケーション ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentation](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/kr/README.md b/docs/kr/README.md index aa88b4309..8d9e2b78e 100644 --- a/docs/kr/README.md +++ b/docs/kr/README.md @@ -10,7 +10,6 @@ ### **✨ 순수 Python으로 고성능 사용자 정의 웹앱을 만들어 보세요. 몇 초만에 배포 가능합니다. ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentaiton](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/pe/README.md b/docs/pe/README.md index dcdb45c1f..a0fb62d7a 100644 --- a/docs/pe/README.md +++ b/docs/pe/README.md @@ -10,7 +10,6 @@ ### **✨ برنامه های تحت وب قابل تنظیم، کارآمد تماما پایتونی که در چند ثانیه مستقر(دپلوی) می‎شود. ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentation](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/tr/README.md b/docs/tr/README.md index e805b92eb..1e2be7d54 100644 --- a/docs/tr/README.md +++ b/docs/tr/README.md @@ -11,7 +11,6 @@ ### **✨ Saf Python'da performanslı, özelleştirilebilir web uygulamaları. Saniyeler içinde dağıtın. ✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentaiton](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/zh/zh_cn/README.md b/docs/zh/zh_cn/README.md index 3edb81976..c39db0c2d 100644 --- a/docs/zh/zh_cn/README.md +++ b/docs/zh/zh_cn/README.md @@ -10,7 +10,6 @@ ### **✨ 使用 Python 创建高效且可自定义的网页应用程序,几秒钟内即可部署.✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentaiton](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) diff --git a/docs/zh/zh_tw/README.md b/docs/zh/zh_tw/README.md index 388631dd2..99603099e 100644 --- a/docs/zh/zh_tw/README.md +++ b/docs/zh/zh_tw/README.md @@ -11,7 +11,6 @@ **✨ 使用 Python 建立高效且可自訂的網頁應用程式,幾秒鐘內即可部署。✨** [![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) -![tests](https://github.com/pynecone-io/pynecone/actions/workflows/integration.yml/badge.svg) ![versions](https://img.shields.io/pypi/pyversions/reflex.svg) [![Documentaiton](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) [![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) From bca49d353746f60645e078137938863fec6967c1 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 19 Sep 2024 19:06:53 -0700 Subject: [PATCH 039/201] Component as Var type (#3732) * [WiP] Support UI components returned from a computed var * Get rid of nasty react hooks warning * include @babel/standalone in the base to avoid CDN * put window variables behind an object * use jsx * implement the thing * cleanup dead test code (#3909) * override dict in propsbase to use camelCase (#3910) * override dict in propsbase to use camelCase * fix underscore in dict * dang it darglint * [REF-3562][REF-3563] Replace chakra usage (#3872) * [ENG-3717] [flexgen] Initialize app from refactored code (#3918) * Remove Pydantic from some classes (#3907) * half of the way there * add dataclass support * Forbid Computed var shadowing (#3843) * get it right pyright * fix unit tests * rip out more pydantic * fix weird issues with merge_imports * add missing docstring * make special props a list instead of a set * fix moment pyi * actually ignore the runtime error * it's ruff out there --------- Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> * Merging * fixss * fix field_name * always import react * move func to file * do some weird things * it's really ruff out there * add docs * how does this work * dang it darglint * fix the silly * don't remove computed guy * silly goose, don't ignore var types :D * update code * put f string on one line * make it deprecated instead of outright killing it * i hate it * add imports from react * assert it has evalReactComponent * do things ig * move get field to global context * ooops --------- Co-authored-by: Khaleel Al-Adhami Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Co-authored-by: Elijah Ahianyo --- .../.templates/jinja/web/pages/_app.js.jinja2 | 14 + reflex/.templates/web/utils/state.js | 109 ++- reflex/base.py | 20 +- reflex/components/component.py | 22 +- reflex/components/datadisplay/code.py | 129 +++- reflex/components/datadisplay/code.pyi | 707 +++++++++++++++++- reflex/components/dynamic.py | 143 ++++ reflex/constants/installer.py | 1 + reflex/state.py | 47 +- reflex/utils/format.py | 2 + reflex/vars/base.py | 339 ++++++++- tests/components/datadisplay/test_code.py | 5 +- tests/test_state.py | 2 +- tests/test_var.py | 24 + 14 files changed, 1398 insertions(+), 166 deletions(-) create mode 100644 reflex/components/dynamic.py diff --git a/reflex/.templates/jinja/web/pages/_app.js.jinja2 b/reflex/.templates/jinja/web/pages/_app.js.jinja2 index 654f7a2a4..97c31925d 100644 --- a/reflex/.templates/jinja/web/pages/_app.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/_app.js.jinja2 @@ -7,6 +7,10 @@ import '/styles/styles.css' {% block declaration %} import { EventLoopProvider, StateProvider, defaultColorMode } from "/utils/context.js"; import { ThemeProvider } from 'next-themes' +import * as React from "react"; +import * as utils_context from "/utils/context.js"; +import * as utils_state from "/utils/state.js"; +import * as radix from "@radix-ui/themes"; {% for custom_code in custom_codes %} {{custom_code}} @@ -26,6 +30,16 @@ function AppWrap({children}) { } export default function MyApp({ Component, pageProps }) { + React.useEffect(() => { + // Make contexts and state objects available globally for dynamic eval'd components + let windowImports = { + "react": React, + "@radix-ui/themes": radix, + "/utils/context": utils_context, + "/utils/state": utils_state, + }; + window["__reflex"] = windowImports; + }, []); return ( diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 26b2d0d0c..66b50b1b4 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -15,6 +15,7 @@ import { } from "utils/context.js"; import debounce from "/utils/helpers/debounce"; import throttle from "/utils/helpers/throttle"; +import * as Babel from "@babel/standalone"; // Endpoint URLs. const EVENTURL = env.EVENT; @@ -117,8 +118,8 @@ export const isStateful = () => { if (event_queue.length === 0) { return false; } - return event_queue.some(event => event.name.startsWith("reflex___state")); -} + return event_queue.some((event) => event.name.startsWith("reflex___state")); +}; /** * Apply a delta to the state. @@ -129,6 +130,22 @@ export const applyDelta = (state, delta) => { return { ...state, ...delta }; }; +/** + * Evaluate a dynamic component. + * @param component The component to evaluate. + * @returns The evaluated component. + */ +export const evalReactComponent = async (component) => { + if (!window.React && window.__reflex) { + window.React = window.__reflex.react; + } + const output = Babel.transform(component, { presets: ["react"] }).code; + const encodedJs = encodeURIComponent(output); + const dataUri = "data:text/javascript;charset=utf-8," + encodedJs; + const module = await eval(`import(dataUri)`); + return module.default; +}; + /** * Only Queue and process events when websocket connection exists. * @param event The event to queue. @@ -141,7 +158,7 @@ export const queueEventIfSocketExists = async (events, socket) => { return; } await queueEvents(events, socket); -} +}; /** * Handle frontend event or send the event to the backend via Websocket. @@ -208,7 +225,10 @@ export const applyEvent = async (event, socket) => { const a = document.createElement("a"); a.hidden = true; // Special case when linking to uploaded files - a.href = event.payload.url.replace("${getBackendURL(env.UPLOAD)}", getBackendURL(env.UPLOAD)) + a.href = event.payload.url.replace( + "${getBackendURL(env.UPLOAD)}", + getBackendURL(env.UPLOAD) + ); a.download = event.payload.filename; a.click(); a.remove(); @@ -249,7 +269,7 @@ export const applyEvent = async (event, socket) => { } catch (e) { console.log("_call_script", e); if (window && window?.onerror) { - window.onerror(e.message, null, null, null, e) + window.onerror(e.message, null, null, null, e); } } return false; @@ -290,10 +310,9 @@ export const applyEvent = async (event, socket) => { export const applyRestEvent = async (event, socket) => { let eventSent = false; if (event.handler === "uploadFiles") { - if (event.payload.files === undefined || event.payload.files.length === 0) { // Submit the event over the websocket to trigger the event handler. - return await applyEvent(Event(event.name), socket) + return await applyEvent(Event(event.name), socket); } // Start upload, but do not wait for it, which would block other events. @@ -397,7 +416,7 @@ export const connect = async ( console.log("Disconnect backend before bfcache on navigation"); socket.current.disconnect(); } - } + }; // Once the socket is open, hydrate the page. socket.current.on("connect", () => { @@ -416,7 +435,7 @@ export const connect = async ( }); // On each received message, queue the updates and events. - socket.current.on("event", (message) => { + socket.current.on("event", async (message) => { const update = JSON5.parse(message); for (const substate in update.delta) { dispatch[substate](update.delta[substate]); @@ -574,7 +593,11 @@ export const hydrateClientStorage = (client_storage) => { } } } - if (client_storage.cookies || client_storage.local_storage || client_storage.session_storage) { + if ( + client_storage.cookies || + client_storage.local_storage || + client_storage.session_storage + ) { return client_storage_values; } return {}; @@ -614,15 +637,17 @@ const applyClientStorageDelta = (client_storage, delta) => { ) { const options = client_storage.local_storage[state_key]; localStorage.setItem(options.name || state_key, delta[substate][key]); - } else if( + } else if ( client_storage.session_storage && state_key in client_storage.session_storage && typeof window !== "undefined" ) { const session_options = client_storage.session_storage[state_key]; - sessionStorage.setItem(session_options.name || state_key, delta[substate][key]); + sessionStorage.setItem( + session_options.name || state_key, + delta[substate][key] + ); } - } } }; @@ -651,7 +676,7 @@ export const useEventLoop = ( if (!(args instanceof Array)) { args = [args]; } - const _e = args.filter((o) => o?.preventDefault !== undefined)[0] + const _e = args.filter((o) => o?.preventDefault !== undefined)[0]; if (event_actions?.preventDefault && _e?.preventDefault) { _e.preventDefault(); @@ -671,7 +696,7 @@ export const useEventLoop = ( debounce( combined_name, () => queueEvents(events, socket), - event_actions.debounce, + event_actions.debounce ); } else { queueEvents(events, socket); @@ -696,30 +721,32 @@ export const useEventLoop = ( } }, [router.isReady]); - // Handle frontend errors and send them to the backend via websocket. - useEffect(() => { - - if (typeof window === 'undefined') { - return; - } - - window.onerror = function (msg, url, lineNo, columnNo, error) { - addEvents([Event(`${exception_state_name}.handle_frontend_exception`, { - stack: error.stack, - })]) - return false; - } + // Handle frontend errors and send them to the backend via websocket. + useEffect(() => { + if (typeof window === "undefined") { + return; + } - //NOTE: Only works in Chrome v49+ - //https://github.com/mknichel/javascript-errors?tab=readme-ov-file#promise-rejection-events - window.onunhandledrejection = function (event) { - addEvents([Event(`${exception_state_name}.handle_frontend_exception`, { - stack: event.reason.stack, - })]) - return false; - } - - },[]) + window.onerror = function (msg, url, lineNo, columnNo, error) { + addEvents([ + Event(`${exception_state_name}.handle_frontend_exception`, { + stack: error.stack, + }), + ]); + return false; + }; + + //NOTE: Only works in Chrome v49+ + //https://github.com/mknichel/javascript-errors?tab=readme-ov-file#promise-rejection-events + window.onunhandledrejection = function (event) { + addEvents([ + Event(`${exception_state_name}.handle_frontend_exception`, { + stack: event.reason.stack, + }), + ]); + return false; + }; + }, []); // Main event loop. useEffect(() => { @@ -782,11 +809,11 @@ export const useEventLoop = ( // Route after the initial page hydration. useEffect(() => { const change_start = () => { - const main_state_dispatch = dispatch["reflex___state____state"] + const main_state_dispatch = dispatch["reflex___state____state"]; if (main_state_dispatch !== undefined) { - main_state_dispatch({ is_hydrated: false }) + main_state_dispatch({ is_hydrated: false }); } - } + }; const change_complete = () => addEvents(onLoadInternalEvent()); router.events.on("routeChangeStart", change_start); router.events.on("routeChangeComplete", change_complete); diff --git a/reflex/base.py b/reflex/base.py index 22b52cfb9..c334ddf56 100644 --- a/reflex/base.py +++ b/reflex/base.py @@ -47,6 +47,9 @@ def validate_field_name(bases: List[Type["BaseModel"]], field_name: str) -> None # shadowed state vars when reloading app via utils.prerequisites.get_app(reload=True) pydantic_main.validate_field_name = validate_field_name # type: ignore +if TYPE_CHECKING: + from reflex.vars import Var + class Base(BaseModel): # pyright: ignore [reportUnboundVariable] """The base class subclassed by all Reflex classes. @@ -92,7 +95,7 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable] return self @classmethod - def get_fields(cls) -> dict[str, Any]: + def get_fields(cls) -> dict[str, ModelField]: """Get the fields of the object. Returns: @@ -101,7 +104,7 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable] return cls.__fields__ @classmethod - def add_field(cls, var: Any, default_value: Any): + def add_field(cls, var: Var, default_value: Any): """Add a pydantic field after class definition. Used by State.add_var() to correctly handle the new variable. @@ -110,7 +113,7 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable] var: The variable to add a pydantic field for. default_value: The default value of the field """ - var_name = var._js_expr.split(".")[-1] + var_name = var._var_field_name new_field = ModelField.infer( name=var_name, value=default_value, @@ -133,13 +136,4 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable] # Seems like this function signature was wrong all along? # If the user wants a field that we know of, get it and pass it off to _get_value key = getattr(self, key) - return self._get_value( - key, - to_dict=True, - by_alias=False, - include=None, - exclude=None, - exclude_unset=False, - exclude_defaults=False, - exclude_none=False, - ) + return key diff --git a/reflex/components/component.py b/reflex/components/component.py index d3ae05c89..e6bdfef06 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -25,6 +25,7 @@ import reflex.state from reflex.base import Base from reflex.compiler.templates import STATEFUL_COMPONENT from reflex.components.core.breakpoints import Breakpoints +from reflex.components.dynamic import load_dynamic_serializer from reflex.components.tags import Tag from reflex.constants import ( Dirs, @@ -52,7 +53,6 @@ from reflex.utils.imports import ( ParsedImportDict, parse_imports, ) -from reflex.utils.serializers import serializer from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var @@ -615,8 +615,8 @@ class Component(BaseComponent, ABC): if types._issubclass(field.type_, EventHandler): args_spec = None annotation = field.annotation - if hasattr(annotation, "__metadata__"): - args_spec = annotation.__metadata__[0] + if (metadata := getattr(annotation, "__metadata__", None)) is not None: + args_spec = metadata[0] default_triggers[field.name] = args_spec or (lambda: []) return default_triggers @@ -1882,19 +1882,6 @@ class NoSSRComponent(Component): return "".join((library_import, mod_import, opts_fragment)) -@serializer -def serialize_component(comp: Component): - """Serialize a component. - - Args: - comp: The component to serialize. - - Returns: - The serialized component. - """ - return str(comp) - - class StatefulComponent(BaseComponent): """A component that depends on state and is rendered outside of the page component. @@ -2307,3 +2294,6 @@ class MemoizationLeaf(Component): update={"disposition": MemoizationDisposition.ALWAYS} ) return comp + + +load_dynamic_serializer() diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index d9ab46e53..0b26e0c04 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -2,11 +2,12 @@ from __future__ import annotations +import enum from typing import Any, Dict, Literal, Optional, Union from typing_extensions import get_args -from reflex.components.component import Component +from reflex.components.component import Component, ComponentNamespace from reflex.components.core.cond import color_mode_cond from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.button import Button @@ -14,9 +15,9 @@ from reflex.components.radix.themes.layout.box import Box from reflex.constants.colors import Color from reflex.event import set_clipboard from reflex.style import Style -from reflex.utils import format +from reflex.utils import console, format from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars.base import LiteralVar, Var +from reflex.vars.base import LiteralVar, Var, VarData LiteralCodeBlockTheme = Literal[ "a11y-dark", @@ -405,31 +406,6 @@ class CodeBlock(Component): """ imports_: ImportDict = {} - themeString = str(self.theme) - - selected_themes = [] - - for possibleTheme in get_args(LiteralCodeBlockTheme): - if format.to_camel_case(possibleTheme) in themeString: - selected_themes.append(possibleTheme) - if possibleTheme in themeString: - selected_themes.append(possibleTheme) - - selected_themes = sorted(set(map(self.convert_theme_name, selected_themes))) - - imports_.update( - { - f"react-syntax-highlighter/dist/cjs/styles/prism/{theme}": [ - ImportVar( - tag=format.to_camel_case(theme), - is_default=True, - install=False, - ) - ] - for theme in selected_themes - } - ) - if ( self.language is not None and (language_without_quotes := str(self.language).replace('"', "")) @@ -480,14 +456,20 @@ class CodeBlock(Component): if "theme" not in props: # Default color scheme responds to global color mode. props["theme"] = color_mode_cond( - light=Var(_js_expr="oneLight"), - dark=Var(_js_expr="oneDark"), + light=Theme.one_light, + dark=Theme.one_dark, ) # react-syntax-highlighter doesnt have an explicit "light" or "dark" theme so we use one-light and one-dark # themes respectively to ensure code compatibility. if "theme" in props and not isinstance(props["theme"], Var): - props["theme"] = cls.convert_theme_name(props["theme"]) + props["theme"] = getattr(Theme, format.to_snake_case(props["theme"])) # type: ignore + console.deprecate( + feature_name="theme prop as string", + reason="Use code_block.themes instead.", + deprecation_version="0.6.0", + removal_version="0.7.0", + ) if can_copy: code = children[0] @@ -533,9 +515,7 @@ class CodeBlock(Component): def _render(self): out = super()._render() - theme = self.theme._replace( - _js_expr=replace_quotes_with_camel_case(str(self.theme)) - ) + theme = self.theme out.add_props(style=theme).remove_props("theme", "code").add_props( children=self.code @@ -558,4 +538,83 @@ class CodeBlock(Component): return theme -code_block = CodeBlock.create +def construct_theme_var(theme: str) -> Var: + """Construct a theme var. + + Args: + theme: The theme to construct. + + Returns: + The constructed theme var. + """ + return Var( + theme, + _var_data=VarData( + imports={ + f"react-syntax-highlighter/dist/cjs/styles/prism/{format.to_kebab_case(theme)}": [ + ImportVar(tag=theme, is_default=True, install=False) + ] + } + ), + ) + + +class Theme(enum.Enum): + """Themes for the CodeBlock component.""" + + a11y_dark = construct_theme_var("a11yDark") + atom_dark = construct_theme_var("atomDark") + cb = construct_theme_var("cb") + coldark_cold = construct_theme_var("coldarkCold") + coldark_dark = construct_theme_var("coldarkDark") + coy = construct_theme_var("coy") + coy_without_shadows = construct_theme_var("coyWithoutShadows") + darcula = construct_theme_var("darcula") + dark = construct_theme_var("oneDark") + dracula = construct_theme_var("dracula") + duotone_dark = construct_theme_var("duotoneDark") + duotone_earth = construct_theme_var("duotoneEarth") + duotone_forest = construct_theme_var("duotoneForest") + duotone_light = construct_theme_var("duotoneLight") + duotone_sea = construct_theme_var("duotoneSea") + duotone_space = construct_theme_var("duotoneSpace") + funky = construct_theme_var("funky") + ghcolors = construct_theme_var("ghcolors") + gruvbox_dark = construct_theme_var("gruvboxDark") + gruvbox_light = construct_theme_var("gruvboxLight") + holi_theme = construct_theme_var("holiTheme") + hopscotch = construct_theme_var("hopscotch") + light = construct_theme_var("oneLight") + lucario = construct_theme_var("lucario") + material_dark = construct_theme_var("materialDark") + material_light = construct_theme_var("materialLight") + material_oceanic = construct_theme_var("materialOceanic") + night_owl = construct_theme_var("nightOwl") + nord = construct_theme_var("nord") + okaidia = construct_theme_var("okaidia") + one_dark = construct_theme_var("oneDark") + one_light = construct_theme_var("oneLight") + pojoaque = construct_theme_var("pojoaque") + prism = construct_theme_var("prism") + shades_of_purple = construct_theme_var("shadesOfPurple") + solarized_dark_atom = construct_theme_var("solarizedDarkAtom") + solarizedlight = construct_theme_var("solarizedlight") + synthwave84 = construct_theme_var("synthwave84") + tomorrow = construct_theme_var("tomorrow") + twilight = construct_theme_var("twilight") + vs = construct_theme_var("vs") + vs_dark = construct_theme_var("vsDark") + vsc_dark_plus = construct_theme_var("vscDarkPlus") + xonokai = construct_theme_var("xonokai") + z_touch = construct_theme_var("zTouch") + + +class CodeblockNamespace(ComponentNamespace): + """Namespace for the CodeBlock component.""" + + themes = Theme + + __call__ = CodeBlock.create + + +code_block = CodeblockNamespace() diff --git a/reflex/components/datadisplay/code.pyi b/reflex/components/datadisplay/code.pyi index 49a7bbb51..7a074d1f9 100644 --- a/reflex/components/datadisplay/code.pyi +++ b/reflex/components/datadisplay/code.pyi @@ -3,9 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +import enum from typing import Any, Callable, Dict, Literal, Optional, Union, overload -from reflex.components.component import Component +from reflex.components.component import Component, ComponentNamespace from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec from reflex.style import Style @@ -1001,4 +1002,706 @@ class CodeBlock(Component): @staticmethod def convert_theme_name(theme) -> str: ... -code_block = CodeBlock.create +def construct_theme_var(theme: str) -> Var: ... + +class Theme(enum.Enum): + a11y_dark = construct_theme_var("a11yDark") + atom_dark = construct_theme_var("atomDark") + cb = construct_theme_var("cb") + coldark_cold = construct_theme_var("coldarkCold") + coldark_dark = construct_theme_var("coldarkDark") + coy = construct_theme_var("coy") + coy_without_shadows = construct_theme_var("coyWithoutShadows") + darcula = construct_theme_var("darcula") + dark = construct_theme_var("oneDark") + dracula = construct_theme_var("dracula") + duotone_dark = construct_theme_var("duotoneDark") + duotone_earth = construct_theme_var("duotoneEarth") + duotone_forest = construct_theme_var("duotoneForest") + duotone_light = construct_theme_var("duotoneLight") + duotone_sea = construct_theme_var("duotoneSea") + duotone_space = construct_theme_var("duotoneSpace") + funky = construct_theme_var("funky") + ghcolors = construct_theme_var("ghcolors") + gruvbox_dark = construct_theme_var("gruvboxDark") + gruvbox_light = construct_theme_var("gruvboxLight") + holi_theme = construct_theme_var("holiTheme") + hopscotch = construct_theme_var("hopscotch") + light = construct_theme_var("oneLight") + lucario = construct_theme_var("lucario") + material_dark = construct_theme_var("materialDark") + material_light = construct_theme_var("materialLight") + material_oceanic = construct_theme_var("materialOceanic") + night_owl = construct_theme_var("nightOwl") + nord = construct_theme_var("nord") + okaidia = construct_theme_var("okaidia") + one_dark = construct_theme_var("oneDark") + one_light = construct_theme_var("oneLight") + pojoaque = construct_theme_var("pojoaque") + prism = construct_theme_var("prism") + shades_of_purple = construct_theme_var("shadesOfPurple") + solarized_dark_atom = construct_theme_var("solarizedDarkAtom") + solarizedlight = construct_theme_var("solarizedlight") + synthwave84 = construct_theme_var("synthwave84") + tomorrow = construct_theme_var("tomorrow") + twilight = construct_theme_var("twilight") + vs = construct_theme_var("vs") + vs_dark = construct_theme_var("vsDark") + vsc_dark_plus = construct_theme_var("vscDarkPlus") + xonokai = construct_theme_var("xonokai") + z_touch = construct_theme_var("zTouch") + +class CodeblockNamespace(ComponentNamespace): + themes = Theme + + @staticmethod + def __call__( + *children, + can_copy: Optional[bool] = False, + copy_button: Optional[Union[Component, bool]] = None, + theme: Optional[Union[Any, Var[Any]]] = None, + language: Optional[ + Union[ + Literal[ + "abap", + "abnf", + "actionscript", + "ada", + "agda", + "al", + "antlr4", + "apacheconf", + "apex", + "apl", + "applescript", + "aql", + "arduino", + "arff", + "asciidoc", + "asm6502", + "asmatmel", + "aspnet", + "autohotkey", + "autoit", + "avisynth", + "avro-idl", + "bash", + "basic", + "batch", + "bbcode", + "bicep", + "birb", + "bison", + "bnf", + "brainfuck", + "brightscript", + "bro", + "bsl", + "c", + "cfscript", + "chaiscript", + "cil", + "clike", + "clojure", + "cmake", + "cobol", + "coffeescript", + "concurnas", + "coq", + "core", + "cpp", + "crystal", + "csharp", + "cshtml", + "csp", + "css", + "css-extras", + "csv", + "cypher", + "d", + "dart", + "dataweave", + "dax", + "dhall", + "diff", + "django", + "dns-zone-file", + "docker", + "dot", + "ebnf", + "editorconfig", + "eiffel", + "ejs", + "elixir", + "elm", + "erb", + "erlang", + "etlua", + "excel-formula", + "factor", + "false", + "firestore-security-rules", + "flow", + "fortran", + "fsharp", + "ftl", + "gap", + "gcode", + "gdscript", + "gedcom", + "gherkin", + "git", + "glsl", + "gml", + "gn", + "go", + "go-module", + "graphql", + "groovy", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hlsl", + "hoon", + "hpkp", + "hsts", + "http", + "ichigojam", + "icon", + "icu-message-format", + "idris", + "iecst", + "ignore", + "index", + "inform7", + "ini", + "io", + "j", + "java", + "javadoc", + "javadoclike", + "javascript", + "javastacktrace", + "jexl", + "jolie", + "jq", + "js-extras", + "js-templates", + "jsdoc", + "json", + "json5", + "jsonp", + "jsstacktrace", + "jsx", + "julia", + "keepalived", + "keyman", + "kotlin", + "kumir", + "kusto", + "latex", + "latte", + "less", + "lilypond", + "liquid", + "lisp", + "livescript", + "llvm", + "log", + "lolcode", + "lua", + "magma", + "makefile", + "markdown", + "markup", + "markup-templating", + "matlab", + "maxscript", + "mel", + "mermaid", + "mizar", + "mongodb", + "monkey", + "moonscript", + "n1ql", + "n4js", + "nand2tetris-hdl", + "naniscript", + "nasm", + "neon", + "nevod", + "nginx", + "nim", + "nix", + "nsis", + "objectivec", + "ocaml", + "opencl", + "openqasm", + "oz", + "parigp", + "parser", + "pascal", + "pascaligo", + "pcaxis", + "peoplecode", + "perl", + "php", + "php-extras", + "phpdoc", + "plsql", + "powerquery", + "powershell", + "processing", + "prolog", + "promql", + "properties", + "protobuf", + "psl", + "pug", + "puppet", + "pure", + "purebasic", + "purescript", + "python", + "q", + "qml", + "qore", + "qsharp", + "r", + "racket", + "reason", + "regex", + "rego", + "renpy", + "rest", + "rip", + "roboconf", + "robotframework", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shell-session", + "smali", + "smalltalk", + "smarty", + "sml", + "solidity", + "solution-file", + "soy", + "sparql", + "splunk-spl", + "sqf", + "sql", + "squirrel", + "stan", + "stylus", + "swift", + "systemd", + "t4-cs", + "t4-templating", + "t4-vb", + "tap", + "tcl", + "textile", + "toml", + "tremor", + "tsx", + "tt2", + "turtle", + "twig", + "typescript", + "typoscript", + "unrealscript", + "uorazor", + "uri", + "v", + "vala", + "vbnet", + "velocity", + "verilog", + "vhdl", + "vim", + "visual-basic", + "warpscript", + "wasm", + "web-idl", + "wiki", + "wolfram", + "wren", + "xeora", + "xml-doc", + "xojo", + "xquery", + "yaml", + "yang", + "zig", + ], + Var[ + Literal[ + "abap", + "abnf", + "actionscript", + "ada", + "agda", + "al", + "antlr4", + "apacheconf", + "apex", + "apl", + "applescript", + "aql", + "arduino", + "arff", + "asciidoc", + "asm6502", + "asmatmel", + "aspnet", + "autohotkey", + "autoit", + "avisynth", + "avro-idl", + "bash", + "basic", + "batch", + "bbcode", + "bicep", + "birb", + "bison", + "bnf", + "brainfuck", + "brightscript", + "bro", + "bsl", + "c", + "cfscript", + "chaiscript", + "cil", + "clike", + "clojure", + "cmake", + "cobol", + "coffeescript", + "concurnas", + "coq", + "core", + "cpp", + "crystal", + "csharp", + "cshtml", + "csp", + "css", + "css-extras", + "csv", + "cypher", + "d", + "dart", + "dataweave", + "dax", + "dhall", + "diff", + "django", + "dns-zone-file", + "docker", + "dot", + "ebnf", + "editorconfig", + "eiffel", + "ejs", + "elixir", + "elm", + "erb", + "erlang", + "etlua", + "excel-formula", + "factor", + "false", + "firestore-security-rules", + "flow", + "fortran", + "fsharp", + "ftl", + "gap", + "gcode", + "gdscript", + "gedcom", + "gherkin", + "git", + "glsl", + "gml", + "gn", + "go", + "go-module", + "graphql", + "groovy", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hlsl", + "hoon", + "hpkp", + "hsts", + "http", + "ichigojam", + "icon", + "icu-message-format", + "idris", + "iecst", + "ignore", + "index", + "inform7", + "ini", + "io", + "j", + "java", + "javadoc", + "javadoclike", + "javascript", + "javastacktrace", + "jexl", + "jolie", + "jq", + "js-extras", + "js-templates", + "jsdoc", + "json", + "json5", + "jsonp", + "jsstacktrace", + "jsx", + "julia", + "keepalived", + "keyman", + "kotlin", + "kumir", + "kusto", + "latex", + "latte", + "less", + "lilypond", + "liquid", + "lisp", + "livescript", + "llvm", + "log", + "lolcode", + "lua", + "magma", + "makefile", + "markdown", + "markup", + "markup-templating", + "matlab", + "maxscript", + "mel", + "mermaid", + "mizar", + "mongodb", + "monkey", + "moonscript", + "n1ql", + "n4js", + "nand2tetris-hdl", + "naniscript", + "nasm", + "neon", + "nevod", + "nginx", + "nim", + "nix", + "nsis", + "objectivec", + "ocaml", + "opencl", + "openqasm", + "oz", + "parigp", + "parser", + "pascal", + "pascaligo", + "pcaxis", + "peoplecode", + "perl", + "php", + "php-extras", + "phpdoc", + "plsql", + "powerquery", + "powershell", + "processing", + "prolog", + "promql", + "properties", + "protobuf", + "psl", + "pug", + "puppet", + "pure", + "purebasic", + "purescript", + "python", + "q", + "qml", + "qore", + "qsharp", + "r", + "racket", + "reason", + "regex", + "rego", + "renpy", + "rest", + "rip", + "roboconf", + "robotframework", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shell-session", + "smali", + "smalltalk", + "smarty", + "sml", + "solidity", + "solution-file", + "soy", + "sparql", + "splunk-spl", + "sqf", + "sql", + "squirrel", + "stan", + "stylus", + "swift", + "systemd", + "t4-cs", + "t4-templating", + "t4-vb", + "tap", + "tcl", + "textile", + "toml", + "tremor", + "tsx", + "tt2", + "turtle", + "twig", + "typescript", + "typoscript", + "unrealscript", + "uorazor", + "uri", + "v", + "vala", + "vbnet", + "velocity", + "verilog", + "vhdl", + "vim", + "visual-basic", + "warpscript", + "wasm", + "web-idl", + "wiki", + "wolfram", + "wren", + "xeora", + "xml-doc", + "xojo", + "xquery", + "yaml", + "yang", + "zig", + ] + ], + ] + ] = None, + code: Optional[Union[Var[str], str]] = None, + show_line_numbers: Optional[Union[Var[bool], bool]] = None, + starting_line_number: Optional[Union[Var[int], int]] = None, + wrap_long_lines: Optional[Union[Var[bool], bool]] = None, + custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None, + code_tag_props: Optional[Union[Dict[str, str], Var[Dict[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, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + **props, + ) -> "CodeBlock": + """Create a text component. + + Args: + *children: The children of the component. + can_copy: Whether a copy button should appears. + copy_button: A custom copy button to override the default one. + theme: The theme to use ("light" or "dark"). + language: The language to use. + code: The code to display. + show_line_numbers: If this is enabled line numbers will be shown next to the code block. + starting_line_number: The starting line number to use. + wrap_long_lines: Whether to wrap long lines. + custom_style: A custom style for the code block. + code_tag_props: Props passed down to the code tag. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props to pass to the component. + + Returns: + The text component. + """ + ... + +code_block = CodeblockNamespace() diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py new file mode 100644 index 000000000..6ae78161f --- /dev/null +++ b/reflex/components/dynamic.py @@ -0,0 +1,143 @@ +"""Components that are dynamically generated on the backend.""" + +from reflex import constants +from reflex.utils import imports +from reflex.utils.serializers import serializer +from reflex.vars import Var, get_unique_variable_name +from reflex.vars.base import VarData, transform + + +def get_cdn_url(lib: str) -> str: + """Get the CDN URL for a library. + + Args: + lib: The library to get the CDN URL for. + + Returns: + The CDN URL for the library. + """ + return f"https://cdn.jsdelivr.net/npm/{lib}" + "/+esm" + + +def load_dynamic_serializer(): + """Load the serializer for dynamic components.""" + # Causes a circular import, so we import here. + from reflex.components.component import Component + + @serializer + def make_component(component: Component) -> str: + """Generate the code for a dynamic component. + + Args: + component: The component to generate code for. + + Returns: + The generated code + """ + # Causes a circular import, so we import here. + from reflex.compiler import templates, utils + + rendered_components = {} + # Include dynamic imports in the shared component. + if dynamic_imports := component._get_all_dynamic_imports(): + rendered_components.update( + {dynamic_import: None for dynamic_import in dynamic_imports} + ) + + # Include custom code in the shared component. + rendered_components.update( + {code: None for code in component._get_all_custom_code()}, + ) + + rendered_components[ + templates.STATEFUL_COMPONENT.render( + tag_name="MySSRComponent", + memo_trigger_hooks=[], + component=component, + ) + ] = None + + imports = {} + for lib, names in component._get_all_imports().items(): + if ( + not lib.startswith((".", "/")) + and not lib.startswith("http") + and lib != "react" + ): + imports[get_cdn_url(lib)] = names + else: + imports[lib] = names + + module_code_lines = templates.STATEFUL_COMPONENTS.render( + imports=utils.compile_imports(imports), + memoized_code="\n".join(rendered_components), + ).splitlines()[1:] + + # Rewrite imports from `/` to destructure from window + for ix, line in enumerate(module_code_lines[:]): + if line.startswith("import "): + if 'from "/' in line: + module_code_lines[ix] = ( + line.replace("import ", "const ", 1).replace( + " from ", " = window['__reflex'][", 1 + ) + + "]" + ) + elif 'from "react"' in line: + module_code_lines[ix] = line.replace( + "import ", "const ", 1 + ).replace(' from "react"', " = window.__reflex.react", 1) + if line.startswith("export function"): + module_code_lines[ix] = line.replace( + "export function", "export default function", 1 + ) + + module_code_lines.insert(0, "const React = window.__reflex.react;") + + return "//__reflex_evaluate\n" + "\n".join(module_code_lines) + + @transform + def evaluate_component(js_string: Var[str]) -> Var[Component]: + """Evaluate a component. + + Args: + js_string: The JavaScript string to evaluate. + + Returns: + The evaluated JavaScript string. + """ + unique_var_name = get_unique_variable_name() + + return js_string._replace( + _js_expr=unique_var_name, + _var_type=Component, + merge_var_data=VarData.merge( + VarData( + imports={ + f"/{constants.Dirs.STATE_PATH}": [ + imports.ImportVar(tag="evalReactComponent"), + ], + "react": [ + imports.ImportVar(tag="useState"), + imports.ImportVar(tag="useEffect"), + ], + }, + hooks={ + f"const [{unique_var_name}, set_{unique_var_name}] = useState(null);": None, + "useEffect(() => {" + "let isMounted = true;" + f"evalReactComponent({str(js_string)})" + ".then((component) => {" + "if (isMounted) {" + f"set_{unique_var_name}(component);" + "}" + "});" + "return () => {" + "isMounted = false;" + "};" + "}" + f", [{str(js_string)}]);": None, + }, + ), + ), + ) diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 4a7027ee8..6f31b08f1 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -111,6 +111,7 @@ class PackageJson(SimpleNamespace): PATH = "package.json" DEPENDENCIES = { + "@babel/standalone": "7.25.3", "@emotion/react": "11.11.1", "axios": "1.6.0", "json5": "2.2.3", diff --git a/reflex/state.py b/reflex/state.py index 6dac48d8f..8b32d1a07 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -40,6 +40,7 @@ from reflex.vars.base import ( DynamicRouteVar, Var, computed_var, + dispatch, is_computed_var, ) @@ -336,6 +337,29 @@ class EventHandlerSetVar(EventHandler): return super().__call__(*args) +if TYPE_CHECKING: + from pydantic.v1.fields import ModelField + + +def get_var_for_field(cls: Type[BaseState], f: ModelField): + """Get a Var instance for a Pydantic field. + + Args: + cls: The state class. + f: The Pydantic field. + + Returns: + The Var instance. + """ + field_name = format.format_state_name(cls.get_full_name()) + "." + f.name + + return dispatch( + field_name=field_name, + var_data=VarData.from_state(cls, f.name), + result_var_type=f.outer_type_, + ) + + class BaseState(Base, ABC, extra=pydantic.Extra.allow): """The state of the app.""" @@ -556,11 +580,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): # Set the base and computed vars. cls.base_vars = { - f.name: Var( - _js_expr=format.format_state_name(cls.get_full_name()) + "." + f.name, - _var_type=f.outer_type_, - _var_data=VarData.from_state(cls), - ).guess_type() + f.name: get_var_for_field(cls, f) for f in cls.get_fields().values() if f.name not in cls.get_skip_vars() } @@ -948,7 +968,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): var = Var( _js_expr=format.format_state_name(cls.get_full_name()) + "." + name, _var_type=type_, - _var_data=VarData.from_state(cls), + _var_data=VarData.from_state(cls, name), ).guess_type() # add the pydantic field dynamically (must be done before _init_var) @@ -974,10 +994,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Args: prop: The var instance to set. """ - acutal_var_name = ( - prop._js_expr if "." not in prop._js_expr else prop._js_expr.split(".")[-1] - ) - setattr(cls, acutal_var_name, prop) + setattr(cls, prop._var_field_name, prop) @classmethod def _create_event_handler(cls, fn): @@ -1017,10 +1034,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): prop: The var to set the default value for. """ # Get the pydantic field for the var. - if "." in prop._js_expr: - field = cls.get_fields()[prop._js_expr.split(".")[-1]] - else: - field = cls.get_fields()[prop._js_expr] + field = cls.get_fields()[prop._var_field_name] if field.required: default_value = prop.get_default_value() if default_value is not None: @@ -1761,11 +1775,12 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): .union(self._always_dirty_computed_vars) ) - subdelta = { - prop: getattr(self, prop) + subdelta: Dict[str, Any] = { + prop: self.get_value(getattr(self, prop)) for prop in delta_vars if not types.is_backend_base_variable(prop, type(self)) } + if len(subdelta) > 0: delta[self.get_full_name()] = subdelta diff --git a/reflex/utils/format.py b/reflex/utils/format.py index e8b040230..c804b2946 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -672,6 +672,8 @@ def format_library_name(library_fullname: str): Returns: The name without the @version if it was part of the name """ + if library_fullname.startswith("https://"): + return library_fullname lib, at, version = library_fullname.rpartition("@") if not lib: lib = at + version diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 37498911f..9fac6fd1f 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -20,6 +20,7 @@ from typing import ( Any, Callable, Dict, + FrozenSet, Generic, Iterable, List, @@ -72,6 +73,7 @@ if TYPE_CHECKING: VAR_TYPE = TypeVar("VAR_TYPE", covariant=True) +OTHER_VAR_TYPE = TypeVar("OTHER_VAR_TYPE") warnings.filterwarnings("ignore", message="fields may not start with an underscore") @@ -119,6 +121,17 @@ class Var(Generic[VAR_TYPE]): """ return self._js_expr + @property + def _var_field_name(self) -> str: + """The name of the field. + + Returns: + The name of the field. + """ + var_data = self._get_all_var_data() + field_name = var_data.field_name if var_data else None + return field_name or self._js_expr + @property @deprecated("Use `_js_expr` instead.") def _var_name_unwrapped(self) -> str: @@ -181,7 +194,19 @@ class Var(Generic[VAR_TYPE]): and self._get_all_var_data() == other._get_all_var_data() ) - def _replace(self, merge_var_data=None, **kwargs: Any): + @overload + def _replace( + self, _var_type: Type[OTHER_VAR_TYPE], merge_var_data=None, **kwargs: Any + ) -> Var[OTHER_VAR_TYPE]: ... + + @overload + def _replace( + self, _var_type: GenericType | None = None, merge_var_data=None, **kwargs: Any + ) -> Self: ... + + def _replace( + self, _var_type: GenericType | None = None, merge_var_data=None, **kwargs: Any + ) -> Self | Var: """Make a copy of this Var with updated fields. Args: @@ -205,14 +230,20 @@ class Var(Generic[VAR_TYPE]): "The _var_full_name_needs_state_prefix argument is not supported for Var." ) - return dataclasses.replace( + value_with_replaced = dataclasses.replace( self, + _var_type=_var_type or self._var_type, _var_data=VarData.merge( kwargs.get("_var_data", self._var_data), merge_var_data ), **kwargs, ) + if (js_expr := kwargs.get("_js_expr", None)) is not None: + object.__setattr__(value_with_replaced, "_js_expr", js_expr) + + return value_with_replaced + @classmethod def create( cls, @@ -566,8 +597,7 @@ class Var(Generic[VAR_TYPE]): Returns: The name of the setter function. """ - var_name_parts = self._js_expr.split(".") - setter = constants.SETTER_PREFIX + var_name_parts[-1] + setter = constants.SETTER_PREFIX + self._var_field_name var_data = self._get_all_var_data() if var_data is None: return setter @@ -581,7 +611,7 @@ class Var(Generic[VAR_TYPE]): Returns: A function that that creates a setter for the var. """ - actual_name = self._js_expr.split(".")[-1] + actual_name = self._var_field_name def setter(state: BaseState, value: Any): """Get the setter for the var. @@ -623,7 +653,9 @@ class Var(Generic[VAR_TYPE]): return StateOperation.create( formatted_state_name, self, - _var_data=VarData.merge(VarData.from_state(state), self._var_data), + _var_data=VarData.merge( + VarData.from_state(state, self._js_expr), self._var_data + ), ).guess_type() def __eq__(self, other: Var | Any) -> BooleanVar: @@ -1706,12 +1738,18 @@ class ComputedVar(Var[RETURN_TYPE]): while self._js_expr in state_where_defined.inherited_vars: state_where_defined = state_where_defined.get_parent_state() - return self._replace( - _js_expr=format_state_name(state_where_defined.get_full_name()) + field_name = ( + format_state_name(state_where_defined.get_full_name()) + "." - + self._js_expr, - merge_var_data=VarData.from_state(state_where_defined), - ).guess_type() + + self._js_expr + ) + + return dispatch( + field_name, + var_data=VarData.from_state(state_where_defined, self._js_expr), + result_var_type=self._var_type, + existing_var=self, + ) if not self._cache: return self.fget(instance) @@ -2339,6 +2377,9 @@ class VarData: # The name of the enclosing state. state: str = dataclasses.field(default="") + # The name of the field in the state. + field_name: str = dataclasses.field(default="") + # Imports needed to render this var imports: ImmutableParsedImportDict = dataclasses.field(default_factory=tuple) @@ -2348,6 +2389,7 @@ class VarData: def __init__( self, state: str = "", + field_name: str = "", imports: ImportDict | ParsedImportDict | None = None, hooks: dict[str, None] | None = None, ): @@ -2355,6 +2397,7 @@ class VarData: Args: state: The name of the enclosing state. + field_name: The name of the field in the state. imports: Imports needed to render this var. hooks: Hooks that need to be present in the component to render this var. """ @@ -2364,6 +2407,7 @@ class VarData: ) ) object.__setattr__(self, "state", state) + object.__setattr__(self, "field_name", field_name) object.__setattr__(self, "imports", immutable_imports) object.__setattr__(self, "hooks", tuple(hooks or {})) @@ -2386,12 +2430,14 @@ class VarData: The merged var data object. """ state = "" + field_name = "" _imports = {} hooks = {} for var_data in others: if var_data is None: continue state = state or var_data.state + field_name = field_name or var_data.field_name _imports = imports.merge_imports(_imports, var_data.imports) hooks.update( var_data.hooks @@ -2399,9 +2445,10 @@ class VarData: else {k: None for k in var_data.hooks} ) - if state or _imports or hooks: + if state or _imports or hooks or field_name: return VarData( state=state, + field_name=field_name, imports=_imports, hooks=hooks, ) @@ -2413,38 +2460,15 @@ class VarData: Returns: True if any field is set to a non-default value. """ - return bool(self.state or self.imports or self.hooks) - - def __eq__(self, other: Any) -> bool: - """Check if two var data objects are equal. - - Args: - other: The other var data object to compare. - - Returns: - True if all fields are equal and collapsed imports are equal. - """ - if not isinstance(other, VarData): - return False - - # Don't compare interpolations - that's added in by the decoder, and - # not part of the vardata itself. - return ( - self.state == other.state - and self.hooks - == ( - other.hooks if isinstance(other, VarData) else tuple(other.hooks.keys()) - ) - and imports.collapse_imports(self.imports) - == imports.collapse_imports(other.imports) - ) + return bool(self.state or self.imports or self.hooks or self.field_name) @classmethod - def from_state(cls, state: Type[BaseState] | str) -> VarData: + def from_state(cls, state: Type[BaseState] | str, field_name: str = "") -> VarData: """Set the state of the var. Args: state: The state to set or the full name of the state. + field_name: The name of the field in the state. Optional. Returns: The var with the set state. @@ -2452,8 +2476,9 @@ class VarData: from reflex.utils import format state_name = state if isinstance(state, str) else state.get_full_name() - new_var_data = VarData( + return VarData( state=state_name, + field_name=field_name, hooks={ "const {0} = useContext(StateContexts.{0})".format( format.format_state_name(state_name) @@ -2464,7 +2489,6 @@ class VarData: "react": [ImportVar(tag="useContext")], }, ) - return new_var_data def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: @@ -2561,3 +2585,238 @@ REPLACED_NAMES = { "set_state": "_var_set_state", "deps": "_deps", } + + +dispatchers: Dict[GenericType, Callable[[Var], Var]] = {} + + +def transform(fn: Callable[[Var], Var]) -> Callable[[Var], Var]: + """Register a function to transform a Var. + + Args: + fn: The function to register. + + Returns: + The decorator. + + Raises: + TypeError: If the return type of the function is not a Var. + TypeError: If the Var return type does not have a generic type. + ValueError: If a function for the generic type is already registered. + """ + return_type = fn.__annotations__["return"] + + origin = get_origin(return_type) + + if origin is not Var: + raise TypeError( + f"Expected return type of {fn.__name__} to be a Var, got {origin}." + ) + + generic_args = get_args(return_type) + + if not generic_args: + raise TypeError( + f"Expected Var return type of {fn.__name__} to have a generic type." + ) + + generic_type = get_origin(generic_args[0]) or generic_args[0] + + if generic_type in dispatchers: + raise ValueError(f"Function for {generic_type} already registered.") + + dispatchers[generic_type] = fn + + return fn + + +def generic_type_to_actual_type_map( + generic_type: GenericType, actual_type: GenericType +) -> Dict[TypeVar, GenericType]: + """Map the generic type to the actual type. + + Args: + generic_type: The generic type. + actual_type: The actual type. + + Returns: + The mapping of type variables to actual types. + + Raises: + TypeError: If the generic type and actual type do not match. + TypeError: If the number of generic arguments and actual arguments do not match. + """ + generic_origin = get_origin(generic_type) or generic_type + actual_origin = get_origin(actual_type) or actual_type + + if generic_origin is not actual_origin: + if isinstance(generic_origin, TypeVar): + return {generic_origin: actual_origin} + raise TypeError( + f"Type mismatch: expected {generic_origin}, got {actual_origin}." + ) + + generic_args = get_args(generic_type) + actual_args = get_args(actual_type) + + if len(generic_args) != len(actual_args): + raise TypeError( + f"Number of generic arguments mismatch: expected {len(generic_args)}, got {len(actual_args)}." + ) + + # call recursively for nested generic types and merge the results + return { + k: v + for generic_arg, actual_arg in zip(generic_args, actual_args) + for k, v in generic_type_to_actual_type_map(generic_arg, actual_arg).items() + } + + +def resolve_generic_type_with_mapping( + generic_type: GenericType, type_mapping: Dict[TypeVar, GenericType] +): + """Resolve a generic type with a type mapping. + + Args: + generic_type: The generic type. + type_mapping: The type mapping. + + Returns: + The resolved generic type. + """ + if isinstance(generic_type, TypeVar): + return type_mapping.get(generic_type, generic_type) + + generic_origin = get_origin(generic_type) or generic_type + + generic_args = get_args(generic_type) + + if not generic_args: + return generic_type + + mapping_for_older_python = { + list: List, + set: Set, + dict: Dict, + tuple: Tuple, + frozenset: FrozenSet, + } + + return mapping_for_older_python.get(generic_origin, generic_origin)[ + tuple( + resolve_generic_type_with_mapping(arg, type_mapping) for arg in generic_args + ) + ] + + +def resolve_arg_type_from_return_type( + arg_type: GenericType, return_type: GenericType, actual_return_type: GenericType +) -> GenericType: + """Resolve the argument type from the return type. + + Args: + arg_type: The argument type. + return_type: The return type. + actual_return_type: The requested return type. + + Returns: + The argument type without the generics that are resolved. + """ + return resolve_generic_type_with_mapping( + arg_type, generic_type_to_actual_type_map(return_type, actual_return_type) + ) + + +def dispatch( + field_name: str, + var_data: VarData, + result_var_type: GenericType, + existing_var: Var | None = None, +) -> Var: + """Dispatch a Var to the appropriate transformation function. + + Args: + field_name: The name of the field. + var_data: The VarData associated with the Var. + result_var_type: The type of the Var. + existing_var: The existing Var to transform. Optional. + + Returns: + The transformed Var. + + Raises: + TypeError: If the return type of the function is not a Var. + TypeError: If the Var return type does not have a generic type. + TypeError: If the first argument of the function is not a Var. + TypeError: If the first argument of the function does not have a generic type + """ + result_origin_var_type = get_origin(result_var_type) or result_var_type + + if result_origin_var_type in dispatchers: + fn = dispatchers[result_origin_var_type] + fn_first_arg_type = list(inspect.signature(fn).parameters.values())[ + 0 + ].annotation + + fn_return = inspect.signature(fn).return_annotation + + fn_return_origin = get_origin(fn_return) or fn_return + + if fn_return_origin is not Var: + raise TypeError( + f"Expected return type of {fn.__name__} to be a Var, got {fn_return}." + ) + + fn_return_generic_args = get_args(fn_return) + + if not fn_return_generic_args: + raise TypeError(f"Expected generic type of {fn_return} to be a type.") + + arg_origin = get_origin(fn_first_arg_type) or fn_first_arg_type + + if arg_origin is not Var: + raise TypeError( + f"Expected first argument of {fn.__name__} to be a Var, got {fn_first_arg_type}." + ) + + arg_generic_args = get_args(fn_first_arg_type) + + if not arg_generic_args: + raise TypeError( + f"Expected generic type of {fn_first_arg_type} to be a type." + ) + + arg_type = arg_generic_args[0] + fn_return_type = fn_return_generic_args[0] + + var = ( + Var( + field_name, + _var_data=var_data, + _var_type=resolve_arg_type_from_return_type( + arg_type, fn_return_type, result_var_type + ), + ).guess_type() + if existing_var is None + else existing_var._replace( + _var_type=resolve_arg_type_from_return_type( + arg_type, fn_return_type, result_var_type + ), + _var_data=var_data, + _js_expr=field_name, + ).guess_type() + ) + + return fn(var) + + if existing_var is not None: + return existing_var._replace( + _js_expr=field_name, + _var_data=var_data, + _var_type=result_var_type, + ).guess_type() + return Var( + field_name, + _var_data=var_data, + _var_type=result_var_type, + ).guess_type() diff --git a/tests/components/datadisplay/test_code.py b/tests/components/datadisplay/test_code.py index 000ae2d26..809c68fe5 100644 --- a/tests/components/datadisplay/test_code.py +++ b/tests/components/datadisplay/test_code.py @@ -1,10 +1,11 @@ import pytest -from reflex.components.datadisplay.code import CodeBlock +from reflex.components.datadisplay.code import CodeBlock, Theme @pytest.mark.parametrize( - "theme, expected", [("light", '"one-light"'), ("dark", '"one-dark"')] + "theme, expected", + [(Theme.one_light, "oneLight"), (Theme.one_dark, "oneDark")], ) def test_code_light_dark_theme(theme, expected): code_block = CodeBlock.create(theme=theme) diff --git a/tests/test_state.py b/tests/test_state.py index d12727615..21584fff9 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -2520,7 +2520,7 @@ def test_json_dumps_with_mutables(): items: List[Foo] = [Foo()] dict_val = MutableContainsBase().dict() - assert isinstance(dict_val[MutableContainsBase.get_full_name()]["items"][0], dict) + assert isinstance(dict_val[MutableContainsBase.get_full_name()]["items"][0], Foo) val = json_dumps(dict_val) f_items = '[{"tags": ["123", "456"]}]' f_formatted_router = str(formatted_router).replace("'", '"') diff --git a/tests/test_var.py b/tests/test_var.py index 90bf3ee05..5cd816c9b 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -6,6 +6,7 @@ from typing import Dict, List, Optional, Set, Tuple, Union, cast import pytest from pandas import DataFrame +import reflex as rx from reflex.base import Base from reflex.constants.base import REFLEX_VAR_CLOSING_TAG, REFLEX_VAR_OPENING_TAG from reflex.state import BaseState @@ -1052,6 +1053,29 @@ def test_object_operations(): ) +def test_var_component(): + class ComponentVarState(rx.State): + field_var: rx.Component = rx.text("I am a field var") + + @rx.var + def computed_var(self) -> rx.Component: + return rx.text("I am a computed var") + + def has_eval_react_component(var: Var): + var_data = var._get_all_var_data() + assert var_data is not None + assert any( + any( + imported_object.name == "evalReactComponent" + for imported_object in imported_objects + ) + for _, imported_objects in var_data.imports + ) + + has_eval_react_component(ComponentVarState.field_var) # type: ignore + has_eval_react_component(ComponentVarState.computed_var) + + def test_type_chains(): object_var = LiteralObjectVar.create({"a": 1, "b": 2, "c": 3}) assert (object_var._key_type(), object_var._value_type()) == (str, int) From a5d73654fc100131f337ee5a9435701738a5f47f Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 19 Sep 2024 19:07:09 -0700 Subject: [PATCH 040/201] use serializer before serializing base yourself (#3960) --- reflex/vars/base.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 9fac6fd1f..4faa38be7 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1074,6 +1074,20 @@ class LiteralVar(Var): if isinstance(value, EventHandler): return Var(_js_expr=".".join(filter(None, get_event_handler_parts(value)))) + serialized_value = serializers.serialize(value) + if serialized_value is not None: + if isinstance(serialized_value, dict): + return LiteralObjectVar.create( + serialized_value, + _var_type=type(value), + _var_data=_var_data, + ) + if isinstance(serialized_value, str): + return LiteralStringVar.create( + serialized_value, _var_type=type(value), _var_data=_var_data + ) + return LiteralVar.create(serialized_value, _var_data=_var_data) + if isinstance(value, Base): # get the fields of the pydantic class fields = value.__fields__.keys() @@ -1089,20 +1103,6 @@ class LiteralVar(Var): _var_data=_var_data, ) - serialized_value = serializers.serialize(value) - if serialized_value is not None: - if isinstance(serialized_value, dict): - return LiteralObjectVar.create( - serialized_value, - _var_type=type(value), - _var_data=_var_data, - ) - if isinstance(serialized_value, str): - return LiteralStringVar.create( - serialized_value, _var_type=type(value), _var_data=_var_data - ) - return LiteralVar.create(serialized_value, _var_data=_var_data) - if dataclasses.is_dataclass(value) and not isinstance(value, type): return LiteralObjectVar.create( { From d4cd5121447dbf7936f24cc7cfdf5059e0a2b84c Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 19 Sep 2024 19:08:00 -0700 Subject: [PATCH 041/201] Add shim for `format_event_chain` (#3958) Allow `format_event_chain` to continue working until 0.7.0 to allow third party component wraps to adapt. --- reflex/utils/format.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/reflex/utils/format.py b/reflex/utils/format.py index c804b2946..86b4d96c9 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -10,6 +10,7 @@ from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union from reflex import constants from reflex.utils import exceptions, types +from reflex.utils.console import deprecate if TYPE_CHECKING: from reflex.components.component import ComponentStyle @@ -502,6 +503,37 @@ if TYPE_CHECKING: from reflex.vars import Var +def format_event_chain( + event_chain: EventChain | Var[EventChain], + event_arg: Var | None = None, +) -> str: + """DEPRECATED: format an event chain as a javascript invocation. + + Use str(rx.Var.create(event_chain)) instead. + + Args: + event_chain: The event chain to format. + event_arg: this argument is ignored. + + Returns: + Compiled javascript code to queue the given event chain on the frontend. + """ + deprecate( + feature_name="format_event_chain", + reason="Use str(rx.Var.create(event_chain)) instead", + deprecation_version="0.6.0", + removal_version="0.7.0", + ) + + from reflex.vars import Var + from reflex.vars.function import ArgsFunctionOperation + + result = Var.create(event_chain) + if isinstance(result, ArgsFunctionOperation): + result = result._return_expr + return str(result) + + def format_queue_events( events: ( EventSpec From 456672149b781ad42ce046561f3e2a9a860efd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Fri, 20 Sep 2024 04:08:23 +0200 Subject: [PATCH 042/201] use current version as default for new custom components (#3957) --- .../.templates/jinja/custom_components/pyproject.toml.jinja2 | 2 +- reflex/custom_components/custom_components.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 index e70a835a5..1bc1d53c3 100644 --- a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +++ b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 @@ -12,7 +12,7 @@ requires-python = ">=3.8" authors = [{ name = "", email = "YOUREMAIL@domain.com" }] keywords = ["reflex","reflex-custom-components"] -dependencies = ["reflex>=0.4.2"] +dependencies = ["reflex>={{ reflex_version }}"] classifiers = ["Development Status :: 4 - Beta"] diff --git a/reflex/custom_components/custom_components.py b/reflex/custom_components/custom_components.py index a47de6feb..e6957f8fd 100644 --- a/reflex/custom_components/custom_components.py +++ b/reflex/custom_components/custom_components.py @@ -65,7 +65,9 @@ def _create_package_config(module_name: str, package_name: str): with open(CustomComponents.PYPROJECT_TOML, "w") as f: f.write( templates.CUSTOM_COMPONENTS_PYPROJECT_TOML.render( - module_name=module_name, package_name=package_name + module_name=module_name, + package_name=package_name, + reflex_version=constants.Reflex.VERSION, ) ) From fe1833c5e16695c715a9895d7bed5e4165c6bc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Fri, 20 Sep 2024 18:52:29 +0200 Subject: [PATCH 043/201] bump python>=3.10 for 0.6.0 (#3956) --- .github/workflows/benchmarks.yml | 16 +- .github/workflows/integration_app_harness.yml | 2 +- .github/workflows/integration_tests.yml | 11 +- .github/workflows/integration_tests_wsl.yml | 4 +- .github/workflows/unit_tests.yml | 10 +- CONTRIBUTING.md | 2 +- README.md | 2 +- docs/de/README.md | 2 +- docs/es/README.md | 2 +- docs/in/README.md | 2 +- docs/it/README.md | 2 +- docs/kr/README.md | 2 +- docs/pe/README.md | 2 +- docs/pt/pt_br/README.md | 2 +- docs/tr/README.md | 2 +- docs/zh/zh_tw/README.md | 2 +- integration/init-test/Dockerfile | 2 +- poetry.lock | 555 +++++++----------- pyproject.toml | 15 +- .../custom_components/pyproject.toml.jinja2 | 2 +- reflex/app.py | 8 +- reflex/components/core/breakpoints.py | 4 +- reflex/event.py | 4 +- reflex/state.py | 1 + reflex/utils/telemetry.py | 2 +- reflex/utils/types.py | 2 +- tests/compiler/test_compiler.py | 2 +- tests/components/test_component.py | 2 + tests/test_var.py | 3 + 29 files changed, 247 insertions(+), 420 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index b849dd328..0971c728b 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -81,19 +81,11 @@ jobs: matrix: # Show OS combos first in GUI os: [ubuntu-latest, windows-latest, macos-12] - python-version: ['3.8.18', '3.9.18', '3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.10.13', '3.11.5', '3.12.0'] exclude: - os: windows-latest python-version: '3.10.13' - - os: windows-latest - python-version: '3.9.18' - - os: windows-latest - python-version: '3.8.18' # keep only one python version for MacOS - - os: macos-latest - python-version: '3.8.18' - - os: macos-latest - python-version: '3.9.18' - os: macos-latest python-version: '3.10.13' - os: macos-12 @@ -101,11 +93,7 @@ jobs: include: - os: windows-latest python-version: '3.10.11' - - os: windows-latest - python-version: '3.9.13' - - os: windows-latest - python-version: '3.8.10' - + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/integration_app_harness.yml b/.github/workflows/integration_app_harness.yml index e92fdb6d0..93412aa71 100644 --- a/.github/workflows/integration_app_harness.yml +++ b/.github/workflows/integration_app_harness.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: state_manager: ['redis', 'memory'] - python-version: ['3.8.18', '3.11.5', '3.12.0'] + python-version: ['3.11.5', '3.12.0'] runs-on: ubuntu-latest services: # Label used to access the service container diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 58f7a668a..289a7b2f1 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -43,21 +43,14 @@ jobs: matrix: # Show OS combos first in GUI os: [ubuntu-latest, windows-latest, macos-12] - python-version: ['3.8.18', '3.9.18', '3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.10.13', '3.11.5', '3.12.0'] exclude: - os: windows-latest python-version: '3.10.13' - - os: windows-latest - python-version: '3.9.18' - - os: windows-latest - python-version: '3.8.18' include: - os: windows-latest python-version: '3.10.11' - - os: windows-latest - python-version: '3.9.13' - - os: windows-latest - python-version: '3.8.10' + runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/integration_tests_wsl.yml b/.github/workflows/integration_tests_wsl.yml index 6750fcd46..ea62268b1 100644 --- a/.github/workflows/integration_tests_wsl.yml +++ b/.github/workflows/integration_tests_wsl.yml @@ -37,13 +37,15 @@ jobs: path: reflex-examples - uses: Vampire/setup-wsl@v3 + with: + distribution: Ubuntu-24.04 - name: Install Python shell: wsl-bash {0} run: | apt update apt install -y python3 python3-pip curl dos2unix zip unzip - + - name: Install Poetry shell: wsl-bash {0} run: | diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f49a9b279..f15434193 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -28,22 +28,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-12] - python-version: ['3.8.18', '3.9.18', '3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.10.13', '3.11.5', '3.12.0'] # Windows is a bit behind on Python version availability in Github exclude: - os: windows-latest python-version: '3.10.13' - - os: windows-latest - python-version: '3.9.18' - - os: windows-latest - python-version: '3.8.18' include: - os: windows-latest python-version: '3.10.11' - - os: windows-latest - python-version: '3.9.13' - - os: windows-latest - python-version: '3.8.10' runs-on: ${{ matrix.os }} # Service containers to run with `runner-job` services: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e57c0a249..6db8e1a04 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ Here is a quick guide on how to run Reflex repo locally so you can start contrib **Prerequisites:** -- Python >= 3.8 +- Python >= 3.10 - Poetry version >= 1.4.0 and add it to your path (see [Poetry Docs](https://python-poetry.org/docs/#installation) for more info). **1. Fork this repository:** diff --git a/README.md b/README.md index f7a3e5dc8..d3f22bb54 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ See our [architecture page](https://reflex.dev/blog/2024-03-21-reflex-architectu ## ⚙️ Installation -Open a terminal and run (Requires Python 3.8+): +Open a terminal and run (Requires Python 3.10+): ```bash pip install reflex diff --git a/docs/de/README.md b/docs/de/README.md index 719940202..6d2d69e94 100644 --- a/docs/de/README.md +++ b/docs/de/README.md @@ -34,7 +34,7 @@ Auf unserer [Architektur-Seite](https://reflex.dev/blog/2024-03-21-reflex-archit ## ⚙️ Installation -Öffne ein Terminal und führe den folgenden Befehl aus (benötigt Python 3.8+): +Öffne ein Terminal und führe den folgenden Befehl aus (benötigt Python 3.10+): ```bash pip install reflex diff --git a/docs/es/README.md b/docs/es/README.md index 638f0ab88..538192e4b 100644 --- a/docs/es/README.md +++ b/docs/es/README.md @@ -35,7 +35,7 @@ Consulta nuestra [página de arquitectura](https://reflex.dev/blog/2024-03-21-re ## ⚙️ Instalación -Abra un terminal y ejecute (Requiere Python 3.8+): +Abra un terminal y ejecute (Requiere Python 3.10+): ```bash pip install reflex diff --git a/docs/in/README.md b/docs/in/README.md index e13a5563e..81b1106ff 100644 --- a/docs/in/README.md +++ b/docs/in/README.md @@ -35,7 +35,7 @@ Reflex के अंदर के कामकाज को जानने क ## ⚙️ इंस्टॉलेशन (Installation) -एक टर्मिनल खोलें और चलाएं (Python 3.8+ की आवश्यकता है): +एक टर्मिनल खोलें और चलाएं (Python 3.10+ की आवश्यकता है): ```bash pip install reflex diff --git a/docs/it/README.md b/docs/it/README.md index 8324743fc..cd6f24dd8 100644 --- a/docs/it/README.md +++ b/docs/it/README.md @@ -22,7 +22,7 @@ ## ⚙️ Installazione -Apri un terminale ed esegui (Richiede Python 3.8+): +Apri un terminale ed esegui (Richiede Python 3.10+): ```bash pip install reflex diff --git a/docs/kr/README.md b/docs/kr/README.md index 8d9e2b78e..57bb43794 100644 --- a/docs/kr/README.md +++ b/docs/kr/README.md @@ -20,7 +20,7 @@ --- ## ⚙️ 설치 -터미널을 열고 실행하세요. (Python 3.8+ 필요): +터미널을 열고 실행하세요. (Python 3.10+ 필요): ```bash pip install reflex diff --git a/docs/pe/README.md b/docs/pe/README.md index a0fb62d7a..867b543bc 100644 --- a/docs/pe/README.md +++ b/docs/pe/README.md @@ -34,7 +34,7 @@ ## ⚙️ Installation - نصب و راه اندازی -یک ترمینال را باز کنید و اجرا کنید (نیازمند Python 3.8+): +یک ترمینال را باز کنید و اجرا کنید (نیازمند Python 3.10+): ```bash pip install reflex diff --git a/docs/pt/pt_br/README.md b/docs/pt/pt_br/README.md index 6ac919bdc..8abfaebde 100644 --- a/docs/pt/pt_br/README.md +++ b/docs/pt/pt_br/README.md @@ -21,7 +21,7 @@ --- ## ⚙️ Instalação -Abra um terminal e execute (Requer Python 3.8+): +Abra um terminal e execute (Requer Python 3.10+): ```bash pip install reflex diff --git a/docs/tr/README.md b/docs/tr/README.md index 1e2be7d54..afb8ae5b9 100644 --- a/docs/tr/README.md +++ b/docs/tr/README.md @@ -24,7 +24,7 @@ ## ⚙️ Kurulum -Bir terminal açın ve çalıştırın (Python 3.8+ gerekir): +Bir terminal açın ve çalıştırın (Python 3.10+ gerekir): ```bash pip install reflex diff --git a/docs/zh/zh_tw/README.md b/docs/zh/zh_tw/README.md index 99603099e..6161e17d0 100644 --- a/docs/zh/zh_tw/README.md +++ b/docs/zh/zh_tw/README.md @@ -36,7 +36,7 @@ Reflex 是一個可以用純 Python 構建全端網頁應用程式的函式庫 ## ⚙️ 安裝 -開啟一個終端機並且執行 (需要 Python 3.8+): +開啟一個終端機並且執行 (需要 Python 3.10+): ```bash pip install reflex diff --git a/integration/init-test/Dockerfile b/integration/init-test/Dockerfile index aa11344b1..e5d2a0820 100644 --- a/integration/init-test/Dockerfile +++ b/integration/init-test/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8 +FROM python:3.10 ARG USERNAME=kerrigan RUN useradd -m $USERNAME diff --git a/poetry.lock b/poetry.lock index eef29eb51..d3a63110b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -12,8 +12,6 @@ files = [ ] [package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.9\""} -importlib-resources = {version = "*", markers = "python_version < \"3.9\""} Mako = "*" SQLAlchemy = ">=1.3.0" typing-extensions = ">=4" @@ -32,18 +30,15 @@ files = [ {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - [[package]] name = "anyio" -version = "4.4.0" +version = "4.5.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" files = [ - {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, - {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, + {file = "anyio-4.5.0-py3-none-any.whl", hash = "sha256:fdeb095b7cc5a5563175eedd926ec4ae55413bb4be5770c424af0ba46ccb4a78"}, + {file = "anyio-4.5.0.tar.gz", hash = "sha256:c5a275fe5ca0afd788001f58fca1e69e29ce706d746e317d660e21f70c530ef9"}, ] [package.dependencies] @@ -53,9 +48,9 @@ sniffio = ">=1.1" typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] -doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] -trio = ["trio (>=0.23)"] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.21.0b1)"] +trio = ["trio (>=0.26.1)"] [[package]] name = "async-timeout" @@ -560,11 +555,14 @@ files = [ [[package]] name = "docutils" -version = "0.20.1" +version = "0.21.2" description = "Docutils -- Python Documentation Utilities" optional = false -python-versions = "*" -files = [] +python-versions = ">=3.9" +files = [ + {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, + {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, +] [[package]] name = "exceptiongroup" @@ -582,13 +580,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.114.1" +version = "0.115.0" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.114.1-py3-none-any.whl", hash = "sha256:5d4746f6e4b7dff0b4f6b6c6d5445645285f662fe75886e99af7ee2d6b58bb3e"}, - {file = "fastapi-0.114.1.tar.gz", hash = "sha256:1d7bbbeabbaae0acb0c22f0ab0b040f642d3093ca3645f8c876b6f91391861d8"}, + {file = "fastapi-0.115.0-py3-none-any.whl", hash = "sha256:17ea427674467486e997206a5ab25760f6b09e069f099b96f5b55a32fb6f1631"}, + {file = "fastapi-0.115.0.tar.gz", hash = "sha256:f93b4ca3529a8ebc6fc3fcf710e5efa8de3df9b41570958abf1d97d843138004"}, ] [package.dependencies] @@ -602,18 +600,18 @@ standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "htt [[package]] name = "filelock" -version = "3.16.0" +version = "3.16.1" description = "A platform independent file lock." optional = false python-versions = ">=3.8" files = [ - {file = "filelock-3.16.0-py3-none-any.whl", hash = "sha256:f6ed4c963184f4c84dd5557ce8fece759a3724b37b80c6c4f20a2f63a4dc6609"}, - {file = "filelock-3.16.0.tar.gz", hash = "sha256:81de9eb8453c769b63369f87f11131a7ab04e367f8d97ad39dc230daa07e3bec"}, + {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, + {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, ] [package.extras] -docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.1.1)", "pytest (>=8.3.2)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.3)"] +docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4.1)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"] typing = ["typing-extensions (>=4.12.2)"] [[package]] @@ -775,13 +773,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "identify" -version = "2.6.0" +version = "2.6.1" description = "File identification library for Python" optional = false python-versions = ">=3.8" files = [ - {file = "identify-2.6.0-py2.py3-none-any.whl", hash = "sha256:e79ae4406387a9d300332b5fd366d8994f1525e8414984e1a59e058b2eda2dd0"}, - {file = "identify-2.6.0.tar.gz", hash = "sha256:cb171c685bdc31bcc4c1734698736a7d5b6c8bf2e0c15117f4d469c8640ae5cf"}, + {file = "identify-2.6.1-py2.py3-none-any.whl", hash = "sha256:53863bcac7caf8d2ed85bd20312ea5dcfc22226800f6d6881f232d861db5a8f0"}, + {file = "identify-2.6.1.tar.gz", hash = "sha256:91478c5fb7c3aac5ff7bf9b4344f803843dc586832d5f110d672b19aa1984c98"}, ] [package.extras] @@ -789,15 +787,18 @@ license = ["ukkonen"] [[package]] name = "idna" -version = "3.8" +version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" files = [ - {file = "idna-3.8-py3-none-any.whl", hash = "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac"}, - {file = "idna-3.8.tar.gz", hash = "sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603"}, + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, ] +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + [[package]] name = "importlib-metadata" version = "8.5.0" @@ -821,28 +822,6 @@ perf = ["ipython"] test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] type = ["pytest-mypy"] -[[package]] -name = "importlib-resources" -version = "6.4.5" -description = "Read resources from Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "importlib_resources-6.4.5-py3-none-any.whl", hash = "sha256:ac29d5f956f01d5e4bb63102a5a19957f1b9175e45649977264a1416783bb717"}, - {file = "importlib_resources-6.4.5.tar.gz", hash = "sha256:980862a1d16c9e147a59603677fa2aa5fd82b87f223b6cb870695bcfce830065"}, -] - -[package.dependencies] -zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} - -[package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] -cover = ["pytest-cov"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -enabler = ["pytest-enabler (>=2.2)"] -test = ["jaraco.test (>=5.4)", "pytest (>=6,!=8.1.*)", "zipp (>=3.17)"] -type = ["pytest-mypy"] - [[package]] name = "iniconfig" version = "2.0.0" @@ -942,18 +921,17 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "keyring" -version = "25.3.0" +version = "25.4.0" description = "Store and access your passwords safely." optional = false python-versions = ">=3.8" files = [ - {file = "keyring-25.3.0-py3-none-any.whl", hash = "sha256:8d963da00ccdf06e356acd9bf3b743208878751032d8599c6cc89eb51310ffae"}, - {file = "keyring-25.3.0.tar.gz", hash = "sha256:8d85a1ea5d6db8515b59e1c5d1d1678b03cf7fc8b8dcfb1651e8c4a524eb42ef"}, + {file = "keyring-25.4.0-py3-none-any.whl", hash = "sha256:a2a630d5c9bef5d3f0968d15ef4e42b894a83e17494edcb67b154c36491c9920"}, + {file = "keyring-25.4.0.tar.gz", hash = "sha256:ae8263fd9264c94f91ad82d098f8a5bb1b7fa71ce0a72388dc4fc0be3f6a034e"}, ] [package.dependencies] importlib-metadata = {version = ">=4.11.4", markers = "python_version < \"3.12\""} -importlib-resources = {version = "*", markers = "python_version < \"3.9\""} "jaraco.classes" = "*" "jaraco.context" = "*" "jaraco.functools" = "*" @@ -962,9 +940,13 @@ pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""} [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] completion = ["shtab (>=1.1.0)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["pyfakefs", "pytest (>=6,!=8.1.*)"] +type = ["pygobject-stubs", "pytest-mypy", "shtab", "types-pywin32"] [[package]] name = "lazy-loader" @@ -1155,97 +1137,6 @@ files = [ {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, ] -[[package]] -name = "numpy" -version = "1.24.4" -description = "Fundamental package for array computing in Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "numpy-1.24.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c0bfb52d2169d58c1cdb8cc1f16989101639b34c7d3ce60ed70b19c63eba0b64"}, - {file = "numpy-1.24.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ed094d4f0c177b1b8e7aa9cba7d6ceed51c0e569a5318ac0ca9a090680a6a1b1"}, - {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79fc682a374c4a8ed08b331bef9c5f582585d1048fa6d80bc6c35bc384eee9b4"}, - {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ffe43c74893dbf38c2b0a1f5428760a1a9c98285553c89e12d70a96a7f3a4d6"}, - {file = "numpy-1.24.4-cp310-cp310-win32.whl", hash = "sha256:4c21decb6ea94057331e111a5bed9a79d335658c27ce2adb580fb4d54f2ad9bc"}, - {file = "numpy-1.24.4-cp310-cp310-win_amd64.whl", hash = "sha256:b4bea75e47d9586d31e892a7401f76e909712a0fd510f58f5337bea9572c571e"}, - {file = "numpy-1.24.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f136bab9c2cfd8da131132c2cf6cc27331dd6fae65f95f69dcd4ae3c3639c810"}, - {file = "numpy-1.24.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2926dac25b313635e4d6cf4dc4e51c8c0ebfed60b801c799ffc4c32bf3d1254"}, - {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:222e40d0e2548690405b0b3c7b21d1169117391c2e82c378467ef9ab4c8f0da7"}, - {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7215847ce88a85ce39baf9e89070cb860c98fdddacbaa6c0da3ffb31b3350bd5"}, - {file = "numpy-1.24.4-cp311-cp311-win32.whl", hash = "sha256:4979217d7de511a8d57f4b4b5b2b965f707768440c17cb70fbf254c4b225238d"}, - {file = "numpy-1.24.4-cp311-cp311-win_amd64.whl", hash = "sha256:b7b1fc9864d7d39e28f41d089bfd6353cb5f27ecd9905348c24187a768c79694"}, - {file = "numpy-1.24.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1452241c290f3e2a312c137a9999cdbf63f78864d63c79039bda65ee86943f61"}, - {file = "numpy-1.24.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:04640dab83f7c6c85abf9cd729c5b65f1ebd0ccf9de90b270cd61935eef0197f"}, - {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5425b114831d1e77e4b5d812b69d11d962e104095a5b9c3b641a218abcc050e"}, - {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd80e219fd4c71fc3699fc1dadac5dcf4fd882bfc6f7ec53d30fa197b8ee22dc"}, - {file = "numpy-1.24.4-cp38-cp38-win32.whl", hash = "sha256:4602244f345453db537be5314d3983dbf5834a9701b7723ec28923e2889e0bb2"}, - {file = "numpy-1.24.4-cp38-cp38-win_amd64.whl", hash = "sha256:692f2e0f55794943c5bfff12b3f56f99af76f902fc47487bdfe97856de51a706"}, - {file = "numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2541312fbf09977f3b3ad449c4e5f4bb55d0dbf79226d7724211acc905049400"}, - {file = "numpy-1.24.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9667575fb6d13c95f1b36aca12c5ee3356bf001b714fc354eb5465ce1609e62f"}, - {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3a86ed21e4f87050382c7bc96571755193c4c1392490744ac73d660e8f564a9"}, - {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d11efb4dbecbdf22508d55e48d9c8384db795e1b7b51ea735289ff96613ff74d"}, - {file = "numpy-1.24.4-cp39-cp39-win32.whl", hash = "sha256:6620c0acd41dbcb368610bb2f4d83145674040025e5536954782467100aa8835"}, - {file = "numpy-1.24.4-cp39-cp39-win_amd64.whl", hash = "sha256:befe2bf740fd8373cf56149a5c23a0f601e82869598d41f8e188a0e9869926f8"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:31f13e25b4e304632a4619d0e0777662c2ffea99fcae2029556b17d8ff958aef"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95f7ac6540e95bc440ad77f56e520da5bf877f87dca58bd095288dce8940532a"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e98f220aa76ca2a977fe435f5b04d7b3470c0a2e6312907b37ba6068f26787f2"}, - {file = "numpy-1.24.4.tar.gz", hash = "sha256:80f5e3a4e498641401868df4208b74581206afbee7cf7b8329daae82676d9463"}, -] - -[[package]] -name = "numpy" -version = "2.0.2" -description = "Fundamental package for array computing in Python" -optional = false -python-versions = ">=3.9" -files = [ - {file = "numpy-2.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:51129a29dbe56f9ca83438b706e2e69a39892b5eda6cedcb6b0c9fdc9b0d3ece"}, - {file = "numpy-2.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f15975dfec0cf2239224d80e32c3170b1d168335eaedee69da84fbe9f1f9cd04"}, - {file = "numpy-2.0.2-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:8c5713284ce4e282544c68d1c3b2c7161d38c256d2eefc93c1d683cf47683e66"}, - {file = "numpy-2.0.2-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:becfae3ddd30736fe1889a37f1f580e245ba79a5855bff5f2a29cb3ccc22dd7b"}, - {file = "numpy-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2da5960c3cf0df7eafefd806d4e612c5e19358de82cb3c343631188991566ccd"}, - {file = "numpy-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:496f71341824ed9f3d2fd36cf3ac57ae2e0165c143b55c3a035ee219413f3318"}, - {file = "numpy-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a61ec659f68ae254e4d237816e33171497e978140353c0c2038d46e63282d0c8"}, - {file = "numpy-2.0.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d731a1c6116ba289c1e9ee714b08a8ff882944d4ad631fd411106a30f083c326"}, - {file = "numpy-2.0.2-cp310-cp310-win32.whl", hash = "sha256:984d96121c9f9616cd33fbd0618b7f08e0cfc9600a7ee1d6fd9b239186d19d97"}, - {file = "numpy-2.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:c7b0be4ef08607dd04da4092faee0b86607f111d5ae68036f16cc787e250a131"}, - {file = "numpy-2.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:49ca4decb342d66018b01932139c0961a8f9ddc7589611158cb3c27cbcf76448"}, - {file = "numpy-2.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:11a76c372d1d37437857280aa142086476136a8c0f373b2e648ab2c8f18fb195"}, - {file = "numpy-2.0.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:807ec44583fd708a21d4a11d94aedf2f4f3c3719035c76a2bbe1fe8e217bdc57"}, - {file = "numpy-2.0.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:8cafab480740e22f8d833acefed5cc87ce276f4ece12fdaa2e8903db2f82897a"}, - {file = "numpy-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a15f476a45e6e5a3a79d8a14e62161d27ad897381fecfa4a09ed5322f2085669"}, - {file = "numpy-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13e689d772146140a252c3a28501da66dfecd77490b498b168b501835041f951"}, - {file = "numpy-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9ea91dfb7c3d1c56a0e55657c0afb38cf1eeae4544c208dc465c3c9f3a7c09f9"}, - {file = "numpy-2.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c1c9307701fec8f3f7a1e6711f9089c06e6284b3afbbcd259f7791282d660a15"}, - {file = "numpy-2.0.2-cp311-cp311-win32.whl", hash = "sha256:a392a68bd329eafac5817e5aefeb39038c48b671afd242710b451e76090e81f4"}, - {file = "numpy-2.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:286cd40ce2b7d652a6f22efdfc6d1edf879440e53e76a75955bc0c826c7e64dc"}, - {file = "numpy-2.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:df55d490dea7934f330006d0f81e8551ba6010a5bf035a249ef61a94f21c500b"}, - {file = "numpy-2.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8df823f570d9adf0978347d1f926b2a867d5608f434a7cff7f7908c6570dcf5e"}, - {file = "numpy-2.0.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:9a92ae5c14811e390f3767053ff54eaee3bf84576d99a2456391401323f4ec2c"}, - {file = "numpy-2.0.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:a842d573724391493a97a62ebbb8e731f8a5dcc5d285dfc99141ca15a3302d0c"}, - {file = "numpy-2.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c05e238064fc0610c840d1cf6a13bf63d7e391717d247f1bf0318172e759e692"}, - {file = "numpy-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0123ffdaa88fa4ab64835dcbde75dcdf89c453c922f18dced6e27c90d1d0ec5a"}, - {file = "numpy-2.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:96a55f64139912d61de9137f11bf39a55ec8faec288c75a54f93dfd39f7eb40c"}, - {file = "numpy-2.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ec9852fb39354b5a45a80bdab5ac02dd02b15f44b3804e9f00c556bf24b4bded"}, - {file = "numpy-2.0.2-cp312-cp312-win32.whl", hash = "sha256:671bec6496f83202ed2d3c8fdc486a8fc86942f2e69ff0e986140339a63bcbe5"}, - {file = "numpy-2.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:cfd41e13fdc257aa5778496b8caa5e856dc4896d4ccf01841daee1d96465467a"}, - {file = "numpy-2.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9059e10581ce4093f735ed23f3b9d283b9d517ff46009ddd485f1747eb22653c"}, - {file = "numpy-2.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:423e89b23490805d2a5a96fe40ec507407b8ee786d66f7328be214f9679df6dd"}, - {file = "numpy-2.0.2-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:2b2955fa6f11907cf7a70dab0d0755159bca87755e831e47932367fc8f2f2d0b"}, - {file = "numpy-2.0.2-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:97032a27bd9d8988b9a97a8c4d2c9f2c15a81f61e2f21404d7e8ef00cb5be729"}, - {file = "numpy-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e795a8be3ddbac43274f18588329c72939870a16cae810c2b73461c40718ab1"}, - {file = "numpy-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f26b258c385842546006213344c50655ff1555a9338e2e5e02a0756dc3e803dd"}, - {file = "numpy-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fec9451a7789926bcf7c2b8d187292c9f93ea30284802a0ab3f5be8ab36865d"}, - {file = "numpy-2.0.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9189427407d88ff25ecf8f12469d4d39d35bee1db5d39fc5c168c6f088a6956d"}, - {file = "numpy-2.0.2-cp39-cp39-win32.whl", hash = "sha256:905d16e0c60200656500c95b6b8dca5d109e23cb24abc701d41c02d74c6b3afa"}, - {file = "numpy-2.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:a3f4ab0caa7f053f6797fcd4e1e25caee367db3112ef2b6ef82d749530768c73"}, - {file = "numpy-2.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:7f0a0c6f12e07fa94133c8a67404322845220c06a9e80e85999afe727f7438b8"}, - {file = "numpy-2.0.2-pp39-pypy39_pp73-macosx_14_0_x86_64.whl", hash = "sha256:312950fdd060354350ed123c0e25a71327d3711584beaef30cdaa93320c392d4"}, - {file = "numpy-2.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26df23238872200f63518dd2aa984cfca675d82469535dc7162dc2ee52d9dd5c"}, - {file = "numpy-2.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a46288ec55ebbd58947d31d72be2c63cbf839f0a63b49cb755022310792a3385"}, - {file = "numpy-2.0.2.tar.gz", hash = "sha256:883c987dee1880e2a864ab0dc9892292582510604156762362d9326444636e78"}, -] - [[package]] name = "numpy" version = "2.1.1" @@ -1333,50 +1224,6 @@ files = [ {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] -[[package]] -name = "pandas" -version = "1.5.3" -description = "Powerful data structures for data analysis, time series, and statistics" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pandas-1.5.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3749077d86e3a2f0ed51367f30bf5b82e131cc0f14260c4d3e499186fccc4406"}, - {file = "pandas-1.5.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:972d8a45395f2a2d26733eb8d0f629b2f90bebe8e8eddbb8829b180c09639572"}, - {file = "pandas-1.5.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:50869a35cbb0f2e0cd5ec04b191e7b12ed688874bd05dd777c19b28cbea90996"}, - {file = "pandas-1.5.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c3ac844a0fe00bfaeb2c9b51ab1424e5c8744f89860b138434a363b1f620f354"}, - {file = "pandas-1.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a0a56cef15fd1586726dace5616db75ebcfec9179a3a55e78f72c5639fa2a23"}, - {file = "pandas-1.5.3-cp310-cp310-win_amd64.whl", hash = "sha256:478ff646ca42b20376e4ed3fa2e8d7341e8a63105586efe54fa2508ee087f328"}, - {file = "pandas-1.5.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6973549c01ca91ec96199e940495219c887ea815b2083722821f1d7abfa2b4dc"}, - {file = "pandas-1.5.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c39a8da13cede5adcd3be1182883aea1c925476f4e84b2807a46e2775306305d"}, - {file = "pandas-1.5.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f76d097d12c82a535fda9dfe5e8dd4127952b45fea9b0276cb30cca5ea313fbc"}, - {file = "pandas-1.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e474390e60ed609cec869b0da796ad94f420bb057d86784191eefc62b65819ae"}, - {file = "pandas-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f2b952406a1588ad4cad5b3f55f520e82e902388a6d5a4a91baa8d38d23c7f6"}, - {file = "pandas-1.5.3-cp311-cp311-win_amd64.whl", hash = "sha256:bc4c368f42b551bf72fac35c5128963a171b40dce866fb066540eeaf46faa003"}, - {file = "pandas-1.5.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:14e45300521902689a81f3f41386dc86f19b8ba8dd5ac5a3c7010ef8d2932813"}, - {file = "pandas-1.5.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9842b6f4b8479e41968eced654487258ed81df7d1c9b7b870ceea24ed9459b31"}, - {file = "pandas-1.5.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:26d9c71772c7afb9d5046e6e9cf42d83dd147b5cf5bcb9d97252077118543792"}, - {file = "pandas-1.5.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5fbcb19d6fceb9e946b3e23258757c7b225ba450990d9ed63ccceeb8cae609f7"}, - {file = "pandas-1.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:565fa34a5434d38e9d250af3c12ff931abaf88050551d9fbcdfafca50d62babf"}, - {file = "pandas-1.5.3-cp38-cp38-win32.whl", hash = "sha256:87bd9c03da1ac870a6d2c8902a0e1fd4267ca00f13bc494c9e5a9020920e1d51"}, - {file = "pandas-1.5.3-cp38-cp38-win_amd64.whl", hash = "sha256:41179ce559943d83a9b4bbacb736b04c928b095b5f25dd2b7389eda08f46f373"}, - {file = "pandas-1.5.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c74a62747864ed568f5a82a49a23a8d7fe171d0c69038b38cedf0976831296fa"}, - {file = "pandas-1.5.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c4c00e0b0597c8e4f59e8d461f797e5d70b4d025880516a8261b2817c47759ee"}, - {file = "pandas-1.5.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a50d9a4336a9621cab7b8eb3fb11adb82de58f9b91d84c2cd526576b881a0c5a"}, - {file = "pandas-1.5.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd05f7783b3274aa206a1af06f0ceed3f9b412cf665b7247eacd83be41cf7bf0"}, - {file = "pandas-1.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f69c4029613de47816b1bb30ff5ac778686688751a5e9c99ad8c7031f6508e5"}, - {file = "pandas-1.5.3-cp39-cp39-win32.whl", hash = "sha256:7cec0bee9f294e5de5bbfc14d0573f65526071029d036b753ee6507d2a21480a"}, - {file = "pandas-1.5.3-cp39-cp39-win_amd64.whl", hash = "sha256:dfd681c5dc216037e0b0a2c821f5ed99ba9f03ebcf119c7dac0e9a7b960b9ec9"}, - {file = "pandas-1.5.3.tar.gz", hash = "sha256:74a3fd7e5a7ec052f183273dc7b0acd3a863edf7520f5d3a1765c04ffdb3b0b1"}, -] - -[package.dependencies] -numpy = {version = ">=1.20.3", markers = "python_version < \"3.10\""} -python-dateutil = ">=2.8.1" -pytz = ">=2020.1" - -[package.extras] -test = ["hypothesis (>=5.5.3)", "pytest (>=6.0)", "pytest-xdist (>=1.31)"] - [[package]] name = "pandas" version = "2.2.2" @@ -1417,8 +1264,8 @@ files = [ [package.dependencies] numpy = [ - {version = ">=1.23.2", markers = "python_version == \"3.11\""}, {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, + {version = ">=1.23.2", markers = "python_version == \"3.11\""}, {version = ">=1.22.4", markers = "python_version < \"3.11\""}, ] python-dateutil = ">=2.8.2" @@ -1592,13 +1439,13 @@ testing = ["pytest", "pytest-cov", "wheel"] [[package]] name = "platformdirs" -version = "4.3.2" +version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.3.2-py3-none-any.whl", hash = "sha256:eb1c8582560b34ed4ba105009a4badf7f6f85768b30126f351328507b2beb617"}, - {file = "platformdirs-4.3.2.tar.gz", hash = "sha256:9e5e27a08aa095dd127b9f2e764d74254f482fef22b0970773bfba79d091ab8c"}, + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, ] [package.extras] @@ -1638,13 +1485,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "3.5.0" +version = "3.8.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "pre_commit-3.5.0-py2.py3-none-any.whl", hash = "sha256:841dc9aef25daba9a0238cd27984041fa0467b4199fc4852e27950664919f660"}, - {file = "pre_commit-3.5.0.tar.gz", hash = "sha256:5804465c675b659b0862f07907f96295d490822a450c4c40e747d0b1c6ebcb32"}, + {file = "pre_commit-3.8.0-py2.py3-none-any.whl", hash = "sha256:9a90a53bf82fdd8778d58085faf8d83df56e40dfe18f45b19446e26bf1b3a63f"}, + {file = "pre_commit-3.8.0.tar.gz", hash = "sha256:8bb6494d4a20423842e198980c9ecf9f96607a07ea29549e180eef9ae80fe7af"}, ] [package.dependencies] @@ -1707,21 +1554,21 @@ files = [ [[package]] name = "pydantic" -version = "2.9.1" +version = "2.9.2" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.9.1-py3-none-any.whl", hash = "sha256:7aff4db5fdf3cf573d4b3c30926a510a10e19a0774d38fc4967f78beb6deb612"}, - {file = "pydantic-2.9.1.tar.gz", hash = "sha256:1363c7d975c7036df0db2b4a61f2e062fbc0aa5ab5f2772e0ffc7191a4f4bce2"}, + {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, + {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, ] [package.dependencies] annotated-types = ">=0.6.0" -pydantic-core = "2.23.3" +pydantic-core = "2.23.4" typing-extensions = [ - {version = ">=4.6.1", markers = "python_version < \"3.13\""}, {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, ] [package.extras] @@ -1730,100 +1577,100 @@ timezone = ["tzdata"] [[package]] name = "pydantic-core" -version = "2.23.3" +version = "2.23.4" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.23.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:7f10a5d1b9281392f1bf507d16ac720e78285dfd635b05737c3911637601bae6"}, - {file = "pydantic_core-2.23.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3c09a7885dd33ee8c65266e5aa7fb7e2f23d49d8043f089989726391dd7350c5"}, - {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6470b5a1ec4d1c2e9afe928c6cb37eb33381cab99292a708b8cb9aa89e62429b"}, - {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9172d2088e27d9a185ea0a6c8cebe227a9139fd90295221d7d495944d2367700"}, - {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86fc6c762ca7ac8fbbdff80d61b2c59fb6b7d144aa46e2d54d9e1b7b0e780e01"}, - {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0cb80fd5c2df4898693aa841425ea1727b1b6d2167448253077d2a49003e0ed"}, - {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03667cec5daf43ac4995cefa8aaf58f99de036204a37b889c24a80927b629cec"}, - {file = "pydantic_core-2.23.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:047531242f8e9c2db733599f1c612925de095e93c9cc0e599e96cf536aaf56ba"}, - {file = "pydantic_core-2.23.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5499798317fff7f25dbef9347f4451b91ac2a4330c6669821c8202fd354c7bee"}, - {file = "pydantic_core-2.23.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bbb5e45eab7624440516ee3722a3044b83fff4c0372efe183fd6ba678ff681fe"}, - {file = "pydantic_core-2.23.3-cp310-none-win32.whl", hash = "sha256:8b5b3ed73abb147704a6e9f556d8c5cb078f8c095be4588e669d315e0d11893b"}, - {file = "pydantic_core-2.23.3-cp310-none-win_amd64.whl", hash = "sha256:2b603cde285322758a0279995b5796d64b63060bfbe214b50a3ca23b5cee3e83"}, - {file = "pydantic_core-2.23.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:c889fd87e1f1bbeb877c2ee56b63bb297de4636661cc9bbfcf4b34e5e925bc27"}, - {file = "pydantic_core-2.23.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ea85bda3189fb27503af4c45273735bcde3dd31c1ab17d11f37b04877859ef45"}, - {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7f7f72f721223f33d3dc98a791666ebc6a91fa023ce63733709f4894a7dc611"}, - {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b2b55b0448e9da68f56b696f313949cda1039e8ec7b5d294285335b53104b61"}, - {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c24574c7e92e2c56379706b9a3f07c1e0c7f2f87a41b6ee86653100c4ce343e5"}, - {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2b05e6ccbee333a8f4b8f4d7c244fdb7a979e90977ad9c51ea31261e2085ce0"}, - {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2c409ce1c219c091e47cb03feb3c4ed8c2b8e004efc940da0166aaee8f9d6c8"}, - {file = "pydantic_core-2.23.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d965e8b325f443ed3196db890d85dfebbb09f7384486a77461347f4adb1fa7f8"}, - {file = "pydantic_core-2.23.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:f56af3a420fb1ffaf43ece3ea09c2d27c444e7c40dcb7c6e7cf57aae764f2b48"}, - {file = "pydantic_core-2.23.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5b01a078dd4f9a52494370af21aa52964e0a96d4862ac64ff7cea06e0f12d2c5"}, - {file = "pydantic_core-2.23.3-cp311-none-win32.whl", hash = "sha256:560e32f0df04ac69b3dd818f71339983f6d1f70eb99d4d1f8e9705fb6c34a5c1"}, - {file = "pydantic_core-2.23.3-cp311-none-win_amd64.whl", hash = "sha256:c744fa100fdea0d000d8bcddee95213d2de2e95b9c12be083370b2072333a0fa"}, - {file = "pydantic_core-2.23.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e0ec50663feedf64d21bad0809f5857bac1ce91deded203efc4a84b31b2e4305"}, - {file = "pydantic_core-2.23.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:db6e6afcb95edbe6b357786684b71008499836e91f2a4a1e55b840955b341dbb"}, - {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:98ccd69edcf49f0875d86942f4418a4e83eb3047f20eb897bffa62a5d419c8fa"}, - {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a678c1ac5c5ec5685af0133262103defb427114e62eafeda12f1357a12140162"}, - {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01491d8b4d8db9f3391d93b0df60701e644ff0894352947f31fff3e52bd5c801"}, - {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fcf31facf2796a2d3b7fe338fe8640aa0166e4e55b4cb108dbfd1058049bf4cb"}, - {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7200fd561fb3be06827340da066df4311d0b6b8eb0c2116a110be5245dceb326"}, - {file = "pydantic_core-2.23.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dc1636770a809dee2bd44dd74b89cc80eb41172bcad8af75dd0bc182c2666d4c"}, - {file = "pydantic_core-2.23.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:67a5def279309f2e23014b608c4150b0c2d323bd7bccd27ff07b001c12c2415c"}, - {file = "pydantic_core-2.23.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:748bdf985014c6dd3e1e4cc3db90f1c3ecc7246ff5a3cd4ddab20c768b2f1dab"}, - {file = "pydantic_core-2.23.3-cp312-none-win32.whl", hash = "sha256:255ec6dcb899c115f1e2a64bc9ebc24cc0e3ab097775755244f77360d1f3c06c"}, - {file = "pydantic_core-2.23.3-cp312-none-win_amd64.whl", hash = "sha256:40b8441be16c1e940abebed83cd006ddb9e3737a279e339dbd6d31578b802f7b"}, - {file = "pydantic_core-2.23.3-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:6daaf5b1ba1369a22c8b050b643250e3e5efc6a78366d323294aee54953a4d5f"}, - {file = "pydantic_core-2.23.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d015e63b985a78a3d4ccffd3bdf22b7c20b3bbd4b8227809b3e8e75bc37f9cb2"}, - {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3fc572d9b5b5cfe13f8e8a6e26271d5d13f80173724b738557a8c7f3a8a3791"}, - {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f6bd91345b5163ee7448bee201ed7dd601ca24f43f439109b0212e296eb5b423"}, - {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc379c73fd66606628b866f661e8785088afe2adaba78e6bbe80796baf708a63"}, - {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbdce4b47592f9e296e19ac31667daed8753c8367ebb34b9a9bd89dacaa299c9"}, - {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc3cf31edf405a161a0adad83246568647c54404739b614b1ff43dad2b02e6d5"}, - {file = "pydantic_core-2.23.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8e22b477bf90db71c156f89a55bfe4d25177b81fce4aa09294d9e805eec13855"}, - {file = "pydantic_core-2.23.3-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:0a0137ddf462575d9bce863c4c95bac3493ba8e22f8c28ca94634b4a1d3e2bb4"}, - {file = "pydantic_core-2.23.3-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:203171e48946c3164fe7691fc349c79241ff8f28306abd4cad5f4f75ed80bc8d"}, - {file = "pydantic_core-2.23.3-cp313-none-win32.whl", hash = "sha256:76bdab0de4acb3f119c2a4bff740e0c7dc2e6de7692774620f7452ce11ca76c8"}, - {file = "pydantic_core-2.23.3-cp313-none-win_amd64.whl", hash = "sha256:37ba321ac2a46100c578a92e9a6aa33afe9ec99ffa084424291d84e456f490c1"}, - {file = "pydantic_core-2.23.3-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d063c6b9fed7d992bcbebfc9133f4c24b7a7f215d6b102f3e082b1117cddb72c"}, - {file = "pydantic_core-2.23.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6cb968da9a0746a0cf521b2b5ef25fc5a0bee9b9a1a8214e0a1cfaea5be7e8a4"}, - {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edbefe079a520c5984e30e1f1f29325054b59534729c25b874a16a5048028d16"}, - {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cbaaf2ef20d282659093913da9d402108203f7cb5955020bd8d1ae5a2325d1c4"}, - {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fb539d7e5dc4aac345846f290cf504d2fd3c1be26ac4e8b5e4c2b688069ff4cf"}, - {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7e6f33503c5495059148cc486867e1d24ca35df5fc064686e631e314d959ad5b"}, - {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04b07490bc2f6f2717b10c3969e1b830f5720b632f8ae2f3b8b1542394c47a8e"}, - {file = "pydantic_core-2.23.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:03795b9e8a5d7fda05f3873efc3f59105e2dcff14231680296b87b80bb327295"}, - {file = "pydantic_core-2.23.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c483dab0f14b8d3f0df0c6c18d70b21b086f74c87ab03c59250dbf6d3c89baba"}, - {file = "pydantic_core-2.23.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8b2682038e255e94baf2c473dca914a7460069171ff5cdd4080be18ab8a7fd6e"}, - {file = "pydantic_core-2.23.3-cp38-none-win32.whl", hash = "sha256:f4a57db8966b3a1d1a350012839c6a0099f0898c56512dfade8a1fe5fb278710"}, - {file = "pydantic_core-2.23.3-cp38-none-win_amd64.whl", hash = "sha256:13dd45ba2561603681a2676ca56006d6dee94493f03d5cadc055d2055615c3ea"}, - {file = "pydantic_core-2.23.3-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:82da2f4703894134a9f000e24965df73cc103e31e8c31906cc1ee89fde72cbd8"}, - {file = "pydantic_core-2.23.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dd9be0a42de08f4b58a3cc73a123f124f65c24698b95a54c1543065baca8cf0e"}, - {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89b731f25c80830c76fdb13705c68fef6a2b6dc494402987c7ea9584fe189f5d"}, - {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6de1ec30c4bb94f3a69c9f5f2182baeda5b809f806676675e9ef6b8dc936f28"}, - {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb68b41c3fa64587412b104294b9cbb027509dc2f6958446c502638d481525ef"}, - {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c3980f2843de5184656aab58698011b42763ccba11c4a8c35936c8dd6c7068c"}, - {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94f85614f2cba13f62c3c6481716e4adeae48e1eaa7e8bac379b9d177d93947a"}, - {file = "pydantic_core-2.23.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:510b7fb0a86dc8f10a8bb43bd2f97beb63cffad1203071dc434dac26453955cd"}, - {file = "pydantic_core-2.23.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1eba2f7ce3e30ee2170410e2171867ea73dbd692433b81a93758ab2de6c64835"}, - {file = "pydantic_core-2.23.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4b259fd8409ab84b4041b7b3f24dcc41e4696f180b775961ca8142b5b21d0e70"}, - {file = "pydantic_core-2.23.3-cp39-none-win32.whl", hash = "sha256:40d9bd259538dba2f40963286009bf7caf18b5112b19d2b55b09c14dde6db6a7"}, - {file = "pydantic_core-2.23.3-cp39-none-win_amd64.whl", hash = "sha256:5a8cd3074a98ee70173a8633ad3c10e00dcb991ecec57263aacb4095c5efb958"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f399e8657c67313476a121a6944311fab377085ca7f490648c9af97fc732732d"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:6b5547d098c76e1694ba85f05b595720d7c60d342f24d5aad32c3049131fa5c4"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0dda0290a6f608504882d9f7650975b4651ff91c85673341789a476b1159f211"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b6e5da855e9c55a0c67f4db8a492bf13d8d3316a59999cfbaf98cc6e401961"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:09e926397f392059ce0afdcac920df29d9c833256354d0c55f1584b0b70cf07e"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:87cfa0ed6b8c5bd6ae8b66de941cece179281239d482f363814d2b986b79cedc"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e61328920154b6a44d98cabcb709f10e8b74276bc709c9a513a8c37a18786cc4"}, - {file = "pydantic_core-2.23.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce3317d155628301d649fe5e16a99528d5680af4ec7aa70b90b8dacd2d725c9b"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e89513f014c6be0d17b00a9a7c81b1c426f4eb9224b15433f3d98c1a071f8433"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:4f62c1c953d7ee375df5eb2e44ad50ce2f5aff931723b398b8bc6f0ac159791a"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2718443bc671c7ac331de4eef9b673063b10af32a0bb385019ad61dcf2cc8f6c"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0d90e08b2727c5d01af1b5ef4121d2f0c99fbee692c762f4d9d0409c9da6541"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2b676583fc459c64146debea14ba3af54e540b61762dfc0613dc4e98c3f66eeb"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:50e4661f3337977740fdbfbae084ae5693e505ca2b3130a6d4eb0f2281dc43b8"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:68f4cf373f0de6abfe599a38307f4417c1c867ca381c03df27c873a9069cda25"}, - {file = "pydantic_core-2.23.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:59d52cf01854cb26c46958552a21acb10dd78a52aa34c86f284e66b209db8cab"}, - {file = "pydantic_core-2.23.3.tar.gz", hash = "sha256:3cb0f65d8b4121c1b015c60104a685feb929a29d7cf204387c7f2688c7974690"}, + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"}, + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"}, + {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"}, + {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"}, + {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"}, + {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, + {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, + {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"}, + {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"}, + {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"}, + {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"}, + {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"}, + {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"}, + {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"}, + {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, ] [package.dependencies] @@ -2132,17 +1979,17 @@ files = [ [[package]] name = "readme-renderer" -version = "43.0" +version = "44.0" description = "readme_renderer is a library for rendering readme descriptions for Warehouse" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "readme_renderer-43.0-py3-none-any.whl", hash = "sha256:19db308d86ecd60e5affa3b2a98f017af384678c63c88e5d4556a380e674f3f9"}, - {file = "readme_renderer-43.0.tar.gz", hash = "sha256:1818dd28140813509eeed8d62687f7cd4f7bad90d4db586001c5dc09d4fde311"}, + {file = "readme_renderer-44.0-py3-none-any.whl", hash = "sha256:2fbca89b81a08526aadf1357a8c2ae889ec05fb03f5da67f9769c9a592166151"}, + {file = "readme_renderer-44.0.tar.gz", hash = "sha256:8712034eabbfa6805cacf1402b4eeb2a73028f72d1166d6f5cb7f9c047c5d1e1"}, ] [package.dependencies] -docutils = ">=0.13.1" +docutils = ">=0.21.2" nh3 = ">=0.2.14" Pygments = ">=2.5.1" @@ -2267,7 +2114,6 @@ files = [ [package.dependencies] markdown-it-py = ">=2.2.0" pygments = ">=2.13.0,<3.0.0" -typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<9)"] @@ -2410,60 +2256,60 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.34" +version = "2.0.35" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.34-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:95d0b2cf8791ab5fb9e3aa3d9a79a0d5d51f55b6357eecf532a120ba3b5524db"}, - {file = "SQLAlchemy-2.0.34-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:243f92596f4fd4c8bd30ab8e8dd5965afe226363d75cab2468f2c707f64cd83b"}, - {file = "SQLAlchemy-2.0.34-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9ea54f7300553af0a2a7235e9b85f4204e1fc21848f917a3213b0e0818de9a24"}, - {file = "SQLAlchemy-2.0.34-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:173f5f122d2e1bff8fbd9f7811b7942bead1f5e9f371cdf9e670b327e6703ebd"}, - {file = "SQLAlchemy-2.0.34-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:196958cde924a00488e3e83ff917be3b73cd4ed8352bbc0f2989333176d1c54d"}, - {file = "SQLAlchemy-2.0.34-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bd90c221ed4e60ac9d476db967f436cfcecbd4ef744537c0f2d5291439848768"}, - {file = "SQLAlchemy-2.0.34-cp310-cp310-win32.whl", hash = "sha256:3166dfff2d16fe9be3241ee60ece6fcb01cf8e74dd7c5e0b64f8e19fab44911b"}, - {file = "SQLAlchemy-2.0.34-cp310-cp310-win_amd64.whl", hash = "sha256:6831a78bbd3c40f909b3e5233f87341f12d0b34a58f14115c9e94b4cdaf726d3"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7db3db284a0edaebe87f8f6642c2b2c27ed85c3e70064b84d1c9e4ec06d5d84"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:430093fce0efc7941d911d34f75a70084f12f6ca5c15d19595c18753edb7c33b"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79cb400c360c7c210097b147c16a9e4c14688a6402445ac848f296ade6283bbc"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb1b30f31a36c7f3fee848391ff77eebdd3af5750bf95fbf9b8b5323edfdb4ec"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fddde2368e777ea2a4891a3fb4341e910a056be0bb15303bf1b92f073b80c02"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:80bd73ea335203b125cf1d8e50fef06be709619eb6ab9e7b891ea34b5baa2287"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-win32.whl", hash = "sha256:6daeb8382d0df526372abd9cb795c992e18eed25ef2c43afe518c73f8cccb721"}, - {file = "SQLAlchemy-2.0.34-cp311-cp311-win_amd64.whl", hash = "sha256:5bc08e75ed11693ecb648b7a0a4ed80da6d10845e44be0c98c03f2f880b68ff4"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:53e68b091492c8ed2bd0141e00ad3089bcc6bf0e6ec4142ad6505b4afe64163e"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bcd18441a49499bf5528deaa9dee1f5c01ca491fc2791b13604e8f972877f812"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:165bbe0b376541092bf49542bd9827b048357f4623486096fc9aaa6d4e7c59a2"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3330415cd387d2b88600e8e26b510d0370db9b7eaf984354a43e19c40df2e2b"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:97b850f73f8abbffb66ccbab6e55a195a0eb655e5dc74624d15cff4bfb35bd74"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7cee4c6917857fd6121ed84f56d1dc78eb1d0e87f845ab5a568aba73e78adf83"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-win32.whl", hash = "sha256:fbb034f565ecbe6c530dff948239377ba859420d146d5f62f0271407ffb8c580"}, - {file = "SQLAlchemy-2.0.34-cp312-cp312-win_amd64.whl", hash = "sha256:707c8f44931a4facd4149b52b75b80544a8d824162602b8cd2fe788207307f9a"}, - {file = "SQLAlchemy-2.0.34-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:24af3dc43568f3780b7e1e57c49b41d98b2d940c1fd2e62d65d3928b6f95f021"}, - {file = "SQLAlchemy-2.0.34-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e60ed6ef0a35c6b76b7640fe452d0e47acc832ccbb8475de549a5cc5f90c2c06"}, - {file = "SQLAlchemy-2.0.34-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413c85cd0177c23e32dee6898c67a5f49296640041d98fddb2c40888fe4daa2e"}, - {file = "SQLAlchemy-2.0.34-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:25691f4adfb9d5e796fd48bf1432272f95f4bbe5f89c475a788f31232ea6afba"}, - {file = "SQLAlchemy-2.0.34-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:526ce723265643dbc4c7efb54f56648cc30e7abe20f387d763364b3ce7506c82"}, - {file = "SQLAlchemy-2.0.34-cp37-cp37m-win32.whl", hash = "sha256:13be2cc683b76977a700948411a94c67ad8faf542fa7da2a4b167f2244781cf3"}, - {file = "SQLAlchemy-2.0.34-cp37-cp37m-win_amd64.whl", hash = "sha256:e54ef33ea80d464c3dcfe881eb00ad5921b60f8115ea1a30d781653edc2fd6a2"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:43f28005141165edd11fbbf1541c920bd29e167b8bbc1fb410d4fe2269c1667a"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b68094b165a9e930aedef90725a8fcfafe9ef95370cbb54abc0464062dbf808f"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a1e03db964e9d32f112bae36f0cc1dcd1988d096cfd75d6a588a3c3def9ab2b"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:203d46bddeaa7982f9c3cc693e5bc93db476ab5de9d4b4640d5c99ff219bee8c"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ae92bebca3b1e6bd203494e5ef919a60fb6dfe4d9a47ed2453211d3bd451b9f5"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:9661268415f450c95f72f0ac1217cc6f10256f860eed85c2ae32e75b60278ad8"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-win32.whl", hash = "sha256:895184dfef8708e15f7516bd930bda7e50ead069280d2ce09ba11781b630a434"}, - {file = "SQLAlchemy-2.0.34-cp38-cp38-win_amd64.whl", hash = "sha256:6e7cde3a2221aa89247944cafb1b26616380e30c63e37ed19ff0bba5e968688d"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dbcdf987f3aceef9763b6d7b1fd3e4ee210ddd26cac421d78b3c206d07b2700b"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ce119fc4ce0d64124d37f66a6f2a584fddc3c5001755f8a49f1ca0a177ef9796"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a17d8fac6df9835d8e2b4c5523666e7051d0897a93756518a1fe101c7f47f2f0"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ebc11c54c6ecdd07bb4efbfa1554538982f5432dfb8456958b6d46b9f834bb7"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2e6965346fc1491a566e019a4a1d3dfc081ce7ac1a736536367ca305da6472a8"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:220574e78ad986aea8e81ac68821e47ea9202b7e44f251b7ed8c66d9ae3f4278"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-win32.whl", hash = "sha256:b75b00083e7fe6621ce13cfce9d4469c4774e55e8e9d38c305b37f13cf1e874c"}, - {file = "SQLAlchemy-2.0.34-cp39-cp39-win_amd64.whl", hash = "sha256:c29d03e0adf3cc1a8c3ec62d176824972ae29b67a66cbb18daff3062acc6faa8"}, - {file = "SQLAlchemy-2.0.34-py3-none-any.whl", hash = "sha256:7286c353ee6475613d8beff83167374006c6b3e3f0e6491bfe8ca610eb1dec0f"}, - {file = "sqlalchemy-2.0.34.tar.gz", hash = "sha256:10d8f36990dd929690666679b0f42235c159a7051534adb135728ee52828dd22"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:67219632be22f14750f0d1c70e62f204ba69d28f62fd6432ba05ab295853de9b"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4668bd8faf7e5b71c0319407b608f278f279668f358857dbfd10ef1954ac9f90"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb8bea573863762bbf45d1e13f87c2d2fd32cee2dbd50d050f83f87429c9e1ea"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f552023710d4b93d8fb29a91fadf97de89c5926c6bd758897875435f2a939f33"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:016b2e665f778f13d3c438651dd4de244214b527a275e0acf1d44c05bc6026a9"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7befc148de64b6060937231cbff8d01ccf0bfd75aa26383ffdf8d82b12ec04ff"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-win32.whl", hash = "sha256:22b83aed390e3099584b839b93f80a0f4a95ee7f48270c97c90acd40ee646f0b"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-win_amd64.whl", hash = "sha256:a29762cd3d116585278ffb2e5b8cc311fb095ea278b96feef28d0b423154858e"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e21f66748ab725ade40fa7af8ec8b5019c68ab00b929f6643e1b1af461eddb60"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8a6219108a15fc6d24de499d0d515c7235c617b2540d97116b663dade1a54d62"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:042622a5306c23b972192283f4e22372da3b8ddf5f7aac1cc5d9c9b222ab3ff6"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:627dee0c280eea91aed87b20a1f849e9ae2fe719d52cbf847c0e0ea34464b3f7"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4fdcd72a789c1c31ed242fd8c1bcd9ea186a98ee8e5408a50e610edfef980d71"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:89b64cd8898a3a6f642db4eb7b26d1b28a497d4022eccd7717ca066823e9fb01"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-win32.whl", hash = "sha256:6a93c5a0dfe8d34951e8a6f499a9479ffb9258123551fa007fc708ae2ac2bc5e"}, + {file = "SQLAlchemy-2.0.35-cp311-cp311-win_amd64.whl", hash = "sha256:c68fe3fcde03920c46697585620135b4ecfdfc1ed23e75cc2c2ae9f8502c10b8"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:eb60b026d8ad0c97917cb81d3662d0b39b8ff1335e3fabb24984c6acd0c900a2"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6921ee01caf375363be5e9ae70d08ce7ca9d7e0e8983183080211a062d299468"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8cdf1a0dbe5ced887a9b127da4ffd7354e9c1a3b9bb330dce84df6b70ccb3a8d"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93a71c8601e823236ac0e5d087e4f397874a421017b3318fd92c0b14acf2b6db"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e04b622bb8a88f10e439084486f2f6349bf4d50605ac3e445869c7ea5cf0fa8c"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1b56961e2d31389aaadf4906d453859f35302b4eb818d34a26fab72596076bb8"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-win32.whl", hash = "sha256:0f9f3f9a3763b9c4deb8c5d09c4cc52ffe49f9876af41cc1b2ad0138878453cf"}, + {file = "SQLAlchemy-2.0.35-cp312-cp312-win_amd64.whl", hash = "sha256:25b0f63e7fcc2a6290cb5f7f5b4fc4047843504983a28856ce9b35d8f7de03cc"}, + {file = "SQLAlchemy-2.0.35-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:f021d334f2ca692523aaf7bbf7592ceff70c8594fad853416a81d66b35e3abf9"}, + {file = "SQLAlchemy-2.0.35-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:05c3f58cf91683102f2f0265c0db3bd3892e9eedabe059720492dbaa4f922da1"}, + {file = "SQLAlchemy-2.0.35-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:032d979ce77a6c2432653322ba4cbeabf5a6837f704d16fa38b5a05d8e21fa00"}, + {file = "SQLAlchemy-2.0.35-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:2e795c2f7d7249b75bb5f479b432a51b59041580d20599d4e112b5f2046437a3"}, + {file = "SQLAlchemy-2.0.35-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:cc32b2990fc34380ec2f6195f33a76b6cdaa9eecf09f0c9404b74fc120aef36f"}, + {file = "SQLAlchemy-2.0.35-cp37-cp37m-win32.whl", hash = "sha256:9509c4123491d0e63fb5e16199e09f8e262066e58903e84615c301dde8fa2e87"}, + {file = "SQLAlchemy-2.0.35-cp37-cp37m-win_amd64.whl", hash = "sha256:3655af10ebcc0f1e4e06c5900bb33e080d6a1fa4228f502121f28a3b1753cde5"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:4c31943b61ed8fdd63dfd12ccc919f2bf95eefca133767db6fbbd15da62078ec"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a62dd5d7cc8626a3634208df458c5fe4f21200d96a74d122c83bc2015b333bc1"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0630774b0977804fba4b6bbea6852ab56c14965a2b0c7fc7282c5f7d90a1ae72"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d625eddf7efeba2abfd9c014a22c0f6b3796e0ffb48f5d5ab106568ef01ff5a"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ada603db10bb865bbe591939de854faf2c60f43c9b763e90f653224138f910d9"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c41411e192f8d3ea39ea70e0fae48762cd11a2244e03751a98bd3c0ca9a4e936"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-win32.whl", hash = "sha256:d299797d75cd747e7797b1b41817111406b8b10a4f88b6e8fe5b5e59598b43b0"}, + {file = "SQLAlchemy-2.0.35-cp38-cp38-win_amd64.whl", hash = "sha256:0375a141e1c0878103eb3d719eb6d5aa444b490c96f3fedab8471c7f6ffe70ee"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ccae5de2a0140d8be6838c331604f91d6fafd0735dbdcee1ac78fc8fbaba76b4"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2a275a806f73e849e1c309ac11108ea1a14cd7058577aba962cd7190e27c9e3c"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:732e026240cdd1c1b2e3ac515c7a23820430ed94292ce33806a95869c46bd139"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:890da8cd1941fa3dab28c5bac3b9da8502e7e366f895b3b8e500896f12f94d11"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c0d8326269dbf944b9201911b0d9f3dc524d64779a07518199a58384c3d37a44"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b76d63495b0508ab9fc23f8152bac63205d2a704cd009a2b0722f4c8e0cba8e0"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-win32.whl", hash = "sha256:69683e02e8a9de37f17985905a5eca18ad651bf592314b4d3d799029797d0eb3"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-win_amd64.whl", hash = "sha256:aee110e4ef3c528f3abbc3c2018c121e708938adeeff9006428dd7c8555e9b3f"}, + {file = "SQLAlchemy-2.0.35-py3-none-any.whl", hash = "sha256:2ab3f0336c0387662ce6221ad30ab3a5e6499aab01b9790879b6578fd9b8faa1"}, + {file = "sqlalchemy-2.0.35.tar.gz", hash = "sha256:e11d7ea4d24f0a262bccf9a7cd6284c976c5369dac21db237cff59586045ab9f"}, ] [package.dependencies] @@ -2523,7 +2369,6 @@ files = [ [package.dependencies] anyio = ">=3.4.0,<5" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} [package.extras] full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7)", "pyyaml"] @@ -2751,13 +2596,13 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [[package]] name = "virtualenv" -version = "20.26.4" +version = "20.26.5" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.26.4-py3-none-any.whl", hash = "sha256:48f2695d9809277003f30776d155615ffc11328e6a0a8c1f0ec80188d7874a55"}, - {file = "virtualenv-20.26.4.tar.gz", hash = "sha256:c17f4e0f3e6036e9f26700446f85c76ab11df65ff6d8a9cbfad9f71aabfcf23c"}, + {file = "virtualenv-20.26.5-py3-none-any.whl", hash = "sha256:4f3ac17b81fba3ce3bd6f4ead2749a72da5929c01774948e243db9ba41df4ff6"}, + {file = "virtualenv-20.26.5.tar.gz", hash = "sha256:ce489cac131aa58f4b25e321d6d186171f78e6cb13fafbf32a840cee67733ff4"}, ] [package.dependencies] @@ -3008,5 +2853,5 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" -python-versions = "^3.8" -content-hash = "7a8990e432a404802c3ace9a81c3c8c33cdd60596f26cdc38e2de424cb1126dd" +python-versions = "^3.10" +content-hash = "1c8904971be7061c2b33400d2b5f461e526703586e5b7f9eb08c2fbfda1a23ab" diff --git a/pyproject.toml b/pyproject.toml index 9643b69e5..203ccc917 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ packages = [ ] [tool.poetry.dependencies] -python = "^3.8" +python = "^3.10" dill = ">=0.3.8,<0.4" fastapi = ">=0.96.0,!=0.111.0,!=0.111.1" gunicorn = ">=20.1.0,<24.0" @@ -70,16 +70,11 @@ toml = ">=0.10.2,<1.0" pytest-asyncio = ">=0.20.1,<0.22.0" # https://github.com/pytest-dev/pytest-asyncio/issues/706 pytest-cov = ">=4.0.0,<5.0" ruff = "^0.4.9" -pandas = [ - {version = ">=2.1.1,<3.0", python = ">=3.9,<3.13"}, - {version = ">=1.5.3,<2.0", python = ">=3.8,<3.9"}, -] -pillow = [ - {version = ">=10.0.0,<11.0", python = ">=3.8,<4.0"} -] +pandas = ">=2.1.1,<3.0" +pillow = ">=10.0.0,<11.0" plotly = ">=5.13.0,<6.0" asynctest = ">=0.13.0,<1.0" -pre-commit = {version = ">=3.2.1", python = ">=3.8,<4.0"} +pre-commit = ">=3.2.1" selenium = ">=4.11.0,<5.0" pytest-benchmark = ">=4.0.0,<5.0" @@ -93,7 +88,7 @@ build-backend = "poetry.core.masonry.api" [tool.pyright] [tool.ruff] -target-version = "py38" +target-version = "py310" lint.select = ["B", "D", "E", "F", "I", "SIM", "W"] lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"] lint.pydocstyle.convention = "google" diff --git a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 index 1bc1d53c3..abfd998fd 100644 --- a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +++ b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 @@ -8,7 +8,7 @@ version = "0.0.1" description = "Reflex custom component {{ module_name }}" readme = "README.md" license = { text = "Apache-2.0" } -requires-python = ">=3.8" +requires-python = ">=3.10" authors = [{ name = "", email = "YOUREMAIL@domain.com" }] keywords = ["reflex","reflex-custom-components"] diff --git a/reflex/app.py b/reflex/app.py index 63334997c..323a3c8f8 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -606,7 +606,10 @@ class App(MiddlewareMixin, LifespanMixin, Base): for route in self.pages: replaced_route = replace_brackets_with_keywords(route) for rw, r, nr in zip( - replaced_route.split("/"), route.split("/"), new_route.split("/") + replaced_route.split("/"), + route.split("/"), + new_route.split("/"), + strict=False, ): if rw in segments and r != nr: # If the slugs in the segments of both routes are not the same, then the route is invalid @@ -955,7 +958,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): # Prepopulate the global ExecutorSafeFunctions class with input data required by the compile functions. # This is required for multiprocessing to work, in presence of non-picklable inputs. - for route, component in zip(self.pages, page_components): + for route, component in zip(self.pages, page_components, strict=False): ExecutorSafeFunctions.COMPILE_PAGE_ARGS_BY_ROUTE[route] = ( route, component, @@ -1169,6 +1172,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): FRONTEND_ARG_SPEC, BACKEND_ARG_SPEC, ], + strict=False, ): if hasattr(handler_fn, "__name__"): _fn_name = handler_fn.__name__ diff --git a/reflex/components/core/breakpoints.py b/reflex/components/core/breakpoints.py index 4b2372a70..decd2727e 100644 --- a/reflex/components/core/breakpoints.py +++ b/reflex/components/core/breakpoints.py @@ -82,7 +82,9 @@ class Breakpoints(Dict[K, V]): return Breakpoints( { k: v - for k, v in zip(["initial", *breakpoint_names], thresholds) + for k, v in zip( + ["initial", *breakpoint_names], thresholds, strict=False + ) if v is not None } ) diff --git a/reflex/event.py b/reflex/event.py index ac0c713ab..fe3a6bfb4 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -217,7 +217,7 @@ class EventHandler(EventActionsMixin): raise EventHandlerTypeError( f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}." ) from e - payload = tuple(zip(fn_args, values)) + payload = tuple(zip(fn_args, values, strict=False)) # Return the event spec. return EventSpec( @@ -310,7 +310,7 @@ class EventSpec(EventActionsMixin): raise EventHandlerTypeError( f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}." ) from e - new_payload = tuple(zip(fn_args, values)) + new_payload = tuple(zip(fn_args, values, strict=False)) return self.with_args(self.args + new_payload) diff --git a/reflex/state.py b/reflex/state.py index 8b32d1a07..5223be7e5 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1316,6 +1316,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for part1, part2 in zip( cls.get_full_name().split("."), other.get_full_name().split("."), + strict=False, ): if part1 != part2: break diff --git a/reflex/utils/telemetry.py b/reflex/utils/telemetry.py index 03e2b943b..b2507e656 100644 --- a/reflex/utils/telemetry.py +++ b/reflex/utils/telemetry.py @@ -121,7 +121,7 @@ def _prepare_event(event: str, **kwargs) -> dict: return {} if UTC is None: - # for python 3.8, 3.9 & 3.10 + # for python 3.10 stamp = datetime.utcnow().isoformat() else: # for python 3.11 & 3.12 diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 63238f67b..ed74131a0 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -632,7 +632,7 @@ def validate_parameter_literals(func): annotations = {param[0]: param[1].annotation for param in func_params} # validate args - for param, arg in zip(annotations, args): + for param, arg in zip(annotations, args, strict=False): if annotations[param] is inspect.Parameter.empty: continue validate_literal(param, arg, annotations[param], func.__name__) diff --git a/tests/compiler/test_compiler.py b/tests/compiler/test_compiler.py index 63014cf33..9ff4e1f14 100644 --- a/tests/compiler/test_compiler.py +++ b/tests/compiler/test_compiler.py @@ -100,7 +100,7 @@ def test_compile_imports(import_dict: ParsedImportDict, test_dicts: List[dict]): test_dicts: The expected output. """ imports = utils.compile_imports(import_dict) - for import_dict, test_dict in zip(imports, test_dicts): + for import_dict, test_dict in zip(imports, test_dicts, strict=False): assert import_dict["lib"] == test_dict["lib"] assert import_dict["default"] == test_dict["default"] assert sorted(import_dict["rest"]) == test_dict["rest"] # type: ignore diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 4dda81896..e6a1a40cb 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -1403,6 +1403,7 @@ def test_get_vars(component, exp_vars): for comp_var, exp_var in zip( comp_vars, sorted(exp_vars, key=lambda v: v._js_expr), + strict=False, ): # print(str(comp_var), str(exp_var)) # print(comp_var._get_all_var_data(), exp_var._get_all_var_data()) @@ -1792,6 +1793,7 @@ def test_custom_component_declare_event_handlers_in_fields(): for v1, v2 in zip( parse_args_spec(test_triggers[trigger_name]), parse_args_spec(custom_triggers[trigger_name]), + strict=False, ): assert v1.equals(v2) diff --git a/tests/test_var.py b/tests/test_var.py index 5cd816c9b..e9998c456 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -184,6 +184,7 @@ def ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): "state.local", "local2", ], + strict=False, ), ) def test_full_name(prop, expected): @@ -201,6 +202,7 @@ def test_full_name(prop, expected): zip( test_vars, ["prop1", "key", "state.value", "state.local", "local2"], + strict=False, ), ) def test_str(prop, expected): @@ -247,6 +249,7 @@ def test_default_value(prop, expected): "state.set_local", "set_local2", ], + strict=False, ), ) def test_get_setter(prop, expected): From f9be184b86ae878245bcda326eb8fd2b6fdf7fa9 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 20 Sep 2024 11:01:57 -0700 Subject: [PATCH 044/201] ruff formatting to unbreak `main` CI (#3964) --- reflex/vars/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 4faa38be7..eb5362090 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -2667,7 +2667,7 @@ def generic_type_to_actual_type_map( # call recursively for nested generic types and merge the results return { k: v - for generic_arg, actual_arg in zip(generic_args, actual_args) + for generic_arg, actual_arg in zip(generic_args, actual_args, strict=False) for k, v in generic_type_to_actual_type_map(generic_arg, actual_arg).items() } From afd52a87ddc6a5fa009fc6c36f1c61b0d97c782a Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Sun, 22 Sep 2024 21:44:16 +0000 Subject: [PATCH 045/201] Make `reflex init --ai` use light mode (#3963) --- reflex/utils/prerequisites.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 6433cd346..7173e4872 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -1481,13 +1481,20 @@ def initialize_main_module_index_from_generation(app_name: str, generation_hash: main_module_path = Path(app_name, app_name + constants.Ext.PY) main_module_code = main_module_path.read_text() - main_module_path.write_text( - re.sub( - r"def index\(\).*:\n([^\n]\s+.*\n+)+", - replace_content, - main_module_code, - ) + + main_module_code = re.sub( + r"def index\(\).*:\n([^\n]\s+.*\n+)+", + replace_content, + main_module_code, ) + # Make the app use light mode until flexgen enforces the conversion of + # tailwind colors to radix colors. + main_module_code = re.sub( + r"app\s*=\s*rx\.App\(\s*\)", + 'app = rx.App(theme=rx.theme(color_mode="light"))', + main_module_code, + ) + main_module_path.write_text(main_module_code) def format_address_width(address_width) -> int | None: From 61332fdba18640a03201a2329199717195b87db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Sun, 22 Sep 2024 23:44:44 +0200 Subject: [PATCH 046/201] add some more tests (#3965) --- .../components/datadisplay/test_dataeditor.py | 11 ++++++ tests/components/recharts/test_polar.py | 38 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/components/datadisplay/test_dataeditor.py create mode 100644 tests/components/recharts/test_polar.py diff --git a/tests/components/datadisplay/test_dataeditor.py b/tests/components/datadisplay/test_dataeditor.py new file mode 100644 index 000000000..63b156e74 --- /dev/null +++ b/tests/components/datadisplay/test_dataeditor.py @@ -0,0 +1,11 @@ +from reflex.components.datadisplay.dataeditor import DataEditor + + +def test_dataeditor(): + editor_wrapper = DataEditor.create().render() + editor = editor_wrapper["children"][0] + assert editor_wrapper["name"] == "div" + assert editor_wrapper["props"] == [ + 'css={({ ["width"] : "100%", ["height"] : "100%" })}' + ] + assert editor["name"] == "DataEditor" diff --git a/tests/components/recharts/test_polar.py b/tests/components/recharts/test_polar.py new file mode 100644 index 000000000..4e4af0f49 --- /dev/null +++ b/tests/components/recharts/test_polar.py @@ -0,0 +1,38 @@ +from reflex.components.recharts import ( + Pie, + PolarAngleAxis, + PolarGrid, + PolarRadiusAxis, + Radar, + RadialBar, +) + + +def test_pie(): + pie = Pie.create().render() + assert pie["name"] == "RechartsPie" + + +def test_radar(): + radar = Radar.create().render() + assert radar["name"] == "RechartsRadar" + + +def test_radialbar(): + radialbar = RadialBar.create().render() + assert radialbar["name"] == "RechartsRadialBar" + + +def test_polarangleaxis(): + polarangleaxis = PolarAngleAxis.create().render() + assert polarangleaxis["name"] == "RechartsPolarAngleAxis" + + +def test_polargrid(): + polargrid = PolarGrid.create().render() + assert polargrid["name"] == "RechartsPolarGrid" + + +def test_polarradiusaxis(): + polarradiusaxis = PolarRadiusAxis.create().render() + assert polarradiusaxis["name"] == "RechartsPolarRadiusAxis" From ee3b0e614c9ffbfe4bd420ce7253190c94a48bd8 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 23 Sep 2024 12:40:14 -0700 Subject: [PATCH 047/201] fix set value logix for client state (#3966) --- reflex/experimental/client_state.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/reflex/experimental/client_state.py b/reflex/experimental/client_state.py index 9601ca58b..438ca0a23 100644 --- a/reflex/experimental/client_state.py +++ b/reflex/experimental/client_state.py @@ -3,6 +3,7 @@ from __future__ import annotations import dataclasses +import re import sys from typing import Any, Callable, Union @@ -174,15 +175,15 @@ class ClientStateVar(Var): else self._setter_name ) if value is not NoValue: - import re - # This is a hack to make it work like an EventSpec taking an arg value_str = str(LiteralVar.create(value)) - # remove patterns of ["*"] from the value_str using regex - arg = re.sub(r"\[\".*\"\]", "", value_str) - - setter = f"({arg}) => {setter}({str(value)})" + if value_str.startswith("_"): + # remove patterns of ["*"] from the value_str using regex + arg = re.sub(r"\[\".*\"\]", "", value_str) + setter = f"(({arg}) => {setter}({value_str}))" + else: + setter = f"(() => {setter}({value_str}))" return Var( _js_expr=setter, _var_data=VarData(imports=_refs_import if self._global_ref else {}), From 47c9938d958f9438c0e170dd0e9bf1cc0acd49fd Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 23 Sep 2024 16:36:58 -0700 Subject: [PATCH 048/201] use is true for bool var (#3973) --- reflex/vars/sequence.py | 8 -------- tests/test_var.py | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index ca8967d33..6145c980c 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -194,14 +194,6 @@ class StringVar(Var[str]): """ return string_strip_operation(self) - def bool(self): - """Boolean conversion. - - Returns: - The boolean value of the string. - """ - return self.length() != 0 - def reversed(self) -> StringVar: """Reverse the string. diff --git a/tests/test_var.py b/tests/test_var.py index e9998c456..31bf80568 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -968,7 +968,7 @@ def test_all_number_operations(): [ (Var.create(False), "false"), (Var.create(True), "true"), - (Var.create("false"), '("false".split("").length !== 0)'), + (Var.create("false"), 'isTrue("false")'), (Var.create([1, 2, 3]), "isTrue([1, 2, 3])"), (Var.create({"a": 1, "b": 2}), 'isTrue(({ ["a"] : 1, ["b"] : 2 }))'), (Var("mysterious_var"), "isTrue(mysterious_var)"), From a5ad5203df9fae74d3512766933441057b235e2d Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 23 Sep 2024 18:13:55 -0700 Subject: [PATCH 049/201] suggest bool() for wrong values (#3975) --- reflex/components/component.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reflex/components/component.py b/reflex/components/component.py index e6bdfef06..b2f3d196f 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -448,8 +448,16 @@ class Component(BaseComponent, ABC): and not types._issubclass(passed_type, expected_type, value) ): value_name = value._js_expr if isinstance(value, Var) else value + + additional_info = ( + " You can call `.bool()` on the value to convert it to a boolean." + if expected_type is bool and isinstance(value, Var) + else "" + ) + raise TypeError( f"Invalid var passed for prop {type(self).__name__}.{key}, expected type {expected_type}, got value {value_name} of type {passed_type}." + + additional_info ) # Check if the key is an event trigger. if key in component_specific_triggers: From 00d995d971f9eec6a62d1c3d3de697dbb8f0fe22 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 23 Sep 2024 18:14:28 -0700 Subject: [PATCH 050/201] [ENG-3833] handle object in is bool (#3974) * handle object in is bool * use if statements --- reflex/.templates/web/utils/state.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 66b50b1b4..78e671809 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -832,7 +832,9 @@ export const useEventLoop = ( * @returns True if the value is truthy, false otherwise. */ export const isTrue = (val) => { - return Array.isArray(val) ? val.length > 0 : !!val; + if (Array.isArray(val)) return val.length > 0; + if (val === Object(val)) return Object.keys(val).length > 0; + return Boolean(val); }; /** From 2883e541a986797d1d1d78c79caf91535323c68d Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 23 Sep 2024 18:15:16 -0700 Subject: [PATCH 051/201] Bring back py3.9 support with a deprecation warning. (#3976) * Revert "ruff formatting to unbreak `main` CI (#3964)" This reverts commit f9be184b86ae878245bcda326eb8fd2b6fdf7fa9. * Revert "bump python>=3.10 for 0.6.0 (#3956)" This reverts commit fe1833c5e16695c715a9895d7bed5e4165c6bc43. * drop python3.8 support * relock dependencies * Raise warning when < py310 is used * Move python version check to reflex version check function Avoid spammy deprecation warnings by only emitting warning once per project, per reflex version, per reinit. * Remove other references to python3.8 --- .github/workflows/benchmarks.yml | 10 +- .github/workflows/integration_tests.yml | 7 +- .github/workflows/integration_tests_wsl.yml | 4 +- .github/workflows/unit_tests.yml | 6 +- CONTRIBUTING.md | 4 +- README.md | 2 +- docs/de/README.md | 2 +- docs/es/README.md | 2 +- docs/in/README.md | 2 +- docs/it/README.md | 2 +- docs/ja/README.md | 2 +- docs/kr/README.md | 2 +- docs/pe/README.md | 2 +- docs/pt/pt_br/README.md | 2 +- docs/tr/README.md | 2 +- docs/zh/zh_cn/README.md | 2 +- docs/zh/zh_tw/README.md | 2 +- integration/init-test/Dockerfile | 2 +- poetry.lock | 490 ++++++++++-------- pyproject.toml | 4 +- .../custom_components/pyproject.toml.jinja2 | 2 +- reflex/app.py | 8 +- reflex/app_module_for_backend.py | 2 +- reflex/components/core/breakpoints.py | 4 +- reflex/event.py | 4 +- reflex/state.py | 1 - reflex/utils/prerequisites.py | 27 +- reflex/utils/telemetry.py | 2 +- reflex/utils/types.py | 2 +- reflex/vars/base.py | 2 +- tests/compiler/test_compiler.py | 2 +- tests/components/media/test_image.py | 1 - tests/components/test_component.py | 2 - tests/test_var.py | 3 - 34 files changed, 349 insertions(+), 264 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 0971c728b..aac67f7a6 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -81,11 +81,15 @@ jobs: matrix: # Show OS combos first in GUI os: [ubuntu-latest, windows-latest, macos-12] - python-version: ['3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] exclude: - os: windows-latest python-version: '3.10.13' + - os: windows-latest + python-version: '3.9.18' # keep only one python version for MacOS + - os: macos-latest + python-version: '3.9.18' - os: macos-latest python-version: '3.10.13' - os: macos-12 @@ -93,7 +97,9 @@ jobs: include: - os: windows-latest python-version: '3.10.11' - + - os: windows-latest + python-version: '3.9.13' + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 289a7b2f1..e9fecc81a 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -43,14 +43,17 @@ jobs: matrix: # Show OS combos first in GUI os: [ubuntu-latest, windows-latest, macos-12] - python-version: ['3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] exclude: - os: windows-latest python-version: '3.10.13' + - os: windows-latest + python-version: '3.9.18' include: - os: windows-latest python-version: '3.10.11' - + - os: windows-latest + python-version: '3.9.13' runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/integration_tests_wsl.yml b/.github/workflows/integration_tests_wsl.yml index ea62268b1..7a743252b 100644 --- a/.github/workflows/integration_tests_wsl.yml +++ b/.github/workflows/integration_tests_wsl.yml @@ -38,14 +38,14 @@ jobs: - uses: Vampire/setup-wsl@v3 with: - distribution: Ubuntu-24.04 + distribution: Ubuntu-24.04 - name: Install Python shell: wsl-bash {0} run: | apt update apt install -y python3 python3-pip curl dos2unix zip unzip - + - name: Install Poetry shell: wsl-bash {0} run: | diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f15434193..333c54cb3 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -28,14 +28,18 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-12] - python-version: ['3.10.13', '3.11.5', '3.12.0'] + python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] # Windows is a bit behind on Python version availability in Github exclude: - os: windows-latest python-version: '3.10.13' + - os: windows-latest + python-version: '3.9.18' include: - os: windows-latest python-version: '3.10.11' + - os: windows-latest + python-version: '3.9.13' runs-on: ${{ matrix.os }} # Service containers to run with `runner-job` services: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6db8e1a04..af195997a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ Here is a quick guide on how to run Reflex repo locally so you can start contrib **Prerequisites:** -- Python >= 3.10 +- Python >= 3.9 - Poetry version >= 1.4.0 and add it to your path (see [Poetry Docs](https://python-poetry.org/docs/#installation) for more info). **1. Fork this repository:** @@ -87,7 +87,7 @@ poetry run ruff format . ``` Consider installing git pre-commit hooks so Ruff, Pyright, Darglint and `make_pyi` will run automatically before each commit. -Note that pre-commit will only be installed when you use a Python version >= 3.8. +Note that pre-commit will only be installed when you use a Python version >= 3.9. ``` bash pre-commit install diff --git a/README.md b/README.md index d3f22bb54..c249aea9f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ See our [architecture page](https://reflex.dev/blog/2024-03-21-reflex-architectu ## ⚙️ Installation -Open a terminal and run (Requires Python 3.10+): +Open a terminal and run (Requires Python 3.9+): ```bash pip install reflex diff --git a/docs/de/README.md b/docs/de/README.md index 6d2d69e94..9931c24cc 100644 --- a/docs/de/README.md +++ b/docs/de/README.md @@ -34,7 +34,7 @@ Auf unserer [Architektur-Seite](https://reflex.dev/blog/2024-03-21-reflex-archit ## ⚙️ Installation -Öffne ein Terminal und führe den folgenden Befehl aus (benötigt Python 3.10+): +Öffne ein Terminal und führe den folgenden Befehl aus (benötigt Python 3.9+): ```bash pip install reflex diff --git a/docs/es/README.md b/docs/es/README.md index 538192e4b..15ce63335 100644 --- a/docs/es/README.md +++ b/docs/es/README.md @@ -35,7 +35,7 @@ Consulta nuestra [página de arquitectura](https://reflex.dev/blog/2024-03-21-re ## ⚙️ Instalación -Abra un terminal y ejecute (Requiere Python 3.10+): +Abra un terminal y ejecute (Requiere Python 3.9+): ```bash pip install reflex diff --git a/docs/in/README.md b/docs/in/README.md index 81b1106ff..ebc4155f4 100644 --- a/docs/in/README.md +++ b/docs/in/README.md @@ -35,7 +35,7 @@ Reflex के अंदर के कामकाज को जानने क ## ⚙️ इंस्टॉलेशन (Installation) -एक टर्मिनल खोलें और चलाएं (Python 3.10+ की आवश्यकता है): +एक टर्मिनल खोलें और चलाएं (Python 3.9+ की आवश्यकता है): ```bash pip install reflex diff --git a/docs/it/README.md b/docs/it/README.md index cd6f24dd8..92438f696 100644 --- a/docs/it/README.md +++ b/docs/it/README.md @@ -22,7 +22,7 @@ ## ⚙️ Installazione -Apri un terminale ed esegui (Richiede Python 3.10+): +Apri un terminale ed esegui (Richiede Python 3.9+): ```bash pip install reflex diff --git a/docs/ja/README.md b/docs/ja/README.md index f58fb70ad..0a7ab0d53 100644 --- a/docs/ja/README.md +++ b/docs/ja/README.md @@ -37,7 +37,7 @@ Reflex がどのように動作しているかを知るには、[アーキテク ## ⚙️ インストール -ターミナルを開いて以下のコマンドを実行してください。(Python 3.8 以上が必要です。): +ターミナルを開いて以下のコマンドを実行してください。(Python 3.9 以上が必要です。): ```bash pip install reflex diff --git a/docs/kr/README.md b/docs/kr/README.md index 57bb43794..a92fcd0c5 100644 --- a/docs/kr/README.md +++ b/docs/kr/README.md @@ -20,7 +20,7 @@ --- ## ⚙️ 설치 -터미널을 열고 실행하세요. (Python 3.10+ 필요): +터미널을 열고 실행하세요. (Python 3.9+ 필요): ```bash pip install reflex diff --git a/docs/pe/README.md b/docs/pe/README.md index 867b543bc..3a0ba044b 100644 --- a/docs/pe/README.md +++ b/docs/pe/README.md @@ -34,7 +34,7 @@ ## ⚙️ Installation - نصب و راه اندازی -یک ترمینال را باز کنید و اجرا کنید (نیازمند Python 3.10+): +یک ترمینال را باز کنید و اجرا کنید (نیازمند Python 3.9+): ```bash pip install reflex diff --git a/docs/pt/pt_br/README.md b/docs/pt/pt_br/README.md index 8abfaebde..184b668bc 100644 --- a/docs/pt/pt_br/README.md +++ b/docs/pt/pt_br/README.md @@ -21,7 +21,7 @@ --- ## ⚙️ Instalação -Abra um terminal e execute (Requer Python 3.10+): +Abra um terminal e execute (Requer Python 3.9+): ```bash pip install reflex diff --git a/docs/tr/README.md b/docs/tr/README.md index afb8ae5b9..376547e01 100644 --- a/docs/tr/README.md +++ b/docs/tr/README.md @@ -24,7 +24,7 @@ ## ⚙️ Kurulum -Bir terminal açın ve çalıştırın (Python 3.10+ gerekir): +Bir terminal açın ve çalıştırın (Python 3.9+ gerekir): ```bash pip install reflex diff --git a/docs/zh/zh_cn/README.md b/docs/zh/zh_cn/README.md index c39db0c2d..e114bc1e2 100644 --- a/docs/zh/zh_cn/README.md +++ b/docs/zh/zh_cn/README.md @@ -34,7 +34,7 @@ Reflex 是一个使用纯Python构建全栈web应用的库。 ## ⚙️ 安装 -打开一个终端并且运行(要求Python3.8+): +打开一个终端并且运行(要求Python3.9+): ```bash pip install reflex diff --git a/docs/zh/zh_tw/README.md b/docs/zh/zh_tw/README.md index 6161e17d0..83f6b2ae2 100644 --- a/docs/zh/zh_tw/README.md +++ b/docs/zh/zh_tw/README.md @@ -36,7 +36,7 @@ Reflex 是一個可以用純 Python 構建全端網頁應用程式的函式庫 ## ⚙️ 安裝 -開啟一個終端機並且執行 (需要 Python 3.10+): +開啟一個終端機並且執行 (需要 Python 3.9+): ```bash pip install reflex diff --git a/integration/init-test/Dockerfile b/integration/init-test/Dockerfile index e5d2a0820..f30466e7f 100644 --- a/integration/init-test/Dockerfile +++ b/integration/init-test/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10 +FROM python:3.9 ARG USERNAME=kerrigan RUN useradd -m $USERNAME diff --git a/poetry.lock b/poetry.lock index d3a63110b..c587977e9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,14 +1,14 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "alembic" -version = "1.13.2" +version = "1.13.3" description = "A database migration tool for SQLAlchemy." optional = false python-versions = ">=3.8" files = [ - {file = "alembic-1.13.2-py3-none-any.whl", hash = "sha256:6b8733129a6224a9a711e17c99b08462dbf7cc9670ba8f2e2ae9af860ceb1953"}, - {file = "alembic-1.13.2.tar.gz", hash = "sha256:1ff0ae32975f4fd96028c39ed9bb3c867fe3af956bd7bb37343b54c9fe7445ef"}, + {file = "alembic-1.13.3-py3-none-any.whl", hash = "sha256:908e905976d15235fae59c9ac42c4c5b75cfcefe3d27c0fbf7ae15a37715d80e"}, + {file = "alembic-1.13.3.tar.gz", hash = "sha256:203503117415561e203aa14541740643a611f641517f0209fcae63e9fa09f1a2"}, ] [package.dependencies] @@ -32,13 +32,13 @@ files = [ [[package]] name = "anyio" -version = "4.5.0" +version = "4.6.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "anyio-4.5.0-py3-none-any.whl", hash = "sha256:fdeb095b7cc5a5563175eedd926ec4ae55413bb4be5770c424af0ba46ccb4a78"}, - {file = "anyio-4.5.0.tar.gz", hash = "sha256:c5a275fe5ca0afd788001f58fca1e69e29ce706d746e317d660e21f70c530ef9"}, + {file = "anyio-4.6.0-py3-none-any.whl", hash = "sha256:c7d2e9d63e31599eeb636c8c5c03a7e108d73b345f064f1c19fdc87b79036a9a"}, + {file = "anyio-4.6.0.tar.gz", hash = "sha256:137b4559cbb034c477165047febb6ff83f390fc3b20bf181c1fc0a728cb8beeb"}, ] [package.dependencies] @@ -616,77 +616,84 @@ typing = ["typing-extensions (>=4.12.2)"] [[package]] name = "greenlet" -version = "3.1.0" +version = "3.1.1" description = "Lightweight in-process concurrent programming" optional = false python-versions = ">=3.7" files = [ - {file = "greenlet-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a814dc3100e8a046ff48faeaa909e80cdb358411a3d6dd5293158425c684eda8"}, - {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a771dc64fa44ebe58d65768d869fcfb9060169d203446c1d446e844b62bdfdca"}, - {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0e49a65d25d7350cca2da15aac31b6f67a43d867448babf997fe83c7505f57bc"}, - {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2cd8518eade968bc52262d8c46727cfc0826ff4d552cf0430b8d65aaf50bb91d"}, - {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76dc19e660baea5c38e949455c1181bc018893f25372d10ffe24b3ed7341fb25"}, - {file = "greenlet-3.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c0a5b1c22c82831f56f2f7ad9bbe4948879762fe0d59833a4a71f16e5fa0f682"}, - {file = "greenlet-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:2651dfb006f391bcb240635079a68a261b227a10a08af6349cba834a2141efa1"}, - {file = "greenlet-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3e7e6ef1737a819819b1163116ad4b48d06cfdd40352d813bb14436024fcda99"}, - {file = "greenlet-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:ffb08f2a1e59d38c7b8b9ac8083c9c8b9875f0955b1e9b9b9a965607a51f8e54"}, - {file = "greenlet-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9730929375021ec90f6447bff4f7f5508faef1c02f399a1953870cdb78e0c345"}, - {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:713d450cf8e61854de9420fb7eea8ad228df4e27e7d4ed465de98c955d2b3fa6"}, - {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c3446937be153718250fe421da548f973124189f18fe4575a0510b5c928f0cc"}, - {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ddc7bcedeb47187be74208bc652d63d6b20cb24f4e596bd356092d8000da6d6"}, - {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44151d7b81b9391ed759a2f2865bbe623ef00d648fed59363be2bbbd5154656f"}, - {file = "greenlet-3.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cea1cca3be76c9483282dc7760ea1cc08a6ecec1f0b6ca0a94ea0d17432da19"}, - {file = "greenlet-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:619935a44f414274a2c08c9e74611965650b730eb4efe4b2270f91df5e4adf9a"}, - {file = "greenlet-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:221169d31cada333a0c7fd087b957c8f431c1dba202c3a58cf5a3583ed973e9b"}, - {file = "greenlet-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:01059afb9b178606b4b6e92c3e710ea1635597c3537e44da69f4531e111dd5e9"}, - {file = "greenlet-3.1.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:24fc216ec7c8be9becba8b64a98a78f9cd057fd2dc75ae952ca94ed8a893bf27"}, - {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3d07c28b85b350564bdff9f51c1c5007dfb2f389385d1bc23288de51134ca303"}, - {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:243a223c96a4246f8a30ea470c440fe9db1f5e444941ee3c3cd79df119b8eebf"}, - {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26811df4dc81271033a7836bc20d12cd30938e6bd2e9437f56fa03da81b0f8fc"}, - {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9d86401550b09a55410f32ceb5fe7efcd998bd2dad9e82521713cb148a4a15f"}, - {file = "greenlet-3.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:26d9c1c4f1748ccac0bae1dbb465fb1a795a75aba8af8ca871503019f4285e2a"}, - {file = "greenlet-3.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:cd468ec62257bb4544989402b19d795d2305eccb06cde5da0eb739b63dc04665"}, - {file = "greenlet-3.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a53dfe8f82b715319e9953330fa5c8708b610d48b5c59f1316337302af5c0811"}, - {file = "greenlet-3.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:28fe80a3eb673b2d5cc3b12eea468a5e5f4603c26aa34d88bf61bba82ceb2f9b"}, - {file = "greenlet-3.1.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:76b3e3976d2a452cba7aa9e453498ac72240d43030fdc6d538a72b87eaff52fd"}, - {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:655b21ffd37a96b1e78cc48bf254f5ea4b5b85efaf9e9e2a526b3c9309d660ca"}, - {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c6f4c2027689093775fd58ca2388d58789009116844432d920e9147f91acbe64"}, - {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76e5064fd8e94c3f74d9fd69b02d99e3cdb8fc286ed49a1f10b256e59d0d3a0b"}, - {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6a4bf607f690f7987ab3291406e012cd8591a4f77aa54f29b890f9c331e84989"}, - {file = "greenlet-3.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:037d9ac99540ace9424cb9ea89f0accfaff4316f149520b4ae293eebc5bded17"}, - {file = "greenlet-3.1.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:90b5bbf05fe3d3ef697103850c2ce3374558f6fe40fd57c9fac1bf14903f50a5"}, - {file = "greenlet-3.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:726377bd60081172685c0ff46afbc600d064f01053190e4450857483c4d44484"}, - {file = "greenlet-3.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:d46d5069e2eeda111d6f71970e341f4bd9aeeee92074e649ae263b834286ecc0"}, - {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81eeec4403a7d7684b5812a8aaa626fa23b7d0848edb3a28d2eb3220daddcbd0"}, - {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a3dae7492d16e85ea6045fd11cb8e782b63eac8c8d520c3a92c02ac4573b0a6"}, - {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b5ea3664eed571779403858d7cd0a9b0ebf50d57d2cdeafc7748e09ef8cd81a"}, - {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a22f4e26400f7f48faef2d69c20dc055a1f3043d330923f9abe08ea0aecc44df"}, - {file = "greenlet-3.1.0-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:13ff8c8e54a10472ce3b2a2da007f915175192f18e6495bad50486e87c7f6637"}, - {file = "greenlet-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f9671e7282d8c6fcabc32c0fb8d7c0ea8894ae85cee89c9aadc2d7129e1a9954"}, - {file = "greenlet-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:184258372ae9e1e9bddce6f187967f2e08ecd16906557c4320e3ba88a93438c3"}, - {file = "greenlet-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:a0409bc18a9f85321399c29baf93545152d74a49d92f2f55302f122007cfda00"}, - {file = "greenlet-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:9eb4a1d7399b9f3c7ac68ae6baa6be5f9195d1d08c9ddc45ad559aa6b556bce6"}, - {file = "greenlet-3.1.0-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:a8870983af660798dc1b529e1fd6f1cefd94e45135a32e58bd70edd694540f33"}, - {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfcfb73aed40f550a57ea904629bdaf2e562c68fa1164fa4588e752af6efdc3f"}, - {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9482c2ed414781c0af0b35d9d575226da6b728bd1a720668fa05837184965b7"}, - {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d58ec349e0c2c0bc6669bf2cd4982d2f93bf067860d23a0ea1fe677b0f0b1e09"}, - {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd65695a8df1233309b701dec2539cc4b11e97d4fcc0f4185b4a12ce54db0491"}, - {file = "greenlet-3.1.0-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:665b21e95bc0fce5cab03b2e1d90ba9c66c510f1bb5fdc864f3a377d0f553f6b"}, - {file = "greenlet-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d3c59a06c2c28a81a026ff11fbf012081ea34fb9b7052f2ed0366e14896f0a1d"}, - {file = "greenlet-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5415b9494ff6240b09af06b91a375731febe0090218e2898d2b85f9b92abcda0"}, - {file = "greenlet-3.1.0-cp38-cp38-win32.whl", hash = "sha256:1544b8dd090b494c55e60c4ff46e238be44fdc472d2589e943c241e0169bcea2"}, - {file = "greenlet-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:7f346d24d74c00b6730440f5eb8ec3fe5774ca8d1c9574e8e57c8671bb51b910"}, - {file = "greenlet-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:db1b3ccb93488328c74e97ff888604a8b95ae4f35f4f56677ca57a4fc3a4220b"}, - {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44cd313629ded43bb3b98737bba2f3e2c2c8679b55ea29ed73daea6b755fe8e7"}, - {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fad7a051e07f64e297e6e8399b4d6a3bdcad3d7297409e9a06ef8cbccff4f501"}, - {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3967dcc1cd2ea61b08b0b276659242cbce5caca39e7cbc02408222fb9e6ff39"}, - {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d45b75b0f3fd8d99f62eb7908cfa6d727b7ed190737dec7fe46d993da550b81a"}, - {file = "greenlet-3.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2d004db911ed7b6218ec5c5bfe4cf70ae8aa2223dffbb5b3c69e342bb253cb28"}, - {file = "greenlet-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b9505a0c8579899057cbefd4ec34d865ab99852baf1ff33a9481eb3924e2da0b"}, - {file = "greenlet-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fd6e94593f6f9714dbad1aaba734b5ec04593374fa6638df61592055868f8b8"}, - {file = "greenlet-3.1.0-cp39-cp39-win32.whl", hash = "sha256:d0dd943282231480aad5f50f89bdf26690c995e8ff555f26d8a5b9887b559bcc"}, - {file = "greenlet-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:ac0adfdb3a21dc2a24ed728b61e72440d297d0fd3a577389df566651fcd08f97"}, - {file = "greenlet-3.1.0.tar.gz", hash = "sha256:b395121e9bbe8d02a750886f108d540abe66075e61e22f7353d9acb0b81be0f0"}, + {file = "greenlet-3.1.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:0bbae94a29c9e5c7e4a2b7f0aae5c17e8e90acbfd3bf6270eeba60c39fce3563"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fde093fb93f35ca72a556cf72c92ea3ebfda3d79fc35bb19fbe685853869a83"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:36b89d13c49216cadb828db8dfa6ce86bbbc476a82d3a6c397f0efae0525bdd0"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94b6150a85e1b33b40b1464a3f9988dcc5251d6ed06842abff82e42632fac120"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93147c513fac16385d1036b7e5b102c7fbbdb163d556b791f0f11eada7ba65dc"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da7a9bff22ce038e19bf62c4dd1ec8391062878710ded0a845bcf47cc0200617"}, + {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b2795058c23988728eec1f36a4e5e4ebad22f8320c85f3587b539b9ac84128d7"}, + {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ed10eac5830befbdd0c32f83e8aa6288361597550ba669b04c48f0f9a2c843c6"}, + {file = "greenlet-3.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:77c386de38a60d1dfb8e55b8c1101d68c79dfdd25c7095d51fec2dd800892b80"}, + {file = "greenlet-3.1.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e4d333e558953648ca09d64f13e6d8f0523fa705f51cae3f03b5983489958c70"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fc016b73c94e98e29af67ab7b9a879c307c6731a2c9da0db5a7d9b7edd1159"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5e975ca70269d66d17dd995dafc06f1b06e8cb1ec1e9ed54c1d1e4a7c4cf26e"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b2813dc3de8c1ee3f924e4d4227999285fd335d1bcc0d2be6dc3f1f6a318ec1"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e347b3bfcf985a05e8c0b7d462ba6f15b1ee1c909e2dcad795e49e91b152c383"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e8f8c9cb53cdac7ba9793c276acd90168f416b9ce36799b9b885790f8ad6c0a"}, + {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62ee94988d6b4722ce0028644418d93a52429e977d742ca2ccbe1c4f4a792511"}, + {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1776fd7f989fc6b8d8c8cb8da1f6b82c5814957264d1f6cf818d475ec2bf6395"}, + {file = "greenlet-3.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:48ca08c771c268a768087b408658e216133aecd835c0ded47ce955381105ba39"}, + {file = "greenlet-3.1.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:4afe7ea89de619adc868e087b4d2359282058479d7cfb94970adf4b55284574d"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f406b22b7c9a9b4f8aa9d2ab13d6ae0ac3e85c9a809bd590ad53fed2bf70dc79"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c3a701fe5a9695b238503ce5bbe8218e03c3bcccf7e204e455e7462d770268aa"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2846930c65b47d70b9d178e89c7e1a69c95c1f68ea5aa0a58646b7a96df12441"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99cfaa2110534e2cf3ba31a7abcac9d328d1d9f1b95beede58294a60348fba36"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9"}, + {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b7cede291382a78f7bb5f04a529cb18e068dd29e0fb27376074b6d0317bf4dd0"}, + {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:23f20bb60ae298d7d8656c6ec6db134bca379ecefadb0b19ce6f19d1f232a942"}, + {file = "greenlet-3.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:7124e16b4c55d417577c2077be379514321916d5790fa287c9ed6f23bd2ffd01"}, + {file = "greenlet-3.1.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:05175c27cb459dcfc05d026c4232f9de8913ed006d42713cb8a5137bd49375f1"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:935e943ec47c4afab8965954bf49bfa639c05d4ccf9ef6e924188f762145c0ff"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:667a9706c970cb552ede35aee17339a18e8f2a87a51fba2ed39ceeeb1004798a"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8a678974d1f3aa55f6cc34dc480169d58f2e6d8958895d68845fa4ab566509e"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efc0f674aa41b92da8c49e0346318c6075d734994c3c4e4430b1c3f853e498e4"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0153404a4bb921f0ff1abeb5ce8a5131da56b953eda6e14b88dc6bbc04d2049e"}, + {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:275f72decf9932639c1c6dd1013a1bc266438eb32710016a1c742df5da6e60a1"}, + {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c4aab7f6381f38a4b42f269057aee279ab0fc7bf2e929e3d4abfae97b682a12c"}, + {file = "greenlet-3.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:b42703b1cf69f2aa1df7d1030b9d77d3e584a70755674d60e710f0af570f3761"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1695e76146579f8c06c1509c7ce4dfe0706f49c6831a817ac04eebb2fd02011"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7876452af029456b3f3549b696bb36a06db7c90747740c5302f74a9e9fa14b13"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ead44c85f8ab905852d3de8d86f6f8baf77109f9da589cb4fa142bd3b57b475"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8320f64b777d00dd7ccdade271eaf0cad6636343293a25074cc5566160e4de7b"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6510bf84a6b643dabba74d3049ead221257603a253d0a9873f55f6a59a65f822"}, + {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:04b013dc07c96f83134b1e99888e7a79979f1a247e2a9f59697fa14b5862ed01"}, + {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47da355d8687fd65240c364c90a31569a133b7b60de111c255ef5b606f2ae291"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:98884ecf2ffb7d7fe6bd517e8eb99d31ff7855a840fa6d0d63cd07c037f6a981"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1d4aeb8891338e60d1ab6127af1fe45def5259def8094b9c7e34690c8858803"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db32b5348615a04b82240cc67983cb315309e88d444a288934ee6ceaebcad6cc"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dcc62f31eae24de7f8dce72134c8651c58000d3b1868e01392baea7c32c247de"}, + {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1d3755bcb2e02de341c55b4fca7a745a24a9e7212ac953f6b3a48d117d7257aa"}, + {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b8da394b34370874b4572676f36acabac172602abf054cbc4ac910219f3340af"}, + {file = "greenlet-3.1.1-cp37-cp37m-win32.whl", hash = "sha256:a0dfc6c143b519113354e780a50381508139b07d2177cb6ad6a08278ec655798"}, + {file = "greenlet-3.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:54558ea205654b50c438029505def3834e80f0869a70fb15b871c29b4575ddef"}, + {file = "greenlet-3.1.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:346bed03fe47414091be4ad44786d1bd8bef0c3fcad6ed3dee074a032ab408a9"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfc59d69fc48664bc693842bd57acfdd490acafda1ab52c7836e3fc75c90a111"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21e10da6ec19b457b82636209cbe2331ff4306b54d06fa04b7c138ba18c8a81"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37b9de5a96111fc15418819ab4c4432e4f3c2ede61e660b1e33971eba26ef9ba"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ef9ea3f137e5711f0dbe5f9263e8c009b7069d8a1acea822bd5e9dae0ae49c8"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:85f3ff71e2e60bd4b4932a043fbbe0f499e263c628390b285cb599154a3b03b1"}, + {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:95ffcf719966dd7c453f908e208e14cde192e09fde6c7186c8f1896ef778d8cd"}, + {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:03a088b9de532cbfe2ba2034b2b85e82df37874681e8c470d6fb2f8c04d7e4b7"}, + {file = "greenlet-3.1.1-cp38-cp38-win32.whl", hash = "sha256:8b8b36671f10ba80e159378df9c4f15c14098c4fd73a36b9ad715f057272fbef"}, + {file = "greenlet-3.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:7017b2be767b9d43cc31416aba48aab0d2309ee31b4dbf10a1d38fb7972bdf9d"}, + {file = "greenlet-3.1.1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:396979749bd95f018296af156201d6211240e7a23090f50a8d5d18c370084dc3"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca9d0ff5ad43e785350894d97e13633a66e2b50000e8a183a50a88d834752d42"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f6ff3b14f2df4c41660a7dec01045a045653998784bf8cfcb5a525bdffffbc8f"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94ebba31df2aa506d7b14866fed00ac141a867e63143fe5bca82a8e503b36437"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73aaad12ac0ff500f62cebed98d8789198ea0e6f233421059fa68a5aa7220145"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63e4844797b975b9af3a3fb8f7866ff08775f5426925e1e0bbcfe7932059a12c"}, + {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7939aa3ca7d2a1593596e7ac6d59391ff30281ef280d8632fa03d81f7c5f955e"}, + {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d0028e725ee18175c6e422797c407874da24381ce0690d6b9396c204c7f7276e"}, + {file = "greenlet-3.1.1-cp39-cp39-win32.whl", hash = "sha256:5e06afd14cbaf9e00899fae69b24a32f2196c19de08fcb9f4779dd4f004e5e7c"}, + {file = "greenlet-3.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:3319aa75e0e0639bc15ff54ca327e8dc7a6fe404003496e3c6925cd3142e0e22"}, + {file = "greenlet-3.1.1.tar.gz", hash = "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467"}, ] [package.extras] @@ -921,13 +928,13 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "keyring" -version = "25.4.0" +version = "25.4.1" description = "Store and access your passwords safely." optional = false python-versions = ">=3.8" files = [ - {file = "keyring-25.4.0-py3-none-any.whl", hash = "sha256:a2a630d5c9bef5d3f0968d15ef4e42b894a83e17494edcb67b154c36491c9920"}, - {file = "keyring-25.4.0.tar.gz", hash = "sha256:ae8263fd9264c94f91ad82d098f8a5bb1b7fa71ce0a72388dc4fc0be3f6a034e"}, + {file = "keyring-25.4.1-py3-none-any.whl", hash = "sha256:5426f817cf7f6f007ba5ec722b1bcad95a75b27d780343772ad76b17cb47b0bf"}, + {file = "keyring-25.4.1.tar.gz", hash = "sha256:b07ebc55f3e8ed86ac81dd31ef14e81ace9dd9c3d4b5d77a6e9a2016d0d71a1b"}, ] [package.dependencies] @@ -1137,6 +1144,60 @@ files = [ {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, ] +[[package]] +name = "numpy" +version = "2.0.2" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "numpy-2.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:51129a29dbe56f9ca83438b706e2e69a39892b5eda6cedcb6b0c9fdc9b0d3ece"}, + {file = "numpy-2.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f15975dfec0cf2239224d80e32c3170b1d168335eaedee69da84fbe9f1f9cd04"}, + {file = "numpy-2.0.2-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:8c5713284ce4e282544c68d1c3b2c7161d38c256d2eefc93c1d683cf47683e66"}, + {file = "numpy-2.0.2-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:becfae3ddd30736fe1889a37f1f580e245ba79a5855bff5f2a29cb3ccc22dd7b"}, + {file = "numpy-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2da5960c3cf0df7eafefd806d4e612c5e19358de82cb3c343631188991566ccd"}, + {file = "numpy-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:496f71341824ed9f3d2fd36cf3ac57ae2e0165c143b55c3a035ee219413f3318"}, + {file = "numpy-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a61ec659f68ae254e4d237816e33171497e978140353c0c2038d46e63282d0c8"}, + {file = "numpy-2.0.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d731a1c6116ba289c1e9ee714b08a8ff882944d4ad631fd411106a30f083c326"}, + {file = "numpy-2.0.2-cp310-cp310-win32.whl", hash = "sha256:984d96121c9f9616cd33fbd0618b7f08e0cfc9600a7ee1d6fd9b239186d19d97"}, + {file = "numpy-2.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:c7b0be4ef08607dd04da4092faee0b86607f111d5ae68036f16cc787e250a131"}, + {file = "numpy-2.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:49ca4decb342d66018b01932139c0961a8f9ddc7589611158cb3c27cbcf76448"}, + {file = "numpy-2.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:11a76c372d1d37437857280aa142086476136a8c0f373b2e648ab2c8f18fb195"}, + {file = "numpy-2.0.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:807ec44583fd708a21d4a11d94aedf2f4f3c3719035c76a2bbe1fe8e217bdc57"}, + {file = "numpy-2.0.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:8cafab480740e22f8d833acefed5cc87ce276f4ece12fdaa2e8903db2f82897a"}, + {file = "numpy-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a15f476a45e6e5a3a79d8a14e62161d27ad897381fecfa4a09ed5322f2085669"}, + {file = "numpy-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13e689d772146140a252c3a28501da66dfecd77490b498b168b501835041f951"}, + {file = "numpy-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9ea91dfb7c3d1c56a0e55657c0afb38cf1eeae4544c208dc465c3c9f3a7c09f9"}, + {file = "numpy-2.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c1c9307701fec8f3f7a1e6711f9089c06e6284b3afbbcd259f7791282d660a15"}, + {file = "numpy-2.0.2-cp311-cp311-win32.whl", hash = "sha256:a392a68bd329eafac5817e5aefeb39038c48b671afd242710b451e76090e81f4"}, + {file = "numpy-2.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:286cd40ce2b7d652a6f22efdfc6d1edf879440e53e76a75955bc0c826c7e64dc"}, + {file = "numpy-2.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:df55d490dea7934f330006d0f81e8551ba6010a5bf035a249ef61a94f21c500b"}, + {file = "numpy-2.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8df823f570d9adf0978347d1f926b2a867d5608f434a7cff7f7908c6570dcf5e"}, + {file = "numpy-2.0.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:9a92ae5c14811e390f3767053ff54eaee3bf84576d99a2456391401323f4ec2c"}, + {file = "numpy-2.0.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:a842d573724391493a97a62ebbb8e731f8a5dcc5d285dfc99141ca15a3302d0c"}, + {file = "numpy-2.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c05e238064fc0610c840d1cf6a13bf63d7e391717d247f1bf0318172e759e692"}, + {file = "numpy-2.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0123ffdaa88fa4ab64835dcbde75dcdf89c453c922f18dced6e27c90d1d0ec5a"}, + {file = "numpy-2.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:96a55f64139912d61de9137f11bf39a55ec8faec288c75a54f93dfd39f7eb40c"}, + {file = "numpy-2.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ec9852fb39354b5a45a80bdab5ac02dd02b15f44b3804e9f00c556bf24b4bded"}, + {file = "numpy-2.0.2-cp312-cp312-win32.whl", hash = "sha256:671bec6496f83202ed2d3c8fdc486a8fc86942f2e69ff0e986140339a63bcbe5"}, + {file = "numpy-2.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:cfd41e13fdc257aa5778496b8caa5e856dc4896d4ccf01841daee1d96465467a"}, + {file = "numpy-2.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9059e10581ce4093f735ed23f3b9d283b9d517ff46009ddd485f1747eb22653c"}, + {file = "numpy-2.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:423e89b23490805d2a5a96fe40ec507407b8ee786d66f7328be214f9679df6dd"}, + {file = "numpy-2.0.2-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:2b2955fa6f11907cf7a70dab0d0755159bca87755e831e47932367fc8f2f2d0b"}, + {file = "numpy-2.0.2-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:97032a27bd9d8988b9a97a8c4d2c9f2c15a81f61e2f21404d7e8ef00cb5be729"}, + {file = "numpy-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e795a8be3ddbac43274f18588329c72939870a16cae810c2b73461c40718ab1"}, + {file = "numpy-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f26b258c385842546006213344c50655ff1555a9338e2e5e02a0756dc3e803dd"}, + {file = "numpy-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fec9451a7789926bcf7c2b8d187292c9f93ea30284802a0ab3f5be8ab36865d"}, + {file = "numpy-2.0.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9189427407d88ff25ecf8f12469d4d39d35bee1db5d39fc5c168c6f088a6956d"}, + {file = "numpy-2.0.2-cp39-cp39-win32.whl", hash = "sha256:905d16e0c60200656500c95b6b8dca5d109e23cb24abc701d41c02d74c6b3afa"}, + {file = "numpy-2.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:a3f4ab0caa7f053f6797fcd4e1e25caee367db3112ef2b6ef82d749530768c73"}, + {file = "numpy-2.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:7f0a0c6f12e07fa94133c8a67404322845220c06a9e80e85999afe727f7438b8"}, + {file = "numpy-2.0.2-pp39-pypy39_pp73-macosx_14_0_x86_64.whl", hash = "sha256:312950fdd060354350ed123c0e25a71327d3711584beaef30cdaa93320c392d4"}, + {file = "numpy-2.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26df23238872200f63518dd2aa984cfca675d82469535dc7162dc2ee52d9dd5c"}, + {file = "numpy-2.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a46288ec55ebbd58947d31d72be2c63cbf839f0a63b49cb755022310792a3385"}, + {file = "numpy-2.0.2.tar.gz", hash = "sha256:883c987dee1880e2a864ab0dc9892292582510604156762362d9326444636e78"}, +] + [[package]] name = "numpy" version = "2.1.1" @@ -1226,40 +1287,53 @@ files = [ [[package]] name = "pandas" -version = "2.2.2" +version = "2.2.3" description = "Powerful data structures for data analysis, time series, and statistics" optional = false python-versions = ">=3.9" files = [ - {file = "pandas-2.2.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:90c6fca2acf139569e74e8781709dccb6fe25940488755716d1d354d6bc58bce"}, - {file = "pandas-2.2.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c7adfc142dac335d8c1e0dcbd37eb8617eac386596eb9e1a1b77791cf2498238"}, - {file = "pandas-2.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4abfe0be0d7221be4f12552995e58723c7422c80a659da13ca382697de830c08"}, - {file = "pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8635c16bf3d99040fdf3ca3db669a7250ddf49c55dc4aa8fe0ae0fa8d6dcc1f0"}, - {file = "pandas-2.2.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:40ae1dffb3967a52203105a077415a86044a2bea011b5f321c6aa64b379a3f51"}, - {file = "pandas-2.2.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8e5a0b00e1e56a842f922e7fae8ae4077aee4af0acb5ae3622bd4b4c30aedf99"}, - {file = "pandas-2.2.2-cp310-cp310-win_amd64.whl", hash = "sha256:ddf818e4e6c7c6f4f7c8a12709696d193976b591cc7dc50588d3d1a6b5dc8772"}, - {file = "pandas-2.2.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:696039430f7a562b74fa45f540aca068ea85fa34c244d0deee539cb6d70aa288"}, - {file = "pandas-2.2.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8e90497254aacacbc4ea6ae5e7a8cd75629d6ad2b30025a4a8b09aa4faf55151"}, - {file = "pandas-2.2.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:58b84b91b0b9f4bafac2a0ac55002280c094dfc6402402332c0913a59654ab2b"}, - {file = "pandas-2.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2123dc9ad6a814bcdea0f099885276b31b24f7edf40f6cdbc0912672e22eee"}, - {file = "pandas-2.2.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:2925720037f06e89af896c70bca73459d7e6a4be96f9de79e2d440bd499fe0db"}, - {file = "pandas-2.2.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0cace394b6ea70c01ca1595f839cf193df35d1575986e484ad35c4aeae7266c1"}, - {file = "pandas-2.2.2-cp311-cp311-win_amd64.whl", hash = "sha256:873d13d177501a28b2756375d59816c365e42ed8417b41665f346289adc68d24"}, - {file = "pandas-2.2.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9dfde2a0ddef507a631dc9dc4af6a9489d5e2e740e226ad426a05cabfbd7c8ef"}, - {file = "pandas-2.2.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e9b79011ff7a0f4b1d6da6a61aa1aa604fb312d6647de5bad20013682d1429ce"}, - {file = "pandas-2.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1cb51fe389360f3b5a4d57dbd2848a5f033350336ca3b340d1c53a1fad33bcad"}, - {file = "pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eee3a87076c0756de40b05c5e9a6069c035ba43e8dd71c379e68cab2c20f16ad"}, - {file = "pandas-2.2.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3e374f59e440d4ab45ca2fffde54b81ac3834cf5ae2cdfa69c90bc03bde04d76"}, - {file = "pandas-2.2.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:43498c0bdb43d55cb162cdc8c06fac328ccb5d2eabe3cadeb3529ae6f0517c32"}, - {file = "pandas-2.2.2-cp312-cp312-win_amd64.whl", hash = "sha256:d187d355ecec3629624fccb01d104da7d7f391db0311145817525281e2804d23"}, - {file = "pandas-2.2.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0ca6377b8fca51815f382bd0b697a0814c8bda55115678cbc94c30aacbb6eff2"}, - {file = "pandas-2.2.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9057e6aa78a584bc93a13f0a9bf7e753a5e9770a30b4d758b8d5f2a62a9433cd"}, - {file = "pandas-2.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:001910ad31abc7bf06f49dcc903755d2f7f3a9186c0c040b827e522e9cef0863"}, - {file = "pandas-2.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:66b479b0bd07204e37583c191535505410daa8df638fd8e75ae1b383851fe921"}, - {file = "pandas-2.2.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a77e9d1c386196879aa5eb712e77461aaee433e54c68cf253053a73b7e49c33a"}, - {file = "pandas-2.2.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:92fd6b027924a7e178ac202cfbe25e53368db90d56872d20ffae94b96c7acc57"}, - {file = "pandas-2.2.2-cp39-cp39-win_amd64.whl", hash = "sha256:640cef9aa381b60e296db324337a554aeeb883ead99dc8f6c18e81a93942f5f4"}, - {file = "pandas-2.2.2.tar.gz", hash = "sha256:9e79019aba43cb4fda9e4d983f8e88ca0373adbb697ae9c6c43093218de28b54"}, + {file = "pandas-2.2.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1948ddde24197a0f7add2bdc4ca83bf2b1ef84a1bc8ccffd95eda17fd836ecb5"}, + {file = "pandas-2.2.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:381175499d3802cde0eabbaf6324cce0c4f5d52ca6f8c377c29ad442f50f6348"}, + {file = "pandas-2.2.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d9c45366def9a3dd85a6454c0e7908f2b3b8e9c138f5dc38fed7ce720d8453ed"}, + {file = "pandas-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:86976a1c5b25ae3f8ccae3a5306e443569ee3c3faf444dfd0f41cda24667ad57"}, + {file = "pandas-2.2.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b8661b0238a69d7aafe156b7fa86c44b881387509653fdf857bebc5e4008ad42"}, + {file = "pandas-2.2.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:37e0aced3e8f539eccf2e099f65cdb9c8aa85109b0be6e93e2baff94264bdc6f"}, + {file = "pandas-2.2.3-cp310-cp310-win_amd64.whl", hash = "sha256:56534ce0746a58afaf7942ba4863e0ef81c9c50d3f0ae93e9497d6a41a057645"}, + {file = "pandas-2.2.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:66108071e1b935240e74525006034333f98bcdb87ea116de573a6a0dccb6c039"}, + {file = "pandas-2.2.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7c2875855b0ff77b2a64a0365e24455d9990730d6431b9e0ee18ad8acee13dbd"}, + {file = "pandas-2.2.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd8d0c3be0515c12fed0bdbae072551c8b54b7192c7b1fda0ba56059a0179698"}, + {file = "pandas-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c124333816c3a9b03fbeef3a9f230ba9a737e9e5bb4060aa2107a86cc0a497fc"}, + {file = "pandas-2.2.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:63cc132e40a2e084cf01adf0775b15ac515ba905d7dcca47e9a251819c575ef3"}, + {file = "pandas-2.2.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:29401dbfa9ad77319367d36940cd8a0b3a11aba16063e39632d98b0e931ddf32"}, + {file = "pandas-2.2.3-cp311-cp311-win_amd64.whl", hash = "sha256:3fc6873a41186404dad67245896a6e440baacc92f5b716ccd1bc9ed2995ab2c5"}, + {file = "pandas-2.2.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b1d432e8d08679a40e2a6d8b2f9770a5c21793a6f9f47fdd52c5ce1948a5a8a9"}, + {file = "pandas-2.2.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a5a1595fe639f5988ba6a8e5bc9649af3baf26df3998a0abe56c02609392e0a4"}, + {file = "pandas-2.2.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5de54125a92bb4d1c051c0659e6fcb75256bf799a732a87184e5ea503965bce3"}, + {file = "pandas-2.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fffb8ae78d8af97f849404f21411c95062db1496aeb3e56f146f0355c9989319"}, + {file = "pandas-2.2.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6dfcb5ee8d4d50c06a51c2fffa6cff6272098ad6540aed1a76d15fb9318194d8"}, + {file = "pandas-2.2.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:062309c1b9ea12a50e8ce661145c6aab431b1e99530d3cd60640e255778bd43a"}, + {file = "pandas-2.2.3-cp312-cp312-win_amd64.whl", hash = "sha256:59ef3764d0fe818125a5097d2ae867ca3fa64df032331b7e0917cf5d7bf66b13"}, + {file = "pandas-2.2.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f00d1345d84d8c86a63e476bb4955e46458b304b9575dcf71102b5c705320015"}, + {file = "pandas-2.2.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3508d914817e153ad359d7e069d752cdd736a247c322d932eb89e6bc84217f28"}, + {file = "pandas-2.2.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22a9d949bfc9a502d320aa04e5d02feab689d61da4e7764b62c30b991c42c5f0"}, + {file = "pandas-2.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3a255b2c19987fbbe62a9dfd6cff7ff2aa9ccab3fc75218fd4b7530f01efa24"}, + {file = "pandas-2.2.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:800250ecdadb6d9c78eae4990da62743b857b470883fa27f652db8bdde7f6659"}, + {file = "pandas-2.2.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6374c452ff3ec675a8f46fd9ab25c4ad0ba590b71cf0656f8b6daa5202bca3fb"}, + {file = "pandas-2.2.3-cp313-cp313-win_amd64.whl", hash = "sha256:61c5ad4043f791b61dd4752191d9f07f0ae412515d59ba8f005832a532f8736d"}, + {file = "pandas-2.2.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:3b71f27954685ee685317063bf13c7709a7ba74fc996b84fc6821c59b0f06468"}, + {file = "pandas-2.2.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:38cf8125c40dae9d5acc10fa66af8ea6fdf760b2714ee482ca691fc66e6fcb18"}, + {file = "pandas-2.2.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ba96630bc17c875161df3818780af30e43be9b166ce51c9a18c1feae342906c2"}, + {file = "pandas-2.2.3-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1db71525a1538b30142094edb9adc10be3f3e176748cd7acc2240c2f2e5aa3a4"}, + {file = "pandas-2.2.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:15c0e1e02e93116177d29ff83e8b1619c93ddc9c49083f237d4312337a61165d"}, + {file = "pandas-2.2.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:ad5b65698ab28ed8d7f18790a0dc58005c7629f227be9ecc1072aa74c0c1d43a"}, + {file = "pandas-2.2.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bc6b93f9b966093cb0fd62ff1a7e4c09e6d546ad7c1de191767baffc57628f39"}, + {file = "pandas-2.2.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5dbca4c1acd72e8eeef4753eeca07de9b1db4f398669d5994086f788a5d7cc30"}, + {file = "pandas-2.2.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8cd6d7cc958a3910f934ea8dbdf17b2364827bb4dafc38ce6eef6bb3d65ff09c"}, + {file = "pandas-2.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99df71520d25fade9db7c1076ac94eb994f4d2673ef2aa2e86ee039b6746d20c"}, + {file = "pandas-2.2.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:31d0ced62d4ea3e231a9f228366919a5ea0b07440d9d4dac345376fd8e1477ea"}, + {file = "pandas-2.2.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7eee9e7cea6adf3e3d24e304ac6b8300646e2a5d1cd3a3c2abed9101b0846761"}, + {file = "pandas-2.2.3-cp39-cp39-win_amd64.whl", hash = "sha256:4850ba03528b6dd51d6c5d273c46f183f39a9baf3f0143e566b89450965b105e"}, + {file = "pandas-2.2.3.tar.gz", hash = "sha256:4f18ba62b61d7e192368b84517265a99b4d7ee8912f8708660fb4a366cc82667"}, ] [package.dependencies] @@ -1861,18 +1935,15 @@ docs = ["sphinx"] [[package]] name = "python-multipart" -version = "0.0.9" +version = "0.0.10" description = "A streaming multipart parser for Python" optional = false python-versions = ">=3.8" files = [ - {file = "python_multipart-0.0.9-py3-none-any.whl", hash = "sha256:97ca7b8ea7b05f977dc3849c3ba99d51689822fab725c3703af7c866a0c2b215"}, - {file = "python_multipart-0.0.9.tar.gz", hash = "sha256:03f54688c663f1b7977105f021043b0793151e4cb1c1a9d4a11fc13d622c4026"}, + {file = "python_multipart-0.0.10-py3-none-any.whl", hash = "sha256:2b06ad9e8d50c7a8db80e3b56dab590137b323410605af2be20d62a5f1ba1dc8"}, + {file = "python_multipart-0.0.10.tar.gz", hash = "sha256:46eb3c6ce6fdda5fb1a03c7e11d490e407c6930a2703fe7aef4da71c374688fa"}, ] -[package.extras] -dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatch", "invoke (==2.2.0)", "more-itertools (==10.2.0)", "pbr (==6.0.0)", "pluggy (==1.4.0)", "py (==1.11.0)", "pytest (==8.0.0)", "pytest-cov (==4.1.0)", "pytest-timeout (==2.2.0)", "pyyaml (==6.0.1)", "ruff (==0.2.1)"] - [[package]] name = "python-socketio" version = "5.11.4" @@ -2161,13 +2232,13 @@ jeepney = ">=0.6" [[package]] name = "selenium" -version = "4.24.0" +version = "4.25.0" description = "Official Python bindings for Selenium WebDriver" optional = false python-versions = ">=3.8" files = [ - {file = "selenium-4.24.0-py3-none-any.whl", hash = "sha256:42c23f60753d5415b261b236cecbd69bd4eb5271e1563915f546b443cb6b71c6"}, - {file = "selenium-4.24.0.tar.gz", hash = "sha256:88281e5b5b90fe231868905d5ea745b9ee5e30db280b33498cc73fb0fa06d571"}, + {file = "selenium-4.25.0-py3-none-any.whl", hash = "sha256:3798d2d12b4a570bc5790163ba57fef10b2afee958bf1d80f2a3cf07c4141f33"}, + {file = "selenium-4.25.0.tar.gz", hash = "sha256:95d08d3b82fb353f3c474895154516604c7f0e6a9a565ae6498ef36c9bac6921"}, ] [package.dependencies] @@ -2358,17 +2429,18 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.38.5" +version = "0.38.6" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.38.5-py3-none-any.whl", hash = "sha256:632f420a9d13e3ee2a6f18f437b0a9f1faecb0bc42e1942aa2ea0e379a4c4206"}, - {file = "starlette-0.38.5.tar.gz", hash = "sha256:04a92830a9b6eb1442c766199d62260c3d4dc9c4f9188360626b1e0273cb7077"}, + {file = "starlette-0.38.6-py3-none-any.whl", hash = "sha256:4517a1409e2e73ee4951214ba012052b9e16f60e90d73cfb06192c19203bbb05"}, + {file = "starlette-0.38.6.tar.gz", hash = "sha256:863a1588f5574e70a821dadefb41e4881ea451a47a3cd1b4df359d4ffefe5ead"}, ] [package.dependencies] anyio = ">=3.4.0,<5" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} [package.extras] full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7)", "pyyaml"] @@ -2632,97 +2704,97 @@ test = ["websockets"] [[package]] name = "websockets" -version = "13.0.1" +version = "13.1" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" optional = false python-versions = ">=3.8" files = [ - {file = "websockets-13.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:1841c9082a3ba4a05ea824cf6d99570a6a2d8849ef0db16e9c826acb28089e8f"}, - {file = "websockets-13.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c5870b4a11b77e4caa3937142b650fbbc0914a3e07a0cf3131f35c0587489c1c"}, - {file = "websockets-13.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f1d3d1f2eb79fe7b0fb02e599b2bf76a7619c79300fc55f0b5e2d382881d4f7f"}, - {file = "websockets-13.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15c7d62ee071fa94a2fc52c2b472fed4af258d43f9030479d9c4a2de885fd543"}, - {file = "websockets-13.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6724b554b70d6195ba19650fef5759ef11346f946c07dbbe390e039bcaa7cc3d"}, - {file = "websockets-13.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56a952fa2ae57a42ba7951e6b2605e08a24801a4931b5644dfc68939e041bc7f"}, - {file = "websockets-13.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:17118647c0ea14796364299e942c330d72acc4b248e07e639d34b75067b3cdd8"}, - {file = "websockets-13.0.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:64a11aae1de4c178fa653b07d90f2fb1a2ed31919a5ea2361a38760192e1858b"}, - {file = "websockets-13.0.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:0617fd0b1d14309c7eab6ba5deae8a7179959861846cbc5cb528a7531c249448"}, - {file = "websockets-13.0.1-cp310-cp310-win32.whl", hash = "sha256:11f9976ecbc530248cf162e359a92f37b7b282de88d1d194f2167b5e7ad80ce3"}, - {file = "websockets-13.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:c3c493d0e5141ec055a7d6809a28ac2b88d5b878bb22df8c621ebe79a61123d0"}, - {file = "websockets-13.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:699ba9dd6a926f82a277063603fc8d586b89f4cb128efc353b749b641fcddda7"}, - {file = "websockets-13.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cf2fae6d85e5dc384bf846f8243ddaa9197f3a1a70044f59399af001fd1f51d4"}, - {file = "websockets-13.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:52aed6ef21a0f1a2a5e310fb5c42d7555e9c5855476bbd7173c3aa3d8a0302f2"}, - {file = "websockets-13.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8eb2b9a318542153674c6e377eb8cb9ca0fc011c04475110d3477862f15d29f0"}, - {file = "websockets-13.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5df891c86fe68b2c38da55b7aea7095beca105933c697d719f3f45f4220a5e0e"}, - {file = "websockets-13.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fac2d146ff30d9dd2fcf917e5d147db037a5c573f0446c564f16f1f94cf87462"}, - {file = "websockets-13.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b8ac5b46fd798bbbf2ac6620e0437c36a202b08e1f827832c4bf050da081b501"}, - {file = "websockets-13.0.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:46af561eba6f9b0848b2c9d2427086cabadf14e0abdd9fde9d72d447df268418"}, - {file = "websockets-13.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b5a06d7f60bc2fc378a333978470dfc4e1415ee52f5f0fce4f7853eb10c1e9df"}, - {file = "websockets-13.0.1-cp311-cp311-win32.whl", hash = "sha256:556e70e4f69be1082e6ef26dcb70efcd08d1850f5d6c5f4f2bcb4e397e68f01f"}, - {file = "websockets-13.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:67494e95d6565bf395476e9d040037ff69c8b3fa356a886b21d8422ad86ae075"}, - {file = "websockets-13.0.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f9c9e258e3d5efe199ec23903f5da0eeaad58cf6fccb3547b74fd4750e5ac47a"}, - {file = "websockets-13.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6b41a1b3b561f1cba8321fb32987552a024a8f67f0d05f06fcf29f0090a1b956"}, - {file = "websockets-13.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f73e676a46b0fe9426612ce8caeca54c9073191a77c3e9d5c94697aef99296af"}, - {file = "websockets-13.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f613289f4a94142f914aafad6c6c87903de78eae1e140fa769a7385fb232fdf"}, - {file = "websockets-13.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f52504023b1480d458adf496dc1c9e9811df4ba4752f0bc1f89ae92f4f07d0c"}, - {file = "websockets-13.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:139add0f98206cb74109faf3611b7783ceafc928529c62b389917a037d4cfdf4"}, - {file = "websockets-13.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:47236c13be337ef36546004ce8c5580f4b1150d9538b27bf8a5ad8edf23ccfab"}, - {file = "websockets-13.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c44ca9ade59b2e376612df34e837013e2b273e6c92d7ed6636d0556b6f4db93d"}, - {file = "websockets-13.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9bbc525f4be3e51b89b2a700f5746c2a6907d2e2ef4513a8daafc98198b92237"}, - {file = "websockets-13.0.1-cp312-cp312-win32.whl", hash = "sha256:3624fd8664f2577cf8de996db3250662e259bfbc870dd8ebdcf5d7c6ac0b5185"}, - {file = "websockets-13.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0513c727fb8adffa6d9bf4a4463b2bade0186cbd8c3604ae5540fae18a90cb99"}, - {file = "websockets-13.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:1ee4cc030a4bdab482a37462dbf3ffb7e09334d01dd37d1063be1136a0d825fa"}, - {file = "websockets-13.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dbb0b697cc0655719522406c059eae233abaa3243821cfdfab1215d02ac10231"}, - {file = "websockets-13.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:acbebec8cb3d4df6e2488fbf34702cbc37fc39ac7abf9449392cefb3305562e9"}, - {file = "websockets-13.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63848cdb6fcc0bf09d4a155464c46c64ffdb5807ede4fb251da2c2692559ce75"}, - {file = "websockets-13.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:872afa52a9f4c414d6955c365b6588bc4401272c629ff8321a55f44e3f62b553"}, - {file = "websockets-13.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05e70fec7c54aad4d71eae8e8cab50525e899791fc389ec6f77b95312e4e9920"}, - {file = "websockets-13.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e82db3756ccb66266504f5a3de05ac6b32f287faacff72462612120074103329"}, - {file = "websockets-13.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4e85f46ce287f5c52438bb3703d86162263afccf034a5ef13dbe4318e98d86e7"}, - {file = "websockets-13.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f3fea72e4e6edb983908f0db373ae0732b275628901d909c382aae3b592589f2"}, - {file = "websockets-13.0.1-cp313-cp313-win32.whl", hash = "sha256:254ecf35572fca01a9f789a1d0f543898e222f7b69ecd7d5381d8d8047627bdb"}, - {file = "websockets-13.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:ca48914cdd9f2ccd94deab5bcb5ac98025a5ddce98881e5cce762854a5de330b"}, - {file = "websockets-13.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:b74593e9acf18ea5469c3edaa6b27fa7ecf97b30e9dabd5a94c4c940637ab96e"}, - {file = "websockets-13.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:132511bfd42e77d152c919147078460c88a795af16b50e42a0bd14f0ad71ddd2"}, - {file = "websockets-13.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:165bedf13556f985a2aa064309baa01462aa79bf6112fbd068ae38993a0e1f1b"}, - {file = "websockets-13.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e801ca2f448850685417d723ec70298feff3ce4ff687c6f20922c7474b4746ae"}, - {file = "websockets-13.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30d3a1f041360f029765d8704eae606781e673e8918e6b2c792e0775de51352f"}, - {file = "websockets-13.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67648f5e50231b5a7f6d83b32f9c525e319f0ddc841be0de64f24928cd75a603"}, - {file = "websockets-13.0.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:4f0426d51c8f0926a4879390f53c7f5a855e42d68df95fff6032c82c888b5f36"}, - {file = "websockets-13.0.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ef48e4137e8799998a343706531e656fdec6797b80efd029117edacb74b0a10a"}, - {file = "websockets-13.0.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:249aab278810bee585cd0d4de2f08cfd67eed4fc75bde623be163798ed4db2eb"}, - {file = "websockets-13.0.1-cp38-cp38-win32.whl", hash = "sha256:06c0a667e466fcb56a0886d924b5f29a7f0886199102f0a0e1c60a02a3751cb4"}, - {file = "websockets-13.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1f3cf6d6ec1142412d4535adabc6bd72a63f5f148c43fe559f06298bc21953c9"}, - {file = "websockets-13.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1fa082ea38d5de51dd409434edc27c0dcbd5fed2b09b9be982deb6f0508d25bc"}, - {file = "websockets-13.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4a365bcb7be554e6e1f9f3ed64016e67e2fa03d7b027a33e436aecf194febb63"}, - {file = "websockets-13.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:10a0dc7242215d794fb1918f69c6bb235f1f627aaf19e77f05336d147fce7c37"}, - {file = "websockets-13.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59197afd478545b1f73367620407b0083303569c5f2d043afe5363676f2697c9"}, - {file = "websockets-13.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d20516990d8ad557b5abeb48127b8b779b0b7e6771a265fa3e91767596d7d97"}, - {file = "websockets-13.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1a2e272d067030048e1fe41aa1ec8cfbbaabce733b3d634304fa2b19e5c897f"}, - {file = "websockets-13.0.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:ad327ac80ba7ee61da85383ca8822ff808ab5ada0e4a030d66703cc025b021c4"}, - {file = "websockets-13.0.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:518f90e6dd089d34eaade01101fd8a990921c3ba18ebbe9b0165b46ebff947f0"}, - {file = "websockets-13.0.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:68264802399aed6fe9652e89761031acc734fc4c653137a5911c2bfa995d6d6d"}, - {file = "websockets-13.0.1-cp39-cp39-win32.whl", hash = "sha256:a5dc0c42ded1557cc7c3f0240b24129aefbad88af4f09346164349391dea8e58"}, - {file = "websockets-13.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:b448a0690ef43db5ef31b3a0d9aea79043882b4632cfc3eaab20105edecf6097"}, - {file = "websockets-13.0.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:faef9ec6354fe4f9a2c0bbb52fb1ff852effc897e2a4501e25eb3a47cb0a4f89"}, - {file = "websockets-13.0.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:03d3f9ba172e0a53e37fa4e636b86cc60c3ab2cfee4935e66ed1d7acaa4625ad"}, - {file = "websockets-13.0.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d450f5a7a35662a9b91a64aefa852f0c0308ee256122f5218a42f1d13577d71e"}, - {file = "websockets-13.0.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f55b36d17ac50aa8a171b771e15fbe1561217510c8768af3d546f56c7576cdc"}, - {file = "websockets-13.0.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14b9c006cac63772b31abbcd3e3abb6228233eec966bf062e89e7fa7ae0b7333"}, - {file = "websockets-13.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:b79915a1179a91f6c5f04ece1e592e2e8a6bd245a0e45d12fd56b2b59e559a32"}, - {file = "websockets-13.0.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:f40de079779acbcdbb6ed4c65af9f018f8b77c5ec4e17a4b737c05c2db554491"}, - {file = "websockets-13.0.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:80e4ba642fc87fa532bac07e5ed7e19d56940b6af6a8c61d4429be48718a380f"}, - {file = "websockets-13.0.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a02b0161c43cc9e0232711eff846569fad6ec836a7acab16b3cf97b2344c060"}, - {file = "websockets-13.0.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6aa74a45d4cdc028561a7d6ab3272c8b3018e23723100b12e58be9dfa5a24491"}, - {file = "websockets-13.0.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00fd961943b6c10ee6f0b1130753e50ac5dcd906130dcd77b0003c3ab797d026"}, - {file = "websockets-13.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:d93572720d781331fb10d3da9ca1067817d84ad1e7c31466e9f5e59965618096"}, - {file = "websockets-13.0.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:71e6e5a3a3728886caee9ab8752e8113670936a193284be9d6ad2176a137f376"}, - {file = "websockets-13.0.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:c4a6343e3b0714e80da0b0893543bf9a5b5fa71b846ae640e56e9abc6fbc4c83"}, - {file = "websockets-13.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a678532018e435396e37422a95e3ab87f75028ac79570ad11f5bf23cd2a7d8c"}, - {file = "websockets-13.0.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d6716c087e4aa0b9260c4e579bb82e068f84faddb9bfba9906cb87726fa2e870"}, - {file = "websockets-13.0.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e33505534f3f673270dd67f81e73550b11de5b538c56fe04435d63c02c3f26b5"}, - {file = "websockets-13.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:acab3539a027a85d568c2573291e864333ec9d912675107d6efceb7e2be5d980"}, - {file = "websockets-13.0.1-py3-none-any.whl", hash = "sha256:b80f0c51681c517604152eb6a572f5a9378f877763231fddb883ba2f968e8817"}, - {file = "websockets-13.0.1.tar.gz", hash = "sha256:4d6ece65099411cfd9a48d13701d7438d9c34f479046b34c50ff60bb8834e43e"}, + {file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"}, + {file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"}, + {file = "websockets-13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f779498eeec470295a2b1a5d97aa1bc9814ecd25e1eb637bd9d1c73a327387f6"}, + {file = "websockets-13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676df3fe46956fbb0437d8800cd5f2b6d41143b6e7e842e60554398432cf29b"}, + {file = "websockets-13.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7affedeb43a70351bb811dadf49493c9cfd1ed94c9c70095fd177e9cc1541fa"}, + {file = "websockets-13.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1971e62d2caa443e57588e1d82d15f663b29ff9dfe7446d9964a4b6f12c1e700"}, + {file = "websockets-13.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5f2e75431f8dc4a47f31565a6e1355fb4f2ecaa99d6b89737527ea917066e26c"}, + {file = "websockets-13.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58cf7e75dbf7e566088b07e36ea2e3e2bd5676e22216e4cad108d4df4a7402a0"}, + {file = "websockets-13.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c90d6dec6be2c7d03378a574de87af9b1efea77d0c52a8301dd831ece938452f"}, + {file = "websockets-13.1-cp310-cp310-win32.whl", hash = "sha256:730f42125ccb14602f455155084f978bd9e8e57e89b569b4d7f0f0c17a448ffe"}, + {file = "websockets-13.1-cp310-cp310-win_amd64.whl", hash = "sha256:5993260f483d05a9737073be197371940c01b257cc45ae3f1d5d7adb371b266a"}, + {file = "websockets-13.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61fc0dfcda609cda0fc9fe7977694c0c59cf9d749fbb17f4e9483929e3c48a19"}, + {file = "websockets-13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ceec59f59d092c5007e815def4ebb80c2de330e9588e101cf8bd94c143ec78a5"}, + {file = "websockets-13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1dca61c6db1166c48b95198c0b7d9c990b30c756fc2923cc66f68d17dc558fd"}, + {file = "websockets-13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:308e20f22c2c77f3f39caca508e765f8725020b84aa963474e18c59accbf4c02"}, + {file = "websockets-13.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d516c325e6540e8a57b94abefc3459d7dab8ce52ac75c96cad5549e187e3a7"}, + {file = "websockets-13.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87c6e35319b46b99e168eb98472d6c7d8634ee37750d7693656dc766395df096"}, + {file = "websockets-13.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5f9fee94ebafbc3117c30be1844ed01a3b177bb6e39088bc6b2fa1dc15572084"}, + {file = "websockets-13.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7c1e90228c2f5cdde263253fa5db63e6653f1c00e7ec64108065a0b9713fa1b3"}, + {file = "websockets-13.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6548f29b0e401eea2b967b2fdc1c7c7b5ebb3eeb470ed23a54cd45ef078a0db9"}, + {file = "websockets-13.1-cp311-cp311-win32.whl", hash = "sha256:c11d4d16e133f6df8916cc5b7e3e96ee4c44c936717d684a94f48f82edb7c92f"}, + {file = "websockets-13.1-cp311-cp311-win_amd64.whl", hash = "sha256:d04f13a1d75cb2b8382bdc16ae6fa58c97337253826dfe136195b7f89f661557"}, + {file = "websockets-13.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9d75baf00138f80b48f1eac72ad1535aac0b6461265a0bcad391fc5aba875cfc"}, + {file = "websockets-13.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9b6f347deb3dcfbfde1c20baa21c2ac0751afaa73e64e5b693bb2b848efeaa49"}, + {file = "websockets-13.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de58647e3f9c42f13f90ac7e5f58900c80a39019848c5547bc691693098ae1bd"}, + {file = "websockets-13.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1b54689e38d1279a51d11e3467dd2f3a50f5f2e879012ce8f2d6943f00e83f0"}, + {file = "websockets-13.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf1781ef73c073e6b0f90af841aaf98501f975d306bbf6221683dd594ccc52b6"}, + {file = "websockets-13.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d23b88b9388ed85c6faf0e74d8dec4f4d3baf3ecf20a65a47b836d56260d4b9"}, + {file = "websockets-13.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3c78383585f47ccb0fcf186dcb8a43f5438bd7d8f47d69e0b56f71bf431a0a68"}, + {file = "websockets-13.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d6d300f8ec35c24025ceb9b9019ae9040c1ab2f01cddc2bcc0b518af31c75c14"}, + {file = "websockets-13.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a9dcaf8b0cc72a392760bb8755922c03e17a5a54e08cca58e8b74f6902b433cf"}, + {file = "websockets-13.1-cp312-cp312-win32.whl", hash = "sha256:2f85cf4f2a1ba8f602298a853cec8526c2ca42a9a4b947ec236eaedb8f2dc80c"}, + {file = "websockets-13.1-cp312-cp312-win_amd64.whl", hash = "sha256:38377f8b0cdeee97c552d20cf1865695fcd56aba155ad1b4ca8779a5b6ef4ac3"}, + {file = "websockets-13.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a9ab1e71d3d2e54a0aa646ab6d4eebfaa5f416fe78dfe4da2839525dc5d765c6"}, + {file = "websockets-13.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b9d7439d7fab4dce00570bb906875734df13d9faa4b48e261c440a5fec6d9708"}, + {file = "websockets-13.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:327b74e915cf13c5931334c61e1a41040e365d380f812513a255aa804b183418"}, + {file = "websockets-13.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:325b1ccdbf5e5725fdcb1b0e9ad4d2545056479d0eee392c291c1bf76206435a"}, + {file = "websockets-13.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:346bee67a65f189e0e33f520f253d5147ab76ae42493804319b5716e46dddf0f"}, + {file = "websockets-13.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91a0fa841646320ec0d3accdff5b757b06e2e5c86ba32af2e0815c96c7a603c5"}, + {file = "websockets-13.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:18503d2c5f3943e93819238bf20df71982d193f73dcecd26c94514f417f6b135"}, + {file = "websockets-13.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a9cd1af7e18e5221d2878378fbc287a14cd527fdd5939ed56a18df8a31136bb2"}, + {file = "websockets-13.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:70c5be9f416aa72aab7a2a76c90ae0a4fe2755c1816c153c1a2bcc3333ce4ce6"}, + {file = "websockets-13.1-cp313-cp313-win32.whl", hash = "sha256:624459daabeb310d3815b276c1adef475b3e6804abaf2d9d2c061c319f7f187d"}, + {file = "websockets-13.1-cp313-cp313-win_amd64.whl", hash = "sha256:c518e84bb59c2baae725accd355c8dc517b4a3ed8db88b4bc93c78dae2974bf2"}, + {file = "websockets-13.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c7934fd0e920e70468e676fe7f1b7261c1efa0d6c037c6722278ca0228ad9d0d"}, + {file = "websockets-13.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:149e622dc48c10ccc3d2760e5f36753db9cacf3ad7bc7bbbfd7d9c819e286f23"}, + {file = "websockets-13.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a569eb1b05d72f9bce2ebd28a1ce2054311b66677fcd46cf36204ad23acead8c"}, + {file = "websockets-13.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95df24ca1e1bd93bbca51d94dd049a984609687cb2fb08a7f2c56ac84e9816ea"}, + {file = "websockets-13.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8dbb1bf0c0a4ae8b40bdc9be7f644e2f3fb4e8a9aca7145bfa510d4a374eeb7"}, + {file = "websockets-13.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:035233b7531fb92a76beefcbf479504db8c72eb3bff41da55aecce3a0f729e54"}, + {file = "websockets-13.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:e4450fc83a3df53dec45922b576e91e94f5578d06436871dce3a6be38e40f5db"}, + {file = "websockets-13.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:463e1c6ec853202dd3657f156123d6b4dad0c546ea2e2e38be2b3f7c5b8e7295"}, + {file = "websockets-13.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6d6855bbe70119872c05107e38fbc7f96b1d8cb047d95c2c50869a46c65a8e96"}, + {file = "websockets-13.1-cp38-cp38-win32.whl", hash = "sha256:204e5107f43095012b00f1451374693267adbb832d29966a01ecc4ce1db26faf"}, + {file = "websockets-13.1-cp38-cp38-win_amd64.whl", hash = "sha256:485307243237328c022bc908b90e4457d0daa8b5cf4b3723fd3c4a8012fce4c6"}, + {file = "websockets-13.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9b37c184f8b976f0c0a231a5f3d6efe10807d41ccbe4488df8c74174805eea7d"}, + {file = "websockets-13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:163e7277e1a0bd9fb3c8842a71661ad19c6aa7bb3d6678dc7f89b17fbcc4aeb7"}, + {file = "websockets-13.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4b889dbd1342820cc210ba44307cf75ae5f2f96226c0038094455a96e64fb07a"}, + {file = "websockets-13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:586a356928692c1fed0eca68b4d1c2cbbd1ca2acf2ac7e7ebd3b9052582deefa"}, + {file = "websockets-13.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7bd6abf1e070a6b72bfeb71049d6ad286852e285f146682bf30d0296f5fbadfa"}, + {file = "websockets-13.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2aad13a200e5934f5a6767492fb07151e1de1d6079c003ab31e1823733ae79"}, + {file = "websockets-13.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:df01aea34b6e9e33572c35cd16bae5a47785e7d5c8cb2b54b2acdb9678315a17"}, + {file = "websockets-13.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e54affdeb21026329fb0744ad187cf812f7d3c2aa702a5edb562b325191fcab6"}, + {file = "websockets-13.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ef8aa8bdbac47f4968a5d66462a2a0935d044bf35c0e5a8af152d58516dbeb5"}, + {file = "websockets-13.1-cp39-cp39-win32.whl", hash = "sha256:deeb929efe52bed518f6eb2ddc00cc496366a14c726005726ad62c2dd9017a3c"}, + {file = "websockets-13.1-cp39-cp39-win_amd64.whl", hash = "sha256:7c65ffa900e7cc958cd088b9a9157a8141c991f8c53d11087e6fb7277a03f81d"}, + {file = "websockets-13.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:5dd6da9bec02735931fccec99d97c29f47cc61f644264eb995ad6c0c27667238"}, + {file = "websockets-13.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:2510c09d8e8df777177ee3d40cd35450dc169a81e747455cc4197e63f7e7bfe5"}, + {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1c3cf67185543730888b20682fb186fc8d0fa6f07ccc3ef4390831ab4b388d9"}, + {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bcc03c8b72267e97b49149e4863d57c2d77f13fae12066622dc78fe322490fe6"}, + {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:004280a140f220c812e65f36944a9ca92d766b6cc4560be652a0a3883a79ed8a"}, + {file = "websockets-13.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e2620453c075abeb0daa949a292e19f56de518988e079c36478bacf9546ced23"}, + {file = "websockets-13.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9156c45750b37337f7b0b00e6248991a047be4aa44554c9886fe6bdd605aab3b"}, + {file = "websockets-13.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:80c421e07973a89fbdd93e6f2003c17d20b69010458d3a8e37fb47874bd67d51"}, + {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82d0ba76371769d6a4e56f7e83bb8e81846d17a6190971e38b5de108bde9b0d7"}, + {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9875a0143f07d74dc5e1ded1c4581f0d9f7ab86c78994e2ed9e95050073c94d"}, + {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a11e38ad8922c7961447f35c7b17bffa15de4d17c70abd07bfbe12d6faa3e027"}, + {file = "websockets-13.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4059f790b6ae8768471cddb65d3c4fe4792b0ab48e154c9f0a04cefaabcd5978"}, + {file = "websockets-13.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:25c35bf84bf7c7369d247f0b8cfa157f989862c49104c5cf85cb5436a641d93e"}, + {file = "websockets-13.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:83f91d8a9bb404b8c2c41a707ac7f7f75b9442a0a876df295de27251a856ad09"}, + {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a43cfdcddd07f4ca2b1afb459824dd3c6d53a51410636a2c7fc97b9a8cf4842"}, + {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48a2ef1381632a2f0cb4efeff34efa97901c9fbc118e01951ad7cfc10601a9bb"}, + {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bf774c754c35dbb487360b12c5727adab887f1622b8aed5755880a21c4a20"}, + {file = "websockets-13.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:95858ca14a9f6fa8413d29e0a585b31b278388aa775b8a81fa24830123874678"}, + {file = "websockets-13.1-py3-none-any.whl", hash = "sha256:a9a396a6ad26130cdae92ae10c36af09d9bfe6cafe69670fd3b6da9b07b4044f"}, + {file = "websockets-13.1.tar.gz", hash = "sha256:a3b3366087c1bc0a2795111edcadddb8b3b59509d5db5d7ea3fdd69f954a8878"}, ] [[package]] @@ -2853,5 +2925,5 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" -python-versions = "^3.10" -content-hash = "1c8904971be7061c2b33400d2b5f461e526703586e5b7f9eb08c2fbfda1a23ab" +python-versions = "^3.9" +content-hash = "83a12dac424352fe71847b80f3cf08d0c3fb68da088561cc6630d6476a60627d" diff --git a/pyproject.toml b/pyproject.toml index 203ccc917..6a58f4700 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ packages = [ ] [tool.poetry.dependencies] -python = "^3.10" +python = "^3.9" dill = ">=0.3.8,<0.4" fastapi = ">=0.96.0,!=0.111.0,!=0.111.1" gunicorn = ">=20.1.0,<24.0" @@ -88,7 +88,7 @@ build-backend = "poetry.core.masonry.api" [tool.pyright] [tool.ruff] -target-version = "py310" +target-version = "py39" lint.select = ["B", "D", "E", "F", "I", "SIM", "W"] lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"] lint.pydocstyle.convention = "google" diff --git a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 index abfd998fd..a5239f33b 100644 --- a/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +++ b/reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 @@ -8,7 +8,7 @@ version = "0.0.1" description = "Reflex custom component {{ module_name }}" readme = "README.md" license = { text = "Apache-2.0" } -requires-python = ">=3.10" +requires-python = ">=3.9" authors = [{ name = "", email = "YOUREMAIL@domain.com" }] keywords = ["reflex","reflex-custom-components"] diff --git a/reflex/app.py b/reflex/app.py index 323a3c8f8..63334997c 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -606,10 +606,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): for route in self.pages: replaced_route = replace_brackets_with_keywords(route) for rw, r, nr in zip( - replaced_route.split("/"), - route.split("/"), - new_route.split("/"), - strict=False, + replaced_route.split("/"), route.split("/"), new_route.split("/") ): if rw in segments and r != nr: # If the slugs in the segments of both routes are not the same, then the route is invalid @@ -958,7 +955,7 @@ class App(MiddlewareMixin, LifespanMixin, Base): # Prepopulate the global ExecutorSafeFunctions class with input data required by the compile functions. # This is required for multiprocessing to work, in presence of non-picklable inputs. - for route, component in zip(self.pages, page_components, strict=False): + for route, component in zip(self.pages, page_components): ExecutorSafeFunctions.COMPILE_PAGE_ARGS_BY_ROUTE[route] = ( route, component, @@ -1172,7 +1169,6 @@ class App(MiddlewareMixin, LifespanMixin, Base): FRONTEND_ARG_SPEC, BACKEND_ARG_SPEC, ], - strict=False, ): if hasattr(handler_fn, "__name__"): _fn_name = handler_fn.__name__ diff --git a/reflex/app_module_for_backend.py b/reflex/app_module_for_backend.py index cae136354..8109fc3d6 100644 --- a/reflex/app_module_for_backend.py +++ b/reflex/app_module_for_backend.py @@ -15,7 +15,7 @@ if constants.CompileVars.APP != "app": telemetry.send("compile") app_module = get_app(reload=False) app = getattr(app_module, constants.CompileVars.APP) -# For py3.8 and py3.9 compatibility when redis is used, we MUST add any decorator pages +# For py3.9 compatibility when redis is used, we MUST add any decorator pages # before compiling the app in a thread to avoid event loop error (REF-2172). app._apply_decorated_pages() compile_future = ThreadPoolExecutor(max_workers=1).submit(app._compile) diff --git a/reflex/components/core/breakpoints.py b/reflex/components/core/breakpoints.py index decd2727e..4b2372a70 100644 --- a/reflex/components/core/breakpoints.py +++ b/reflex/components/core/breakpoints.py @@ -82,9 +82,7 @@ class Breakpoints(Dict[K, V]): return Breakpoints( { k: v - for k, v in zip( - ["initial", *breakpoint_names], thresholds, strict=False - ) + for k, v in zip(["initial", *breakpoint_names], thresholds) if v is not None } ) diff --git a/reflex/event.py b/reflex/event.py index fe3a6bfb4..ac0c713ab 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -217,7 +217,7 @@ class EventHandler(EventActionsMixin): raise EventHandlerTypeError( f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}." ) from e - payload = tuple(zip(fn_args, values, strict=False)) + payload = tuple(zip(fn_args, values)) # Return the event spec. return EventSpec( @@ -310,7 +310,7 @@ class EventSpec(EventActionsMixin): raise EventHandlerTypeError( f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}." ) from e - new_payload = tuple(zip(fn_args, values, strict=False)) + new_payload = tuple(zip(fn_args, values)) return self.with_args(self.args + new_payload) diff --git a/reflex/state.py b/reflex/state.py index 5223be7e5..8b32d1a07 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1316,7 +1316,6 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for part1, part2 in zip( cls.get_full_name().split("."), other.get_full_name().split("."), - strict=False, ): if part1 != part2: break diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 7173e4872..f86da0c53 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -74,6 +74,18 @@ def get_web_dir() -> Path: return workdir +def _python_version_check(): + """Emit deprecation warning for deprecated python versions.""" + # Check for end-of-life python versions. + if sys.version_info < (3, 10): + console.deprecate( + feature_name="Support for Python 3.9 and older", + reason="please upgrade to Python 3.10 or newer", + deprecation_version="0.6.0", + removal_version="0.7.0", + ) + + def check_latest_package_version(package_name: str): """Check if the latest version of the package is installed. @@ -86,15 +98,16 @@ def check_latest_package_version(package_name: str): url = f"https://pypi.org/pypi/{package_name}/json" response = net.get(url) latest_version = response.json()["info"]["version"] - if ( - version.parse(current_version) < version.parse(latest_version) - and not get_or_set_last_reflex_version_check_datetime() - ): - # only show a warning when the host version is outdated and - # the last_version_check_datetime is not set in reflex.json + if get_or_set_last_reflex_version_check_datetime(): + # Versions were already checked and saved in reflex.json, no need to warn again + return + if version.parse(current_version) < version.parse(latest_version): + # Show a warning when the host version is older than PyPI version console.warn( f"Your version ({current_version}) of {package_name} is out of date. Upgrade to {latest_version} with 'pip install {package_name} --upgrade'" ) + # Check for depreacted python versions + _python_version_check() except Exception: pass @@ -291,7 +304,7 @@ def get_compiled_app(reload: bool = False, export: bool = False) -> ModuleType: """ app_module = get_app(reload=reload) app = getattr(app_module, constants.CompileVars.APP) - # For py3.8 and py3.9 compatibility when redis is used, we MUST add any decorator pages + # For py3.9 compatibility when redis is used, we MUST add any decorator pages # before compiling the app in a thread to avoid event loop error (REF-2172). app._apply_decorated_pages() app._compile(export=export) diff --git a/reflex/utils/telemetry.py b/reflex/utils/telemetry.py index b2507e656..af3994ff8 100644 --- a/reflex/utils/telemetry.py +++ b/reflex/utils/telemetry.py @@ -121,7 +121,7 @@ def _prepare_event(event: str, **kwargs) -> dict: return {} if UTC is None: - # for python 3.10 + # for python 3.9 & 3.10 stamp = datetime.utcnow().isoformat() else: # for python 3.11 & 3.12 diff --git a/reflex/utils/types.py b/reflex/utils/types.py index ed74131a0..63238f67b 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -632,7 +632,7 @@ def validate_parameter_literals(func): annotations = {param[0]: param[1].annotation for param in func_params} # validate args - for param, arg in zip(annotations, args, strict=False): + for param, arg in zip(annotations, args): if annotations[param] is inspect.Parameter.empty: continue validate_literal(param, arg, annotations[param], func.__name__) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index eb5362090..4faa38be7 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -2667,7 +2667,7 @@ def generic_type_to_actual_type_map( # call recursively for nested generic types and merge the results return { k: v - for generic_arg, actual_arg in zip(generic_args, actual_args, strict=False) + for generic_arg, actual_arg in zip(generic_args, actual_args) for k, v in generic_type_to_actual_type_map(generic_arg, actual_arg).items() } diff --git a/tests/compiler/test_compiler.py b/tests/compiler/test_compiler.py index 9ff4e1f14..63014cf33 100644 --- a/tests/compiler/test_compiler.py +++ b/tests/compiler/test_compiler.py @@ -100,7 +100,7 @@ def test_compile_imports(import_dict: ParsedImportDict, test_dicts: List[dict]): test_dicts: The expected output. """ imports = utils.compile_imports(import_dict) - for import_dict, test_dict in zip(imports, test_dicts, strict=False): + for import_dict, test_dict in zip(imports, test_dicts): assert import_dict["lib"] == test_dict["lib"] assert import_dict["default"] == test_dict["default"] assert sorted(import_dict["rest"]) == test_dict["rest"] # type: ignore diff --git a/tests/components/media/test_image.py b/tests/components/media/test_image.py index e3d924235..f8618347c 100644 --- a/tests/components/media/test_image.py +++ b/tests/components/media/test_image.py @@ -1,4 +1,3 @@ -# PIL is only available in python 3.8+ import numpy as np import PIL import pytest diff --git a/tests/components/test_component.py b/tests/components/test_component.py index e6a1a40cb..4dda81896 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -1403,7 +1403,6 @@ def test_get_vars(component, exp_vars): for comp_var, exp_var in zip( comp_vars, sorted(exp_vars, key=lambda v: v._js_expr), - strict=False, ): # print(str(comp_var), str(exp_var)) # print(comp_var._get_all_var_data(), exp_var._get_all_var_data()) @@ -1793,7 +1792,6 @@ def test_custom_component_declare_event_handlers_in_fields(): for v1, v2 in zip( parse_args_spec(test_triggers[trigger_name]), parse_args_spec(custom_triggers[trigger_name]), - strict=False, ): assert v1.equals(v2) diff --git a/tests/test_var.py b/tests/test_var.py index 31bf80568..227b01d85 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -184,7 +184,6 @@ def ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): "state.local", "local2", ], - strict=False, ), ) def test_full_name(prop, expected): @@ -202,7 +201,6 @@ def test_full_name(prop, expected): zip( test_vars, ["prop1", "key", "state.value", "state.local", "local2"], - strict=False, ), ) def test_str(prop, expected): @@ -249,7 +247,6 @@ def test_default_value(prop, expected): "state.set_local", "set_local2", ], - strict=False, ), ) def test_get_setter(prop, expected): From 2c4310d9ff4136416bbfe7e255a3d7ab610ccac7 Mon Sep 17 00:00:00 2001 From: Andrew Davies <6566948+minimav@users.noreply.github.com> Date: Tue, 24 Sep 2024 02:18:05 +0100 Subject: [PATCH 052/201] Use tailwind typography plugin by default (#3593) Co-authored-by: Khaleel Al-Adhami --- reflex/components/core/html.py | 2 +- reflex/config.py | 2 +- tests/components/core/test_html.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reflex/components/core/html.py b/reflex/components/core/html.py index cfe46e591..a732e7828 100644 --- a/reflex/components/core/html.py +++ b/reflex/components/core/html.py @@ -40,7 +40,7 @@ class Html(Div): given_class_name = props.pop("class_name", []) if isinstance(given_class_name, str): given_class_name = [given_class_name] - props["class_name"] = ["rx-Html", *given_class_name] + props["class_name"] = ["rx-Html", "prose", *given_class_name] # Create the component. return super().create(**props) diff --git a/reflex/config.py b/reflex/config.py index 06d8c2193..fadd82482 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -194,7 +194,7 @@ class Config(Base): cors_allowed_origins: List[str] = ["*"] # Tailwind config. - tailwind: Optional[Dict[str, Any]] = {} + tailwind: Optional[Dict[str, Any]] = {"plugins": ["@tailwindcss/typography"]} # Timeout when launching the gunicorn server. TODO(rename this to backend_timeout?) timeout: int = 120 diff --git a/tests/components/core/test_html.py b/tests/components/core/test_html.py index 4847e1d5a..cc6530cb6 100644 --- a/tests/components/core/test_html.py +++ b/tests/components/core/test_html.py @@ -19,7 +19,7 @@ def test_html_create(): assert str(html.dangerouslySetInnerHTML) == '({ ["__html"] : "

Hello !

" })' # type: ignore assert ( str(html) - == '
Hello !

" })}/>' + == '
Hello !

" })}/>' ) @@ -37,5 +37,5 @@ def test_html_fstring_create(): ) assert ( str(html) - == f'
' # type: ignore + == f'
' # type: ignore ) From 4e4d36a86789f1d5ea8acfb0a208863b5b338684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 24 Sep 2024 23:29:56 +0200 Subject: [PATCH 053/201] re add removed method with better behaviour and tests (#3986) --- reflex/page.py | 19 +++++++++++++++++++ tests/test_page.py | 31 ++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/reflex/page.py b/reflex/page.py index 27a3c4fa8..52f0c8efc 100644 --- a/reflex/page.py +++ b/reflex/page.py @@ -63,3 +63,22 @@ def page( return render_fn return decorator + + +def get_decorated_pages(omit_implicit_routes=True) -> list[dict[str, Any]]: + """Get the decorated pages. + + Args: + omit_implicit_routes: Whether to omit pages where the route will be implicitely guessed later. + + Returns: + The decorated pages. + """ + return sorted( + [ + page_data + for _, page_data in DECORATED_PAGES[get_config().app_name] + if not omit_implicit_routes or "route" in page_data + ], + key=lambda x: x.get("route", ""), + ) diff --git a/tests/test_page.py b/tests/test_page.py index 9cbd2886d..e1dd70905 100644 --- a/tests/test_page.py +++ b/tests/test_page.py @@ -1,6 +1,6 @@ from reflex import text from reflex.config import get_config -from reflex.page import DECORATED_PAGES, page +from reflex.page import DECORATED_PAGES, get_decorated_pages, page def test_page_decorator(): @@ -48,3 +48,32 @@ def test_page_decorator_with_kwargs(): } DECORATED_PAGES.clear() + + +def test_get_decorated_pages(): + assert get_decorated_pages() == [] + + def foo_(): + return text("foo") + + page()(foo_) + + assert get_decorated_pages() == [] + assert get_decorated_pages(omit_implicit_routes=False) == [{}] + + page(route="foo2")(foo_) + + assert get_decorated_pages() == [{"route": "foo2"}] + assert get_decorated_pages(omit_implicit_routes=False) == [{}, {"route": "foo2"}] + + page(route="foo3", title="Foo3")(foo_) + + assert get_decorated_pages() == [ + {"route": "foo2"}, + {"route": "foo3", "title": "Foo3"}, + ] + assert get_decorated_pages(omit_implicit_routes=False) == [ + {}, + {"route": "foo2"}, + {"route": "foo3", "title": "Foo3"}, + ] From d0ad5cd15e8575b7c09b34b68d54925efbc2e275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 25 Sep 2024 02:34:41 +0200 Subject: [PATCH 054/201] use svg elements instead of raw html for logo (#3978) * use svg elements instead of raw html for logo * avoid duplication --- reflex/components/datadisplay/logo.py | 40 ++++++++++++++------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/reflex/components/datadisplay/logo.py b/reflex/components/datadisplay/logo.py index c00c8ebae..beb9b9d10 100644 --- a/reflex/components/datadisplay/logo.py +++ b/reflex/components/datadisplay/logo.py @@ -12,31 +12,33 @@ def logo(**props): Returns: The logo component. """ - light_mode_logo = """ - - - - - - -""" - dark_mode_logo = """ - - - - - - -""" + def logo_path(d): + return rx.el.svg.path( + d=d, + fill=rx.color_mode_cond("#110F1F", "white"), + ) + + paths = [ + "M0 11.5999V0.399902H8.96V4.8799H6.72V2.6399H2.24V4.8799H6.72V7.1199H2.24V11.5999H0ZM6.72 11.5999V7.1199H8.96V11.5999H6.72Z", + "M11.2 11.5999V0.399902H17.92V2.6399H13.44V4.8799H17.92V7.1199H13.44V9.3599H17.92V11.5999H11.2Z", + "M20.16 11.5999V0.399902H26.88V2.6399H22.4V4.8799H26.88V7.1199H22.4V11.5999H20.16Z", + "M29.12 11.5999V0.399902H31.36V9.3599H35.84V11.5999H29.12Z", + "M38.08 11.5999V0.399902H44.8V2.6399H40.32V4.8799H44.8V7.1199H40.32V9.3599H44.8V11.5999H38.08Z", + "M47.04 4.8799V0.399902H49.28V4.8799H47.04ZM53.76 4.8799V0.399902H56V4.8799H53.76ZM49.28 7.1199V4.8799H53.76V7.1199H49.28ZM47.04 11.5999V7.1199H49.28V11.5999H47.04ZM53.76 11.5999V7.1199H56V11.5999H53.76Z", + ] return rx.center( rx.link( rx.hstack( "Built with ", - rx.color_mode_cond( - rx.html(light_mode_logo), - rx.html(dark_mode_logo), + rx.el.svg( + *[logo_path(d) for d in paths], + width="56", + height="12", + viewBox="0 0 56 12", + fill="none", + xmlns="http://www.w3.org/2000/svg", ), text_align="center", align="center", From 001b8c4222b9202b60cbd2a09aac3d13ad8d90b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 25 Sep 2024 02:36:58 +0200 Subject: [PATCH 055/201] can run with granian by setting REFLEX_USE_GRANIAN var (#3919) * can run with granian by setting REFLEX_USE_GRANIAN var * granian also useable for prod mode * adjust reload paths for granian * move uvicorn / granian logic to their own function * fix prod mode --- reflex/utils/exec.py | 163 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 147 insertions(+), 16 deletions(-) diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 417d6fbe7..013fa8734 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -172,6 +172,33 @@ def run_frontend_prod(root: Path, port: str, backend_present=True): ) +def should_use_granian(): + """Whether to use Granian for backend. + + Returns: + True if Granian should be used. + """ + return os.getenv("REFLEX_USE_GRANIAN", "0") == "1" + + +def get_app_module(): + """Get the app module for the backend. + + Returns: + The app module for the backend. + """ + return f"reflex.app_module_for_backend:{constants.CompileVars.APP}" + + +def get_granian_target(): + """Get the Granian target for the backend. + + Returns: + The Granian target for the backend. + """ + return get_app_module() + f".{constants.CompileVars.API}" + + def run_backend( host: str, port: int, @@ -184,24 +211,76 @@ def run_backend( port: The app port loglevel: The log level. """ - import uvicorn - - config = get_config() - app_module = f"reflex.app_module_for_backend:{constants.CompileVars.APP}" - web_dir = get_web_dir() # Create a .nocompile file to skip compile for backend. if web_dir.exists(): (web_dir / constants.NOCOMPILE_FILE).touch() - # Run the backend in development mode. + if should_use_granian(): + run_granian_backend(host, port, loglevel) + else: + run_uvicorn_backend(host, port, loglevel) + + +def run_uvicorn_backend(host, port, loglevel): + """Run the backend in development mode using Uvicorn. + + Args: + host: The app host + port: The app port + loglevel: The log level. + """ + import uvicorn + uvicorn.run( - app=f"{app_module}.{constants.CompileVars.API}", + app=f"{get_app_module()}.{constants.CompileVars.API}", host=host, port=port, log_level=loglevel.value, reload=True, - reload_dirs=[config.app_name], + reload_dirs=[get_config().app_name], + ) + + +def run_granian_backend(host, port, loglevel): + """Run the backend in development mode using Granian. + + Args: + host: The app host + port: The app port + loglevel: The log level. + """ + console.debug("Using Granian for backend") + try: + from granian import Granian # type: ignore + from granian.constants import Interfaces # type: ignore + from granian.log import LogLevels # type: ignore + + Granian( + target=get_granian_target(), + address=host, + port=port, + interface=Interfaces.ASGI, + log_level=LogLevels(loglevel.value), + reload=True, + reload_paths=[Path(get_config().app_name)], + reload_ignore_dirs=[".web"], + ).serve() + except ImportError: + console.error( + 'InstallError: REFLEX_USE_GRANIAN is set but `granian` is not installed. (run `pip install "granian>=1.6.0"`)' + ) + os._exit(1) + + +def _get_backend_workers(): + from reflex.utils import processes + + config = get_config() + return ( + processes.get_num_workers() + if not config.gunicorn_workers + else config.gunicorn_workers ) @@ -212,6 +291,20 @@ def run_backend_prod( ): """Run the backend. + Args: + host: The app host + port: The app port + loglevel: The log level. + """ + if should_use_granian(): + run_granian_backend_prod(host, port, loglevel) + else: + run_uvicorn_backend_prod(host, port, loglevel) + + +def run_uvicorn_backend_prod(host, port, loglevel): + """Run the backend in production mode using Uvicorn. + Args: host: The app host port: The app port @@ -220,14 +313,11 @@ def run_backend_prod( from reflex.utils import processes config = get_config() - num_workers = ( - processes.get_num_workers() - if not config.gunicorn_workers - else config.gunicorn_workers - ) + + app_module = get_app_module() + RUN_BACKEND_PROD = f"gunicorn --worker-class {config.gunicorn_worker_class} --preload --timeout {config.timeout} --log-level critical".split() RUN_BACKEND_PROD_WINDOWS = f"uvicorn --timeout-keep-alive {config.timeout}".split() - app_module = f"reflex.app_module_for_backend:{constants.CompileVars.APP}" command = ( [ *RUN_BACKEND_PROD_WINDOWS, @@ -243,7 +333,7 @@ def run_backend_prod( "--bind", f"{host}:{port}", "--threads", - str(num_workers), + str(_get_backend_workers()), f"{app_module}()", ] ) @@ -252,7 +342,7 @@ def run_backend_prod( "--log-level", loglevel.value, "--workers", - str(num_workers), + str(_get_backend_workers()), ] processes.new_process( command, @@ -262,6 +352,47 @@ def run_backend_prod( ) +def run_granian_backend_prod(host, port, loglevel): + """Run the backend in production mode using Granian. + + Args: + host: The app host + port: The app port + loglevel: The log level. + """ + from reflex.utils import processes + + try: + from granian.constants import Interfaces # type: ignore + + command = [ + "granian", + "--workers", + str(_get_backend_workers()), + "--log-level", + "critical", + "--host", + host, + "--port", + str(port), + "--interface", + str(Interfaces.ASGI), + get_granian_target(), + ] + processes.new_process( + command, + run=True, + show_logs=True, + env={ + constants.SKIP_COMPILE_ENV_VAR: "yes" + }, # skip compile for prod backend + ) + except ImportError: + console.error( + 'InstallError: REFLEX_USE_GRANIAN is set but `granian` is not installed. (run `pip install "granian>=1.6.0"`)' + ) + + def output_system_info(): """Show system information if the loglevel is in DEBUG.""" if console._LOG_LEVEL > constants.LogLevel.DEBUG: From 46be46d6eaea76381a84380dd11654611333a7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 25 Sep 2024 02:38:12 +0200 Subject: [PATCH 056/201] allow link as metatags (#3980) * allow link as metatags * remove stray print & fix nit --- reflex/compiler/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 3b643718f..1808f787a 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -429,11 +429,11 @@ def add_meta( Returns: The component with the metadata added. """ - meta_tags = [Meta.create(**item) for item in meta] - - children: list[Any] = [ - Title.create(title), + meta_tags = [ + item if isinstance(item, Component) else Meta.create(**item) for item in meta ] + + children: list[Any] = [Title.create(title)] if description: children.append(Description.create(content=description)) children.append(Image.create(content=image)) From 5e738fd62bbac46467d52558d1742d94e0d8a9e1 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 24 Sep 2024 17:38:49 -0700 Subject: [PATCH 057/201] don't camel case keys of dicts in style (#3982) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * don't camel case keys of dicts in style * change tests to fit the code 😎 * respect objectvars as true dicts --- reflex/components/component.py | 2 +- reflex/style.py | 14 ++++++++++++-- tests/test_style.py | 6 +++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/reflex/components/component.py b/reflex/components/component.py index b2f3d196f..e89da6900 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -477,7 +477,7 @@ class Component(BaseComponent, ABC): # Merge styles, the later ones overriding keys in the earlier ones. style = {k: v for style_dict in style for k, v in style_dict.items()} - if isinstance(style, Breakpoints): + if isinstance(style, (Breakpoints, Var)): style = { # Assign the Breakpoints to the self-referential selector to avoid squashing down to a regular dict. "&": style, diff --git a/reflex/style.py b/reflex/style.py index e63cb820f..4ebd42ac3 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -13,6 +13,7 @@ from reflex.utils.imports import ImportVar from reflex.vars import VarData from reflex.vars.base import CallableVar, LiteralVar, Var from reflex.vars.function import FunctionVar +from reflex.vars.object import ObjectVar SYSTEM_COLOR_MODE: str = "system" LIGHT_COLOR_MODE: str = "light" @@ -188,7 +189,16 @@ def convert( out[k] = return_value for key, value in style_dict.items(): - keys = format_style_key(key) + keys = ( + format_style_key(key) + if not isinstance(value, (dict, ObjectVar)) + or ( + isinstance(value, Breakpoints) + and all(not isinstance(v, dict) for v in value.values()) + ) + else (key,) + ) + if isinstance(value, Var): return_val = value new_var_data = value._get_all_var_data() @@ -283,7 +293,7 @@ def _format_emotion_style_pseudo_selector(key: str) -> str: """Format a pseudo selector for emotion CSS-in-JS. Args: - key: Underscore-prefixed or colon-prefixed pseudo selector key (_hover). + key: Underscore-prefixed or colon-prefixed pseudo selector key (_hover/:hover). Returns: A self-referential pseudo selector key (&:hover). diff --git a/tests/test_style.py b/tests/test_style.py index 19106df75..e1d652798 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -15,9 +15,9 @@ test_style = [ ({"a": 1}, {"a": 1}), ({"a": LiteralVar.create("abc")}, {"a": "abc"}), ({"test_case": 1}, {"testCase": 1}), - ({"test_case": {"a": 1}}, {"testCase": {"a": 1}}), - ({":test_case": {"a": 1}}, {":testCase": {"a": 1}}), - ({"::test_case": {"a": 1}}, {"::testCase": {"a": 1}}), + ({"test_case": {"a": 1}}, {"test_case": {"a": 1}}), + ({":test_case": {"a": 1}}, {":test_case": {"a": 1}}), + ({"::test_case": {"a": 1}}, {"::test_case": {"a": 1}}), ( {"::-webkit-scrollbar": {"display": "none"}}, {"::-webkit-scrollbar": {"display": "none"}}, From fc5d352431a05e7ed568754aa733fdd4da01dc95 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 25 Sep 2024 09:55:16 -0700 Subject: [PATCH 058/201] add basic integration test for dynamic components (#3990) * add basic integration test * fix docstrings * dang it darglint --- integration/test_dynamic_components.py | 152 +++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 integration/test_dynamic_components.py diff --git a/integration/test_dynamic_components.py b/integration/test_dynamic_components.py new file mode 100644 index 000000000..31080223f --- /dev/null +++ b/integration/test_dynamic_components.py @@ -0,0 +1,152 @@ +"""Integration tests for var operations.""" + +import time +from typing import Callable, Generator, TypeVar + +import pytest +from selenium.webdriver.common.by import By + +from reflex.testing import AppHarness + +# pyright: reportOptionalMemberAccess=false, reportGeneralTypeIssues=false, reportUnknownMemberType=false + + +def DynamicComponents(): + """App with var operations.""" + import reflex as rx + + class DynamicComponentsState(rx.State): + button: rx.Component = rx.button( + "Click me", + custom_attrs={ + "id": "button", + }, + ) + + def got_clicked(self): + self.button = rx.button( + "Clicked", + custom_attrs={ + "id": "button", + }, + ) + + @rx.var + def client_token_component(self) -> rx.Component: + return rx.vstack( + rx.el.input( + custom_attrs={ + "id": "token", + }, + value=self.router.session.client_token, + is_read_only=True, + ), + rx.button( + "Update", + custom_attrs={ + "id": "update", + }, + on_click=DynamicComponentsState.got_clicked, + ), + ) + + app = rx.App() + + @app.add_page + def index(): + return rx.vstack( + DynamicComponentsState.client_token_component, + DynamicComponentsState.button, + ) + + +@pytest.fixture(scope="module") +def dynamic_components(tmp_path_factory) -> Generator[AppHarness, None, None]: + """Start VarOperations app at tmp_path via AppHarness. + + Args: + tmp_path_factory: pytest tmp_path_factory fixture + + Yields: + running AppHarness instance + """ + with AppHarness.create( + root=tmp_path_factory.mktemp("dynamic_components"), + app_source=DynamicComponents, # type: ignore + ) as harness: + assert harness.app_instance is not None, "app is not running" + yield harness + + +T = TypeVar("T") + + +def poll_for_result( + f: Callable[[], T], exception=Exception, max_attempts=5, seconds_between_attempts=1 +) -> T: + """Poll for a result from a function. + + Args: + f: function to call + exception: exception to catch + max_attempts: maximum number of attempts + seconds_between_attempts: seconds to wait between + + Returns: + Result of the function + + Raises: + AssertionError: if the function does not return a value + """ + attempts = 0 + while attempts < max_attempts: + try: + return f() + except exception: + attempts += 1 + time.sleep(seconds_between_attempts) + raise AssertionError("Function did not return a value") + + +@pytest.fixture +def driver(dynamic_components: AppHarness): + """Get an instance of the browser open to the dynamic components app. + + Args: + dynamic_components: AppHarness for the dynamic components + + Yields: + WebDriver instance. + """ + driver = dynamic_components.frontend() + try: + token_input = poll_for_result(lambda: driver.find_element(By.ID, "token")) + assert token_input + # wait for the backend connection to send the token + token = dynamic_components.poll_for_value(token_input) + assert token is not None + + yield driver + finally: + driver.quit() + + +def test_dynamic_components(driver, dynamic_components: AppHarness): + """Test that the var operations produce the right results. + + Args: + driver: selenium WebDriver open to the app + dynamic_components: AppHarness for the dynamic components + """ + button = poll_for_result(lambda: driver.find_element(By.ID, "button")) + assert button + assert button.text == "Click me" + + update_button = driver.find_element(By.ID, "update") + assert update_button + update_button.click() + + assert ( + dynamic_components.poll_for_content(button, exp_not_equal="Click me") + == "Clicked" + ) From 3eeb0bde9c1c541224cccb39798db272a838715b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 25 Sep 2024 18:56:15 +0200 Subject: [PATCH 059/201] bump nextjs version (#3992) --- reflex/constants/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 6f31b08f1..e01e5ae69 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -115,7 +115,7 @@ class PackageJson(SimpleNamespace): "@emotion/react": "11.11.1", "axios": "1.6.0", "json5": "2.2.3", - "next": "14.0.1", + "next": "14.2.13", "next-sitemap": "4.1.8", "next-themes": "0.2.1", "react": "18.2.0", From 982c43d5953825fd3739e47497002d08f6c792c4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 25 Sep 2024 09:57:16 -0700 Subject: [PATCH 060/201] use bundled radix ui for dynamic components (#3993) --- reflex/components/dynamic.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py index 6ae78161f..ad044d54f 100644 --- a/reflex/components/dynamic.py +++ b/reflex/components/dynamic.py @@ -57,12 +57,20 @@ def load_dynamic_serializer(): ) ] = None + libs_in_window = [ + "react", + "@radix-ui/themes", + ] + imports = {} for lib, names in component._get_all_imports().items(): if ( not lib.startswith((".", "/")) and not lib.startswith("http") - and lib != "react" + and all( + not lib.startswith(lib_in_window) + for lib_in_window in libs_in_window + ) ): imports[get_cdn_url(lib)] = names else: @@ -83,10 +91,16 @@ def load_dynamic_serializer(): ) + "]" ) - elif 'from "react"' in line: - module_code_lines[ix] = line.replace( - "import ", "const ", 1 - ).replace(' from "react"', " = window.__reflex.react", 1) + else: + for lib in libs_in_window: + if f'from "{lib}"' in line: + module_code_lines[ix] = ( + line.replace("import ", "const ", 1) + .replace( + f' from "{lib}"', f" = window.__reflex['{lib}']", 1 + ) + .replace(" as ", ": ") + ) if line.startswith("export function"): module_code_lines[ix] = line.replace( "export function", "export default function", 1 From 74d1c47ce219c79354a77de36b86a943f26e513b Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 25 Sep 2024 09:57:29 -0700 Subject: [PATCH 061/201] allow classname to be state vars (#3991) * allow classname to be state vars * simplify join with all literal string vars * add test case and avoid concat var operation if it's not necessary * remove silly print statement * simplify case where there's no var * don't automatically do class name str to literal var --- reflex/components/component.py | 8 +++- .../components/radix/themes/layout/stack.py | 2 +- reflex/vars/sequence.py | 43 +++++++++++++++++++ tests/components/test_component.py | 10 +++++ 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/reflex/components/component.py b/reflex/components/component.py index e89da6900..7ee9b0d3a 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -55,6 +55,7 @@ from reflex.utils.imports import ( ) from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var +from reflex.vars.sequence import LiteralArrayVar class BaseComponent(Base, ABC): @@ -496,7 +497,12 @@ class Component(BaseComponent, ABC): # Convert class_name to str if it's list class_name = kwargs.get("class_name", "") if isinstance(class_name, (List, tuple)): - kwargs["class_name"] = " ".join(class_name) + if any(isinstance(c, Var) for c in class_name): + kwargs["class_name"] = LiteralArrayVar.create( + class_name, _var_type=List[str] + ).join(" ") + else: + kwargs["class_name"] = " ".join(class_name) # Construct the component. super().__init__(*args, **kwargs) diff --git a/reflex/components/radix/themes/layout/stack.py b/reflex/components/radix/themes/layout/stack.py index cb513cbfb..94bba4fb6 100644 --- a/reflex/components/radix/themes/layout/stack.py +++ b/reflex/components/radix/themes/layout/stack.py @@ -33,7 +33,7 @@ class Stack(Flex): """ # Apply the default classname given_class_name = props.pop("class_name", []) - if isinstance(given_class_name, str): + if not isinstance(given_class_name, list): given_class_name = [given_class_name] props["class_name"] = ["rx-Stack", *given_class_name] diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 6145c980c..15c7411a6 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -592,6 +592,29 @@ class LiteralStringVar(LiteralVar, StringVar): else: return only_string.to(StringVar, only_string._var_type) + if len( + literal_strings := [ + s + for s in filtered_strings_and_vals + if isinstance(s, (str, LiteralStringVar)) + ] + ) == len(filtered_strings_and_vals): + return LiteralStringVar.create( + "".join( + s._var_value if isinstance(s, LiteralStringVar) else s + for s in literal_strings + ), + _var_type=_var_type, + _var_data=VarData.merge( + _var_data, + *( + s._get_all_var_data() + for s in filtered_strings_and_vals + if isinstance(s, Var) + ), + ), + ) + concat_result = ConcatVarOperation.create( *filtered_strings_and_vals, _var_data=_var_data, @@ -736,6 +759,26 @@ class ArrayVar(Var[ARRAY_VAR_TYPE]): """ if not isinstance(sep, (StringVar, str)): raise_unsupported_operand_types("join", (type(self), type(sep))) + if ( + isinstance(self, LiteralArrayVar) + and ( + len( + args := [ + x + for x in self._var_value + if isinstance(x, (LiteralStringVar, str)) + ] + ) + == len(self._var_value) + ) + and isinstance(sep, (LiteralStringVar, str)) + ): + sep_str = sep._var_value if isinstance(sep, LiteralStringVar) else sep + return LiteralStringVar.create( + sep_str.join( + i._var_value if isinstance(i, LiteralStringVar) else i for i in args + ) + ) return array_join_operation(self, sep) def reverse(self) -> ArrayVar[ARRAY_VAR_TYPE]: diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 4dda81896..73d3f611b 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -1288,6 +1288,16 @@ class EventState(rx.State): [FORMATTED_TEST_VAR], id="fstring-class_name", ), + pytest.param( + rx.fragment(class_name=f"foo{TEST_VAR}bar other-class"), + [LiteralVar.create(f"{FORMATTED_TEST_VAR} other-class")], + id="fstring-dual-class_name", + ), + pytest.param( + rx.fragment(class_name=[TEST_VAR, "other-class"]), + [LiteralVar.create([TEST_VAR, "other-class"]).join(" ")], + id="fstring-dual-class_name", + ), pytest.param( rx.fragment(special_props=[TEST_VAR]), [TEST_VAR], From e1538b75f8ab5639fe609176e9c26ae218e35485 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Wed, 25 Sep 2024 11:31:45 -0700 Subject: [PATCH 062/201] bump to 0.6.1 for further dev (#3995) * bump version to 0.6.1dev1 * bump reflex-chakra requirement to 0.6.0 * update poetry file --------- Co-authored-by: Khaleel Al-Adhami --- poetry.lock | 20 ++++++++------------ pyproject.toml | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/poetry.lock b/poetry.lock index c587977e9..7a836a021 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "alembic" @@ -2087,13 +2087,13 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "reflex-chakra" -version = "0.6.0a7" +version = "0.6.0" description = "reflex using chakra components" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_chakra-0.6.0a7-py3-none-any.whl", hash = "sha256:d693aee7323af13ce491165ffb4fe392344939e45516991671d5601727f749f4"}, - {file = "reflex_chakra-0.6.0a7.tar.gz", hash = "sha256:fe17282e439fdfdfd507e24857a615258ef9789f15049aa0e70239fbcb4d5fbf"}, + {file = "reflex_chakra-0.6.0-py3-none-any.whl", hash = "sha256:eca1593fca67289e05591dd21fbcc8632c119d64a08bdc41fd995055a114cc91"}, + {file = "reflex_chakra-0.6.0.tar.gz", hash = "sha256:db1c7b48f1ba547bf91e5af103fce6fc7191d7225b414ebfbada7d983e33dd87"}, ] [package.dependencies] @@ -2334,9 +2334,7 @@ python-versions = ">=3.7" files = [ {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:67219632be22f14750f0d1c70e62f204ba69d28f62fd6432ba05ab295853de9b"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4668bd8faf7e5b71c0319407b608f278f279668f358857dbfd10ef1954ac9f90"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb8bea573863762bbf45d1e13f87c2d2fd32cee2dbd50d050f83f87429c9e1ea"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f552023710d4b93d8fb29a91fadf97de89c5926c6bd758897875435f2a939f33"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:016b2e665f778f13d3c438651dd4de244214b527a275e0acf1d44c05bc6026a9"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7befc148de64b6060937231cbff8d01ccf0bfd75aa26383ffdf8d82b12ec04ff"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-win32.whl", hash = "sha256:22b83aed390e3099584b839b93f80a0f4a95ee7f48270c97c90acd40ee646f0b"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-win_amd64.whl", hash = "sha256:a29762cd3d116585278ffb2e5b8cc311fb095ea278b96feef28d0b423154858e"}, @@ -2373,9 +2371,7 @@ files = [ {file = "SQLAlchemy-2.0.35-cp38-cp38-win_amd64.whl", hash = "sha256:0375a141e1c0878103eb3d719eb6d5aa444b490c96f3fedab8471c7f6ffe70ee"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ccae5de2a0140d8be6838c331604f91d6fafd0735dbdcee1ac78fc8fbaba76b4"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2a275a806f73e849e1c309ac11108ea1a14cd7058577aba962cd7190e27c9e3c"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:732e026240cdd1c1b2e3ac515c7a23820430ed94292ce33806a95869c46bd139"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:890da8cd1941fa3dab28c5bac3b9da8502e7e366f895b3b8e500896f12f94d11"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c0d8326269dbf944b9201911b0d9f3dc524d64779a07518199a58384c3d37a44"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b76d63495b0508ab9fc23f8152bac63205d2a704cd009a2b0722f4c8e0cba8e0"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-win32.whl", hash = "sha256:69683e02e8a9de37f17985905a5eca18ad651bf592314b4d3d799029797d0eb3"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-win_amd64.whl", hash = "sha256:aee110e4ef3c528f3abbc3c2018c121e708938adeeff9006428dd7c8555e9b3f"}, @@ -2618,13 +2614,13 @@ files = [ [[package]] name = "tzdata" -version = "2024.1" +version = "2024.2" description = "Provider of IANA time zone data" optional = false python-versions = ">=2" files = [ - {file = "tzdata-2024.1-py2.py3-none-any.whl", hash = "sha256:9068bc196136463f5245e51efda838afa15aaeca9903f49050dfa2679db4d252"}, - {file = "tzdata-2024.1.tar.gz", hash = "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd"}, + {file = "tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd"}, + {file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"}, ] [[package]] @@ -2926,4 +2922,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "83a12dac424352fe71847b80f3cf08d0c3fb68da088561cc6630d6476a60627d" +content-hash = "df66545bb3f79e356e3a91866306f8b18b800aeadf1f98ac184644f986a83d95" diff --git a/pyproject.toml b/pyproject.toml index 6a58f4700..c8a62e195 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "reflex" -version = "0.6.0a1" +version = "0.6.1dev1" description = "Web apps in pure Python." license = "Apache-2.0" authors = [ @@ -59,7 +59,7 @@ httpx = ">=0.25.1,<1.0" twine = ">=4.0.0,<6.0" tomlkit = ">=0.12.4,<1.0" lazy_loader = ">=0.4" -reflex-chakra = ">=0.6.0a6" +reflex-chakra = ">=0.6.0" [tool.poetry.group.dev.dependencies] pytest = ">=7.1.2,<8.0" From 9d8b737b1aa9ed486d1a1cfaf9726dbcf4e11eae Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 25 Sep 2024 13:11:04 -0700 Subject: [PATCH 063/201] hash the state file name (#4000) * hash the state file name * forgot to digest my food oop --- reflex/state.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reflex/state.py b/reflex/state.py index 8b32d1a07..f0f3e1453 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -12,6 +12,7 @@ import os import uuid from abc import ABC, abstractmethod from collections import defaultdict +from hashlib import md5 from pathlib import Path from types import FunctionType, MethodType from typing import ( @@ -2704,7 +2705,9 @@ class StateManagerDisk(StateManager): Returns: The path for the token. """ - return (self.states_directory / f"{token}.pkl").absolute() + return ( + self.states_directory / f"{md5(token.encode()).hexdigest()}.pkl" + ).absolute() async def load_state(self, token: str, root_state: BaseState) -> BaseState: """Load a state object based on the provided token. From b07fba72e9c6049ab35f37644ad2b15aa68b9b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 26 Sep 2024 00:57:08 +0200 Subject: [PATCH 064/201] add missing message when running in backend_only (#4002) * add missing message when running in backend_only * actually pass loglevel to backend_cmd --- reflex/reflex.py | 4 ++-- reflex/utils/exec.py | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/reflex/reflex.py b/reflex/reflex.py index c90e328e4..07c1dff5b 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -247,13 +247,13 @@ def _run( # In prod mode, run the backend on a separate thread. if backend and env == constants.Env.PROD: - commands.append((backend_cmd, backend_host, backend_port)) + commands.append((backend_cmd, backend_host, backend_port, loglevel, frontend)) # Start the frontend and backend. with processes.run_concurrently_context(*commands): # In dev mode, run the backend on the main thread. if backend and env == constants.Env.DEV: - backend_cmd(backend_host, int(backend_port)) + backend_cmd(backend_host, int(backend_port), loglevel, frontend) # The windows uvicorn bug workaround # https://github.com/reflex-dev/reflex/issues/2335 if constants.IS_WINDOWS and exec.frontend_process: diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 013fa8734..82fb8d9b3 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -60,6 +60,13 @@ def kill(proc_pid: int): process.kill() +def notify_backend(): + """Output a string notifying where the backend is running.""" + console.print( + f"Backend running at: [bold green]http://0.0.0.0:{get_config().backend_port}[/bold green]" + ) + + # run_process_and_launch_url is assumed to be used # only to launch the frontend # If this is not the case, might have to change the logic @@ -103,9 +110,7 @@ def run_process_and_launch_url(run_command: list[str], backend_present=True): f"App running at: [bold green]{url}[/bold green]{' (Frontend-only mode)' if not backend_present else ''}" ) if backend_present: - console.print( - f"Backend running at: [bold green]http://0.0.0.0:{get_config().backend_port}[/bold green]" - ) + notify_backend() first_run = False else: console.print("New packages detected: Updating app...") @@ -203,6 +208,7 @@ def run_backend( host: str, port: int, loglevel: constants.LogLevel = constants.LogLevel.ERROR, + frontend_present: bool = False, ): """Run the backend. @@ -210,11 +216,16 @@ def run_backend( host: The app host port: The app port loglevel: The log level. + frontend_present: Whether the frontend is present. """ web_dir = get_web_dir() # Create a .nocompile file to skip compile for backend. if web_dir.exists(): (web_dir / constants.NOCOMPILE_FILE).touch() + + if not frontend_present: + notify_backend() + # Run the backend in development mode. if should_use_granian(): run_granian_backend(host, port, loglevel) @@ -288,6 +299,7 @@ def run_backend_prod( host: str, port: int, loglevel: constants.LogLevel = constants.LogLevel.ERROR, + frontend_present: bool = False, ): """Run the backend. @@ -295,7 +307,11 @@ def run_backend_prod( host: The app host port: The app port loglevel: The log level. + frontend_present: Whether the frontend is present. """ + if not frontend_present: + notify_backend() + if should_use_granian(): run_granian_backend_prod(host, port, loglevel) else: From 3f538865b5c4f3d777f528e0c8958e1da9f7fa9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 26 Sep 2024 01:22:52 +0200 Subject: [PATCH 065/201] reorganize all tests in a single top folder (#3981) * lift node version restraint to allow more recent version if already installed * add node test for latest version * change python version * use purple for debug logs * update workflow * add playwright dev dependency * update workflow * change test * oops * improve test * update test * fix tests * mv units tests to a subfolder * reorganize tests * fix install * update test_state * revert node changes and only keep new tests organization * move integration tests in tests/integration * fix integration workflow * fix dockerfile workflow * fix dockerfile workflow 2 * fix shared_state --- .github/workflows/check_node_latest.yml | 39 +++ .github/workflows/integration_app_harness.yml | 2 +- .../workflows/reflex_init_in_docker_test.yml | 4 +- .github/workflows/unit_tests.yml | 6 +- .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 2 +- poetry.lock | 239 ++++++++++++------ pyproject.toml | 2 + reflex/utils/console.py | 2 +- .../integration}/__init__.py | 0 .../integration}/conftest.py | 0 .../integration}/init-test/Dockerfile | 0 .../init-test/in_docker_test_script.sh | 2 +- .../integration}/shared/state.py | 0 .../integration}/test_background_task.py | 0 .../integration}/test_call_script.py | 0 .../integration}/test_client_storage.py | 0 .../integration}/test_component_state.py | 0 .../integration}/test_computed_vars.py | 0 .../integration}/test_connection_banner.py | 0 .../integration}/test_deploy_url.py | 0 .../integration}/test_dynamic_components.py | 0 .../integration}/test_dynamic_routes.py | 0 .../integration}/test_event_actions.py | 0 .../integration}/test_event_chain.py | 0 .../integration}/test_exception_handlers.py | 0 .../integration}/test_form_submit.py | 0 .../integration}/test_input.py | 0 .../integration}/test_large_state.py | 0 .../integration}/test_lifespan.py | 0 .../integration}/test_login_flow.py | 0 .../integration}/test_media.py | 0 .../integration}/test_navigation.py | 0 .../integration}/test_server_side_event.py | 0 .../integration}/test_shared_state.py | 2 +- .../integration}/test_state_inheritance.py | 0 .../integration}/test_table.py | 0 .../integration}/test_tailwind.py | 0 .../integration}/test_upload.py | 0 .../integration}/test_urls.py | 0 .../integration}/test_var_operations.py | 0 {integration => tests/integration}/utils.py | 0 tests/test_node_version.py | 73 ++++++ tests/units/__init__.py | 5 + tests/{ => units}/compiler/__init__.py | 0 tests/{ => units}/compiler/test_compiler.py | 0 .../compiler/test_compiler_utils.py | 0 tests/{ => units}/components/__init__.py | 0 .../{ => units}/components/base/test_bare.py | 0 .../{ => units}/components/base/test_link.py | 0 .../components/base/test_script.py | 0 tests/{ => units}/components/core/__init__.py | 0 .../components/core/test_banner.py | 0 .../components/core/test_colors.py | 0 .../{ => units}/components/core/test_cond.py | 0 .../components/core/test_debounce.py | 0 .../components/core/test_foreach.py | 0 .../{ => units}/components/core/test_html.py | 0 .../{ => units}/components/core/test_match.py | 0 .../components/core/test_responsive.py | 0 .../components/core/test_upload.py | 0 .../components/datadisplay/__init__.py | 0 .../components/datadisplay/conftest.py | 0 .../components/datadisplay/test_code.py | 0 .../components/datadisplay/test_dataeditor.py | 0 .../components/datadisplay/test_datatable.py | 0 tests/{ => units}/components/el/test_html.py | 0 .../{ => units}/components/forms/__init__.py | 0 .../{ => units}/components/forms/test_form.py | 0 .../components/forms/test_uploads.py | 0 .../components/graphing/__init__.py | 0 .../components/graphing/test_plotly.py | 0 .../components/graphing/test_recharts.py | 0 .../{ => units}/components/layout/__init__.py | 0 .../components/lucide/test_icon.py | 0 .../{ => units}/components/media/__init__.py | 0 .../components/media/test_image.py | 0 .../components/radix/test_icon_button.py | 0 .../components/radix/test_layout.py | 0 .../components/recharts/test_cartesian.py | 0 .../components/recharts/test_polar.py | 0 .../{ => units}/components/test_component.py | 0 .../test_component_future_annotations.py | 0 .../components/test_component_state.py | 0 tests/{ => units}/components/test_tag.py | 0 .../components/typography/__init__.py | 0 .../components/typography/test_markdown.py | 0 tests/{ => units}/conftest.py | 0 .../{ => units}/experimental/custom_script.js | 0 tests/{ => units}/experimental/test_assets.py | 0 tests/{ => units}/middleware/__init__.py | 0 tests/{ => units}/middleware/conftest.py | 0 .../middleware/test_hydrate_middleware.py | 0 tests/{ => units}/states/__init__.py | 0 tests/{ => units}/states/mutation.py | 0 tests/{ => units}/states/upload.py | 0 tests/{ => units}/test_app.py | 0 .../{ => units}/test_attribute_access_type.py | 0 tests/{ => units}/test_base.py | 0 tests/{ => units}/test_config.py | 0 tests/{ => units}/test_db_config.py | 0 tests/{ => units}/test_event.py | 0 tests/{ => units}/test_health_endpoint.py | 0 tests/{ => units}/test_model.py | 0 tests/{ => units}/test_page.py | 0 tests/{ => units}/test_prerequisites.py | 0 tests/{ => units}/test_route.py | 0 tests/{ => units}/test_sqlalchemy.py | 0 tests/{ => units}/test_state.py | 20 +- tests/{ => units}/test_state_tree.py | 0 tests/{ => units}/test_style.py | 0 tests/{ => units}/test_telemetry.py | 0 tests/{ => units}/test_testing.py | 0 tests/{ => units}/test_var.py | 0 tests/{ => units}/utils/__init__.py | 0 tests/{ => units}/utils/test_format.py | 2 +- tests/{ => units}/utils/test_imports.py | 0 tests/{ => units}/utils/test_serializers.py | 0 tests/{ => units}/utils/test_types.py | 0 tests/{ => units}/utils/test_utils.py | 0 tests/{ => units}/vars/test_base.py | 0 121 files changed, 306 insertions(+), 96 deletions(-) create mode 100644 .github/workflows/check_node_latest.yml rename {integration => tests/integration}/__init__.py (100%) rename {integration => tests/integration}/conftest.py (100%) rename {integration => tests/integration}/init-test/Dockerfile (100%) rename {integration => tests/integration}/init-test/in_docker_test_script.sh (96%) rename {integration => tests/integration}/shared/state.py (100%) rename {integration => tests/integration}/test_background_task.py (100%) rename {integration => tests/integration}/test_call_script.py (100%) rename {integration => tests/integration}/test_client_storage.py (100%) rename {integration => tests/integration}/test_component_state.py (100%) rename {integration => tests/integration}/test_computed_vars.py (100%) rename {integration => tests/integration}/test_connection_banner.py (100%) rename {integration => tests/integration}/test_deploy_url.py (100%) rename {integration => tests/integration}/test_dynamic_components.py (100%) rename {integration => tests/integration}/test_dynamic_routes.py (100%) rename {integration => tests/integration}/test_event_actions.py (100%) rename {integration => tests/integration}/test_event_chain.py (100%) rename {integration => tests/integration}/test_exception_handlers.py (100%) rename {integration => tests/integration}/test_form_submit.py (100%) rename {integration => tests/integration}/test_input.py (100%) rename {integration => tests/integration}/test_large_state.py (100%) rename {integration => tests/integration}/test_lifespan.py (100%) rename {integration => tests/integration}/test_login_flow.py (100%) rename {integration => tests/integration}/test_media.py (100%) rename {integration => tests/integration}/test_navigation.py (100%) rename {integration => tests/integration}/test_server_side_event.py (100%) rename {integration => tests/integration}/test_shared_state.py (96%) rename {integration => tests/integration}/test_state_inheritance.py (100%) rename {integration => tests/integration}/test_table.py (100%) rename {integration => tests/integration}/test_tailwind.py (100%) rename {integration => tests/integration}/test_upload.py (100%) rename {integration => tests/integration}/test_urls.py (100%) rename {integration => tests/integration}/test_var_operations.py (100%) rename {integration => tests/integration}/utils.py (100%) create mode 100644 tests/test_node_version.py create mode 100644 tests/units/__init__.py rename tests/{ => units}/compiler/__init__.py (100%) rename tests/{ => units}/compiler/test_compiler.py (100%) rename tests/{ => units}/compiler/test_compiler_utils.py (100%) rename tests/{ => units}/components/__init__.py (100%) rename tests/{ => units}/components/base/test_bare.py (100%) rename tests/{ => units}/components/base/test_link.py (100%) rename tests/{ => units}/components/base/test_script.py (100%) rename tests/{ => units}/components/core/__init__.py (100%) rename tests/{ => units}/components/core/test_banner.py (100%) rename tests/{ => units}/components/core/test_colors.py (100%) rename tests/{ => units}/components/core/test_cond.py (100%) rename tests/{ => units}/components/core/test_debounce.py (100%) rename tests/{ => units}/components/core/test_foreach.py (100%) rename tests/{ => units}/components/core/test_html.py (100%) rename tests/{ => units}/components/core/test_match.py (100%) rename tests/{ => units}/components/core/test_responsive.py (100%) rename tests/{ => units}/components/core/test_upload.py (100%) rename tests/{ => units}/components/datadisplay/__init__.py (100%) rename tests/{ => units}/components/datadisplay/conftest.py (100%) rename tests/{ => units}/components/datadisplay/test_code.py (100%) rename tests/{ => units}/components/datadisplay/test_dataeditor.py (100%) rename tests/{ => units}/components/datadisplay/test_datatable.py (100%) rename tests/{ => units}/components/el/test_html.py (100%) rename tests/{ => units}/components/forms/__init__.py (100%) rename tests/{ => units}/components/forms/test_form.py (100%) rename tests/{ => units}/components/forms/test_uploads.py (100%) rename tests/{ => units}/components/graphing/__init__.py (100%) rename tests/{ => units}/components/graphing/test_plotly.py (100%) rename tests/{ => units}/components/graphing/test_recharts.py (100%) rename tests/{ => units}/components/layout/__init__.py (100%) rename tests/{ => units}/components/lucide/test_icon.py (100%) rename tests/{ => units}/components/media/__init__.py (100%) rename tests/{ => units}/components/media/test_image.py (100%) rename tests/{ => units}/components/radix/test_icon_button.py (100%) rename tests/{ => units}/components/radix/test_layout.py (100%) rename tests/{ => units}/components/recharts/test_cartesian.py (100%) rename tests/{ => units}/components/recharts/test_polar.py (100%) rename tests/{ => units}/components/test_component.py (100%) rename tests/{ => units}/components/test_component_future_annotations.py (100%) rename tests/{ => units}/components/test_component_state.py (100%) rename tests/{ => units}/components/test_tag.py (100%) rename tests/{ => units}/components/typography/__init__.py (100%) rename tests/{ => units}/components/typography/test_markdown.py (100%) rename tests/{ => units}/conftest.py (100%) rename tests/{ => units}/experimental/custom_script.js (100%) rename tests/{ => units}/experimental/test_assets.py (100%) rename tests/{ => units}/middleware/__init__.py (100%) rename tests/{ => units}/middleware/conftest.py (100%) rename tests/{ => units}/middleware/test_hydrate_middleware.py (100%) rename tests/{ => units}/states/__init__.py (100%) rename tests/{ => units}/states/mutation.py (100%) rename tests/{ => units}/states/upload.py (100%) rename tests/{ => units}/test_app.py (100%) rename tests/{ => units}/test_attribute_access_type.py (100%) rename tests/{ => units}/test_base.py (100%) rename tests/{ => units}/test_config.py (100%) rename tests/{ => units}/test_db_config.py (100%) rename tests/{ => units}/test_event.py (100%) rename tests/{ => units}/test_health_endpoint.py (100%) rename tests/{ => units}/test_model.py (100%) rename tests/{ => units}/test_page.py (100%) rename tests/{ => units}/test_prerequisites.py (100%) rename tests/{ => units}/test_route.py (100%) rename tests/{ => units}/test_sqlalchemy.py (100%) rename tests/{ => units}/test_state.py (99%) rename tests/{ => units}/test_state_tree.py (100%) rename tests/{ => units}/test_style.py (100%) rename tests/{ => units}/test_telemetry.py (100%) rename tests/{ => units}/test_testing.py (100%) rename tests/{ => units}/test_var.py (100%) rename tests/{ => units}/utils/__init__.py (100%) rename tests/{ => units}/utils/test_format.py (99%) rename tests/{ => units}/utils/test_imports.py (100%) rename tests/{ => units}/utils/test_serializers.py (100%) rename tests/{ => units}/utils/test_types.py (100%) rename tests/{ => units}/utils/test_utils.py (100%) rename tests/{ => units}/vars/test_base.py (100%) diff --git a/.github/workflows/check_node_latest.yml b/.github/workflows/check_node_latest.yml new file mode 100644 index 000000000..945786c05 --- /dev/null +++ b/.github/workflows/check_node_latest.yml @@ -0,0 +1,39 @@ +name: integration-node-latest + +on: + push: + branches: + - main + pull_request: + branches: + - main + +env: + TELEMETRY_ENABLED: false + +jobs: + check_latest_node: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.12'] + node-version: ['node'] + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_build_env + with: + python-version: ${{ matrix.python-version }} + run-poetry-install: true + create-venv-at-path: .venv + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: | + poetry run uv pip install pyvirtualdisplay pillow + poetry run playwright install --with-deps + - run: | + # poetry run pytest tests/test_node_version.py + poetry run pytest tests/integration + + + diff --git a/.github/workflows/integration_app_harness.yml b/.github/workflows/integration_app_harness.yml index 93412aa71..c11e6e01c 100644 --- a/.github/workflows/integration_app_harness.yml +++ b/.github/workflows/integration_app_harness.yml @@ -51,7 +51,7 @@ jobs: SCREENSHOT_DIR: /tmp/screenshots REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }} run: | - poetry run pytest integration + poetry run pytest tests/integration - uses: actions/upload-artifact@v4 name: Upload failed test screenshots if: always() diff --git a/.github/workflows/reflex_init_in_docker_test.yml b/.github/workflows/reflex_init_in_docker_test.yml index b34efd2f6..ce56a1310 100644 --- a/.github/workflows/reflex_init_in_docker_test.yml +++ b/.github/workflows/reflex_init_in_docker_test.yml @@ -28,5 +28,5 @@ jobs: # Run reflex init in a docker container # cwd is repo root - docker build -f integration/init-test/Dockerfile -t reflex-init-test integration/init-test - docker run --rm -v $(pwd):/reflex-repo/ reflex-init-test /reflex-repo/integration/init-test/in_docker_test_script.sh + docker build -f tests/integration/init-test/Dockerfile -t reflex-init-test tests/integration/init-test + docker run --rm -v $(pwd):/reflex-repo/ reflex-init-test /reflex-repo/tests/integration/init-test/in_docker_test_script.sh diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 333c54cb3..09e489949 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -65,17 +65,17 @@ jobs: - name: Run unit tests run: | export PYTHONUNBUFFERED=1 - poetry run pytest tests --cov --no-cov-on-fail --cov-report= + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= - name: Run unit tests w/ redis if: ${{ matrix.os == 'ubuntu-latest' }} run: | export PYTHONUNBUFFERED=1 export REDIS_URL=redis://localhost:6379 - poetry run pytest tests --cov --no-cov-on-fail --cov-report= + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= # Change to explicitly install v1 when reflex-hosting-cli is compatible with v2 - name: Run unit tests w/ pydantic v1 run: | export PYTHONUNBUFFERED=1 poetry run uv pip install "pydantic~=1.10" - poetry run pytest tests --cov --no-cov-on-fail --cov-report= + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= - run: poetry run coverage html diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbd88c485..609364a6e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: rev: v0.4.10 hooks: - id: ruff-format - args: [integration, reflex, tests] + args: [reflex, tests] - id: ruff args: ["--fix", "--exit-non-zero-on-fix"] exclude: '^integration/benchmarks/' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index af195997a..fc8398013 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ In your `reflex` directory run make sure all the unit tests are still passing us This will fail if code coverage is below 70%. ``` bash -poetry run pytest tests --cov --no-cov-on-fail --cov-report= +poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= ``` Next make sure all the following tests pass. This ensures that every new change has proper documentation and type checking. diff --git a/poetry.lock b/poetry.lock index 7a836a021..f94a3832a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -616,84 +616,69 @@ typing = ["typing-extensions (>=4.12.2)"] [[package]] name = "greenlet" -version = "3.1.1" +version = "3.0.3" description = "Lightweight in-process concurrent programming" optional = false python-versions = ">=3.7" files = [ - {file = "greenlet-3.1.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:0bbae94a29c9e5c7e4a2b7f0aae5c17e8e90acbfd3bf6270eeba60c39fce3563"}, - {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fde093fb93f35ca72a556cf72c92ea3ebfda3d79fc35bb19fbe685853869a83"}, - {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:36b89d13c49216cadb828db8dfa6ce86bbbc476a82d3a6c397f0efae0525bdd0"}, - {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94b6150a85e1b33b40b1464a3f9988dcc5251d6ed06842abff82e42632fac120"}, - {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93147c513fac16385d1036b7e5b102c7fbbdb163d556b791f0f11eada7ba65dc"}, - {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da7a9bff22ce038e19bf62c4dd1ec8391062878710ded0a845bcf47cc0200617"}, - {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b2795058c23988728eec1f36a4e5e4ebad22f8320c85f3587b539b9ac84128d7"}, - {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ed10eac5830befbdd0c32f83e8aa6288361597550ba669b04c48f0f9a2c843c6"}, - {file = "greenlet-3.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:77c386de38a60d1dfb8e55b8c1101d68c79dfdd25c7095d51fec2dd800892b80"}, - {file = "greenlet-3.1.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e4d333e558953648ca09d64f13e6d8f0523fa705f51cae3f03b5983489958c70"}, - {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fc016b73c94e98e29af67ab7b9a879c307c6731a2c9da0db5a7d9b7edd1159"}, - {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5e975ca70269d66d17dd995dafc06f1b06e8cb1ec1e9ed54c1d1e4a7c4cf26e"}, - {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b2813dc3de8c1ee3f924e4d4227999285fd335d1bcc0d2be6dc3f1f6a318ec1"}, - {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e347b3bfcf985a05e8c0b7d462ba6f15b1ee1c909e2dcad795e49e91b152c383"}, - {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e8f8c9cb53cdac7ba9793c276acd90168f416b9ce36799b9b885790f8ad6c0a"}, - {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62ee94988d6b4722ce0028644418d93a52429e977d742ca2ccbe1c4f4a792511"}, - {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1776fd7f989fc6b8d8c8cb8da1f6b82c5814957264d1f6cf818d475ec2bf6395"}, - {file = "greenlet-3.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:48ca08c771c268a768087b408658e216133aecd835c0ded47ce955381105ba39"}, - {file = "greenlet-3.1.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:4afe7ea89de619adc868e087b4d2359282058479d7cfb94970adf4b55284574d"}, - {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f406b22b7c9a9b4f8aa9d2ab13d6ae0ac3e85c9a809bd590ad53fed2bf70dc79"}, - {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c3a701fe5a9695b238503ce5bbe8218e03c3bcccf7e204e455e7462d770268aa"}, - {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2846930c65b47d70b9d178e89c7e1a69c95c1f68ea5aa0a58646b7a96df12441"}, - {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99cfaa2110534e2cf3ba31a7abcac9d328d1d9f1b95beede58294a60348fba36"}, - {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9"}, - {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b7cede291382a78f7bb5f04a529cb18e068dd29e0fb27376074b6d0317bf4dd0"}, - {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:23f20bb60ae298d7d8656c6ec6db134bca379ecefadb0b19ce6f19d1f232a942"}, - {file = "greenlet-3.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:7124e16b4c55d417577c2077be379514321916d5790fa287c9ed6f23bd2ffd01"}, - {file = "greenlet-3.1.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:05175c27cb459dcfc05d026c4232f9de8913ed006d42713cb8a5137bd49375f1"}, - {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:935e943ec47c4afab8965954bf49bfa639c05d4ccf9ef6e924188f762145c0ff"}, - {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:667a9706c970cb552ede35aee17339a18e8f2a87a51fba2ed39ceeeb1004798a"}, - {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8a678974d1f3aa55f6cc34dc480169d58f2e6d8958895d68845fa4ab566509e"}, - {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efc0f674aa41b92da8c49e0346318c6075d734994c3c4e4430b1c3f853e498e4"}, - {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0153404a4bb921f0ff1abeb5ce8a5131da56b953eda6e14b88dc6bbc04d2049e"}, - {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:275f72decf9932639c1c6dd1013a1bc266438eb32710016a1c742df5da6e60a1"}, - {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c4aab7f6381f38a4b42f269057aee279ab0fc7bf2e929e3d4abfae97b682a12c"}, - {file = "greenlet-3.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:b42703b1cf69f2aa1df7d1030b9d77d3e584a70755674d60e710f0af570f3761"}, - {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1695e76146579f8c06c1509c7ce4dfe0706f49c6831a817ac04eebb2fd02011"}, - {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7876452af029456b3f3549b696bb36a06db7c90747740c5302f74a9e9fa14b13"}, - {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ead44c85f8ab905852d3de8d86f6f8baf77109f9da589cb4fa142bd3b57b475"}, - {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8320f64b777d00dd7ccdade271eaf0cad6636343293a25074cc5566160e4de7b"}, - {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6510bf84a6b643dabba74d3049ead221257603a253d0a9873f55f6a59a65f822"}, - {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:04b013dc07c96f83134b1e99888e7a79979f1a247e2a9f59697fa14b5862ed01"}, - {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6"}, - {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47da355d8687fd65240c364c90a31569a133b7b60de111c255ef5b606f2ae291"}, - {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:98884ecf2ffb7d7fe6bd517e8eb99d31ff7855a840fa6d0d63cd07c037f6a981"}, - {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1d4aeb8891338e60d1ab6127af1fe45def5259def8094b9c7e34690c8858803"}, - {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db32b5348615a04b82240cc67983cb315309e88d444a288934ee6ceaebcad6cc"}, - {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dcc62f31eae24de7f8dce72134c8651c58000d3b1868e01392baea7c32c247de"}, - {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1d3755bcb2e02de341c55b4fca7a745a24a9e7212ac953f6b3a48d117d7257aa"}, - {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b8da394b34370874b4572676f36acabac172602abf054cbc4ac910219f3340af"}, - {file = "greenlet-3.1.1-cp37-cp37m-win32.whl", hash = "sha256:a0dfc6c143b519113354e780a50381508139b07d2177cb6ad6a08278ec655798"}, - {file = "greenlet-3.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:54558ea205654b50c438029505def3834e80f0869a70fb15b871c29b4575ddef"}, - {file = "greenlet-3.1.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:346bed03fe47414091be4ad44786d1bd8bef0c3fcad6ed3dee074a032ab408a9"}, - {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfc59d69fc48664bc693842bd57acfdd490acafda1ab52c7836e3fc75c90a111"}, - {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21e10da6ec19b457b82636209cbe2331ff4306b54d06fa04b7c138ba18c8a81"}, - {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37b9de5a96111fc15418819ab4c4432e4f3c2ede61e660b1e33971eba26ef9ba"}, - {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ef9ea3f137e5711f0dbe5f9263e8c009b7069d8a1acea822bd5e9dae0ae49c8"}, - {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:85f3ff71e2e60bd4b4932a043fbbe0f499e263c628390b285cb599154a3b03b1"}, - {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:95ffcf719966dd7c453f908e208e14cde192e09fde6c7186c8f1896ef778d8cd"}, - {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:03a088b9de532cbfe2ba2034b2b85e82df37874681e8c470d6fb2f8c04d7e4b7"}, - {file = "greenlet-3.1.1-cp38-cp38-win32.whl", hash = "sha256:8b8b36671f10ba80e159378df9c4f15c14098c4fd73a36b9ad715f057272fbef"}, - {file = "greenlet-3.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:7017b2be767b9d43cc31416aba48aab0d2309ee31b4dbf10a1d38fb7972bdf9d"}, - {file = "greenlet-3.1.1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:396979749bd95f018296af156201d6211240e7a23090f50a8d5d18c370084dc3"}, - {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca9d0ff5ad43e785350894d97e13633a66e2b50000e8a183a50a88d834752d42"}, - {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f6ff3b14f2df4c41660a7dec01045a045653998784bf8cfcb5a525bdffffbc8f"}, - {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94ebba31df2aa506d7b14866fed00ac141a867e63143fe5bca82a8e503b36437"}, - {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73aaad12ac0ff500f62cebed98d8789198ea0e6f233421059fa68a5aa7220145"}, - {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63e4844797b975b9af3a3fb8f7866ff08775f5426925e1e0bbcfe7932059a12c"}, - {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7939aa3ca7d2a1593596e7ac6d59391ff30281ef280d8632fa03d81f7c5f955e"}, - {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d0028e725ee18175c6e422797c407874da24381ce0690d6b9396c204c7f7276e"}, - {file = "greenlet-3.1.1-cp39-cp39-win32.whl", hash = "sha256:5e06afd14cbaf9e00899fae69b24a32f2196c19de08fcb9f4779dd4f004e5e7c"}, - {file = "greenlet-3.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:3319aa75e0e0639bc15ff54ca327e8dc7a6fe404003496e3c6925cd3142e0e22"}, - {file = "greenlet-3.1.1.tar.gz", hash = "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467"}, + {file = "greenlet-3.0.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:9da2bd29ed9e4f15955dd1595ad7bc9320308a3b766ef7f837e23ad4b4aac31a"}, + {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d353cadd6083fdb056bb46ed07e4340b0869c305c8ca54ef9da3421acbdf6881"}, + {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dca1e2f3ca00b84a396bc1bce13dd21f680f035314d2379c4160c98153b2059b"}, + {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ed7fb269f15dc662787f4119ec300ad0702fa1b19d2135a37c2c4de6fadfd4a"}, + {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd4f49ae60e10adbc94b45c0b5e6a179acc1736cf7a90160b404076ee283cf83"}, + {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:73a411ef564e0e097dbe7e866bb2dda0f027e072b04da387282b02c308807405"}, + {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7f362975f2d179f9e26928c5b517524e89dd48530a0202570d55ad6ca5d8a56f"}, + {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:649dde7de1a5eceb258f9cb00bdf50e978c9db1b996964cd80703614c86495eb"}, + {file = "greenlet-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:68834da854554926fbedd38c76e60c4a2e3198c6fbed520b106a8986445caaf9"}, + {file = "greenlet-3.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61"}, + {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559"}, + {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e"}, + {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33"}, + {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379"}, + {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22"}, + {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3"}, + {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d"}, + {file = "greenlet-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728"}, + {file = "greenlet-3.0.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:70fb482fdf2c707765ab5f0b6655e9cfcf3780d8d87355a063547b41177599be"}, + {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4d1ac74f5c0c0524e4a24335350edad7e5f03b9532da7ea4d3c54d527784f2e"}, + {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:149e94a2dd82d19838fe4b2259f1b6b9957d5ba1b25640d2380bea9c5df37676"}, + {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15d79dd26056573940fcb8c7413d84118086f2ec1a8acdfa854631084393efcc"}, + {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b7db1ebff4ba09aaaeae6aa491daeb226c8150fc20e836ad00041bcb11230"}, + {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fcd2469d6a2cf298f198f0487e0a5b1a47a42ca0fa4dfd1b6862c999f018ebbf"}, + {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1f672519db1796ca0d8753f9e78ec02355e862d0998193038c7073045899f305"}, + {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2516a9957eed41dd8f1ec0c604f1cdc86758b587d964668b5b196a9db5bfcde6"}, + {file = "greenlet-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:bba5387a6975598857d86de9eac14210a49d554a77eb8261cc68b7d082f78ce2"}, + {file = "greenlet-3.0.3-cp37-cp37m-macosx_11_0_universal2.whl", hash = "sha256:5b51e85cb5ceda94e79d019ed36b35386e8c37d22f07d6a751cb659b180d5274"}, + {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:daf3cb43b7cf2ba96d614252ce1684c1bccee6b2183a01328c98d36fcd7d5cb0"}, + {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99bf650dc5d69546e076f413a87481ee1d2d09aaaaaca058c9251b6d8c14783f"}, + {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dd6e660effd852586b6a8478a1d244b8dc90ab5b1321751d2ea15deb49ed414"}, + {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3391d1e16e2a5a1507d83e4a8b100f4ee626e8eca43cf2cadb543de69827c4c"}, + {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e1f145462f1fa6e4a4ae3c0f782e580ce44d57c8f2c7aae1b6fa88c0b2efdb41"}, + {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1a7191e42732df52cb5f39d3527217e7ab73cae2cb3694d241e18f53d84ea9a7"}, + {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6"}, + {file = "greenlet-3.0.3-cp37-cp37m-win32.whl", hash = "sha256:b542be2440edc2d48547b5923c408cbe0fc94afb9f18741faa6ae970dbcb9b6d"}, + {file = "greenlet-3.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67"}, + {file = "greenlet-3.0.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1996cb9306c8595335bb157d133daf5cf9f693ef413e7673cb07e3e5871379ca"}, + {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ddc0f794e6ad661e321caa8d2f0a55ce01213c74722587256fb6566049a8b04"}, + {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9db1c18f0eaad2f804728c67d6c610778456e3e1cc4ab4bbd5eeb8e6053c6fc"}, + {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7170375bcc99f1a2fbd9c306f5be8764eaf3ac6b5cb968862cad4c7057756506"}, + {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b66c9c1e7ccabad3a7d037b2bcb740122a7b17a53734b7d72a344ce39882a1b"}, + {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:098d86f528c855ead3479afe84b49242e174ed262456c342d70fc7f972bc13c4"}, + {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:81bb9c6d52e8321f09c3d165b2a78c680506d9af285bfccbad9fb7ad5a5da3e5"}, + {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da"}, + {file = "greenlet-3.0.3-cp38-cp38-win32.whl", hash = "sha256:d46677c85c5ba00a9cb6f7a00b2bfa6f812192d2c9f7d9c4f6a55b60216712f3"}, + {file = "greenlet-3.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:419b386f84949bf0e7c73e6032e3457b82a787c1ab4a0e43732898a761cc9dbf"}, + {file = "greenlet-3.0.3-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:da70d4d51c8b306bb7a031d5cff6cc25ad253affe89b70352af5f1cb68e74b53"}, + {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:086152f8fbc5955df88382e8a75984e2bb1c892ad2e3c80a2508954e52295257"}, + {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d73a9fe764d77f87f8ec26a0c85144d6a951a6c438dfe50487df5595c6373eac"}, + {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7dcbe92cc99f08c8dd11f930de4d99ef756c3591a5377d1d9cd7dd5e896da71"}, + {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1551a8195c0d4a68fac7a4325efac0d541b48def35feb49d803674ac32582f61"}, + {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:64d7675ad83578e3fc149b617a444fab8efdafc9385471f868eb5ff83e446b8b"}, + {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b37eef18ea55f2ffd8f00ff8fe7c8d3818abd3e25fb73fae2ca3b672e333a7a6"}, + {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:77457465d89b8263bca14759d7c1684df840b6811b2499838cc5b040a8b5b113"}, + {file = "greenlet-3.0.3-cp39-cp39-win32.whl", hash = "sha256:57e8974f23e47dac22b83436bdcf23080ade568ce77df33159e019d161ce1d1e"}, + {file = "greenlet-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:c5ee858cfe08f34712f548c3c363e807e7186f03ad7a5039ebadb29e8c6be067"}, + {file = "greenlet-3.0.3.tar.gz", hash = "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491"}, ] [package.extras] @@ -1527,6 +1512,26 @@ docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-a test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] type = ["mypy (>=1.11.2)"] +[[package]] +name = "playwright" +version = "1.47.0" +description = "A high-level API to automate web browsers" +optional = false +python-versions = ">=3.8" +files = [ + {file = "playwright-1.47.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:f205df24edb925db1a4ab62f1ab0da06f14bb69e382efecfb0deedc4c7f4b8cd"}, + {file = "playwright-1.47.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7fc820faf6885f69a52ba4ec94124e575d3c4a4003bf29200029b4a4f2b2d0ab"}, + {file = "playwright-1.47.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:8e212dc472ff19c7d46ed7e900191c7a786ce697556ac3f1615986ec3aa00341"}, + {file = "playwright-1.47.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:a1935672531963e4b2a321de5aa59b982fb92463ee6e1032dd7326378e462955"}, + {file = "playwright-1.47.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0a1b61473d6f7f39c5d77d4800b3cbefecb03344c90b98f3fbcae63294ad249"}, + {file = "playwright-1.47.0-py3-none-win32.whl", hash = "sha256:1b977ed81f6bba5582617684a21adab9bad5676d90a357ebf892db7bdf4a9974"}, + {file = "playwright-1.47.0-py3-none-win_amd64.whl", hash = "sha256:0ec1056042d2e86088795a503347407570bffa32cbe20748e5d4c93dba085280"}, +] + +[package.dependencies] +greenlet = "3.0.3" +pyee = "12.0.0" + [[package]] name = "plotly" version = "5.24.1" @@ -1750,6 +1755,23 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" +[[package]] +name = "pyee" +version = "12.0.0" +description = "A rough port of Node.js's EventEmitter to Python with a few tricks of its own" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyee-12.0.0-py3-none-any.whl", hash = "sha256:7b14b74320600049ccc7d0e0b1becd3b4bd0a03c745758225e31a59f4095c990"}, + {file = "pyee-12.0.0.tar.gz", hash = "sha256:c480603f4aa2927d4766eb41fa82793fe60a82cbfdb8d688e0d08c55a534e145"}, +] + +[package.dependencies] +typing-extensions = "*" + +[package.extras] +dev = ["black", "build", "flake8", "flake8-black", "isort", "jupyter-console", "mkdocs", "mkdocs-include-markdown-plugin", "mkdocstrings[python]", "pytest", "pytest-asyncio", "pytest-trio", "sphinx", "toml", "tox", "trio", "trio", "trio-typing", "twine", "twisted", "validate-pyproject[all]"] + [[package]] name = "pygments" version = "2.18.0" @@ -1845,6 +1867,24 @@ pytest = ">=7.0.0" docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] +[[package]] +name = "pytest-base-url" +version = "2.1.0" +description = "pytest plugin for URL based testing" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_base_url-2.1.0-py3-none-any.whl", hash = "sha256:3ad15611778764d451927b2a53240c1a7a591b521ea44cebfe45849d2d2812e6"}, + {file = "pytest_base_url-2.1.0.tar.gz", hash = "sha256:02748589a54f9e63fcbe62301d6b0496da0d10231b753e950c63e03aee745d45"}, +] + +[package.dependencies] +pytest = ">=7.0.0" +requests = ">=2.9" + +[package.extras] +test = ["black (>=22.1.0)", "flake8 (>=4.0.1)", "pre-commit (>=2.17.0)", "pytest-localserver (>=0.7.1)", "tox (>=3.24.5)"] + [[package]] name = "pytest-benchmark" version = "4.0.0" @@ -1900,6 +1940,23 @@ pytest = ">=6.2.5" [package.extras] dev = ["pre-commit", "pytest-asyncio", "tox"] +[[package]] +name = "pytest-playwright" +version = "0.5.2" +description = "A pytest wrapper with fixtures for Playwright to automate web browsers" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_playwright-0.5.2-py3-none-any.whl", hash = "sha256:2c5720591364a1cdf66610b972ff8492512bc380953e043c85f705b78b2ed582"}, + {file = "pytest_playwright-0.5.2.tar.gz", hash = "sha256:c6d603df9e6c50b35f057b0528e11d41c0963283e98c257267117f5ed6ba1924"}, +] + +[package.dependencies] +playwright = ">=1.18" +pytest = ">=6.2.4,<9.0.0" +pytest-base-url = ">=1.0.0,<3.0.0" +python-slugify = ">=6.0.0,<9.0.0" + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -1944,6 +2001,23 @@ files = [ {file = "python_multipart-0.0.10.tar.gz", hash = "sha256:46eb3c6ce6fdda5fb1a03c7e11d490e407c6930a2703fe7aef4da71c374688fa"}, ] +[[package]] +name = "python-slugify" +version = "8.0.4" +description = "A Python slugify application that also handles Unicode" +optional = false +python-versions = ">=3.7" +files = [ + {file = "python-slugify-8.0.4.tar.gz", hash = "sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856"}, + {file = "python_slugify-8.0.4-py2.py3-none-any.whl", hash = "sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8"}, +] + +[package.dependencies] +text-unidecode = ">=1.3" + +[package.extras] +unidecode = ["Unidecode (>=1.1.1)"] + [[package]] name = "python-socketio" version = "5.11.4" @@ -2334,7 +2408,9 @@ python-versions = ">=3.7" files = [ {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:67219632be22f14750f0d1c70e62f204ba69d28f62fd6432ba05ab295853de9b"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4668bd8faf7e5b71c0319407b608f278f279668f358857dbfd10ef1954ac9f90"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb8bea573863762bbf45d1e13f87c2d2fd32cee2dbd50d050f83f87429c9e1ea"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f552023710d4b93d8fb29a91fadf97de89c5926c6bd758897875435f2a939f33"}, + {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:016b2e665f778f13d3c438651dd4de244214b527a275e0acf1d44c05bc6026a9"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7befc148de64b6060937231cbff8d01ccf0bfd75aa26383ffdf8d82b12ec04ff"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-win32.whl", hash = "sha256:22b83aed390e3099584b839b93f80a0f4a95ee7f48270c97c90acd40ee646f0b"}, {file = "SQLAlchemy-2.0.35-cp310-cp310-win_amd64.whl", hash = "sha256:a29762cd3d116585278ffb2e5b8cc311fb095ea278b96feef28d0b423154858e"}, @@ -2371,7 +2447,9 @@ files = [ {file = "SQLAlchemy-2.0.35-cp38-cp38-win_amd64.whl", hash = "sha256:0375a141e1c0878103eb3d719eb6d5aa444b490c96f3fedab8471c7f6ffe70ee"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ccae5de2a0140d8be6838c331604f91d6fafd0735dbdcee1ac78fc8fbaba76b4"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2a275a806f73e849e1c309ac11108ea1a14cd7058577aba962cd7190e27c9e3c"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:732e026240cdd1c1b2e3ac515c7a23820430ed94292ce33806a95869c46bd139"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:890da8cd1941fa3dab28c5bac3b9da8502e7e366f895b3b8e500896f12f94d11"}, + {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c0d8326269dbf944b9201911b0d9f3dc524d64779a07518199a58384c3d37a44"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b76d63495b0508ab9fc23f8152bac63205d2a704cd009a2b0722f4c8e0cba8e0"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-win32.whl", hash = "sha256:69683e02e8a9de37f17985905a5eca18ad651bf592314b4d3d799029797d0eb3"}, {file = "SQLAlchemy-2.0.35-cp39-cp39-win_amd64.whl", hash = "sha256:aee110e4ef3c528f3abbc3c2018c121e708938adeeff9006428dd7c8555e9b3f"}, @@ -2493,6 +2571,17 @@ files = [ doc = ["reno", "sphinx"] test = ["pytest", "tornado (>=4.5)", "typeguard"] +[[package]] +name = "text-unidecode" +version = "1.3" +description = "The most basic Text::Unidecode port" +optional = false +python-versions = "*" +files = [ + {file = "text-unidecode-1.3.tar.gz", hash = "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93"}, + {file = "text_unidecode-1.3-py2.py3-none-any.whl", hash = "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8"}, +] + [[package]] name = "toml" version = "0.10.2" @@ -2922,4 +3011,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "df66545bb3f79e356e3a91866306f8b18b800aeadf1f98ac184644f986a83d95" +content-hash = "adccd071775567aeefe219261aeb9e222906c865745f03edb1e770edc79c44ac" diff --git a/pyproject.toml b/pyproject.toml index c8a62e195..335fc440e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,8 @@ asynctest = ">=0.13.0,<1.0" pre-commit = ">=3.2.1" selenium = ">=4.11.0,<5.0" pytest-benchmark = ">=4.0.0,<5.0" +playwright = ">=1.46.0" +pytest-playwright = ">=0.5.1" [tool.poetry.scripts] reflex = "reflex.reflex:cli" diff --git a/reflex/utils/console.py b/reflex/utils/console.py index 69500b32f..20c699e20 100644 --- a/reflex/utils/console.py +++ b/reflex/utils/console.py @@ -58,7 +58,7 @@ def debug(msg: str, **kwargs): kwargs: Keyword arguments to pass to the print function. """ if is_debug(): - msg_ = f"[blue]Debug: {msg}[/blue]" + msg_ = f"[purple]Debug: {msg}[/purple]" if progress := kwargs.pop("progress", None): progress.console.print(msg_, **kwargs) else: diff --git a/integration/__init__.py b/tests/integration/__init__.py similarity index 100% rename from integration/__init__.py rename to tests/integration/__init__.py diff --git a/integration/conftest.py b/tests/integration/conftest.py similarity index 100% rename from integration/conftest.py rename to tests/integration/conftest.py diff --git a/integration/init-test/Dockerfile b/tests/integration/init-test/Dockerfile similarity index 100% rename from integration/init-test/Dockerfile rename to tests/integration/init-test/Dockerfile diff --git a/integration/init-test/in_docker_test_script.sh b/tests/integration/init-test/in_docker_test_script.sh similarity index 96% rename from integration/init-test/in_docker_test_script.sh rename to tests/integration/init-test/in_docker_test_script.sh index 4e898ac99..31d245588 100755 --- a/integration/init-test/in_docker_test_script.sh +++ b/tests/integration/init-test/in_docker_test_script.sh @@ -13,7 +13,7 @@ function do_export () { reflex init --template "$template" reflex export ( - cd "$SCRIPTPATH/../.." + cd "$SCRIPTPATH/../../.." scripts/integration.sh ~/"$template" dev pkill -9 -f 'next-server|python3' || true sleep 10 diff --git a/integration/shared/state.py b/tests/integration/shared/state.py similarity index 100% rename from integration/shared/state.py rename to tests/integration/shared/state.py diff --git a/integration/test_background_task.py b/tests/integration/test_background_task.py similarity index 100% rename from integration/test_background_task.py rename to tests/integration/test_background_task.py diff --git a/integration/test_call_script.py b/tests/integration/test_call_script.py similarity index 100% rename from integration/test_call_script.py rename to tests/integration/test_call_script.py diff --git a/integration/test_client_storage.py b/tests/integration/test_client_storage.py similarity index 100% rename from integration/test_client_storage.py rename to tests/integration/test_client_storage.py diff --git a/integration/test_component_state.py b/tests/integration/test_component_state.py similarity index 100% rename from integration/test_component_state.py rename to tests/integration/test_component_state.py diff --git a/integration/test_computed_vars.py b/tests/integration/test_computed_vars.py similarity index 100% rename from integration/test_computed_vars.py rename to tests/integration/test_computed_vars.py diff --git a/integration/test_connection_banner.py b/tests/integration/test_connection_banner.py similarity index 100% rename from integration/test_connection_banner.py rename to tests/integration/test_connection_banner.py diff --git a/integration/test_deploy_url.py b/tests/integration/test_deploy_url.py similarity index 100% rename from integration/test_deploy_url.py rename to tests/integration/test_deploy_url.py diff --git a/integration/test_dynamic_components.py b/tests/integration/test_dynamic_components.py similarity index 100% rename from integration/test_dynamic_components.py rename to tests/integration/test_dynamic_components.py diff --git a/integration/test_dynamic_routes.py b/tests/integration/test_dynamic_routes.py similarity index 100% rename from integration/test_dynamic_routes.py rename to tests/integration/test_dynamic_routes.py diff --git a/integration/test_event_actions.py b/tests/integration/test_event_actions.py similarity index 100% rename from integration/test_event_actions.py rename to tests/integration/test_event_actions.py diff --git a/integration/test_event_chain.py b/tests/integration/test_event_chain.py similarity index 100% rename from integration/test_event_chain.py rename to tests/integration/test_event_chain.py diff --git a/integration/test_exception_handlers.py b/tests/integration/test_exception_handlers.py similarity index 100% rename from integration/test_exception_handlers.py rename to tests/integration/test_exception_handlers.py diff --git a/integration/test_form_submit.py b/tests/integration/test_form_submit.py similarity index 100% rename from integration/test_form_submit.py rename to tests/integration/test_form_submit.py diff --git a/integration/test_input.py b/tests/integration/test_input.py similarity index 100% rename from integration/test_input.py rename to tests/integration/test_input.py diff --git a/integration/test_large_state.py b/tests/integration/test_large_state.py similarity index 100% rename from integration/test_large_state.py rename to tests/integration/test_large_state.py diff --git a/integration/test_lifespan.py b/tests/integration/test_lifespan.py similarity index 100% rename from integration/test_lifespan.py rename to tests/integration/test_lifespan.py diff --git a/integration/test_login_flow.py b/tests/integration/test_login_flow.py similarity index 100% rename from integration/test_login_flow.py rename to tests/integration/test_login_flow.py diff --git a/integration/test_media.py b/tests/integration/test_media.py similarity index 100% rename from integration/test_media.py rename to tests/integration/test_media.py diff --git a/integration/test_navigation.py b/tests/integration/test_navigation.py similarity index 100% rename from integration/test_navigation.py rename to tests/integration/test_navigation.py diff --git a/integration/test_server_side_event.py b/tests/integration/test_server_side_event.py similarity index 100% rename from integration/test_server_side_event.py rename to tests/integration/test_server_side_event.py diff --git a/integration/test_shared_state.py b/tests/integration/test_shared_state.py similarity index 96% rename from integration/test_shared_state.py rename to tests/integration/test_shared_state.py index a1a3d6080..6f59c5142 100644 --- a/integration/test_shared_state.py +++ b/tests/integration/test_shared_state.py @@ -12,7 +12,7 @@ from reflex.testing import AppHarness, WebDriver def SharedStateApp(): """Test that shared state works as expected.""" import reflex as rx - from integration.shared.state import SharedState + from tests.integration.shared.state import SharedState class State(SharedState): pass diff --git a/integration/test_state_inheritance.py b/tests/integration/test_state_inheritance.py similarity index 100% rename from integration/test_state_inheritance.py rename to tests/integration/test_state_inheritance.py diff --git a/integration/test_table.py b/tests/integration/test_table.py similarity index 100% rename from integration/test_table.py rename to tests/integration/test_table.py diff --git a/integration/test_tailwind.py b/tests/integration/test_tailwind.py similarity index 100% rename from integration/test_tailwind.py rename to tests/integration/test_tailwind.py diff --git a/integration/test_upload.py b/tests/integration/test_upload.py similarity index 100% rename from integration/test_upload.py rename to tests/integration/test_upload.py diff --git a/integration/test_urls.py b/tests/integration/test_urls.py similarity index 100% rename from integration/test_urls.py rename to tests/integration/test_urls.py diff --git a/integration/test_var_operations.py b/tests/integration/test_var_operations.py similarity index 100% rename from integration/test_var_operations.py rename to tests/integration/test_var_operations.py diff --git a/integration/utils.py b/tests/integration/utils.py similarity index 100% rename from integration/utils.py rename to tests/integration/utils.py diff --git a/tests/test_node_version.py b/tests/test_node_version.py new file mode 100644 index 000000000..9555eb524 --- /dev/null +++ b/tests/test_node_version.py @@ -0,0 +1,73 @@ +"""Test for latest node version being able to run reflex.""" + +from __future__ import annotations + +from typing import Any, Generator + +import httpx +import pytest +from playwright.sync_api import Page, expect + +from reflex.testing import AppHarness + + +def TestNodeVersionApp(): + """A test app for node latest version.""" + import reflex as rx + from reflex.utils.prerequisites import get_node_version + + class TestNodeVersionConfig(rx.Config): + pass + + class TestNodeVersionState(rx.State): + @rx.var + def node_version(self) -> str: + return str(get_node_version()) + + app = rx.App() + + @app.add_page + def index(): + return rx.heading("Node Version check v", TestNodeVersionState.node_version) + + +@pytest.fixture() +def node_version_app(tmp_path) -> Generator[AppHarness, Any, None]: + """Fixture to start TestNodeVersionApp app at tmp_path via AppHarness. + + Args: + tmp_path: pytest tmp_path fixture + + Yields: + running AppHarness instance + """ + with AppHarness.create( + root=tmp_path, + app_source=TestNodeVersionApp, # type: ignore + ) as harness: + yield harness + + +def test_node_version(node_version_app: AppHarness, page: Page): + """Test for latest node version being able to run reflex. + + Args: + node_version_app: running AppHarness instance + page: playwright page instance + """ + + def get_latest_node_version(): + response = httpx.get("https://nodejs.org/dist/index.json") + versions = response.json() + + # Assuming the first entry in the API response is the most recent version + if versions: + latest_version = versions[0]["version"] + return latest_version + return None + + assert node_version_app.frontend_url is not None + page.goto(node_version_app.frontend_url) + expect(page.get_by_role("heading")).to_have_text( + f"Node Version check {get_latest_node_version()}" + ) diff --git a/tests/units/__init__.py b/tests/units/__init__.py new file mode 100644 index 000000000..d0196603c --- /dev/null +++ b/tests/units/__init__.py @@ -0,0 +1,5 @@ +"""Root directory for tests.""" + +import os + +from reflex import constants diff --git a/tests/compiler/__init__.py b/tests/units/compiler/__init__.py similarity index 100% rename from tests/compiler/__init__.py rename to tests/units/compiler/__init__.py diff --git a/tests/compiler/test_compiler.py b/tests/units/compiler/test_compiler.py similarity index 100% rename from tests/compiler/test_compiler.py rename to tests/units/compiler/test_compiler.py diff --git a/tests/compiler/test_compiler_utils.py b/tests/units/compiler/test_compiler_utils.py similarity index 100% rename from tests/compiler/test_compiler_utils.py rename to tests/units/compiler/test_compiler_utils.py diff --git a/tests/components/__init__.py b/tests/units/components/__init__.py similarity index 100% rename from tests/components/__init__.py rename to tests/units/components/__init__.py diff --git a/tests/components/base/test_bare.py b/tests/units/components/base/test_bare.py similarity index 100% rename from tests/components/base/test_bare.py rename to tests/units/components/base/test_bare.py diff --git a/tests/components/base/test_link.py b/tests/units/components/base/test_link.py similarity index 100% rename from tests/components/base/test_link.py rename to tests/units/components/base/test_link.py diff --git a/tests/components/base/test_script.py b/tests/units/components/base/test_script.py similarity index 100% rename from tests/components/base/test_script.py rename to tests/units/components/base/test_script.py diff --git a/tests/components/core/__init__.py b/tests/units/components/core/__init__.py similarity index 100% rename from tests/components/core/__init__.py rename to tests/units/components/core/__init__.py diff --git a/tests/components/core/test_banner.py b/tests/units/components/core/test_banner.py similarity index 100% rename from tests/components/core/test_banner.py rename to tests/units/components/core/test_banner.py diff --git a/tests/components/core/test_colors.py b/tests/units/components/core/test_colors.py similarity index 100% rename from tests/components/core/test_colors.py rename to tests/units/components/core/test_colors.py diff --git a/tests/components/core/test_cond.py b/tests/units/components/core/test_cond.py similarity index 100% rename from tests/components/core/test_cond.py rename to tests/units/components/core/test_cond.py diff --git a/tests/components/core/test_debounce.py b/tests/units/components/core/test_debounce.py similarity index 100% rename from tests/components/core/test_debounce.py rename to tests/units/components/core/test_debounce.py diff --git a/tests/components/core/test_foreach.py b/tests/units/components/core/test_foreach.py similarity index 100% rename from tests/components/core/test_foreach.py rename to tests/units/components/core/test_foreach.py diff --git a/tests/components/core/test_html.py b/tests/units/components/core/test_html.py similarity index 100% rename from tests/components/core/test_html.py rename to tests/units/components/core/test_html.py diff --git a/tests/components/core/test_match.py b/tests/units/components/core/test_match.py similarity index 100% rename from tests/components/core/test_match.py rename to tests/units/components/core/test_match.py diff --git a/tests/components/core/test_responsive.py b/tests/units/components/core/test_responsive.py similarity index 100% rename from tests/components/core/test_responsive.py rename to tests/units/components/core/test_responsive.py diff --git a/tests/components/core/test_upload.py b/tests/units/components/core/test_upload.py similarity index 100% rename from tests/components/core/test_upload.py rename to tests/units/components/core/test_upload.py diff --git a/tests/components/datadisplay/__init__.py b/tests/units/components/datadisplay/__init__.py similarity index 100% rename from tests/components/datadisplay/__init__.py rename to tests/units/components/datadisplay/__init__.py diff --git a/tests/components/datadisplay/conftest.py b/tests/units/components/datadisplay/conftest.py similarity index 100% rename from tests/components/datadisplay/conftest.py rename to tests/units/components/datadisplay/conftest.py diff --git a/tests/components/datadisplay/test_code.py b/tests/units/components/datadisplay/test_code.py similarity index 100% rename from tests/components/datadisplay/test_code.py rename to tests/units/components/datadisplay/test_code.py diff --git a/tests/components/datadisplay/test_dataeditor.py b/tests/units/components/datadisplay/test_dataeditor.py similarity index 100% rename from tests/components/datadisplay/test_dataeditor.py rename to tests/units/components/datadisplay/test_dataeditor.py diff --git a/tests/components/datadisplay/test_datatable.py b/tests/units/components/datadisplay/test_datatable.py similarity index 100% rename from tests/components/datadisplay/test_datatable.py rename to tests/units/components/datadisplay/test_datatable.py diff --git a/tests/components/el/test_html.py b/tests/units/components/el/test_html.py similarity index 100% rename from tests/components/el/test_html.py rename to tests/units/components/el/test_html.py diff --git a/tests/components/forms/__init__.py b/tests/units/components/forms/__init__.py similarity index 100% rename from tests/components/forms/__init__.py rename to tests/units/components/forms/__init__.py diff --git a/tests/components/forms/test_form.py b/tests/units/components/forms/test_form.py similarity index 100% rename from tests/components/forms/test_form.py rename to tests/units/components/forms/test_form.py diff --git a/tests/components/forms/test_uploads.py b/tests/units/components/forms/test_uploads.py similarity index 100% rename from tests/components/forms/test_uploads.py rename to tests/units/components/forms/test_uploads.py diff --git a/tests/components/graphing/__init__.py b/tests/units/components/graphing/__init__.py similarity index 100% rename from tests/components/graphing/__init__.py rename to tests/units/components/graphing/__init__.py diff --git a/tests/components/graphing/test_plotly.py b/tests/units/components/graphing/test_plotly.py similarity index 100% rename from tests/components/graphing/test_plotly.py rename to tests/units/components/graphing/test_plotly.py diff --git a/tests/components/graphing/test_recharts.py b/tests/units/components/graphing/test_recharts.py similarity index 100% rename from tests/components/graphing/test_recharts.py rename to tests/units/components/graphing/test_recharts.py diff --git a/tests/components/layout/__init__.py b/tests/units/components/layout/__init__.py similarity index 100% rename from tests/components/layout/__init__.py rename to tests/units/components/layout/__init__.py diff --git a/tests/components/lucide/test_icon.py b/tests/units/components/lucide/test_icon.py similarity index 100% rename from tests/components/lucide/test_icon.py rename to tests/units/components/lucide/test_icon.py diff --git a/tests/components/media/__init__.py b/tests/units/components/media/__init__.py similarity index 100% rename from tests/components/media/__init__.py rename to tests/units/components/media/__init__.py diff --git a/tests/components/media/test_image.py b/tests/units/components/media/test_image.py similarity index 100% rename from tests/components/media/test_image.py rename to tests/units/components/media/test_image.py diff --git a/tests/components/radix/test_icon_button.py b/tests/units/components/radix/test_icon_button.py similarity index 100% rename from tests/components/radix/test_icon_button.py rename to tests/units/components/radix/test_icon_button.py diff --git a/tests/components/radix/test_layout.py b/tests/units/components/radix/test_layout.py similarity index 100% rename from tests/components/radix/test_layout.py rename to tests/units/components/radix/test_layout.py diff --git a/tests/components/recharts/test_cartesian.py b/tests/units/components/recharts/test_cartesian.py similarity index 100% rename from tests/components/recharts/test_cartesian.py rename to tests/units/components/recharts/test_cartesian.py diff --git a/tests/components/recharts/test_polar.py b/tests/units/components/recharts/test_polar.py similarity index 100% rename from tests/components/recharts/test_polar.py rename to tests/units/components/recharts/test_polar.py diff --git a/tests/components/test_component.py b/tests/units/components/test_component.py similarity index 100% rename from tests/components/test_component.py rename to tests/units/components/test_component.py diff --git a/tests/components/test_component_future_annotations.py b/tests/units/components/test_component_future_annotations.py similarity index 100% rename from tests/components/test_component_future_annotations.py rename to tests/units/components/test_component_future_annotations.py diff --git a/tests/components/test_component_state.py b/tests/units/components/test_component_state.py similarity index 100% rename from tests/components/test_component_state.py rename to tests/units/components/test_component_state.py diff --git a/tests/components/test_tag.py b/tests/units/components/test_tag.py similarity index 100% rename from tests/components/test_tag.py rename to tests/units/components/test_tag.py diff --git a/tests/components/typography/__init__.py b/tests/units/components/typography/__init__.py similarity index 100% rename from tests/components/typography/__init__.py rename to tests/units/components/typography/__init__.py diff --git a/tests/components/typography/test_markdown.py b/tests/units/components/typography/test_markdown.py similarity index 100% rename from tests/components/typography/test_markdown.py rename to tests/units/components/typography/test_markdown.py diff --git a/tests/conftest.py b/tests/units/conftest.py similarity index 100% rename from tests/conftest.py rename to tests/units/conftest.py diff --git a/tests/experimental/custom_script.js b/tests/units/experimental/custom_script.js similarity index 100% rename from tests/experimental/custom_script.js rename to tests/units/experimental/custom_script.js diff --git a/tests/experimental/test_assets.py b/tests/units/experimental/test_assets.py similarity index 100% rename from tests/experimental/test_assets.py rename to tests/units/experimental/test_assets.py diff --git a/tests/middleware/__init__.py b/tests/units/middleware/__init__.py similarity index 100% rename from tests/middleware/__init__.py rename to tests/units/middleware/__init__.py diff --git a/tests/middleware/conftest.py b/tests/units/middleware/conftest.py similarity index 100% rename from tests/middleware/conftest.py rename to tests/units/middleware/conftest.py diff --git a/tests/middleware/test_hydrate_middleware.py b/tests/units/middleware/test_hydrate_middleware.py similarity index 100% rename from tests/middleware/test_hydrate_middleware.py rename to tests/units/middleware/test_hydrate_middleware.py diff --git a/tests/states/__init__.py b/tests/units/states/__init__.py similarity index 100% rename from tests/states/__init__.py rename to tests/units/states/__init__.py diff --git a/tests/states/mutation.py b/tests/units/states/mutation.py similarity index 100% rename from tests/states/mutation.py rename to tests/units/states/mutation.py diff --git a/tests/states/upload.py b/tests/units/states/upload.py similarity index 100% rename from tests/states/upload.py rename to tests/units/states/upload.py diff --git a/tests/test_app.py b/tests/units/test_app.py similarity index 100% rename from tests/test_app.py rename to tests/units/test_app.py diff --git a/tests/test_attribute_access_type.py b/tests/units/test_attribute_access_type.py similarity index 100% rename from tests/test_attribute_access_type.py rename to tests/units/test_attribute_access_type.py diff --git a/tests/test_base.py b/tests/units/test_base.py similarity index 100% rename from tests/test_base.py rename to tests/units/test_base.py diff --git a/tests/test_config.py b/tests/units/test_config.py similarity index 100% rename from tests/test_config.py rename to tests/units/test_config.py diff --git a/tests/test_db_config.py b/tests/units/test_db_config.py similarity index 100% rename from tests/test_db_config.py rename to tests/units/test_db_config.py diff --git a/tests/test_event.py b/tests/units/test_event.py similarity index 100% rename from tests/test_event.py rename to tests/units/test_event.py diff --git a/tests/test_health_endpoint.py b/tests/units/test_health_endpoint.py similarity index 100% rename from tests/test_health_endpoint.py rename to tests/units/test_health_endpoint.py diff --git a/tests/test_model.py b/tests/units/test_model.py similarity index 100% rename from tests/test_model.py rename to tests/units/test_model.py diff --git a/tests/test_page.py b/tests/units/test_page.py similarity index 100% rename from tests/test_page.py rename to tests/units/test_page.py diff --git a/tests/test_prerequisites.py b/tests/units/test_prerequisites.py similarity index 100% rename from tests/test_prerequisites.py rename to tests/units/test_prerequisites.py diff --git a/tests/test_route.py b/tests/units/test_route.py similarity index 100% rename from tests/test_route.py rename to tests/units/test_route.py diff --git a/tests/test_sqlalchemy.py b/tests/units/test_sqlalchemy.py similarity index 100% rename from tests/test_sqlalchemy.py rename to tests/units/test_sqlalchemy.py diff --git a/tests/test_state.py b/tests/units/test_state.py similarity index 99% rename from tests/test_state.py rename to tests/units/test_state.py index 21584fff9..89aad1536 100644 --- a/tests/test_state.py +++ b/tests/units/test_state.py @@ -43,7 +43,7 @@ from reflex.testing import chdir from reflex.utils import format, prerequisites, types from reflex.utils.format import json_dumps from reflex.vars.base import ComputedVar, Var -from tests.states.mutation import MutableSQLAModel, MutableTestState +from tests.units.states.mutation import MutableSQLAModel, MutableTestState from .states import GenState @@ -440,26 +440,28 @@ def test_get_substates(): def test_get_name(): """Test getting the name of a state.""" - assert TestState.get_name() == "tests___test_state____test_state" - assert ChildState.get_name() == "tests___test_state____child_state" - assert ChildState2.get_name() == "tests___test_state____child_state2" - assert GrandchildState.get_name() == "tests___test_state____grandchild_state" + assert TestState.get_name() == "tests___units___test_state____test_state" + assert ChildState.get_name() == "tests___units___test_state____child_state" + assert ChildState2.get_name() == "tests___units___test_state____child_state2" + assert ( + GrandchildState.get_name() == "tests___units___test_state____grandchild_state" + ) def test_get_full_name(): """Test getting the full name.""" - assert TestState.get_full_name() == "tests___test_state____test_state" + assert TestState.get_full_name() == "tests___units___test_state____test_state" assert ( ChildState.get_full_name() - == "tests___test_state____test_state.tests___test_state____child_state" + == "tests___units___test_state____test_state.tests___units___test_state____child_state" ) assert ( ChildState2.get_full_name() - == "tests___test_state____test_state.tests___test_state____child_state2" + == "tests___units___test_state____test_state.tests___units___test_state____child_state2" ) assert ( GrandchildState.get_full_name() - == "tests___test_state____test_state.tests___test_state____child_state.tests___test_state____grandchild_state" + == "tests___units___test_state____test_state.tests___units___test_state____child_state.tests___units___test_state____grandchild_state" ) diff --git a/tests/test_state_tree.py b/tests/units/test_state_tree.py similarity index 100% rename from tests/test_state_tree.py rename to tests/units/test_state_tree.py diff --git a/tests/test_style.py b/tests/units/test_style.py similarity index 100% rename from tests/test_style.py rename to tests/units/test_style.py diff --git a/tests/test_telemetry.py b/tests/units/test_telemetry.py similarity index 100% rename from tests/test_telemetry.py rename to tests/units/test_telemetry.py diff --git a/tests/test_testing.py b/tests/units/test_testing.py similarity index 100% rename from tests/test_testing.py rename to tests/units/test_testing.py diff --git a/tests/test_var.py b/tests/units/test_var.py similarity index 100% rename from tests/test_var.py rename to tests/units/test_var.py diff --git a/tests/utils/__init__.py b/tests/units/utils/__init__.py similarity index 100% rename from tests/utils/__init__.py rename to tests/units/utils/__init__.py diff --git a/tests/utils/test_format.py b/tests/units/utils/test_format.py similarity index 99% rename from tests/utils/test_format.py rename to tests/units/utils/test_format.py index b108f9dc2..4ec5099f5 100644 --- a/tests/utils/test_format.py +++ b/tests/units/utils/test_format.py @@ -13,7 +13,7 @@ from reflex.utils import format from reflex.utils.serializers import serialize_figure from reflex.vars.base import LiteralVar, Var from reflex.vars.object import ObjectVar -from tests.test_state import ( +from tests.units.test_state import ( ChildState, ChildState2, ChildState3, diff --git a/tests/utils/test_imports.py b/tests/units/utils/test_imports.py similarity index 100% rename from tests/utils/test_imports.py rename to tests/units/utils/test_imports.py diff --git a/tests/utils/test_serializers.py b/tests/units/utils/test_serializers.py similarity index 100% rename from tests/utils/test_serializers.py rename to tests/units/utils/test_serializers.py diff --git a/tests/utils/test_types.py b/tests/units/utils/test_types.py similarity index 100% rename from tests/utils/test_types.py rename to tests/units/utils/test_types.py diff --git a/tests/utils/test_utils.py b/tests/units/utils/test_utils.py similarity index 100% rename from tests/utils/test_utils.py rename to tests/units/utils/test_utils.py diff --git a/tests/vars/test_base.py b/tests/units/vars/test_base.py similarity index 100% rename from tests/vars/test_base.py rename to tests/units/vars/test_base.py From 25016f5e27d21f5a1bd35dea48880d4ea0edccf2 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 26 Sep 2024 11:04:35 -0700 Subject: [PATCH 066/201] Update markdown component map to use new rx.code_block.theme enum (#3996) * Update markdown component map to use new rx.code_block.theme enum * change var to theme * give the types some attention instead of ignoring them --------- Co-authored-by: Khaleel Al-Adhami --- reflex/components/datadisplay/__init__.py | 1 - reflex/components/datadisplay/__init__.pyi | 1 - reflex/components/datadisplay/code.py | 220 +++++++-------------- reflex/components/datadisplay/code.pyi | 160 ++++++--------- reflex/components/markdown/markdown.py | 6 +- 5 files changed, 134 insertions(+), 254 deletions(-) diff --git a/reflex/components/datadisplay/__init__.py b/reflex/components/datadisplay/__init__.py index fe613ee52..1aff69676 100644 --- a/reflex/components/datadisplay/__init__.py +++ b/reflex/components/datadisplay/__init__.py @@ -8,7 +8,6 @@ _SUBMOD_ATTRS: dict[str, list[str]] = { "code": [ "CodeBlock", "code_block", - "LiteralCodeBlockTheme", "LiteralCodeLanguage", ], "dataeditor": ["data_editor", "data_editor_theme", "DataEditorTheme"], diff --git a/reflex/components/datadisplay/__init__.pyi b/reflex/components/datadisplay/__init__.pyi index 4882c83df..32b29d106 100644 --- a/reflex/components/datadisplay/__init__.pyi +++ b/reflex/components/datadisplay/__init__.pyi @@ -4,7 +4,6 @@ # ------------------------------------------------------ from .code import CodeBlock as CodeBlock -from .code import LiteralCodeBlockTheme as LiteralCodeBlockTheme from .code import LiteralCodeLanguage as LiteralCodeLanguage from .code import code_block as code_block from .dataeditor import DataEditorTheme as DataEditorTheme diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index 0b26e0c04..c18e44885 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -2,10 +2,8 @@ from __future__ import annotations -import enum -from typing import Any, Dict, Literal, Optional, Union - -from typing_extensions import get_args +import dataclasses +from typing import ClassVar, Dict, Literal, Optional, Union from reflex.components.component import Component, ComponentNamespace from reflex.components.core.cond import color_mode_cond @@ -19,55 +17,6 @@ from reflex.utils import console, format from reflex.utils.imports import ImportDict, ImportVar from reflex.vars.base import LiteralVar, Var, VarData -LiteralCodeBlockTheme = Literal[ - "a11y-dark", - "atom-dark", - "cb", - "coldark-cold", - "coldark-dark", - "coy", - "coy-without-shadows", - "darcula", - "dark", - "dracula", - "duotone-dark", - "duotone-earth", - "duotone-forest", - "duotone-light", - "duotone-sea", - "duotone-space", - "funky", - "ghcolors", - "gruvbox-dark", - "gruvbox-light", - "holi-theme", - "hopscotch", - "light", # not present in react-syntax-highlighter styles - "lucario", - "material-dark", - "material-light", - "material-oceanic", - "night-owl", - "nord", - "okaidia", - "one-dark", - "one-light", - "pojoaque", - "prism", - "shades-of-purple", - "solarized-dark-atom", - "solarizedlight", - "synthwave84", - "tomorrow", - "twilight", - "vs", - "vs-dark", - "vsc-dark-plus", - "xonokai", - "z-touch", -] - - LiteralCodeLanguage = Literal[ "abap", "abnf", @@ -351,18 +300,82 @@ LiteralCodeLanguage = Literal[ ] -def replace_quotes_with_camel_case(value: str) -> str: - """Replaces quotes in the given string with camel case format. +def construct_theme_var(theme: str) -> Var[Theme]: + """Construct a theme var. Args: - value (str): The string to be processed. + theme: The theme to construct. Returns: - str: The processed string with quotes replaced by camel case. + The constructed theme var. """ - for theme in get_args(LiteralCodeBlockTheme): - value = value.replace(f'"{theme}"', format.to_camel_case(theme)) - return value + return Var( + theme, + _var_data=VarData( + imports={ + f"react-syntax-highlighter/dist/cjs/styles/prism/{format.to_kebab_case(theme)}": [ + ImportVar(tag=theme, is_default=True, install=False) + ] + } + ), + ) + + +@dataclasses.dataclass(init=False) +class Theme: + """Themes for the CodeBlock component.""" + + a11y_dark: ClassVar[Var[Theme]] = construct_theme_var("a11yDark") + atom_dark: ClassVar[Var[Theme]] = construct_theme_var("atomDark") + cb: ClassVar[Var[Theme]] = construct_theme_var("cb") + coldark_cold: ClassVar[Var[Theme]] = construct_theme_var("coldarkCold") + coldark_dark: ClassVar[Var[Theme]] = construct_theme_var("coldarkDark") + coy: ClassVar[Var[Theme]] = construct_theme_var("coy") + coy_without_shadows: ClassVar[Var[Theme]] = construct_theme_var("coyWithoutShadows") + darcula: ClassVar[Var[Theme]] = construct_theme_var("darcula") + dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark") + dracula: ClassVar[Var[Theme]] = construct_theme_var("dracula") + duotone_dark: ClassVar[Var[Theme]] = construct_theme_var("duotoneDark") + duotone_earth: ClassVar[Var[Theme]] = construct_theme_var("duotoneEarth") + duotone_forest: ClassVar[Var[Theme]] = construct_theme_var("duotoneForest") + duotone_light: ClassVar[Var[Theme]] = construct_theme_var("duotoneLight") + duotone_sea: ClassVar[Var[Theme]] = construct_theme_var("duotoneSea") + duotone_space: ClassVar[Var[Theme]] = construct_theme_var("duotoneSpace") + funky: ClassVar[Var[Theme]] = construct_theme_var("funky") + ghcolors: ClassVar[Var[Theme]] = construct_theme_var("ghcolors") + gruvbox_dark: ClassVar[Var[Theme]] = construct_theme_var("gruvboxDark") + gruvbox_light: ClassVar[Var[Theme]] = construct_theme_var("gruvboxLight") + holi_theme: ClassVar[Var[Theme]] = construct_theme_var("holiTheme") + hopscotch: ClassVar[Var[Theme]] = construct_theme_var("hopscotch") + light: ClassVar[Var[Theme]] = construct_theme_var("oneLight") + lucario: ClassVar[Var[Theme]] = construct_theme_var("lucario") + material_dark: ClassVar[Var[Theme]] = construct_theme_var("materialDark") + material_light: ClassVar[Var[Theme]] = construct_theme_var("materialLight") + material_oceanic: ClassVar[Var[Theme]] = construct_theme_var("materialOceanic") + night_owl: ClassVar[Var[Theme]] = construct_theme_var("nightOwl") + nord: ClassVar[Var[Theme]] = construct_theme_var("nord") + okaidia: ClassVar[Var[Theme]] = construct_theme_var("okaidia") + one_dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark") + one_light: ClassVar[Var[Theme]] = construct_theme_var("oneLight") + pojoaque: ClassVar[Var[Theme]] = construct_theme_var("pojoaque") + prism: ClassVar[Var[Theme]] = construct_theme_var("prism") + shades_of_purple: ClassVar[Var[Theme]] = construct_theme_var("shadesOfPurple") + solarized_dark_atom: ClassVar[Var[Theme]] = construct_theme_var("solarizedDarkAtom") + solarizedlight: ClassVar[Var[Theme]] = construct_theme_var("solarizedlight") + synthwave84: ClassVar[Var[Theme]] = construct_theme_var("synthwave84") + tomorrow: ClassVar[Var[Theme]] = construct_theme_var("tomorrow") + twilight: ClassVar[Var[Theme]] = construct_theme_var("twilight") + vs: ClassVar[Var[Theme]] = construct_theme_var("vs") + vs_dark: ClassVar[Var[Theme]] = construct_theme_var("vsDark") + vsc_dark_plus: ClassVar[Var[Theme]] = construct_theme_var("vscDarkPlus") + xonokai: ClassVar[Var[Theme]] = construct_theme_var("xonokai") + z_touch: ClassVar[Var[Theme]] = construct_theme_var("zTouch") + + +for theme_name in dir(Theme): + if theme_name.startswith("_"): + continue + setattr(Theme, theme_name, getattr(Theme, theme_name)._replace(_var_type=Theme)) class CodeBlock(Component): @@ -375,7 +388,7 @@ class CodeBlock(Component): alias = "SyntaxHighlighter" # The theme to use ("light" or "dark"). - theme: Var[Any] = "one-light" # type: ignore + theme: Var[Union[Theme, str]] = Theme.one_light # The language to use. language: Var[LiteralCodeLanguage] = "python" # type: ignore @@ -523,91 +536,6 @@ class CodeBlock(Component): return out - @staticmethod - def convert_theme_name(theme) -> str: - """Convert theme names to appropriate names. - - Args: - theme: The theme name. - - Returns: - The right theme name. - """ - if theme in ["light", "dark"]: - return f"one-{theme}" - return theme - - -def construct_theme_var(theme: str) -> Var: - """Construct a theme var. - - Args: - theme: The theme to construct. - - Returns: - The constructed theme var. - """ - return Var( - theme, - _var_data=VarData( - imports={ - f"react-syntax-highlighter/dist/cjs/styles/prism/{format.to_kebab_case(theme)}": [ - ImportVar(tag=theme, is_default=True, install=False) - ] - } - ), - ) - - -class Theme(enum.Enum): - """Themes for the CodeBlock component.""" - - a11y_dark = construct_theme_var("a11yDark") - atom_dark = construct_theme_var("atomDark") - cb = construct_theme_var("cb") - coldark_cold = construct_theme_var("coldarkCold") - coldark_dark = construct_theme_var("coldarkDark") - coy = construct_theme_var("coy") - coy_without_shadows = construct_theme_var("coyWithoutShadows") - darcula = construct_theme_var("darcula") - dark = construct_theme_var("oneDark") - dracula = construct_theme_var("dracula") - duotone_dark = construct_theme_var("duotoneDark") - duotone_earth = construct_theme_var("duotoneEarth") - duotone_forest = construct_theme_var("duotoneForest") - duotone_light = construct_theme_var("duotoneLight") - duotone_sea = construct_theme_var("duotoneSea") - duotone_space = construct_theme_var("duotoneSpace") - funky = construct_theme_var("funky") - ghcolors = construct_theme_var("ghcolors") - gruvbox_dark = construct_theme_var("gruvboxDark") - gruvbox_light = construct_theme_var("gruvboxLight") - holi_theme = construct_theme_var("holiTheme") - hopscotch = construct_theme_var("hopscotch") - light = construct_theme_var("oneLight") - lucario = construct_theme_var("lucario") - material_dark = construct_theme_var("materialDark") - material_light = construct_theme_var("materialLight") - material_oceanic = construct_theme_var("materialOceanic") - night_owl = construct_theme_var("nightOwl") - nord = construct_theme_var("nord") - okaidia = construct_theme_var("okaidia") - one_dark = construct_theme_var("oneDark") - one_light = construct_theme_var("oneLight") - pojoaque = construct_theme_var("pojoaque") - prism = construct_theme_var("prism") - shades_of_purple = construct_theme_var("shadesOfPurple") - solarized_dark_atom = construct_theme_var("solarizedDarkAtom") - solarizedlight = construct_theme_var("solarizedlight") - synthwave84 = construct_theme_var("synthwave84") - tomorrow = construct_theme_var("tomorrow") - twilight = construct_theme_var("twilight") - vs = construct_theme_var("vs") - vs_dark = construct_theme_var("vsDark") - vsc_dark_plus = construct_theme_var("vscDarkPlus") - xonokai = construct_theme_var("xonokai") - z_touch = construct_theme_var("zTouch") - class CodeblockNamespace(ComponentNamespace): """Namespace for the CodeBlock component.""" diff --git a/reflex/components/datadisplay/code.pyi b/reflex/components/datadisplay/code.pyi index 7a074d1f9..621dce5d0 100644 --- a/reflex/components/datadisplay/code.pyi +++ b/reflex/components/datadisplay/code.pyi @@ -3,8 +3,8 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -import enum -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +import dataclasses +from typing import Any, Callable, ClassVar, Dict, Literal, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.constants.colors import Color @@ -13,53 +13,6 @@ from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var -LiteralCodeBlockTheme = Literal[ - "a11y-dark", - "atom-dark", - "cb", - "coldark-cold", - "coldark-dark", - "coy", - "coy-without-shadows", - "darcula", - "dark", - "dracula", - "duotone-dark", - "duotone-earth", - "duotone-forest", - "duotone-light", - "duotone-sea", - "duotone-space", - "funky", - "ghcolors", - "gruvbox-dark", - "gruvbox-light", - "holi-theme", - "hopscotch", - "light", - "lucario", - "material-dark", - "material-light", - "material-oceanic", - "night-owl", - "nord", - "okaidia", - "one-dark", - "one-light", - "pojoaque", - "prism", - "shades-of-purple", - "solarized-dark-atom", - "solarizedlight", - "synthwave84", - "tomorrow", - "twilight", - "vs", - "vs-dark", - "vsc-dark-plus", - "xonokai", - "z-touch", -] LiteralCodeLanguage = Literal[ "abap", "abnf", @@ -342,7 +295,59 @@ LiteralCodeLanguage = Literal[ "zig", ] -def replace_quotes_with_camel_case(value: str) -> str: ... +def construct_theme_var(theme: str) -> Var[Theme]: ... +@dataclasses.dataclass(init=False) +class Theme: + a11y_dark: ClassVar[Var[Theme]] = construct_theme_var("a11yDark") + atom_dark: ClassVar[Var[Theme]] = construct_theme_var("atomDark") + cb: ClassVar[Var[Theme]] = construct_theme_var("cb") + coldark_cold: ClassVar[Var[Theme]] = construct_theme_var("coldarkCold") + coldark_dark: ClassVar[Var[Theme]] = construct_theme_var("coldarkDark") + coy: ClassVar[Var[Theme]] = construct_theme_var("coy") + coy_without_shadows: ClassVar[Var[Theme]] = construct_theme_var("coyWithoutShadows") + darcula: ClassVar[Var[Theme]] = construct_theme_var("darcula") + dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark") + dracula: ClassVar[Var[Theme]] = construct_theme_var("dracula") + duotone_dark: ClassVar[Var[Theme]] = construct_theme_var("duotoneDark") + duotone_earth: ClassVar[Var[Theme]] = construct_theme_var("duotoneEarth") + duotone_forest: ClassVar[Var[Theme]] = construct_theme_var("duotoneForest") + duotone_light: ClassVar[Var[Theme]] = construct_theme_var("duotoneLight") + duotone_sea: ClassVar[Var[Theme]] = construct_theme_var("duotoneSea") + duotone_space: ClassVar[Var[Theme]] = construct_theme_var("duotoneSpace") + funky: ClassVar[Var[Theme]] = construct_theme_var("funky") + ghcolors: ClassVar[Var[Theme]] = construct_theme_var("ghcolors") + gruvbox_dark: ClassVar[Var[Theme]] = construct_theme_var("gruvboxDark") + gruvbox_light: ClassVar[Var[Theme]] = construct_theme_var("gruvboxLight") + holi_theme: ClassVar[Var[Theme]] = construct_theme_var("holiTheme") + hopscotch: ClassVar[Var[Theme]] = construct_theme_var("hopscotch") + light: ClassVar[Var[Theme]] = construct_theme_var("oneLight") + lucario: ClassVar[Var[Theme]] = construct_theme_var("lucario") + material_dark: ClassVar[Var[Theme]] = construct_theme_var("materialDark") + material_light: ClassVar[Var[Theme]] = construct_theme_var("materialLight") + material_oceanic: ClassVar[Var[Theme]] = construct_theme_var("materialOceanic") + night_owl: ClassVar[Var[Theme]] = construct_theme_var("nightOwl") + nord: ClassVar[Var[Theme]] = construct_theme_var("nord") + okaidia: ClassVar[Var[Theme]] = construct_theme_var("okaidia") + one_dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark") + one_light: ClassVar[Var[Theme]] = construct_theme_var("oneLight") + pojoaque: ClassVar[Var[Theme]] = construct_theme_var("pojoaque") + prism: ClassVar[Var[Theme]] = construct_theme_var("prism") + shades_of_purple: ClassVar[Var[Theme]] = construct_theme_var("shadesOfPurple") + solarized_dark_atom: ClassVar[Var[Theme]] = construct_theme_var("solarizedDarkAtom") + solarizedlight: ClassVar[Var[Theme]] = construct_theme_var("solarizedlight") + synthwave84: ClassVar[Var[Theme]] = construct_theme_var("synthwave84") + tomorrow: ClassVar[Var[Theme]] = construct_theme_var("tomorrow") + twilight: ClassVar[Var[Theme]] = construct_theme_var("twilight") + vs: ClassVar[Var[Theme]] = construct_theme_var("vs") + vs_dark: ClassVar[Var[Theme]] = construct_theme_var("vsDark") + vsc_dark_plus: ClassVar[Var[Theme]] = construct_theme_var("vscDarkPlus") + xonokai: ClassVar[Var[Theme]] = construct_theme_var("xonokai") + z_touch: ClassVar[Var[Theme]] = construct_theme_var("zTouch") + +for theme_name in dir(Theme): + if theme_name.startswith("_"): + continue + setattr(Theme, theme_name, getattr(Theme, theme_name)._replace(_var_type=Theme)) class CodeBlock(Component): def add_imports(self) -> ImportDict: ... @@ -353,7 +358,7 @@ class CodeBlock(Component): *children, can_copy: Optional[bool] = False, copy_button: Optional[Union[Component, bool]] = None, - theme: Optional[Union[Any, Var[Any]]] = None, + theme: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None, language: Optional[ Union[ Literal[ @@ -999,57 +1004,6 @@ class CodeBlock(Component): ... def add_style(self): ... - @staticmethod - def convert_theme_name(theme) -> str: ... - -def construct_theme_var(theme: str) -> Var: ... - -class Theme(enum.Enum): - a11y_dark = construct_theme_var("a11yDark") - atom_dark = construct_theme_var("atomDark") - cb = construct_theme_var("cb") - coldark_cold = construct_theme_var("coldarkCold") - coldark_dark = construct_theme_var("coldarkDark") - coy = construct_theme_var("coy") - coy_without_shadows = construct_theme_var("coyWithoutShadows") - darcula = construct_theme_var("darcula") - dark = construct_theme_var("oneDark") - dracula = construct_theme_var("dracula") - duotone_dark = construct_theme_var("duotoneDark") - duotone_earth = construct_theme_var("duotoneEarth") - duotone_forest = construct_theme_var("duotoneForest") - duotone_light = construct_theme_var("duotoneLight") - duotone_sea = construct_theme_var("duotoneSea") - duotone_space = construct_theme_var("duotoneSpace") - funky = construct_theme_var("funky") - ghcolors = construct_theme_var("ghcolors") - gruvbox_dark = construct_theme_var("gruvboxDark") - gruvbox_light = construct_theme_var("gruvboxLight") - holi_theme = construct_theme_var("holiTheme") - hopscotch = construct_theme_var("hopscotch") - light = construct_theme_var("oneLight") - lucario = construct_theme_var("lucario") - material_dark = construct_theme_var("materialDark") - material_light = construct_theme_var("materialLight") - material_oceanic = construct_theme_var("materialOceanic") - night_owl = construct_theme_var("nightOwl") - nord = construct_theme_var("nord") - okaidia = construct_theme_var("okaidia") - one_dark = construct_theme_var("oneDark") - one_light = construct_theme_var("oneLight") - pojoaque = construct_theme_var("pojoaque") - prism = construct_theme_var("prism") - shades_of_purple = construct_theme_var("shadesOfPurple") - solarized_dark_atom = construct_theme_var("solarizedDarkAtom") - solarizedlight = construct_theme_var("solarizedlight") - synthwave84 = construct_theme_var("synthwave84") - tomorrow = construct_theme_var("tomorrow") - twilight = construct_theme_var("twilight") - vs = construct_theme_var("vs") - vs_dark = construct_theme_var("vsDark") - vsc_dark_plus = construct_theme_var("vscDarkPlus") - xonokai = construct_theme_var("xonokai") - z_touch = construct_theme_var("zTouch") class CodeblockNamespace(ComponentNamespace): themes = Theme @@ -1059,7 +1013,7 @@ class CodeblockNamespace(ComponentNamespace): *children, can_copy: Optional[bool] = False, copy_button: Optional[Union[Component, bool]] = None, - theme: Optional[Union[Any, Var[Any]]] = None, + theme: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None, language: Optional[ Union[ Literal[ diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index 1596f5ce2..6c288c071 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -147,7 +147,7 @@ class Markdown(Component): Returns: The imports for the markdown component. """ - from reflex.components.datadisplay.code import CodeBlock + from reflex.components.datadisplay.code import CodeBlock, Theme from reflex.components.radix.themes.typography.code import Code return [ @@ -173,8 +173,8 @@ class Markdown(Component): component(_MOCK_ARG)._get_all_imports() # type: ignore for component in self.component_map.values() ], - CodeBlock.create(theme="light")._get_imports(), # type: ignore, - Code.create()._get_imports(), # type: ignore, + CodeBlock.create(theme=Theme.light)._get_imports(), + Code.create()._get_imports(), ] def get_component(self, tag: str, **props) -> Component: From 130bcf96ca30dabdacbde15edaeac6f5fe499746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 26 Sep 2024 11:56:59 -0700 Subject: [PATCH 067/201] default on_submit in form set to prevent_default (#4005) * default submit forms set to prevent_default * fix tests --- reflex/components/el/elements/forms.py | 5 ++++- tests/units/components/forms/test_form.py | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index 29fea357b..1963f8b37 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -10,7 +10,7 @@ from jinja2 import Environment from reflex.components.el.element import Element from reflex.components.tags.tag import Tag from reflex.constants import Dirs, EventTriggers -from reflex.event import EventChain, EventHandler +from reflex.event import EventChain, EventHandler, prevent_default from reflex.utils.imports import ImportDict from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var @@ -148,6 +148,9 @@ class Form(BaseHTML): Returns: The form component. """ + if "on_submit" not in props: + props["on_submit"] = prevent_default + if "handle_submit_unique_name" in props: return super().create(*children, **props) diff --git a/tests/units/components/forms/test_form.py b/tests/units/components/forms/test_form.py index 3cbbab3b8..5f3ba2d37 100644 --- a/tests/units/components/forms/test_form.py +++ b/tests/units/components/forms/test_form.py @@ -1,5 +1,5 @@ from reflex.components.radix.primitives.form import Form -from reflex.event import EventChain +from reflex.event import EventChain, prevent_default from reflex.vars.base import Var @@ -15,7 +15,6 @@ def test_render_on_submit(): def test_render_no_on_submit(): - """A form without on_submit should not render a submit handler.""" + """A form without on_submit should render a prevent_default handler.""" f = Form.create() - for prop in f.render()["props"]: - assert "onSubmit" not in prop + assert f.event_triggers["on_submit"] == prevent_default From 54c7b5a261356b534683c1da40fa4dd88b31f6b0 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 26 Sep 2024 13:47:05 -0700 Subject: [PATCH 068/201] disable prose by default for rx.html (#4001) * disable prose by default for rx.html * remove styled * put that on one line --- reflex/components/core/html.py | 2 +- tests/units/components/core/test_html.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reflex/components/core/html.py b/reflex/components/core/html.py index a732e7828..cfe46e591 100644 --- a/reflex/components/core/html.py +++ b/reflex/components/core/html.py @@ -40,7 +40,7 @@ class Html(Div): given_class_name = props.pop("class_name", []) if isinstance(given_class_name, str): given_class_name = [given_class_name] - props["class_name"] = ["rx-Html", "prose", *given_class_name] + props["class_name"] = ["rx-Html", *given_class_name] # Create the component. return super().create(**props) diff --git a/tests/units/components/core/test_html.py b/tests/units/components/core/test_html.py index cc6530cb6..4847e1d5a 100644 --- a/tests/units/components/core/test_html.py +++ b/tests/units/components/core/test_html.py @@ -19,7 +19,7 @@ def test_html_create(): assert str(html.dangerouslySetInnerHTML) == '({ ["__html"] : "

Hello !

" })' # type: ignore assert ( str(html) - == '
Hello !

" })}/>' + == '
Hello !

" })}/>' ) @@ -37,5 +37,5 @@ def test_html_fstring_create(): ) assert ( str(html) - == f'
' # type: ignore + == f'
' # type: ignore ) From 60276cf1ff55fc5e6476e4d355d2bdb428f2acb5 Mon Sep 17 00:00:00 2001 From: LeoH Date: Thu, 26 Sep 2024 22:56:53 +0200 Subject: [PATCH 069/201] EventFnArgMismatch fix to support defaults args (#4004) * EventFnArgMismatch fix to support defaults args * fixing type hint and docstring raises * enforce stronger type checking * unwrap var annotations :( --------- Co-authored-by: Khaleel Al-Adhami --- reflex/event.py | 75 +++++++++++++++++++++++++++++---------- reflex/utils/types.py | 19 ++++++++-- tests/units/test_event.py | 2 +- 3 files changed, 74 insertions(+), 22 deletions(-) diff --git a/reflex/event.py b/reflex/event.py index ac0c713ab..d8f0a5f0f 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -18,10 +18,12 @@ from typing import ( get_type_hints, ) +from typing_extensions import get_args, get_origin + from reflex import constants from reflex.utils import format from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch -from reflex.utils.types import ArgsSpec +from reflex.utils.types import ArgsSpec, GenericType from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var from reflex.vars.function import FunctionStringVar, FunctionVar @@ -417,7 +419,7 @@ class FileUpload: on_upload_progress: Optional[Union[EventHandler, Callable]] = None @staticmethod - def on_upload_progress_args_spec(_prog: Dict[str, Union[int, float, bool]]): + def on_upload_progress_args_spec(_prog: Var[Dict[str, Union[int, float, bool]]]): """Args spec for on_upload_progress event handler. Returns: @@ -910,6 +912,20 @@ def call_event_handler( ) +def unwrap_var_annotation(annotation: GenericType): + """Unwrap a Var annotation or return it as is if it's not Var[X]. + + Args: + annotation: The annotation to unwrap. + + Returns: + The unwrapped annotation. + """ + if get_origin(annotation) is Var and (args := get_args(annotation)): + return args[0] + return annotation + + def parse_args_spec(arg_spec: ArgsSpec): """Parse the args provided in the ArgsSpec of an event trigger. @@ -921,20 +937,54 @@ def parse_args_spec(arg_spec: ArgsSpec): """ spec = inspect.getfullargspec(arg_spec) annotations = get_type_hints(arg_spec) + return arg_spec( *[ - Var(f"_{l_arg}").to(annotations.get(l_arg, FrontendEvent)) + Var(f"_{l_arg}").to( + unwrap_var_annotation(annotations.get(l_arg, FrontendEvent)) + ) for l_arg in spec.args ] ) +def check_fn_match_arg_spec(fn: Callable, arg_spec: ArgsSpec) -> List[Var]: + """Ensures that the function signature matches the passed argument specification + or raises an EventFnArgMismatch if they do not. + + Args: + fn: The function to be validated. + arg_spec: The argument specification for the event trigger. + + Returns: + The parsed arguments from the argument specification. + + Raises: + EventFnArgMismatch: Raised if the number of mandatory arguments do not match + """ + fn_args = inspect.getfullargspec(fn).args + fn_defaults_args = inspect.getfullargspec(fn).defaults + n_fn_args = len(fn_args) + n_fn_defaults_args = len(fn_defaults_args) if fn_defaults_args else 0 + if isinstance(fn, types.MethodType): + n_fn_args -= 1 # subtract 1 for bound self arg + parsed_args = parse_args_spec(arg_spec) + if not (n_fn_args - n_fn_defaults_args <= len(parsed_args) <= n_fn_args): + raise EventFnArgMismatch( + "The number of mandatory arguments accepted by " + f"{fn} ({n_fn_args - n_fn_defaults_args}) " + "does not match the arguments passed by the event trigger: " + f"{[str(v) for v in parsed_args]}\n" + "See https://reflex.dev/docs/events/event-arguments/" + ) + return parsed_args + + def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: """Call a function to a list of event specs. The function should return a single EventSpec, a list of EventSpecs, or a - single Var. The function signature must match the passed arg_spec or - EventFnArgsMismatch will be raised. + single Var. Args: fn: The function to call. @@ -944,7 +994,6 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: The event specs from calling the function or a Var. Raises: - EventFnArgMismatch: If the function signature doesn't match the arg spec. EventHandlerValueError: If the lambda returns an unusable value. """ # Import here to avoid circular imports. @@ -952,19 +1001,7 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: from reflex.utils.exceptions import EventHandlerValueError # Check that fn signature matches arg_spec - fn_args = inspect.getfullargspec(fn).args - n_fn_args = len(fn_args) - if isinstance(fn, types.MethodType): - n_fn_args -= 1 # subtract 1 for bound self arg - parsed_args = parse_args_spec(arg_spec) - if len(parsed_args) != n_fn_args: - raise EventFnArgMismatch( - "The number of arguments accepted by " - f"{fn} ({n_fn_args}) " - "does not match the arguments passed by the event trigger: " - f"{[str(v) for v in parsed_args]}\n" - "See https://reflex.dev/docs/events/event-arguments/" - ) + parsed_args = check_fn_match_arg_spec(fn, arg_spec) # Call the function with the parsed args. out = fn(*parsed_args) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 63238f67b..41e1ed49a 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -9,6 +9,7 @@ import sys import types from functools import cached_property, lru_cache, wraps from typing import ( + TYPE_CHECKING, Any, Callable, ClassVar, @@ -96,8 +97,22 @@ PrimitiveType = Union[int, float, bool, str, list, dict, set, tuple] StateVar = Union[PrimitiveType, Base, None] StateIterVar = Union[list, set, tuple] -# ArgsSpec = Callable[[Var], list[Var]] -ArgsSpec = Callable +if TYPE_CHECKING: + from reflex.vars.base import Var + + # ArgsSpec = Callable[[Var], list[Var]] + ArgsSpec = ( + Callable[[], List[Var]] + | Callable[[Var], List[Var]] + | Callable[[Var, Var], List[Var]] + | Callable[[Var, Var, Var], List[Var]] + | Callable[[Var, Var, Var, Var], List[Var]] + | Callable[[Var, Var, Var, Var, Var], List[Var]] + | Callable[[Var, Var, Var, Var, Var, Var], List[Var]] + | Callable[[Var, Var, Var, Var, Var, Var, Var], List[Var]] + ) +else: + ArgsSpec = Callable[..., List[Any]] PrimitiveToAnnotation = { diff --git a/tests/units/test_event.py b/tests/units/test_event.py index a152c3749..3996a6101 100644 --- a/tests/units/test_event.py +++ b/tests/units/test_event.py @@ -97,7 +97,7 @@ def test_call_event_handler_partial(): test_fn_with_args.__qualname__ = "test_fn_with_args" - def spec(a2: str) -> List[str]: + def spec(a2: Var[str]) -> List[Var[str]]: return [a2] handler = EventHandler(fn=test_fn_with_args) From 70bd88c682166c5ba3cef32ebe85f498a783549d Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 26 Sep 2024 13:59:17 -0700 Subject: [PATCH 070/201] serialize default value for disk state manager (#4008) --- reflex/state.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index f0f3e1453..8ab6a90a2 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -2592,16 +2592,24 @@ def _serialize_type(type_: Any) -> str: return f"{type_.__module__}.{type_.__qualname__}" +def is_serializable(value: Any) -> bool: + """Check if a value is serializable. + + Args: + value: The value to check. + + Returns: + Whether the value is serializable. + """ + try: + return bool(dill.dumps(value)) + except Exception: + return False + + def state_to_schema( state: BaseState, -) -> List[ - Tuple[ - str, - str, - Any, - Union[bool, None], - ] -]: +) -> List[Tuple[str, str, Any, Union[bool, None], Any]]: """Convert a state to a schema. Args: @@ -2621,6 +2629,7 @@ def state_to_schema( if isinstance(model_field.required, bool) else None ), + (model_field.default if is_serializable(model_field.default) else None), ) for field_name, model_field in state.__fields__.items() ) From 0ab161c11967c9a85faa2a5a5898263276221877 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 26 Sep 2024 16:00:28 -0700 Subject: [PATCH 071/201] remove format_state and override behavior for bare (#3979) * remove format_state and override behavior for bare * pass the test cases * only do one level of dicting dataclasses * remove dict and replace list with set * delete unnecessary serialize calls * remove serialize for mutable proxy * dang it darglint --- reflex/compiler/utils.py | 2 +- reflex/components/base/bare.py | 4 +- reflex/middleware/hydrate_middleware.py | 3 +- reflex/state.py | 21 +++------- reflex/utils/format.py | 44 +------------------- reflex/utils/serializers.py | 53 ++++-------------------- reflex/vars/base.py | 2 +- tests/integration/test_var_operations.py | 4 +- tests/units/test_app.py | 3 +- tests/units/utils/test_format.py | 3 +- tests/units/utils/test_serializers.py | 8 ++-- 11 files changed, 30 insertions(+), 117 deletions(-) diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 1808f787a..443e1984f 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -155,7 +155,7 @@ def compile_state(state: Type[BaseState]) -> dict: initial_state = state(_reflex_internal_init=True).dict( initial=True, include_computed=False ) - return format.format_state(initial_state) + return initial_state def _compile_client_storage_field( diff --git a/reflex/components/base/bare.py b/reflex/components/base/bare.py index 970cdfc84..ada511ef2 100644 --- a/reflex/components/base/bare.py +++ b/reflex/components/base/bare.py @@ -7,7 +7,7 @@ from typing import Any, Iterator from reflex.components.component import Component from reflex.components.tags import Tag from reflex.components.tags.tagless import Tagless -from reflex.vars.base import Var +from reflex.vars import ArrayVar, BooleanVar, ObjectVar, Var class Bare(Component): @@ -33,6 +33,8 @@ class Bare(Component): def _render(self) -> Tag: if isinstance(self.contents, Var): + if isinstance(self.contents, (BooleanVar, ObjectVar, ArrayVar)): + return Tagless(contents=f"{{{str(self.contents.to_string())}}}") return Tagless(contents=f"{{{str(self.contents)}}}") return Tagless(contents=str(self.contents)) diff --git a/reflex/middleware/hydrate_middleware.py b/reflex/middleware/hydrate_middleware.py index 46b524cd7..2198b82c2 100644 --- a/reflex/middleware/hydrate_middleware.py +++ b/reflex/middleware/hydrate_middleware.py @@ -9,7 +9,6 @@ from reflex import constants from reflex.event import Event, get_hydrate_event from reflex.middleware.middleware import Middleware from reflex.state import BaseState, StateUpdate -from reflex.utils import format if TYPE_CHECKING: from reflex.app import App @@ -43,7 +42,7 @@ class HydrateMiddleware(Middleware): setattr(state, constants.CompileVars.IS_HYDRATED, False) # Get the initial state. - delta = format.format_state(state.dict()) + delta = state.dict() # since a full dict was captured, clean any dirtiness state._clean() diff --git a/reflex/state.py b/reflex/state.py index 8ab6a90a2..c16b37b69 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -73,7 +73,7 @@ from reflex.utils.exceptions import ( LockExpiredError, ) from reflex.utils.exec import is_testing_env -from reflex.utils.serializers import SerializedType, serialize, serializer +from reflex.utils.serializers import serializer from reflex.utils.types import override from reflex.vars import VarData @@ -1790,9 +1790,6 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for substate in self.dirty_substates.union(self._always_dirty_substates): delta.update(substates[substate].get_delta()) - # Format the delta. - delta = format.format_state(delta) - # Return the delta. return delta @@ -2433,7 +2430,7 @@ class StateUpdate: Returns: The state update as a JSON string. """ - return format.json_dumps(dataclasses.asdict(self)) + return format.json_dumps(self) class StateManager(Base, ABC): @@ -3660,22 +3657,16 @@ class MutableProxy(wrapt.ObjectProxy): @serializer -def serialize_mutable_proxy(mp: MutableProxy) -> SerializedType: - """Serialize the wrapped value of a MutableProxy. +def serialize_mutable_proxy(mp: MutableProxy): + """Return the wrapped value of a MutableProxy. Args: mp: The MutableProxy to serialize. Returns: - The serialized wrapped object. - - Raises: - ValueError: when the wrapped object is not serializable. + The wrapped object. """ - value = serialize(mp.__wrapped__) - if value is None: - raise ValueError(f"Cannot serialize {type(mp.__wrapped__)}") - return value + return mp.__wrapped__ class ImmutableMutableProxy(MutableProxy): diff --git a/reflex/utils/format.py b/reflex/utils/format.py index 86b4d96c9..ae985a871 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -9,7 +9,7 @@ import re from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union from reflex import constants -from reflex.utils import exceptions, types +from reflex.utils import exceptions from reflex.utils.console import deprecate if TYPE_CHECKING: @@ -624,48 +624,6 @@ def format_query_params(router_data: dict[str, Any]) -> dict[str, str]: return {k.replace("-", "_"): v for k, v in params.items()} -def format_state(value: Any, key: Optional[str] = None) -> Any: - """Recursively format values in the given state. - - Args: - value: The state to format. - key: The key associated with the value (optional). - - Returns: - The formatted state. - - Raises: - TypeError: If the given value is not a valid state. - """ - from reflex.utils import serializers - - # Handle dicts. - if isinstance(value, dict): - return {k: format_state(v, k) for k, v in value.items()} - - # Handle lists, sets, typles. - if isinstance(value, types.StateIterBases): - return [format_state(v) for v in value] - - # Return state vars as is. - if isinstance(value, types.StateBases): - return value - - # Serialize the value. - serialized = serializers.serialize(value) - if serialized is not None: - return serialized - - if key is None: - raise TypeError( - f"No JSON serializer found for var {value} of type {type(value)}." - ) - else: - raise TypeError( - f"No JSON serializer found for State Var '{key}' of value {value} of type {type(value)}." - ) - - def format_state_name(state_name: str) -> str: """Format a state name, replacing dots with double underscore. diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index 42fb82916..614257181 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -12,7 +12,6 @@ from pathlib import Path from typing import ( Any, Callable, - Dict, List, Literal, Optional, @@ -126,7 +125,8 @@ def serialize( # If there is no serializer, return None. if serializer is None: if dataclasses.is_dataclass(value) and not isinstance(value, type): - return serialize(dataclasses.asdict(value)) + return {k.name: getattr(value, k.name) for k in dataclasses.fields(value)} + if get_type: return None, None return None @@ -214,32 +214,6 @@ def serialize_type(value: type) -> str: return value.__name__ -@serializer -def serialize_str(value: str) -> str: - """Serialize a string. - - Args: - value: The string to serialize. - - Returns: - The serialized string. - """ - return value - - -@serializer -def serialize_primitive(value: Union[bool, int, float, None]): - """Serialize a primitive type. - - Args: - value: The number/bool/None to serialize. - - Returns: - The serialized number/bool/None. - """ - return value - - @serializer def serialize_base(value: Base) -> dict: """Serialize a Base instance. @@ -250,33 +224,20 @@ def serialize_base(value: Base) -> dict: Returns: The serialized Base. """ - return {k: serialize(v) for k, v in value.dict().items() if not callable(v)} + return {k: v for k, v in value.dict().items() if not callable(v)} @serializer -def serialize_list(value: Union[List, Tuple, Set]) -> list: - """Serialize a list to a JSON string. +def serialize_set(value: Set) -> list: + """Serialize a set to a JSON serializable list. Args: - value: The list to serialize. + value: The set to serialize. Returns: The serialized list. """ - return [serialize(item) for item in value] - - -@serializer -def serialize_dict(prop: Dict[str, Any]) -> dict: - """Serialize a dictionary to a JSON string. - - Args: - prop: The dictionary to serialize. - - Returns: - The serialized dictionary. - """ - return {k: serialize(v) for k, v in prop.items()} + return list(value) @serializer(to=str) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 4faa38be7..afbc56a55 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1141,7 +1141,7 @@ def serialize_literal(value: LiteralVar): Returns: The serialized Literal. """ - return serializers.serialize(value._var_value) + return value._var_value P = ParamSpec("P") diff --git a/tests/integration/test_var_operations.py b/tests/integration/test_var_operations.py index cae56e1a8..919a39f3b 100644 --- a/tests/integration/test_var_operations.py +++ b/tests/integration/test_var_operations.py @@ -793,8 +793,8 @@ def test_var_operations(driver, var_operations: AppHarness): ("foreach_list_ix", "1\n2"), ("foreach_list_nested", "1\n1\n2"), # rx.memo component with state - ("memo_comp", "1210"), - ("memo_comp_nested", "345"), + ("memo_comp", "[1,2]10"), + ("memo_comp_nested", "[3,4]5"), # foreach in a match ("foreach_in_match", "first\nsecond\nthird"), ] diff --git a/tests/units/test_app.py b/tests/units/test_app.py index 88655d7de..0c22c38e3 100644 --- a/tests/units/test_app.py +++ b/tests/units/test_app.py @@ -1,6 +1,5 @@ from __future__ import annotations -import dataclasses import functools import io import json @@ -1053,7 +1052,7 @@ async def test_dynamic_route_var_route_change_completed_on_load( f"comp_{arg_name}": exp_val, constants.CompileVars.IS_HYDRATED: False, # "side_effect_counter": exp_index, - "router": dataclasses.asdict(exp_router), + "router": exp_router, } }, events=[ diff --git a/tests/units/utils/test_format.py b/tests/units/utils/test_format.py index 4ec5099f5..042c3f323 100644 --- a/tests/units/utils/test_format.py +++ b/tests/units/utils/test_format.py @@ -1,6 +1,7 @@ from __future__ import annotations import datetime +import json from typing import Any, List import plotly.graph_objects as go @@ -621,7 +622,7 @@ def test_format_state(input, output): input: The state to format. output: The expected formatted state. """ - assert format.format_state(input) == output + assert json.loads(format.json_dumps(input)) == json.loads(format.json_dumps(output)) @pytest.mark.parametrize( diff --git a/tests/units/utils/test_serializers.py b/tests/units/utils/test_serializers.py index 97da98792..630187309 100644 --- a/tests/units/utils/test_serializers.py +++ b/tests/units/utils/test_serializers.py @@ -1,19 +1,21 @@ import datetime +import json from enum import Enum from pathlib import Path -from typing import Any, Dict, Type +from typing import Any, Type import pytest from reflex.base import Base from reflex.components.core.colors import Color from reflex.utils import serializers +from reflex.utils.format import json_dumps from reflex.vars.base import LiteralVar @pytest.mark.parametrize( "type_,expected", - [(str, True), (dict, True), (Dict[int, int], True), (Enum, True)], + [(Enum, True)], ) def test_has_serializer(type_: Type, expected: bool): """Test that has_serializer returns the correct value. @@ -198,7 +200,7 @@ def test_serialize(value: Any, expected: str): value: The value to serialize. expected: The expected result. """ - assert serializers.serialize(value) == expected + assert json.loads(json_dumps(value)) == json.loads(json_dumps(expected)) @pytest.mark.parametrize( From 299f842756fe4c6fb27d962d26d3152bf7f674c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 26 Sep 2024 16:12:12 -0700 Subject: [PATCH 072/201] add env var to enable using system node and bun (#4006) * add env var to enable using system node and bun * fix test to use env var --- .github/workflows/check_node_latest.yml | 3 +- reflex/constants/installer.py | 6 ++++ reflex/utils/path_ops.py | 37 ++++++++++++++++++++++++- reflex/utils/prerequisites.py | 4 ++- 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_node_latest.yml b/.github/workflows/check_node_latest.yml index 945786c05..749b94efa 100644 --- a/.github/workflows/check_node_latest.yml +++ b/.github/workflows/check_node_latest.yml @@ -10,6 +10,7 @@ on: env: TELEMETRY_ENABLED: false + REFLEX_USE_SYSTEM_NODE: true jobs: check_latest_node: @@ -32,7 +33,7 @@ jobs: poetry run uv pip install pyvirtualdisplay pillow poetry run playwright install --with-deps - run: | - # poetry run pytest tests/test_node_version.py + poetry run pytest tests/test_node_version.py poetry run pytest tests/integration diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index e01e5ae69..01a11a37e 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -54,6 +54,9 @@ class Bun(SimpleNamespace): # Path of the bunfig file CONFIG_PATH = "bunfig.toml" + # The environment variable to use the system installed bun. + USE_SYSTEM_VAR = "REFLEX_USE_SYSTEM_BUN" + # FNM config. class Fnm(SimpleNamespace): @@ -96,6 +99,9 @@ class Node(SimpleNamespace): # The default path where npm is installed. NPM_PATH = os.path.join(BIN_PATH, "npm") + # The environment variable to use the system installed node. + USE_SYSTEM_VAR = "REFLEX_USE_SYSTEM_NODE" + class PackageJson(SimpleNamespace): """Constants used to build the package.json file.""" diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index 21065db99..00affd820 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -129,6 +129,41 @@ def which(program: str | Path) -> str | Path | None: return shutil.which(str(program)) +def use_system_install(var_name: str) -> bool: + """Check if the system install should be used. + + Args: + var_name: The name of the environment variable. + + Raises: + ValueError: If the variable name is invalid. + + Returns: + Whether the associated env var should use the system install. + """ + if not var_name.startswith("REFLEX_USE_SYSTEM_"): + raise ValueError("Invalid system install variable name.") + return os.getenv(var_name, "").lower() in ["true", "1", "yes"] + + +def use_system_node() -> bool: + """Check if the system node should be used. + + Returns: + Whether the system node should be used. + """ + return use_system_install(constants.Node.USE_SYSTEM_VAR) + + +def use_system_bun() -> bool: + """Check if the system bun should be used. + + Returns: + Whether the system bun should be used. + """ + return use_system_install(constants.Bun.USE_SYSTEM_VAR) + + def get_node_bin_path() -> str | None: """Get the node binary dir path. @@ -149,7 +184,7 @@ def get_node_path() -> str | None: The path to the node binary file. """ node_path = Path(constants.Node.PATH) - if not node_path.exists(): + if use_system_node() or not node_path.exists(): return str(which("node")) return str(node_path) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index f86da0c53..f9eb9a790 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -143,7 +143,7 @@ def check_node_version() -> bool: # Compare the version numbers return ( current_version >= version.parse(constants.Node.MIN_VERSION) - if constants.IS_WINDOWS + if constants.IS_WINDOWS or path_ops.use_system_node() else current_version == version.parse(constants.Node.VERSION) ) return False @@ -1034,6 +1034,8 @@ def validate_bun(): # if a custom bun path is provided, make sure its valid # This is specific to non-FHS OS bun_path = get_config().bun_path + if path_ops.use_system_bun(): + bun_path = path_ops.which("bun") if bun_path != constants.Bun.DEFAULT_PATH: console.info(f"Using custom Bun path: {bun_path}") bun_version = get_bun_version() From ae0f3f820ed44a791be9325db2986a6016e6d74b Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 26 Sep 2024 21:52:31 -0700 Subject: [PATCH 073/201] Handle bool cast for optional NumberVar (#4010) * Handle bool cast for optional NumberVar If the _var_type is optional, then also check that the value is not None * boolify the result of `and_operation` * flip order to be more semantically pure --------- Co-authored-by: Khaleel Al-Adhami --- reflex/vars/number.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reflex/vars/number.py b/reflex/vars/number.py index 9a899f220..0aaa7a068 100644 --- a/reflex/vars/number.py +++ b/reflex/vars/number.py @@ -21,6 +21,7 @@ from typing import ( from reflex.constants.base import Dirs from reflex.utils.exceptions import PrimitiveUnserializableToJSON, VarTypeError from reflex.utils.imports import ImportDict, ImportVar +from reflex.utils.types import is_optional from .base import ( CustomVarOperationReturn, @@ -524,6 +525,8 @@ class NumberVar(Var[NUMBER_T]): Returns: The boolean value of the number. """ + if is_optional(self._var_type): + return boolify((self != None) & (self != 0)) # noqa: E711 return self != 0 def _is_strict_float(self) -> bool: From eea5dc1918b8be8d3ae4a190fc2d9328b81e64f3 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 26 Sep 2024 21:54:03 -0700 Subject: [PATCH 074/201] change loglevel and fix granian on linux (#4012) * change loglevel and fix it on linux * run precommit * fix that as well --- reflex/config.py | 2 +- reflex/constants/base.py | 1 + reflex/reflex.py | 20 ++++++++++++++++++-- reflex/utils/exec.py | 11 ++++++++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/reflex/config.py b/reflex/config.py index fadd82482..c237d7421 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -158,7 +158,7 @@ class Config(Base): app_name: str # The log level to use. - loglevel: constants.LogLevel = constants.LogLevel.INFO + loglevel: constants.LogLevel = constants.LogLevel.DEFAULT # The port to run the frontend on. NOTE: When running in dev mode, the next available port will be used if this is taken. frontend_port: int = constants.DefaultPorts.FRONTEND_PORT diff --git a/reflex/constants/base.py b/reflex/constants/base.py index df64a1006..225e8000b 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -173,6 +173,7 @@ class LogLevel(str, Enum): """The log levels.""" DEBUG = "debug" + DEFAULT = "default" INFO = "info" WARNING = "warning" ERROR = "error" diff --git a/reflex/reflex.py b/reflex/reflex.py index 07c1dff5b..44c0d40ff 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -15,6 +15,7 @@ from reflex_cli.utils import dependency from reflex import constants from reflex.config import get_config +from reflex.constants.base import LogLevel from reflex.custom_components.custom_components import custom_components_cli from reflex.state import reset_disk_state_manager from reflex.utils import console, redir, telemetry @@ -245,15 +246,30 @@ def _run( setup_frontend(Path.cwd()) commands.append((frontend_cmd, Path.cwd(), frontend_port, backend)) + # If no loglevel is specified, set the subprocesses loglevel to WARNING. + subprocesses_loglevel = ( + loglevel if loglevel != LogLevel.DEFAULT else LogLevel.WARNING + ) + # In prod mode, run the backend on a separate thread. if backend and env == constants.Env.PROD: - commands.append((backend_cmd, backend_host, backend_port, loglevel, frontend)) + commands.append( + ( + backend_cmd, + backend_host, + backend_port, + subprocesses_loglevel, + frontend, + ) + ) # Start the frontend and backend. with processes.run_concurrently_context(*commands): # In dev mode, run the backend on the main thread. if backend and env == constants.Env.DEV: - backend_cmd(backend_host, int(backend_port), loglevel, frontend) + backend_cmd( + backend_host, int(backend_port), subprocesses_loglevel, frontend + ) # The windows uvicorn bug workaround # https://github.com/reflex-dev/reflex/issues/2335 if constants.IS_WINDOWS and exec.frontend_process: diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 82fb8d9b3..b6550fdde 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -16,6 +16,7 @@ import psutil from reflex import constants from reflex.config import get_config +from reflex.constants.base import LogLevel from reflex.utils import console, path_ops from reflex.utils.prerequisites import get_web_dir @@ -201,7 +202,11 @@ def get_granian_target(): Returns: The Granian target for the backend. """ - return get_app_module() + f".{constants.CompileVars.API}" + import reflex + + app_module_path = Path(reflex.__file__).parent / "app_module_for_backend.py" + + return f"{str(app_module_path)}:{constants.CompileVars.APP}.{constants.CompileVars.API}" def run_backend( @@ -233,7 +238,7 @@ def run_backend( run_uvicorn_backend(host, port, loglevel) -def run_uvicorn_backend(host, port, loglevel): +def run_uvicorn_backend(host, port, loglevel: LogLevel): """Run the backend in development mode using Uvicorn. Args: @@ -253,7 +258,7 @@ def run_uvicorn_backend(host, port, loglevel): ) -def run_granian_backend(host, port, loglevel): +def run_granian_backend(host, port, loglevel: LogLevel): """Run the backend in development mode using Granian. Args: From 9ca5d4a095731e75ab868edafd61fe78304fc5ee Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 27 Sep 2024 12:04:43 -0700 Subject: [PATCH 075/201] Track backend-only vars that are declared without a default value (#4016) * Track backend-only vars that are declared without a default value Without this provision, declared backend vars can be accidentally shared among all states if a mutable value is assigned to the class attribute. * add test case for no default backend var --- reflex/state.py | 10 ++++++++++ tests/units/test_state.py | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/reflex/state.py b/reflex/state.py index c16b37b69..6af70db14 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -30,6 +30,7 @@ from typing import ( Type, Union, cast, + get_type_hints, ) import dill @@ -573,6 +574,15 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for name, value in cls.__dict__.items() if types.is_backend_base_variable(name, cls) } + # Add annotated backend vars that do not have a default value. + new_backend_vars.update( + { + name: Var("", _var_type=annotation_value).get_default_value() + for name, annotation_value in get_type_hints(cls).items() + if name not in new_backend_vars + and types.is_backend_base_variable(name, cls) + } + ) cls.backend_vars = { **cls.inherited_backend_vars, diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 89aad1536..205162b9f 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -3216,6 +3216,7 @@ class MixinState(State, mixin=True): num: int = 0 _backend: int = 0 + _backend_no_default: dict @rx.var(cache=True) def computed(self) -> str: @@ -3243,11 +3244,16 @@ def test_mixin_state() -> None: """Test that a mixin state works correctly.""" assert "num" in UsesMixinState.base_vars assert "num" in UsesMixinState.vars - assert UsesMixinState.backend_vars == {"_backend": 0} + assert UsesMixinState.backend_vars == {"_backend": 0, "_backend_no_default": {}} assert "computed" in UsesMixinState.computed_vars assert "computed" in UsesMixinState.vars + assert ( + UsesMixinState(_reflex_internal_init=True)._backend_no_default # type: ignore + is not UsesMixinState.backend_vars["_backend_no_default"] + ) + def test_child_mixin_state() -> None: """Test that mixin vars are only applied to the highest state in the hierarchy.""" From 1b3422dab6d65728690e19784655553f6d72ee65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Fri, 27 Sep 2024 16:17:30 -0700 Subject: [PATCH 076/201] improve lifespan typecheck and debug (#4014) * add lifespan debug statement * improve some of the logic for lifespan tasks * fix partial name with update_wrapper --- reflex/app_mixins/lifespan.py | 30 ++++++++++++++++++++++++------ reflex/utils/exceptions.py | 4 ++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/reflex/app_mixins/lifespan.py b/reflex/app_mixins/lifespan.py index 2b5ed8b58..ef882a2ea 100644 --- a/reflex/app_mixins/lifespan.py +++ b/reflex/app_mixins/lifespan.py @@ -6,11 +6,13 @@ import asyncio import contextlib import functools import inspect -import sys from typing import Callable, Coroutine, Set, Union from fastapi import FastAPI +from reflex.utils import console +from reflex.utils.exceptions import InvalidLifespanTaskType + from .mixin import AppMixin @@ -26,6 +28,7 @@ class LifespanMixin(AppMixin): try: async with contextlib.AsyncExitStack() as stack: for task in self.lifespan_tasks: + run_msg = f"Started lifespan task: {task.__name__} as {{type}}" # type: ignore if isinstance(task, asyncio.Task): running_tasks.append(task) else: @@ -35,15 +38,19 @@ class LifespanMixin(AppMixin): _t = task() if isinstance(_t, contextlib._AsyncGeneratorContextManager): await stack.enter_async_context(_t) + console.debug(run_msg.format(type="asynccontextmanager")) elif isinstance(_t, Coroutine): - running_tasks.append(asyncio.create_task(_t)) + task_ = asyncio.create_task(_t) + task_.add_done_callback(lambda t: t.result()) + running_tasks.append(task_) + console.debug(run_msg.format(type="coroutine")) + else: + console.debug(run_msg.format(type="function")) yield finally: - cancel_kwargs = ( - {"msg": "lifespan_cleanup"} if sys.version_info >= (3, 9) else {} - ) for task in running_tasks: - task.cancel(**cancel_kwargs) + console.debug(f"Canceling lifespan task: {task}") + task.cancel(msg="lifespan_cleanup") def register_lifespan_task(self, task: Callable | asyncio.Task, **task_kwargs): """Register a task to run during the lifespan of the app. @@ -51,7 +58,18 @@ class LifespanMixin(AppMixin): Args: task: The task to register. task_kwargs: The kwargs of the task. + + Raises: + InvalidLifespanTaskType: If the task is a generator function. """ + if inspect.isgeneratorfunction(task) or inspect.isasyncgenfunction(task): + raise InvalidLifespanTaskType( + f"Task {task.__name__} of type generator must be decorated with contextlib.asynccontextmanager." + ) + if task_kwargs: + original_task = task task = functools.partial(task, **task_kwargs) # type: ignore + functools.update_wrapper(task, original_task) # type: ignore self.lifespan_tasks.add(task) # type: ignore + console.debug(f"Registered lifespan task: {task.__name__}") # type: ignore diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 95d68c3b8..7c3532861 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -111,3 +111,7 @@ class GeneratedCodeHasNoFunctionDefs(ReflexError): class PrimitiveUnserializableToJSON(ReflexError, ValueError): """Raised when a primitive type is unserializable to JSON. Usually with NaN and Infinity.""" + + +class InvalidLifespanTaskType(ReflexError, TypeError): + """Raised when an invalid task type is registered as a lifespan task.""" From 62021b0b405432b73519902bc556b937c6387d4c Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 27 Sep 2024 16:58:20 -0700 Subject: [PATCH 077/201] implement _evaluate in state (#4018) * implement _evaluate in state * add warning * use typing_extension * add integration test --- reflex/state.py | 32 ++++++++++++++++++++ reflex/vars/base.py | 5 +-- tests/integration/test_dynamic_components.py | 15 +++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 6af70db14..29ad84b3f 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -35,6 +35,7 @@ from typing import ( import dill from sqlalchemy.orm import DeclarativeBase +from typing_extensions import Self from reflex.config import get_config from reflex.vars.base import ( @@ -43,6 +44,7 @@ from reflex.vars.base import ( Var, computed_var, dispatch, + get_unique_variable_name, is_computed_var, ) @@ -695,6 +697,36 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): and hasattr(value, "__code__") ) + @classmethod + def _evaluate(cls, f: Callable[[Self], Any]) -> Var: + """Evaluate a function to a ComputedVar. Experimental. + + Args: + f: The function to evaluate. + + Returns: + The ComputedVar. + """ + console.warn( + "The _evaluate method is experimental and may be removed in future versions." + ) + from reflex.components.base.fragment import fragment + from reflex.components.component import Component + + unique_var_name = get_unique_variable_name() + + @computed_var(_js_expr=unique_var_name, return_type=Component) + def computed_var_func(state: Self): + return fragment(f(state)) + + setattr(cls, unique_var_name, computed_var_func) + cls.computed_vars[unique_var_name] = computed_var_func + cls.vars[unique_var_name] = computed_var_func + cls._update_substate_inherited_vars({unique_var_name: computed_var_func}) + cls._always_dirty_computed_vars.add(unique_var_name) + + return getattr(cls, unique_var_name) + @classmethod def _mixins(cls) -> List[Type]: """Get the mixin classes of the state. diff --git a/reflex/vars/base.py b/reflex/vars/base.py index afbc56a55..2d78a14be 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1559,8 +1559,9 @@ class ComputedVar(Var[RETURN_TYPE]): Raises: TypeError: If the computed var dependencies are not Var instances or var names. """ - hints = get_type_hints(fget) - hint = hints.get("return", Any) + hint = kwargs.pop("return_type", None) or get_type_hints(fget).get( + "return", Any + ) kwargs["_js_expr"] = kwargs.pop("_js_expr", fget.__name__) kwargs["_var_type"] = kwargs.pop("_var_type", hint) diff --git a/tests/integration/test_dynamic_components.py b/tests/integration/test_dynamic_components.py index 31080223f..5a4d99f9e 100644 --- a/tests/integration/test_dynamic_components.py +++ b/tests/integration/test_dynamic_components.py @@ -16,6 +16,8 @@ def DynamicComponents(): import reflex as rx class DynamicComponentsState(rx.State): + value: int = 10 + button: rx.Component = rx.button( "Click me", custom_attrs={ @@ -52,11 +54,20 @@ def DynamicComponents(): app = rx.App() + def factorial(n: int) -> int: + if n == 0: + return 1 + return n * factorial(n - 1) + @app.add_page def index(): return rx.vstack( DynamicComponentsState.client_token_component, DynamicComponentsState.button, + rx.text( + DynamicComponentsState._evaluate(lambda state: factorial(state.value)), + id="factorial", + ), ) @@ -150,3 +161,7 @@ def test_dynamic_components(driver, dynamic_components: AppHarness): dynamic_components.poll_for_content(button, exp_not_equal="Click me") == "Clicked" ) + + factorial = poll_for_result(lambda: driver.find_element(By.ID, "factorial")) + assert factorial + assert factorial.text == "3628800" From 23e979717f9d227a1afaaeab493560709efca79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Fri, 27 Sep 2024 17:25:22 -0700 Subject: [PATCH 078/201] remove all runtime asserts (#4019) * remove all runtime asserts * Update reflex/testing.py Co-authored-by: Masen Furer --------- Co-authored-by: Masen Furer --- reflex/app.py | 14 +++++++++----- reflex/compiler/utils.py | 15 ++++++++++++--- reflex/components/base/meta.py | 8 +++++--- reflex/components/component.py | 6 +++++- reflex/components/core/cond.py | 8 ++++---- reflex/components/gridjs/datatable.py | 3 ++- reflex/components/markdown/markdown.py | 10 +++++++--- reflex/components/markdown/markdown.pyi | 3 +++ reflex/components/tags/iter_tag.py | 6 +++++- reflex/event.py | 6 +++++- reflex/experimental/assets.py | 4 +++- reflex/experimental/client_state.py | 6 +++++- reflex/experimental/misc.py | 8 +++++--- reflex/reflex.py | 3 ++- reflex/state.py | 8 +++++--- reflex/testing.py | 12 ++++++++---- reflex/utils/format.py | 4 +++- 17 files changed, 88 insertions(+), 36 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 63334997c..111dd9dfd 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -482,9 +482,8 @@ class App(MiddlewareMixin, LifespanMixin, Base): """ # If the route is not set, get it from the callable. if route is None: - assert isinstance( - component, Callable - ), "Route must be set if component is not a callable." + if not isinstance(component, Callable): + raise ValueError("Route must be set if component is not a callable.") # Format the route. route = format.format_route(component.__name__) else: @@ -1528,6 +1527,9 @@ class EventNamespace(AsyncNamespace): async def on_event(self, sid, data): """Event for receiving front-end websocket events. + Raises: + RuntimeError: If the Socket.IO is badly initialized. + Args: sid: The Socket.IO session id. data: The event data. @@ -1540,9 +1542,11 @@ class EventNamespace(AsyncNamespace): self.sid_to_token[sid] = event.token # Get the event environment. - assert self.app.sio is not None + if self.app.sio is None: + raise RuntimeError("Socket.IO is not initialized.") environ = self.app.sio.get_environ(sid, self.namespace) - assert environ is not None + if environ is None: + raise RuntimeError("Socket.IO environ is not initialized.") # Get the client headers. headers = { diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 443e1984f..b10552554 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -44,6 +44,9 @@ def compile_import_statement(fields: list[ImportVar]) -> tuple[str, list[str]]: Args: fields: The set of fields to import from the library. + Raises: + ValueError: If there is more than one default import. + Returns: The libraries for default and rest. default: default library. When install "import def from library". @@ -54,7 +57,8 @@ def compile_import_statement(fields: list[ImportVar]) -> tuple[str, list[str]]: # Check for default imports. defaults = {field for field in fields_set if field.is_default} - assert len(defaults) < 2 + if len(defaults) >= 2: + raise ValueError("Only one default import is allowed.") # Get the default import, and the specific imports. default = next(iter({field.name for field in defaults}), "") @@ -92,6 +96,9 @@ def compile_imports(import_dict: ParsedImportDict) -> list[dict]: Args: import_dict: The import dict to compile. + Raises: + ValueError: If an import in the dict is invalid. + Returns: The list of import dict. """ @@ -106,8 +113,10 @@ def compile_imports(import_dict: ParsedImportDict) -> list[dict]: continue if not lib: - assert not default, "No default field allowed for empty library." - assert rest is not None and len(rest) > 0, "No fields to import." + if default: + raise ValueError("No default field allowed for empty library.") + if rest is None or len(rest) == 0: + raise ValueError("No fields to import.") for module in sorted(rest): import_dicts.append(get_import_dict(module)) continue diff --git a/reflex/components/base/meta.py b/reflex/components/base/meta.py index 55cb42f0a..526233c8b 100644 --- a/reflex/components/base/meta.py +++ b/reflex/components/base/meta.py @@ -16,13 +16,15 @@ class Title(Component): def render(self) -> dict: """Render the title component. + Raises: + ValueError: If the title is not a single string. + Returns: The rendered title component. """ # Make sure the title is a single string. - assert len(self.children) == 1 and isinstance( - self.children[0], Bare - ), "Title must be a single string." + if len(self.children) != 1 or not isinstance(self.children[0], Bare): + raise ValueError("Title must be a single string.") return super().render() diff --git a/reflex/components/component.py b/reflex/components/component.py index 7ee9b0d3a..9bdd12f0e 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -1744,10 +1744,14 @@ class CustomComponent(Component): Args: seen: The tags of the components that have already been seen. + Raises: + ValueError: If the tag is not set. + Returns: The set of custom components. """ - assert self.tag is not None, "The tag must be set." + if self.tag is None: + raise ValueError("The tag must be set.") # Store the seen components in a set to avoid infinite recursion. if seen is None: diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py index d1f53be23..1590875d3 100644 --- a/reflex/components/core/cond.py +++ b/reflex/components/core/cond.py @@ -138,13 +138,13 @@ def cond(condition: Any, c1: Any, c2: Any = None) -> Component | Var: """ # Convert the condition to a Var. cond_var = LiteralVar.create(condition) - assert cond_var is not None, "The condition must be set." + if cond_var is None: + raise ValueError("The condition must be set.") # If the first component is a component, create a Cond component. if isinstance(c1, BaseComponent): - assert c2 is None or isinstance( - c2, BaseComponent - ), "Both arguments must be components." + if c2 is not None and not isinstance(c2, BaseComponent): + raise ValueError("Both arguments must be components.") return Cond.create(cond_var, c1, c2) # Otherwise, create a conditional Var. diff --git a/reflex/components/gridjs/datatable.py b/reflex/components/gridjs/datatable.py index aaccda9d2..34ca62605 100644 --- a/reflex/components/gridjs/datatable.py +++ b/reflex/components/gridjs/datatable.py @@ -124,7 +124,8 @@ class DataTable(Gridjs): if types.is_dataframe(type(self.data)): # If given a pandas df break up the data and columns data = serialize(self.data) - assert isinstance(data, dict), "Serialized dataframe should be a dict." + if not isinstance(data, dict): + raise ValueError("Serialized dataframe should be a dict.") self.columns = LiteralVar.create(data["columns"]) self.data = LiteralVar.create(data["data"]) diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index 6c288c071..1665144fd 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -95,12 +95,16 @@ class Markdown(Component): *children: The children of the component. **props: The properties of the component. + Raises: + ValueError: If the children are not valid. + Returns: The markdown component. """ - assert ( - len(children) == 1 and types._isinstance(children[0], Union[str, Var]) - ), "Markdown component must have exactly one child containing the markdown source." + if len(children) != 1 or not types._isinstance(children[0], Union[str, Var]): + raise ValueError( + "Markdown component must have exactly one child containing the markdown source." + ) # Update the base component map with the custom component map. component_map = {**get_base_component_map(), **props.pop("component_map", {})} diff --git a/reflex/components/markdown/markdown.pyi b/reflex/components/markdown/markdown.pyi index 611770a55..d82756f44 100644 --- a/reflex/components/markdown/markdown.pyi +++ b/reflex/components/markdown/markdown.pyi @@ -93,6 +93,9 @@ class Markdown(Component): custom_attrs: custom attribute **props: The properties of the component. + Raises: + ValueError: If the children are not valid. + Returns: The markdown component. """ diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index e998fc41a..86e5a57fc 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -114,6 +114,9 @@ class IterTag(Tag): def render_component(self) -> Component: """Render the component. + Raises: + ValueError: If the render function takes more than 2 arguments. + Returns: The rendered component. """ @@ -132,7 +135,8 @@ class IterTag(Tag): component = self.render_fn(arg) else: # If the render function takes the index as an argument. - assert len(args) == 2 + if len(args) != 2: + raise ValueError("The render function must take 2 arguments.") component = self.render_fn(arg, index) # Nested foreach components or cond must be wrapped in fragments. diff --git a/reflex/event.py b/reflex/event.py index d8f0a5f0f..95358ace1 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1062,6 +1062,9 @@ def fix_events( token: The user token. router_data: The optional router data to set in the event. + Raises: + ValueError: If the event type is not what was expected. + Returns: The fixed events. """ @@ -1085,7 +1088,8 @@ def fix_events( # Otherwise, create an event from the event spec. if isinstance(e, EventHandler): e = e() - assert isinstance(e, EventSpec), f"Unexpected event type, {type(e)}." + if not isinstance(e, EventSpec): + raise ValueError(f"Unexpected event type, {type(e)}.") name = format.format_event_handler(e.handler) payload = {k._js_expr: v._decode() for k, v in e.args} # type: ignore diff --git a/reflex/experimental/assets.py b/reflex/experimental/assets.py index c18ac1e84..dcf386d8d 100644 --- a/reflex/experimental/assets.py +++ b/reflex/experimental/assets.py @@ -24,6 +24,7 @@ def asset(relative_filename: str, subfolder: Optional[str] = None) -> str: Raises: FileNotFoundError: If the file does not exist. + ValueError: If the module is None. Returns: The relative URL to the copied asset. @@ -31,7 +32,8 @@ def asset(relative_filename: str, subfolder: Optional[str] = None) -> str: # Determine the file by which the asset is exposed. calling_file = inspect.stack()[1].filename module = inspect.getmodule(inspect.stack()[1][0]) - assert module is not None + if module is None: + raise ValueError("Module is None") caller_module_path = module.__name__.replace(".", "/") subfolder = f"{caller_module_path}/{subfolder}" if subfolder else caller_module_path diff --git a/reflex/experimental/client_state.py b/reflex/experimental/client_state.py index 438ca0a23..c7b2260a1 100644 --- a/reflex/experimental/client_state.py +++ b/reflex/experimental/client_state.py @@ -91,12 +91,16 @@ class ClientStateVar(Var): default: The default value of the variable. global_ref: Whether the state should be accessible in any Component and on the backend. + Raises: + ValueError: If the var_name is not a string. + Returns: ClientStateVar """ if var_name is None: var_name = get_unique_variable_name() - assert isinstance(var_name, str), "var_name must be a string." + if not isinstance(var_name, str): + raise ValueError("var_name must be a string.") if default is NoValue: default_var = Var(_js_expr="") elif not isinstance(default, Var): diff --git a/reflex/experimental/misc.py b/reflex/experimental/misc.py index 716d081b8..e3d237153 100644 --- a/reflex/experimental/misc.py +++ b/reflex/experimental/misc.py @@ -12,10 +12,12 @@ async def run_in_thread(func) -> Any: Args: func (callable): The non-async function to run. + Raises: + ValueError: If the function is an async function. + Returns: Any: The return value of the function. """ - assert not asyncio.coroutines.iscoroutinefunction( - func - ), "func must be a non-async function" + if asyncio.coroutines.iscoroutinefunction(func): + raise ValueError("func must be a non-async function") return await asyncio.get_event_loop().run_in_executor(None, func) diff --git a/reflex/reflex.py b/reflex/reflex.py index 44c0d40ff..43ebe2eb4 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -230,7 +230,8 @@ def _run( exec.run_frontend_prod, exec.run_backend_prod, ) - assert setup_frontend and frontend_cmd and backend_cmd, "Invalid env" + if not setup_frontend or not frontend_cmd or not backend_cmd: + raise ValueError("Invalid env") # Post a telemetry event. telemetry.send(f"run-{env.value}") diff --git a/reflex/state.py b/reflex/state.py index 29ad84b3f..cda36a0a9 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -870,6 +870,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): def get_parent_state(cls) -> Type[BaseState] | None: """Get the parent state. + Raises: + ValueError: If more than one parent state is found. + Returns: The parent state. """ @@ -878,9 +881,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for base in cls.__bases__ if issubclass(base, BaseState) and base is not BaseState and not base._mixin ] - assert ( - len(parent_states) < 2 - ), f"Only one parent state is allowed {parent_states}." + if len(parent_states) >= 2: + raise ValueError(f"Only one parent state is allowed {parent_states}.") return parent_states[0] if len(parent_states) == 1 else None # type: ignore @classmethod diff --git a/reflex/testing.py b/reflex/testing.py index 503db6c2f..bdbd3dc94 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -340,6 +340,9 @@ class AppHarness: This is necessary when the backend is restarted and the state manager is a StateManagerRedis instance. + + Raises: + RuntimeError: when the state manager cannot be reset """ if ( self.app_instance is not None @@ -354,7 +357,8 @@ class AppHarness: self.app_instance._state_manager = StateManagerRedis.create( state=self.app_instance.state, ) - assert isinstance(self.app_instance.state_manager, StateManagerRedis) + if not isinstance(self.app_instance.state_manager, StateManagerRedis): + raise RuntimeError("Failed to reset state manager.") def _start_frontend(self): # Set up the frontend. @@ -787,13 +791,13 @@ class AppHarness: Raises: RuntimeError: when the app hasn't started running TimeoutError: when the timeout expires before any states are seen + ValueError: when the state_manager is not a memory state manager """ if self.app_instance is None: raise RuntimeError("App is not running.") state_manager = self.app_instance.state_manager - assert isinstance( - state_manager, (StateManagerMemory, StateManagerDisk) - ), "Only works with memory state manager" + if not isinstance(state_manager, (StateManagerMemory, StateManagerDisk)): + raise ValueError("Only works with memory or disk state manager") if not self._poll_for( target=lambda: state_manager.states, timeout=timeout, diff --git a/reflex/utils/format.py b/reflex/utils/format.py index ae985a871..4029bd275 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -345,6 +345,7 @@ def format_prop( Raises: exceptions.InvalidStylePropError: If the style prop value is not a valid type. TypeError: If the prop is not valid. + ValueError: If the prop is not a string. """ # import here to avoid circular import. from reflex.event import EventChain @@ -391,7 +392,8 @@ def format_prop( raise TypeError(f"Could not format prop: {prop} of type {type(prop)}") from e # Wrap the variable in braces. - assert isinstance(prop, str), "The prop must be a string." + if not isinstance(prop, str): + raise ValueError(f"Invalid prop: {prop}. Expected a string.") return wrap(prop, "{", check_first=False) From 9719f5d57e2feb17fb0e378241e6b8b18622f04f Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sun, 29 Sep 2024 12:08:56 -0700 Subject: [PATCH 079/201] use literal var instead of serialize for toast props (#4027) --- reflex/components/sonner/toast.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index c797d7f84..b29b71875 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -17,7 +17,7 @@ from reflex.event import ( from reflex.style import Style, resolved_color_mode from reflex.utils import format from reflex.utils.imports import ImportVar -from reflex.utils.serializers import serialize, serializer +from reflex.utils.serializers import serializer from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var @@ -281,8 +281,8 @@ class Toaster(Component): if message == "" and ("title" not in props or "description" not in props): raise ValueError("Toast message or title or description must be provided.") if props: - args = serialize(ToastProps(**props)) # type: ignore - toast = f"{toast_command}(`{message}`, {args})" + args = LiteralVar.create(ToastProps(**props)) + toast = f"{toast_command}(`{message}`, {str(args)})" else: toast = f"{toast_command}(`{message}`)" From bd71c8e6c9d65202445e8eb629cc83adc6d53b53 Mon Sep 17 00:00:00 2001 From: ChinoUkaegbu <77782533+ChinoUkaegbu@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:24:26 +0100 Subject: [PATCH 080/201] feat: Add support for missing SVGs (#3962) --- reflex/components/el/elements/media.py | 89 +++++ reflex/components/el/elements/media.pyi | 480 ++++++++++++++++++++++++ tests/components/el/test_svg.py | 74 ++++ 3 files changed, 643 insertions(+) create mode 100644 tests/components/el/test_svg.py diff --git a/reflex/components/el/elements/media.py b/reflex/components/el/elements/media.py index 705233532..9935902ad 100644 --- a/reflex/components/el/elements/media.py +++ b/reflex/components/el/elements/media.py @@ -317,6 +317,42 @@ class Svg(BaseHTML): xmlns: Var[str] +class Text(BaseHTML): + """The SVG text component.""" + + tag = "text" + # The x coordinate of the starting point of the text baseline. + x: Var[Union[str, int]] + # The y coordinate of the starting point of the text baseline. + y: Var[Union[str, int]] + # Shifts the text position horizontally from a previous text element. + dx: Var[Union[str, int]] + # Shifts the text position vertically from a previous text element. + dy: Var[Union[str, int]] + # Rotates orientation of each individual glyph. + rotate: Var[Union[str, int]] + # How the text is stretched or compressed to fit the width defined by the text_length attribute. + length_adjust: Var[str] + # A width that the text should be scaled to fit. + text_length: Var[Union[str, int]] + + +class Line(BaseHTML): + """The SVG line component.""" + + tag = "line" + # The x-axis coordinate of the line starting point. + x1: Var[Union[str, int]] + # The x-axis coordinate of the the line ending point. + x2: Var[Union[str, int]] + # The y-axis coordinate of the line starting point. + y1: Var[Union[str, int]] + # The y-axis coordinate of the the line ending point. + y2: Var[Union[str, int]] + # The total path length, in user units. + path_length: Var[int] + + class Circle(BaseHTML): """The SVG circle component.""" @@ -331,6 +367,22 @@ class Circle(BaseHTML): path_length: Var[int] +class Ellipse(BaseHTML): + """The SVG ellipse component.""" + + tag = "ellipse" + # The x position of the center of the ellipse. + cx: Var[Union[str, int]] + # The y position of the center of the ellipse. + cy: Var[Union[str, int]] + # The radius of the ellipse on the x axis. + rx: Var[Union[str, int]] + # The radius of the ellipse on the y axis. + ry: Var[Union[str, int]] + # The total length for the ellipse's circumference, in user units. + path_length: Var[int] + + class Rect(BaseHTML): """The SVG rect component.""" @@ -394,6 +446,39 @@ class LinearGradient(BaseHTML): y2: Var[Union[str, int, bool]] +class RadialGradient(BaseHTML): + """Display the radialGradient element.""" + + tag = "radialGradient" + + # The x coordinate of the end circle of the radial gradient. + cx: Var[Union[str, int, bool]] + + # The y coordinate of the end circle of the radial gradient. + cy: Var[Union[str, int, bool]] + + # The radius of the start circle of the radial gradient. + fr: Var[Union[str, int, bool]] + + # The x coordinate of the start circle of the radial gradient. + fx: Var[Union[str, int, bool]] + + # The y coordinate of the start circle of the radial gradient. + fy: Var[Union[str, int, bool]] + + # Units for the gradient. + gradient_units: Var[Union[str, bool]] + + # Transform applied to the gradient. + gradient_transform: Var[Union[str, bool]] + + # The radius of the end circle of the radial gradient. + r: Var[Union[str, int, bool]] + + # Method used to spread the gradient. + spread_method: Var[Union[str, bool]] + + class Stop(BaseHTML): """Display the stop element.""" @@ -421,12 +506,16 @@ class Path(BaseHTML): class SVG(ComponentNamespace): """SVG component namespace.""" + text = staticmethod(Text.create) + line = staticmethod(Line.create) circle = staticmethod(Circle.create) + ellipse = staticmethod(Ellipse.create) rect = staticmethod(Rect.create) polygon = staticmethod(Polygon.create) path = staticmethod(Path.create) stop = staticmethod(Stop.create) linear_gradient = staticmethod(LinearGradient.create) + radial_gradient = staticmethod(RadialGradient.create) defs = staticmethod(Defs.create) __call__ = staticmethod(Svg.create) diff --git a/reflex/components/el/elements/media.pyi b/reflex/components/el/elements/media.pyi index 6d05fe69f..336d6fbb9 100644 --- a/reflex/components/el/elements/media.pyi +++ b/reflex/components/el/elements/media.pyi @@ -1550,6 +1550,242 @@ class Svg(BaseHTML): """ ... +class Text(BaseHTML): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + x: Optional[Union[Var[Union[int, str]], int, str]] = None, + y: Optional[Union[Var[Union[int, str]], int, str]] = None, + dx: Optional[Union[Var[Union[int, str]], int, str]] = None, + dy: Optional[Union[Var[Union[int, str]], int, str]] = None, + rotate: Optional[Union[Var[Union[int, str]], int, str]] = None, + length_adjust: Optional[Union[Var[str], str]] = None, + text_length: Optional[Union[Var[Union[int, str]], int, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + auto_capitalize: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + content_editable: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + context_menu: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + enter_key_hint: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + **props, + ) -> "Text": + """Create the component. + + Args: + *children: The children of the component. + x: The x coordinate of the starting point of the text baseline. + y: The y coordinate of the starting point of the text baseline. + dx: Shifts the text position horizontally from a previous text element. + dy: Shifts the text position vertically from a previous text element. + rotate: Rotates orientation of each individual glyph. + length_adjust: How the text is stretched or compressed to fit the width defined by the text_length attribute. + text_length: A width that the text should be scaled to fit. + access_key: Provides a hint for generating a keyboard shortcut for the current element. + auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props of the component. + + Returns: + The component. + """ + ... + +class Line(BaseHTML): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + x1: Optional[Union[Var[Union[int, str]], int, str]] = None, + x2: Optional[Union[Var[Union[int, str]], int, str]] = None, + y1: Optional[Union[Var[Union[int, str]], int, str]] = None, + y2: Optional[Union[Var[Union[int, str]], int, str]] = None, + path_length: Optional[Union[Var[int], int]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + auto_capitalize: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + content_editable: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + context_menu: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + enter_key_hint: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + **props, + ) -> "Line": + """Create the component. + + Args: + *children: The children of the component. + x1: The x-axis coordinate of the line starting point. + x2: The x-axis coordinate of the the line ending point. + y1: The y-axis coordinate of the line starting point. + y2: The y-axis coordinate of the the line ending point. + path_length: The total path length, in user units. + access_key: Provides a hint for generating a keyboard shortcut for the current element. + auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props of the component. + + Returns: + The component. + """ + ... + class Circle(BaseHTML): @overload @classmethod @@ -1664,6 +1900,122 @@ class Circle(BaseHTML): """ ... +class Ellipse(BaseHTML): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + cx: Optional[Union[Var[Union[int, str]], int, str]] = None, + cy: Optional[Union[Var[Union[int, str]], int, str]] = None, + rx: Optional[Union[Var[Union[int, str]], int, str]] = None, + ry: Optional[Union[Var[Union[int, str]], int, str]] = None, + path_length: Optional[Union[Var[int], int]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + auto_capitalize: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + content_editable: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + context_menu: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + enter_key_hint: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + **props, + ) -> "Ellipse": + """Create the component. + + Args: + *children: The children of the component. + cx: The x position of the center of the ellipse. + cy: The y position of the center of the ellipse. + rx: The radius of the ellipse on the x axis. + ry: The radius of the ellipse on the y axis. + path_length: The total length for the ellipse's circumference, in user units. + access_key: Provides a hint for generating a keyboard shortcut for the current element. + auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props of the component. + + Returns: + The component. + """ + ... + class Rect(BaseHTML): @overload @classmethod @@ -2120,6 +2472,130 @@ class LinearGradient(BaseHTML): """ ... +class RadialGradient(BaseHTML): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + cx: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + cy: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + fr: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + fx: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + fy: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + gradient_units: Optional[Union[Var[Union[bool, str]], bool, str]] = None, + gradient_transform: Optional[Union[Var[Union[bool, str]], bool, str]] = None, + r: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spread_method: Optional[Union[Var[Union[bool, str]], bool, str]] = None, + access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + auto_capitalize: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + content_editable: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + context_menu: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + enter_key_hint: Optional[ + Union[Var[Union[bool, int, str]], bool, int, str] + ] = None, + hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, + title: Optional[Union[Var[Union[bool, int, str]], bool, int, 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, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + **props, + ) -> "RadialGradient": + """Create the component. + + Args: + *children: The children of the component. + cx: The x coordinate of the end circle of the radial gradient. + cy: The y coordinate of the end circle of the radial gradient. + fr: The radius of the start circle of the radial gradient. + fx: The x coordinate of the start circle of the radial gradient. + fy: The y coordinate of the start circle of the radial gradient. + gradient_units: Units for the gradient. + gradient_transform: Transform applied to the gradient. + r: The radius of the end circle of the radial gradient. + spread_method: Method used to spread the gradient. + access_key: Provides a hint for generating a keyboard shortcut for the current element. + auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props of the component. + + Returns: + The component. + """ + ... + class Stop(BaseHTML): @overload @classmethod @@ -2345,12 +2821,16 @@ class Path(BaseHTML): ... class SVG(ComponentNamespace): + text = staticmethod(Text.create) + line = staticmethod(Line.create) circle = staticmethod(Circle.create) + ellipse = staticmethod(Ellipse.create) rect = staticmethod(Rect.create) polygon = staticmethod(Polygon.create) path = staticmethod(Path.create) stop = staticmethod(Stop.create) linear_gradient = staticmethod(LinearGradient.create) + radial_gradient = staticmethod(RadialGradient.create) defs = staticmethod(Defs.create) @staticmethod diff --git a/tests/components/el/test_svg.py b/tests/components/el/test_svg.py new file mode 100644 index 000000000..29aaa96dd --- /dev/null +++ b/tests/components/el/test_svg.py @@ -0,0 +1,74 @@ +from reflex.components.el.elements.media import ( + Circle, + Defs, + Ellipse, + Line, + LinearGradient, + Path, + Polygon, + RadialGradient, + Rect, + Stop, + Svg, + Text, +) + + +def test_circle(): + circle = Circle.create().render() + assert circle["name"] == "circle" + + +def test_defs(): + defs = Defs.create().render() + assert defs["name"] == "defs" + + +def test_ellipse(): + ellipse = Ellipse.create().render() + assert ellipse["name"] == "ellipse" + + +def test_line(): + line = Line.create().render() + assert line["name"] == "line" + + +def test_linear_gradient(): + linear_gradient = LinearGradient.create().render() + assert linear_gradient["name"] == "linearGradient" + + +def test_path(): + path = Path.create().render() + assert path["name"] == "path" + + +def test_polygon(): + polygon = Polygon.create().render() + assert polygon["name"] == "polygon" + + +def test_radial_gradient(): + radial_gradient = RadialGradient.create().render() + assert radial_gradient["name"] == "radialGradient" + + +def test_rect(): + rect = Rect.create().render() + assert rect["name"] == "rect" + + +def test_svg(): + svg = Svg.create().render() + assert svg["name"] == "svg" + + +def test_text(): + text = Text.create().render() + assert text["name"] == "text" + + +def test_stop(): + stop = Stop.create().render() + assert stop["name"] == "stop" From 9c3cc0cfa61cdcc2841b62a5e16112023e15578e Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 1 Oct 2024 12:34:28 -0700 Subject: [PATCH 081/201] bump version to 0.6.2dev1 (#4025) For further development against the version that will become 0.6.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 335fc440e..08c4fbdbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "reflex" -version = "0.6.1dev1" +version = "0.6.2dev1" description = "Web apps in pure Python." license = "Apache-2.0" authors = [ From e96b4bf42eb84c19925dc2f84aae1f195bfee49c Mon Sep 17 00:00:00 2001 From: Simon Young <40179067+Kastier1@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:32:05 -0700 Subject: [PATCH 082/201] a friendly little helper (#4021) * a friendly little helper * addressing comments * update comment --------- Co-authored-by: simon --- reflex/model.py | 5 ++--- reflex/utils/compat.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/reflex/model.py b/reflex/model.py index fefb1f9e9..0e8d62e90 100644 --- a/reflex/model.py +++ b/reflex/model.py @@ -22,7 +22,7 @@ from reflex import constants from reflex.base import Base from reflex.config import get_config from reflex.utils import console -from reflex.utils.compat import sqlmodel +from reflex.utils.compat import sqlmodel, sqlmodel_field_has_primary_key def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine: @@ -166,8 +166,7 @@ class Model(Base, sqlmodel.SQLModel): # pyright: ignore [reportGeneralTypeIssue non_default_primary_key_fields = [ field_name for field_name, field in cls.__fields__.items() - if field_name != "id" - and getattr(field.field_info, "primary_key", None) is True + if field_name != "id" and sqlmodel_field_has_primary_key(field) ] if non_default_primary_key_fields: cls.__fields__.pop("id", None) diff --git a/reflex/utils/compat.py b/reflex/utils/compat.py index ef5fcd3e1..27c4753db 100644 --- a/reflex/utils/compat.py +++ b/reflex/utils/compat.py @@ -69,3 +69,21 @@ def pydantic_v1_patch(): with pydantic_v1_patch(): import sqlmodel as sqlmodel + + +def sqlmodel_field_has_primary_key(field) -> bool: + """Determines if a field is a priamary. + + Args: + field: a rx.model field + + Returns: + If field is a primary key (Bool) + """ + if getattr(field.field_info, "primary_key", None) is True: + return True + if getattr(field.field_info, "sa_column", None) is None: + return False + if getattr(field.field_info.sa_column, "primary_key", None) is True: + return True + return False From c08720ed1a8b7b0d28d1b9d65531af71a5164dd3 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 1 Oct 2024 15:23:35 -0700 Subject: [PATCH 083/201] Use an equality check instead of startswith (#4024) --- reflex/components/dynamic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py index ad044d54f..390b6e688 100644 --- a/reflex/components/dynamic.py +++ b/reflex/components/dynamic.py @@ -2,6 +2,7 @@ from reflex import constants from reflex.utils import imports +from reflex.utils.format import format_library_name from reflex.utils.serializers import serializer from reflex.vars import Var, get_unique_variable_name from reflex.vars.base import VarData, transform @@ -64,11 +65,12 @@ def load_dynamic_serializer(): imports = {} for lib, names in component._get_all_imports().items(): + formatted_lib_name = format_library_name(lib) if ( not lib.startswith((".", "/")) and not lib.startswith("http") and all( - not lib.startswith(lib_in_window) + formatted_lib_name != lib_in_window for lib_in_window in libs_in_window ) ): From 6a9f83cc2d3e56128d6245870ae0c4c9e71ec2b9 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 2 Oct 2024 18:04:04 -0700 Subject: [PATCH 084/201] set loglevel to info with hosting cli (#4043) * set loglevel to info with hosting cli * reduce reused logic --- reflex/constants/base.py | 8 ++++++++ reflex/reflex.py | 16 +++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/reflex/constants/base.py b/reflex/constants/base.py index 225e8000b..0914c087f 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -191,6 +191,14 @@ class LogLevel(str, Enum): levels = list(LogLevel) return levels.index(self) <= levels.index(other) + def subprocess_level(self): + """Return the log level for the subprocess. + + Returns: + The log level for the subprocess + """ + return self if self != LogLevel.DEFAULT else LogLevel.INFO + # Server socket configuration variables POLLING_MAX_HTTP_BUFFER_SIZE = 1000 * 1000 diff --git a/reflex/reflex.py b/reflex/reflex.py index 43ebe2eb4..99dccf831 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -15,7 +15,6 @@ from reflex_cli.utils import dependency from reflex import constants from reflex.config import get_config -from reflex.constants.base import LogLevel from reflex.custom_components.custom_components import custom_components_cli from reflex.state import reset_disk_state_manager from reflex.utils import console, redir, telemetry @@ -247,11 +246,6 @@ def _run( setup_frontend(Path.cwd()) commands.append((frontend_cmd, Path.cwd(), frontend_port, backend)) - # If no loglevel is specified, set the subprocesses loglevel to WARNING. - subprocesses_loglevel = ( - loglevel if loglevel != LogLevel.DEFAULT else LogLevel.WARNING - ) - # In prod mode, run the backend on a separate thread. if backend and env == constants.Env.PROD: commands.append( @@ -259,7 +253,7 @@ def _run( backend_cmd, backend_host, backend_port, - subprocesses_loglevel, + loglevel.subprocess_level(), frontend, ) ) @@ -269,7 +263,7 @@ def _run( # In dev mode, run the backend on the main thread. if backend and env == constants.Env.DEV: backend_cmd( - backend_host, int(backend_port), subprocesses_loglevel, frontend + backend_host, int(backend_port), loglevel.subprocess_level(), frontend ) # The windows uvicorn bug workaround # https://github.com/reflex-dev/reflex/issues/2335 @@ -342,7 +336,7 @@ def export( backend=backend, zip_dest_dir=zip_dest_dir, upload_db_file=upload_db_file, - loglevel=loglevel, + loglevel=loglevel.subprocess_level(), ) @@ -577,7 +571,7 @@ def deploy( frontend=frontend, backend=backend, zipping=zipping, - loglevel=loglevel, + loglevel=loglevel.subprocess_level(), upload_db_file=upload_db_file, ), key=key, @@ -591,7 +585,7 @@ def deploy( interactive=interactive, with_metrics=with_metrics, with_tracing=with_tracing, - loglevel=loglevel.value, + loglevel=loglevel.subprocess_level(), ) From f3be9a33058ec7b4f6c30717a91be111b8c8cdb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 3 Oct 2024 06:04:44 -0700 Subject: [PATCH 085/201] fix granian message (#4037) --- reflex/utils/exec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index b6550fdde..acb69ee19 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -284,7 +284,7 @@ def run_granian_backend(host, port, loglevel: LogLevel): ).serve() except ImportError: console.error( - 'InstallError: REFLEX_USE_GRANIAN is set but `granian` is not installed. (run `pip install "granian>=1.6.0"`)' + 'InstallError: REFLEX_USE_GRANIAN is set but `granian` is not installed. (run `pip install "granian[reload]>=1.6.0"`)' ) os._exit(1) @@ -410,7 +410,7 @@ def run_granian_backend_prod(host, port, loglevel): ) except ImportError: console.error( - 'InstallError: REFLEX_USE_GRANIAN is set but `granian` is not installed. (run `pip install "granian>=1.6.0"`)' + 'InstallError: REFLEX_USE_GRANIAN is set but `granian` is not installed. (run `pip install "granian[reload]>=1.6.0"`)' ) From 3f5194316298eb936f2f3c498f197e41bec56eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 3 Oct 2024 08:50:39 -0700 Subject: [PATCH 086/201] use pathlib as much as possible (#3967) * use pathlib as much as possible * fixstuff * break locally to unbreak in CI :shrug: * add type on env * debug attempt 1 * debugged * oops, there is the actual fix * fix 3.9 compat --- benchmarks/benchmark_lighthouse.py | 35 +++-- benchmarks/benchmark_package_size.py | 17 ++- benchmarks/benchmark_web_size.py | 3 +- benchmarks/utils.py | 15 +- reflex/compiler/compiler.py | 2 +- reflex/compiler/utils.py | 9 +- reflex/config.py | 5 +- reflex/constants/base.py | 26 ++-- reflex/constants/config.py | 7 +- reflex/constants/custom_components.py | 7 +- reflex/constants/installer.py | 29 ++-- reflex/custom_components/custom_components.py | 71 +++++----- reflex/reflex.py | 3 - reflex/utils/build.py | 34 ++--- reflex/utils/path_ops.py | 6 +- reflex/utils/prerequisites.py | 129 ++++++------------ reflex/utils/processes.py | 4 +- tests/integration/test_urls.py | 44 +++--- tests/units/compiler/test_compiler.py | 6 +- tests/units/test_config.py | 2 +- tests/units/test_telemetry.py | 2 +- tests/units/utils/test_utils.py | 6 +- 22 files changed, 202 insertions(+), 260 deletions(-) diff --git a/benchmarks/benchmark_lighthouse.py b/benchmarks/benchmark_lighthouse.py index 72f486b6f..25d5eaac4 100644 --- a/benchmarks/benchmark_lighthouse.py +++ b/benchmarks/benchmark_lighthouse.py @@ -3,8 +3,8 @@ from __future__ import annotations import json -import os import sys +from pathlib import Path from utils import send_data_to_posthog @@ -28,7 +28,7 @@ def insert_benchmarking_data( send_data_to_posthog("lighthouse_benchmark", properties) -def get_lighthouse_scores(directory_path: str) -> dict: +def get_lighthouse_scores(directory_path: str | Path) -> dict: """Extracts the Lighthouse scores from the JSON files in the specified directory. Args: @@ -38,24 +38,21 @@ def get_lighthouse_scores(directory_path: str) -> dict: dict: The Lighthouse scores. """ scores = {} - + directory_path = Path(directory_path) try: - for filename in os.listdir(directory_path): - if filename.endswith(".json") and filename != "manifest.json": - file_path = os.path.join(directory_path, filename) - with open(file_path, "r") as file: - data = json.load(file) - # Extract scores and add them to the dictionary with the filename as key - scores[data["finalUrl"].replace("http://localhost:3000/", "/")] = { - "performance_score": data["categories"]["performance"]["score"], - "accessibility_score": data["categories"]["accessibility"][ - "score" - ], - "best_practices_score": data["categories"]["best-practices"][ - "score" - ], - "seo_score": data["categories"]["seo"]["score"], - } + for filename in directory_path.iterdir(): + if filename.suffix == ".json" and filename.stem != "manifest": + file_path = directory_path / filename + data = json.loads(file_path.read_text()) + # Extract scores and add them to the dictionary with the filename as key + scores[data["finalUrl"].replace("http://localhost:3000/", "/")] = { + "performance_score": data["categories"]["performance"]["score"], + "accessibility_score": data["categories"]["accessibility"]["score"], + "best_practices_score": data["categories"]["best-practices"][ + "score" + ], + "seo_score": data["categories"]["seo"]["score"], + } except Exception as e: return {"error": e} diff --git a/benchmarks/benchmark_package_size.py b/benchmarks/benchmark_package_size.py index 8e2704355..778b52769 100644 --- a/benchmarks/benchmark_package_size.py +++ b/benchmarks/benchmark_package_size.py @@ -2,11 +2,12 @@ import argparse import os +from pathlib import Path from utils import get_directory_size, get_python_version, send_data_to_posthog -def get_package_size(venv_path, os_name): +def get_package_size(venv_path: Path, os_name): """Get the size of a specified package. Args: @@ -26,14 +27,12 @@ def get_package_size(venv_path, os_name): is_windows = "windows" in os_name - full_path = ( - ["lib", f"python{python_version}", "site-packages"] + package_dir: Path = ( + venv_path / "lib" / f"python{python_version}" / "site-packages" if not is_windows - else ["Lib", "site-packages"] + else venv_path / "Lib" / "site-packages" ) - - package_dir = os.path.join(venv_path, *full_path) - if not os.path.exists(package_dir): + if not package_dir.exists(): raise ValueError( "Error: Virtual environment does not exist or is not activated." ) @@ -63,9 +62,9 @@ def insert_benchmarking_data( path: The path to the dir or file to check size. """ if "./dist" in path: - size = get_directory_size(path) + size = get_directory_size(Path(path)) else: - size = get_package_size(path, os_type_version) + size = get_package_size(Path(path), os_type_version) # Prepare the event data properties = { diff --git a/benchmarks/benchmark_web_size.py b/benchmarks/benchmark_web_size.py index 6c2f40bbc..3ceccecf8 100644 --- a/benchmarks/benchmark_web_size.py +++ b/benchmarks/benchmark_web_size.py @@ -2,6 +2,7 @@ import argparse import os +from pathlib import Path from utils import get_directory_size, send_data_to_posthog @@ -28,7 +29,7 @@ def insert_benchmarking_data( pr_id: The id of the PR. path: The path to the dir or file to check size. """ - size = get_directory_size(path) + size = get_directory_size(Path(path)) # Prepare the event data properties = { diff --git a/benchmarks/utils.py b/benchmarks/utils.py index 7b02c8cc8..bfadf5b4e 100644 --- a/benchmarks/utils.py +++ b/benchmarks/utils.py @@ -2,12 +2,13 @@ import os import subprocess +from pathlib import Path import httpx from httpx import HTTPError -def get_python_version(venv_path, os_name): +def get_python_version(venv_path: Path, os_name): """Get the python version of python in a virtual env. Args: @@ -18,13 +19,13 @@ def get_python_version(venv_path, os_name): The python version. """ python_executable = ( - os.path.join(venv_path, "bin", "python") + venv_path / "bin" / "python" if "windows" not in os_name - else os.path.join(venv_path, "Scripts", "python.exe") + else venv_path / "Scripts" / "python.exe" ) try: output = subprocess.check_output( - [python_executable, "--version"], stderr=subprocess.STDOUT + [str(python_executable), "--version"], stderr=subprocess.STDOUT ) python_version = output.decode("utf-8").strip().split()[1] return ".".join(python_version.split(".")[:-1]) @@ -32,7 +33,7 @@ def get_python_version(venv_path, os_name): return None -def get_directory_size(directory): +def get_directory_size(directory: Path): """Get the size of a directory in bytes. Args: @@ -44,8 +45,8 @@ def get_directory_size(directory): total_size = 0 for dirpath, _, filenames in os.walk(directory): for f in filenames: - fp = os.path.join(dirpath, f) - total_size += os.path.getsize(fp) + fp = Path(dirpath) / f + total_size += fp.stat().st_size return total_size diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index edf03039e..343bda3e1 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -171,7 +171,7 @@ def _compile_root_stylesheet(stylesheets: list[str]) -> str: stylesheet_full_path = ( Path.cwd() / constants.Dirs.APP_ASSETS / stylesheet.strip("/") ) - if not os.path.exists(stylesheet_full_path): + if not stylesheet_full_path.exists(): raise FileNotFoundError( f"The stylesheet file {stylesheet_full_path} does not exist." ) diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index b10552554..6f4fa2d1b 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -2,7 +2,6 @@ from __future__ import annotations -import os from pathlib import Path from typing import Any, Callable, Dict, Optional, Type, Union from urllib.parse import urlparse @@ -457,16 +456,16 @@ def add_meta( return page -def write_page(path: str, code: str): +def write_page(path: str | Path, code: str): """Write the given code to the given path. Args: path: The path to write the code to. code: The code to write. """ - path_ops.mkdir(os.path.dirname(path)) - with open(path, "w", encoding="utf-8") as f: - f.write(code) + path = Path(path) + path_ops.mkdir(path.parent) + path.write_text(code, encoding="utf-8") def empty_dir(path: str | Path, keep_files: list[str] | None = None): diff --git a/reflex/config.py b/reflex/config.py index c237d7421..a5d66cb52 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -6,7 +6,8 @@ import importlib import os import sys import urllib.parse -from typing import Any, Dict, List, Optional, Set +from pathlib import Path +from typing import Any, Dict, List, Optional, Set, Union try: import pydantic.v1 as pydantic @@ -188,7 +189,7 @@ class Config(Base): telemetry_enabled: bool = True # The bun path - bun_path: str = constants.Bun.DEFAULT_PATH + bun_path: Union[str, Path] = constants.Bun.DEFAULT_PATH # List of origins that are allowed to connect to the backend API. cors_allowed_origins: List[str] = ["*"] diff --git a/reflex/constants/base.py b/reflex/constants/base.py index 0914c087f..05675643f 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -6,6 +6,7 @@ import os import platform from enum import Enum from importlib import metadata +from pathlib import Path from types import SimpleNamespace from platformdirs import PlatformDirs @@ -66,18 +67,19 @@ class Reflex(SimpleNamespace): # Get directory value from enviroment variables if it exists. _dir = os.environ.get("REFLEX_DIR", "") - DIR = _dir or ( - # on windows, we use C:/Users//AppData/Local/reflex. - # on macOS, we use ~/Library/Application Support/reflex. - # on linux, we use ~/.local/share/reflex. - # If user sets REFLEX_DIR envroment variable use that instead. - PlatformDirs(MODULE_NAME, False).user_data_dir + DIR = Path( + _dir + or ( + # on windows, we use C:/Users//AppData/Local/reflex. + # on macOS, we use ~/Library/Application Support/reflex. + # on linux, we use ~/.local/share/reflex. + # If user sets REFLEX_DIR envroment variable use that instead. + PlatformDirs(MODULE_NAME, False).user_data_dir + ) ) # The root directory of the reflex library. - ROOT_DIR = os.path.dirname( - os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - ) + ROOT_DIR = Path(__file__).parents[2] RELEASES_URL = f"https://api.github.com/repos/reflex-dev/templates/releases" @@ -125,11 +127,11 @@ class Templates(SimpleNamespace): """Folders used by the template system of Reflex.""" # The template directory used during reflex init. - BASE = os.path.join(Reflex.ROOT_DIR, Reflex.MODULE_NAME, ".templates") + BASE = Reflex.ROOT_DIR / Reflex.MODULE_NAME / ".templates" # The web subdirectory of the template directory. - WEB_TEMPLATE = os.path.join(BASE, "web") + WEB_TEMPLATE = BASE / "web" # The jinja template directory. - JINJA_TEMPLATE = os.path.join(BASE, "jinja") + JINJA_TEMPLATE = BASE / "jinja" # Where the code for the templates is stored. CODE = "code" diff --git a/reflex/constants/config.py b/reflex/constants/config.py index 966727426..3ff7aade5 100644 --- a/reflex/constants/config.py +++ b/reflex/constants/config.py @@ -1,6 +1,7 @@ """Config constants.""" import os +from pathlib import Path from types import SimpleNamespace from reflex.constants.base import Dirs, Reflex @@ -17,9 +18,7 @@ class Config(SimpleNamespace): # The name of the reflex config module. MODULE = "rxconfig" # The python config file. - FILE = f"{MODULE}{Ext.PY}" - # The previous config file. - PREVIOUS_FILE = f"pcconfig{Ext.PY}" + FILE = Path(f"{MODULE}{Ext.PY}") class Expiration(SimpleNamespace): @@ -37,7 +36,7 @@ class GitIgnore(SimpleNamespace): """Gitignore constants.""" # The gitignore file. - FILE = ".gitignore" + FILE = Path(".gitignore") # Files to gitignore. DEFAULTS = {Dirs.WEB, "*.db", "__pycache__/", "*.py[cod]", "assets/external/"} diff --git a/reflex/constants/custom_components.py b/reflex/constants/custom_components.py index 3ea9cf6ed..d879a01f2 100644 --- a/reflex/constants/custom_components.py +++ b/reflex/constants/custom_components.py @@ -2,6 +2,7 @@ from __future__ import annotations +from pathlib import Path from types import SimpleNamespace @@ -11,9 +12,9 @@ class CustomComponents(SimpleNamespace): # The name of the custom components source directory. SRC_DIR = "custom_components" # The name of the custom components pyproject.toml file. - PYPROJECT_TOML = "pyproject.toml" + PYPROJECT_TOML = Path("pyproject.toml") # The name of the custom components package README file. - PACKAGE_README = "README.md" + PACKAGE_README = Path("README.md") # The name of the custom components package .gitignore file. PACKAGE_GITIGNORE = ".gitignore" # The name of the distribution directory as result of a build. @@ -29,6 +30,6 @@ class CustomComponents(SimpleNamespace): "testpypi": "https://test.pypi.org/legacy/", } # The .gitignore file for the custom component project. - FILE = ".gitignore" + FILE = Path(".gitignore") # Files to gitignore. DEFAULTS = {"__pycache__/", "*.py[cod]", "*.egg-info/", "dist/"} diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 01a11a37e..a815b1284 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -2,7 +2,6 @@ from __future__ import annotations -import os import platform from types import SimpleNamespace @@ -40,11 +39,10 @@ class Bun(SimpleNamespace): # Min Bun Version MIN_VERSION = "0.7.0" # The directory to store the bun. - ROOT_PATH = os.path.join(Reflex.DIR, "bun") + ROOT_PATH = Reflex.DIR / "bun" # Default bun path. - DEFAULT_PATH = os.path.join( - ROOT_PATH, "bin", "bun" if not IS_WINDOWS else "bun.exe" - ) + DEFAULT_PATH = ROOT_PATH / "bin" / ("bun" if not IS_WINDOWS else "bun.exe") + # URL to bun install script. INSTALL_URL = "https://bun.sh/install" # URL to windows install script. @@ -65,10 +63,10 @@ class Fnm(SimpleNamespace): # The FNM version. VERSION = "1.35.1" # The directory to store fnm. - DIR = os.path.join(Reflex.DIR, "fnm") + DIR = Reflex.DIR / "fnm" FILENAME = get_fnm_name() # The fnm executable binary. - EXE = os.path.join(DIR, "fnm.exe" if IS_WINDOWS else "fnm") + EXE = DIR / ("fnm.exe" if IS_WINDOWS else "fnm") # The URL to the fnm release binary INSTALL_URL = ( @@ -86,18 +84,19 @@ class Node(SimpleNamespace): MIN_VERSION = "18.17.0" # The node bin path. - BIN_PATH = os.path.join( - Fnm.DIR, - "node-versions", - f"v{VERSION}", - "installation", - "bin" if not IS_WINDOWS else "", + BIN_PATH = ( + Fnm.DIR + / "node-versions" + / f"v{VERSION}" + / "installation" + / ("bin" if not IS_WINDOWS else "") ) + # The default path where node is installed. - PATH = os.path.join(BIN_PATH, "node.exe" if IS_WINDOWS else "node") + PATH = BIN_PATH / ("node.exe" if IS_WINDOWS else "node") # The default path where npm is installed. - NPM_PATH = os.path.join(BIN_PATH, "npm") + NPM_PATH = BIN_PATH / "npm" # The environment variable to use the system installed node. USE_SYSTEM_VAR = "REFLEX_USE_SYSTEM_NODE" diff --git a/reflex/custom_components/custom_components.py b/reflex/custom_components/custom_components.py index e6957f8fd..146bb12c2 100644 --- a/reflex/custom_components/custom_components.py +++ b/reflex/custom_components/custom_components.py @@ -36,7 +36,7 @@ POST_CUSTOM_COMPONENTS_GALLERY_TIMEOUT = 15 @contextmanager -def set_directory(working_directory: str): +def set_directory(working_directory: str | Path): """Context manager that sets the working directory. Args: @@ -45,7 +45,8 @@ def set_directory(working_directory: str): Yields: Yield to the caller to perform operations in the working directory. """ - current_directory = os.getcwd() + current_directory = Path.cwd() + working_directory = Path(working_directory) try: os.chdir(working_directory) yield @@ -62,14 +63,14 @@ def _create_package_config(module_name: str, package_name: str): """ from reflex.compiler import templates - with open(CustomComponents.PYPROJECT_TOML, "w") as f: - f.write( - templates.CUSTOM_COMPONENTS_PYPROJECT_TOML.render( - module_name=module_name, - package_name=package_name, - reflex_version=constants.Reflex.VERSION, - ) + pyproject = Path(CustomComponents.PYPROJECT_TOML) + pyproject.write_text( + templates.CUSTOM_COMPONENTS_PYPROJECT_TOML.render( + module_name=module_name, + package_name=package_name, + reflex_version=constants.Reflex.VERSION, ) + ) def _get_package_config(exit_on_fail: bool = True) -> dict: @@ -84,11 +85,11 @@ def _get_package_config(exit_on_fail: bool = True) -> dict: Raises: Exit: If the pyproject.toml file is not found. """ + pyproject = Path(CustomComponents.PYPROJECT_TOML) try: - with open(CustomComponents.PYPROJECT_TOML, "rb") as f: - return dict(tomlkit.load(f)) + return dict(tomlkit.loads(pyproject.read_bytes())) except (OSError, TOMLKitError) as ex: - console.error(f"Unable to read from pyproject.toml due to {ex}") + console.error(f"Unable to read from {pyproject} due to {ex}") if exit_on_fail: raise typer.Exit(code=1) from ex raise @@ -103,17 +104,17 @@ def _create_readme(module_name: str, package_name: str): """ from reflex.compiler import templates - with open(CustomComponents.PACKAGE_README, "w") as f: - f.write( - templates.CUSTOM_COMPONENTS_README.render( - module_name=module_name, - package_name=package_name, - ) + readme = Path(CustomComponents.PACKAGE_README) + readme.write_text( + templates.CUSTOM_COMPONENTS_README.render( + module_name=module_name, + package_name=package_name, ) + ) def _write_source_and_init_py( - custom_component_src_dir: str, + custom_component_src_dir: Path, component_class_name: str, module_name: str, ): @@ -126,27 +127,17 @@ def _write_source_and_init_py( """ from reflex.compiler import templates - with open( - os.path.join( - custom_component_src_dir, - f"{module_name}.py", - ), - "w", - ) as f: - f.write( - templates.CUSTOM_COMPONENTS_SOURCE.render( - component_class_name=component_class_name, module_name=module_name - ) + module_path = custom_component_src_dir / f"{module_name}.py" + module_path.write_text( + templates.CUSTOM_COMPONENTS_SOURCE.render( + component_class_name=component_class_name, module_name=module_name ) + ) - with open( - os.path.join( - custom_component_src_dir, - CustomComponents.INIT_FILE, - ), - "w", - ) as f: - f.write(templates.CUSTOM_COMPONENTS_INIT_FILE.render(module_name=module_name)) + init_path = custom_component_src_dir / CustomComponents.INIT_FILE + init_path.write_text( + templates.CUSTOM_COMPONENTS_INIT_FILE.render(module_name=module_name) + ) def _populate_demo_app(name_variants: NameVariants): @@ -192,7 +183,7 @@ def _get_default_library_name_parts() -> list[str]: Returns: The parts of default library name. """ - current_dir_name = os.getcwd().split(os.path.sep)[-1] + current_dir_name = Path.cwd().name cleaned_dir_name = re.sub("[^0-9a-zA-Z-_]+", "", current_dir_name).lower() parts = [part for part in re.split("-|_", cleaned_dir_name) if part] @@ -345,7 +336,7 @@ def init( console.set_log_level(loglevel) - if os.path.exists(CustomComponents.PYPROJECT_TOML): + if CustomComponents.PYPROJECT_TOML.exists(): console.error(f"A {CustomComponents.PYPROJECT_TOML} already exists. Aborting.") typer.Exit(code=1) diff --git a/reflex/reflex.py b/reflex/reflex.py index 99dccf831..4608ed171 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -114,9 +114,6 @@ def _init( app_name, generation_hash=generation_hash ) - # Migrate Pynecone projects to Reflex. - prerequisites.migrate_to_reflex() - # Initialize the .gitignore. prerequisites.initialize_gitignore() diff --git a/reflex/utils/build.py b/reflex/utils/build.py index 7a67ec32e..f16224d05 100644 --- a/reflex/utils/build.py +++ b/reflex/utils/build.py @@ -61,8 +61,8 @@ def generate_sitemap_config(deploy_url: str, export=False): def _zip( component_name: constants.ComponentName, - target: str, - root_dir: str, + target: str | Path, + root_dir: str | Path, exclude_venv_dirs: bool, upload_db_file: bool = False, dirs_to_exclude: set[str] | None = None, @@ -82,22 +82,22 @@ def _zip( top_level_dirs_to_exclude: The top level directory names immediately under root_dir to exclude. Do not exclude folders by these names further in the sub-directories. """ + target = Path(target) + root_dir = Path(root_dir) dirs_to_exclude = dirs_to_exclude or set() files_to_exclude = files_to_exclude or set() files_to_zip: list[str] = [] # Traverse the root directory in a top-down manner. In this traversal order, # we can modify the dirs list in-place to remove directories we don't want to include. for root, dirs, files in os.walk(root_dir, topdown=True): + root = Path(root) # Modify the dirs in-place so excluded and hidden directories are skipped in next traversal. dirs[:] = [ d for d in dirs - if (basename := os.path.basename(os.path.normpath(d))) - not in dirs_to_exclude + if (basename := Path(d).resolve().name) not in dirs_to_exclude and not basename.startswith(".") - and ( - not exclude_venv_dirs or not _looks_like_venv_dir(os.path.join(root, d)) - ) + and (not exclude_venv_dirs or not _looks_like_venv_dir(root / d)) ] # If we are at the top level with root_dir, exclude the top level dirs. if top_level_dirs_to_exclude and root == root_dir: @@ -109,7 +109,7 @@ def _zip( if not f.startswith(".") and (upload_db_file or not f.endswith(".db")) ] files_to_zip += [ - os.path.join(root, file) for file in files if file not in files_to_exclude + str(root / file) for file in files if file not in files_to_exclude ] # Create a progress bar for zipping the component. @@ -126,13 +126,13 @@ def _zip( for file in files_to_zip: console.debug(f"{target}: {file}", progress=progress) progress.advance(task) - zipf.write(file, os.path.relpath(file, root_dir)) + zipf.write(file, Path(file).relative_to(root_dir)) def zip_app( frontend: bool = True, backend: bool = True, - zip_dest_dir: str = os.getcwd(), + zip_dest_dir: str | Path = Path.cwd(), upload_db_file: bool = False, ): """Zip up the app. @@ -143,6 +143,7 @@ def zip_app( zip_dest_dir: The directory to export the zip file to. upload_db_file: Whether to upload the database file. """ + zip_dest_dir = Path(zip_dest_dir) files_to_exclude = { constants.ComponentName.FRONTEND.zip(), constants.ComponentName.BACKEND.zip(), @@ -151,8 +152,8 @@ def zip_app( if frontend: _zip( component_name=constants.ComponentName.FRONTEND, - target=os.path.join(zip_dest_dir, constants.ComponentName.FRONTEND.zip()), - root_dir=str(prerequisites.get_web_dir() / constants.Dirs.STATIC), + target=zip_dest_dir / constants.ComponentName.FRONTEND.zip(), + root_dir=prerequisites.get_web_dir() / constants.Dirs.STATIC, files_to_exclude=files_to_exclude, exclude_venv_dirs=False, ) @@ -160,8 +161,8 @@ def zip_app( if backend: _zip( component_name=constants.ComponentName.BACKEND, - target=os.path.join(zip_dest_dir, constants.ComponentName.BACKEND.zip()), - root_dir=".", + target=zip_dest_dir / constants.ComponentName.BACKEND.zip(), + root_dir=Path("."), dirs_to_exclude={"__pycache__"}, files_to_exclude=files_to_exclude, top_level_dirs_to_exclude={"assets"}, @@ -266,5 +267,6 @@ def setup_frontend_prod( build(deploy_url=get_config().deploy_url) -def _looks_like_venv_dir(dir_to_check: str) -> bool: - return os.path.exists(os.path.join(dir_to_check, "pyvenv.cfg")) +def _looks_like_venv_dir(dir_to_check: str | Path) -> bool: + dir_to_check = Path(dir_to_check) + return (dir_to_check / "pyvenv.cfg").exists() diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index 00affd820..1de635b88 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -164,7 +164,7 @@ def use_system_bun() -> bool: return use_system_install(constants.Bun.USE_SYSTEM_VAR) -def get_node_bin_path() -> str | None: +def get_node_bin_path() -> Path | None: """Get the node binary dir path. Returns: @@ -173,8 +173,8 @@ def get_node_bin_path() -> str | None: bin_path = Path(constants.Node.BIN_PATH) if not bin_path.exists(): str_path = which("node") - return str(Path(str_path).parent.resolve()) if str_path else str_path - return str(bin_path.resolve()) + return Path(str_path).parent.resolve() if str_path else None + return bin_path.resolve() def get_node_path() -> str | None: diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index f9eb9a790..0e49e3b55 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -2,9 +2,9 @@ from __future__ import annotations +import contextlib import dataclasses import functools -import glob import importlib import importlib.metadata import json @@ -19,7 +19,6 @@ import tempfile import time import zipfile from datetime import datetime -from fileinput import FileInput from pathlib import Path from types import ModuleType from typing import Callable, List, Optional @@ -192,7 +191,7 @@ def get_bun_version() -> version.Version | None: """ try: # Run the bun -v command and capture the output - result = processes.new_process([get_config().bun_path, "-v"], run=True) + result = processes.new_process([str(get_config().bun_path), "-v"], run=True) return version.parse(result.stdout) # type: ignore except FileNotFoundError: return None @@ -217,7 +216,7 @@ def get_install_package_manager() -> str | None: or windows_npm_escape_hatch() ): return get_package_manager() - return get_config().bun_path + return str(get_config().bun_path) def get_package_manager() -> str | None: @@ -394,9 +393,7 @@ def validate_app_name(app_name: str | None = None) -> str: Raises: Exit: if the app directory name is reflex or if the name is not standard for a python package name. """ - app_name = ( - app_name if app_name else os.getcwd().split(os.path.sep)[-1].replace("-", "_") - ) + app_name = app_name if app_name else Path.cwd().name.replace("-", "_") # Make sure the app is not named "reflex". if app_name.lower() == constants.Reflex.MODULE_NAME: console.error( @@ -430,7 +427,7 @@ def create_config(app_name: str): def initialize_gitignore( - gitignore_file: str = constants.GitIgnore.FILE, + gitignore_file: Path = constants.GitIgnore.FILE, files_to_ignore: set[str] = constants.GitIgnore.DEFAULTS, ): """Initialize the template .gitignore file. @@ -441,9 +438,10 @@ def initialize_gitignore( """ # Combine with the current ignored files. current_ignore: set[str] = set() - if os.path.exists(gitignore_file): - with open(gitignore_file, "r") as f: - current_ignore |= set([line.strip() for line in f.readlines()]) + if gitignore_file.exists(): + current_ignore |= set( + line.strip() for line in gitignore_file.read_text().splitlines() + ) if files_to_ignore == current_ignore: console.debug(f"{gitignore_file} already up to date.") @@ -451,9 +449,11 @@ def initialize_gitignore( files_to_ignore |= current_ignore # Write files to the .gitignore file. - with open(gitignore_file, "w", newline="\n") as f: - console.debug(f"Creating {gitignore_file}") - f.write(f"{(path_ops.join(sorted(files_to_ignore))).lstrip()}\n") + gitignore_file.touch(exist_ok=True) + console.debug(f"Creating {gitignore_file}") + gitignore_file.write_text( + "\n".join(sorted(files_to_ignore)) + "\n", + ) def initialize_requirements_txt(): @@ -546,8 +546,8 @@ def initialize_app_directory( # Rename the template app to the app name. path_ops.mv(template_code_dir_name, app_name) path_ops.mv( - os.path.join(app_name, template_name + constants.Ext.PY), - os.path.join(app_name, app_name + constants.Ext.PY), + Path(app_name) / (template_name + constants.Ext.PY), + Path(app_name) / (app_name + constants.Ext.PY), ) # Fix up the imports. @@ -691,7 +691,7 @@ def _update_next_config( def remove_existing_bun_installation(): """Remove existing bun installation.""" console.debug("Removing existing bun installation.") - if os.path.exists(get_config().bun_path): + if Path(get_config().bun_path).exists(): path_ops.rm(constants.Bun.ROOT_PATH) @@ -731,7 +731,7 @@ def download_and_extract_fnm_zip(): # Download the zip file url = constants.Fnm.INSTALL_URL console.debug(f"Downloading {url}") - fnm_zip_file = os.path.join(constants.Fnm.DIR, f"{constants.Fnm.FILENAME}.zip") + fnm_zip_file = constants.Fnm.DIR / f"{constants.Fnm.FILENAME}.zip" # Function to download and extract the FNM zip release. try: # Download the FNM zip release. @@ -770,7 +770,7 @@ def install_node(): return path_ops.mkdir(constants.Fnm.DIR) - if not os.path.exists(constants.Fnm.EXE): + if not constants.Fnm.EXE.exists(): download_and_extract_fnm_zip() if constants.IS_WINDOWS: @@ -827,7 +827,7 @@ def install_bun(): ) # Skip if bun is already installed. - if os.path.exists(get_config().bun_path) and get_bun_version() == version.parse( + if Path(get_config().bun_path).exists() and get_bun_version() == version.parse( constants.Bun.VERSION ): console.debug("Skipping bun installation as it is already installed.") @@ -842,7 +842,7 @@ def install_bun(): f"irm {constants.Bun.WINDOWS_INSTALL_URL}|iex", ], env={ - "BUN_INSTALL": constants.Bun.ROOT_PATH, + "BUN_INSTALL": str(constants.Bun.ROOT_PATH), "BUN_VERSION": constants.Bun.VERSION, }, shell=True, @@ -858,25 +858,26 @@ def install_bun(): download_and_run( constants.Bun.INSTALL_URL, f"bun-v{constants.Bun.VERSION}", - BUN_INSTALL=constants.Bun.ROOT_PATH, + BUN_INSTALL=str(constants.Bun.ROOT_PATH), ) -def _write_cached_procedure_file(payload: str, cache_file: str): - with open(cache_file, "w") as f: - f.write(payload) +def _write_cached_procedure_file(payload: str, cache_file: str | Path): + cache_file = Path(cache_file) + cache_file.write_text(payload) -def _read_cached_procedure_file(cache_file: str) -> str | None: - if os.path.exists(cache_file): - with open(cache_file, "r") as f: - return f.read() +def _read_cached_procedure_file(cache_file: str | Path) -> str | None: + cache_file = Path(cache_file) + if cache_file.exists(): + return cache_file.read_text() return None -def _clear_cached_procedure_file(cache_file: str): - if os.path.exists(cache_file): - os.remove(cache_file) +def _clear_cached_procedure_file(cache_file: str | Path): + cache_file = Path(cache_file) + if cache_file.exists(): + cache_file.unlink() def cached_procedure(cache_file: str, payload_fn: Callable[..., str]): @@ -977,7 +978,7 @@ def needs_reinit(frontend: bool = True) -> bool: Raises: Exit: If the app is not initialized. """ - if not os.path.exists(constants.Config.FILE): + if not constants.Config.FILE.exists(): console.error( f"[cyan]{constants.Config.FILE}[/cyan] not found. Move to the root folder of your project, or run [bold]{constants.Reflex.MODULE_NAME} init[/bold] to start a new project." ) @@ -988,7 +989,7 @@ def needs_reinit(frontend: bool = True) -> bool: return False # Make sure the .reflex directory exists. - if not os.path.exists(constants.Reflex.DIR): + if not constants.Reflex.DIR.exists(): return True # Make sure the .web directory exists in frontend mode. @@ -1093,25 +1094,21 @@ def ensure_reflex_installation_id() -> Optional[int]: """ try: initialize_reflex_user_directory() - installation_id_file = os.path.join(constants.Reflex.DIR, "installation_id") + installation_id_file = constants.Reflex.DIR / "installation_id" installation_id = None - if os.path.exists(installation_id_file): - try: - with open(installation_id_file, "r") as f: - installation_id = int(f.read()) - except Exception: + if installation_id_file.exists(): + with contextlib.suppress(Exception): + installation_id = int(installation_id_file.read_text()) # If anything goes wrong at all... just regenerate. # Like what? Examples: # - file not exists # - file not readable # - content not parseable as an int - pass if installation_id is None: installation_id = random.getrandbits(128) - with open(installation_id_file, "w") as f: - f.write(str(installation_id)) + installation_id_file.write_text(str(installation_id)) # If we get here, installation_id is definitely set return installation_id except Exception as e: @@ -1205,50 +1202,6 @@ def prompt_for_template(templates: list[Template]) -> str: return templates[int(template)].name -def migrate_to_reflex(): - """Migration from Pynecone to Reflex.""" - # Check if the old config file exists. - if not os.path.exists(constants.Config.PREVIOUS_FILE): - return - - # Ask the user if they want to migrate. - action = console.ask( - "Pynecone project detected. Automatically upgrade to Reflex?", - choices=["y", "n"], - ) - if action == "n": - return - - # Rename pcconfig to rxconfig. - console.log( - f"[bold]Renaming {constants.Config.PREVIOUS_FILE} to {constants.Config.FILE}" - ) - os.rename(constants.Config.PREVIOUS_FILE, constants.Config.FILE) - - # Find all python files in the app directory. - file_pattern = os.path.join(get_config().app_name, "**/*.py") - file_list = glob.glob(file_pattern, recursive=True) - - # Add the config file to the list of files to be migrated. - file_list.append(constants.Config.FILE) - - # Migrate all files. - updates = { - "Pynecone": "Reflex", - "pynecone as pc": "reflex as rx", - "pynecone.io": "reflex.dev", - "pynecone": "reflex", - "pc.": "rx.", - "pcconfig": "rxconfig", - } - for file_path in file_list: - with FileInput(file_path, inplace=True) as file: - for line in file: - for old, new in updates.items(): - line = line.replace(old, new) - print(line, end="") - - def fetch_app_templates(version: str) -> dict[str, Template]: """Fetch a dict of templates from the templates repo using github API. @@ -1401,7 +1354,7 @@ def initialize_app(app_name: str, template: str | None = None): from reflex.utils import telemetry # Check if the app is already initialized. - if os.path.exists(constants.Config.FILE): + if constants.Config.FILE.exists(): telemetry.send("reinit") return diff --git a/reflex/utils/processes.py b/reflex/utils/processes.py index c435af7d0..a45676c01 100644 --- a/reflex/utils/processes.py +++ b/reflex/utils/processes.py @@ -156,7 +156,7 @@ def new_process(args, run: bool = False, show_logs: bool = False, **kwargs): Raises: Exit: When attempting to run a command with a None value. """ - node_bin_path = path_ops.get_node_bin_path() + node_bin_path = str(path_ops.get_node_bin_path()) if not node_bin_path and not prerequisites.CURRENTLY_INSTALLING_NODE: console.warn( "The path to the Node binary could not be found. Please ensure that Node is properly " @@ -167,7 +167,7 @@ def new_process(args, run: bool = False, show_logs: bool = False, **kwargs): console.error(f"Invalid command: {args}") raise typer.Exit(1) # Add the node bin path to the PATH environment variable. - env = { + env: dict[str, str] = { **os.environ, "PATH": os.pathsep.join( [node_bin_path if node_bin_path else "", os.environ["PATH"]] diff --git a/tests/integration/test_urls.py b/tests/integration/test_urls.py index bcf17fe41..81689aa18 100755 --- a/tests/integration/test_urls.py +++ b/tests/integration/test_urls.py @@ -8,7 +8,7 @@ import pytest import requests -def check_urls(repo_dir): +def check_urls(repo_dir: Path): """Check that all URLs in the repo are valid and secure. Args: @@ -21,33 +21,33 @@ def check_urls(repo_dir): errors = [] for root, _dirs, files in os.walk(repo_dir): - if "__pycache__" in root: + root = Path(root) + if root.stem == "__pycache__": continue for file_name in files: if not file_name.endswith(".py") and not file_name.endswith(".md"): continue - file_path = os.path.join(root, file_name) + file_path = root / file_name try: - with open(file_path, "r", encoding="utf-8", errors="ignore") as file: - for line in file: - urls = url_pattern.findall(line) - for url in set(urls): - if url.startswith("http://"): - errors.append( - f"Found insecure HTTP URL: {url} in {file_path}" - ) - url = url.strip('"\n') - try: - response = requests.head( - url, allow_redirects=True, timeout=5 - ) - response.raise_for_status() - except requests.RequestException as e: - errors.append( - f"Error accessing URL: {url} in {file_path} | Error: {e}, , Check your path ends with a /" - ) + for line in file_path.read_text().splitlines(): + urls = url_pattern.findall(line) + for url in set(urls): + if url.startswith("http://"): + errors.append( + f"Found insecure HTTP URL: {url} in {file_path}" + ) + url = url.strip('"\n') + try: + response = requests.head( + url, allow_redirects=True, timeout=5 + ) + response.raise_for_status() + except requests.RequestException as e: + errors.append( + f"Error accessing URL: {url} in {file_path} | Error: {e}, , Check your path ends with a /" + ) except Exception as e: errors.append(f"Error reading file: {file_path} | Error: {e}") @@ -58,7 +58,7 @@ def check_urls(repo_dir): "repo_dir", [Path(__file__).resolve().parent.parent / "reflex"], ) -def test_find_and_check_urls(repo_dir): +def test_find_and_check_urls(repo_dir: Path): """Test that all URLs in the repo are valid and secure. Args: diff --git a/tests/units/compiler/test_compiler.py b/tests/units/compiler/test_compiler.py index 63014cf33..afacf43c5 100644 --- a/tests/units/compiler/test_compiler.py +++ b/tests/units/compiler/test_compiler.py @@ -1,4 +1,4 @@ -import os +from pathlib import Path from typing import List import pytest @@ -130,7 +130,7 @@ def test_compile_stylesheets(tmp_path, mocker): ] assert compiler.compile_root_stylesheet(stylesheets) == ( - os.path.join(".web", "styles", "styles.css"), + str(Path(".web") / "styles" / "styles.css"), f"@import url('./tailwind.css'); \n" f"@import url('https://fonts.googleapis.com/css?family=Sofia&effect=neon|outline|emboss|shadow-multiple'); \n" f"@import url('https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css'); \n" @@ -164,7 +164,7 @@ def test_compile_stylesheets_exclude_tailwind(tmp_path, mocker): ] assert compiler.compile_root_stylesheet(stylesheets) == ( - os.path.join(".web", "styles", "styles.css"), + str(Path(".web") / "styles" / "styles.css"), "@import url('../public/styles.css'); \n", ) diff --git a/tests/units/test_config.py b/tests/units/test_config.py index 31dd77649..a6c6fe697 100644 --- a/tests/units/test_config.py +++ b/tests/units/test_config.py @@ -192,4 +192,4 @@ def test_reflex_dir_env_var(monkeypatch, tmp_path): mp_ctx = multiprocessing.get_context(method="spawn") with mp_ctx.Pool(processes=1) as pool: - assert pool.apply(reflex_dir_constant) == str(tmp_path) + assert pool.apply(reflex_dir_constant) == tmp_path diff --git a/tests/units/test_telemetry.py b/tests/units/test_telemetry.py index a434779d4..25ad91323 100644 --- a/tests/units/test_telemetry.py +++ b/tests/units/test_telemetry.py @@ -52,4 +52,4 @@ def test_send(mocker, event): telemetry._send(event, telemetry_enabled=True) httpx_post_mock.assert_called_once() - pathlib_path_read_text_mock.assert_called_once() + assert pathlib_path_read_text_mock.call_count == 2 diff --git a/tests/units/utils/test_utils.py b/tests/units/utils/test_utils.py index 5cdd846fe..41bd4e661 100644 --- a/tests/units/utils/test_utils.py +++ b/tests/units/utils/test_utils.py @@ -117,7 +117,7 @@ def test_remove_existing_bun_installation(mocker): Args: mocker: Pytest mocker. """ - mocker.patch("reflex.utils.prerequisites.os.path.exists", return_value=True) + mocker.patch("reflex.utils.prerequisites.Path.exists", return_value=True) rm = mocker.patch("reflex.utils.prerequisites.path_ops.rm", mocker.Mock()) prerequisites.remove_existing_bun_installation() @@ -458,7 +458,7 @@ def test_bun_install_without_unzip(mocker): mocker: Pytest mocker object. """ mocker.patch("reflex.utils.path_ops.which", return_value=None) - mocker.patch("os.path.exists", return_value=False) + mocker.patch("pathlib.Path.exists", return_value=False) mocker.patch("reflex.utils.prerequisites.constants.IS_WINDOWS", False) with pytest.raises(FileNotFoundError): @@ -476,7 +476,7 @@ def test_bun_install_version(mocker, bun_version): """ mocker.patch("reflex.utils.prerequisites.constants.IS_WINDOWS", False) - mocker.patch("os.path.exists", return_value=True) + mocker.patch("pathlib.Path.exists", return_value=True) mocker.patch( "reflex.utils.prerequisites.get_bun_version", return_value=version.parse(bun_version), From 12d73e4167c4d204591a1eb4a6390327e362d1e8 Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Thu, 3 Oct 2024 16:48:50 +0000 Subject: [PATCH 087/201] Track the last reflex run time (#4045) --- reflex/utils/build.py | 3 +++ reflex/utils/prerequisites.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/reflex/utils/build.py b/reflex/utils/build.py index f16224d05..770809015 100644 --- a/reflex/utils/build.py +++ b/reflex/utils/build.py @@ -237,6 +237,9 @@ def setup_frontend( # Set the environment variables in client (env.json). set_env_json() + # update the last reflex run time. + prerequisites.set_last_reflex_run_time() + # Disable the Next telemetry. if disable_telemetry: processes.new_process( diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 0e49e3b55..3c2875204 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -131,6 +131,14 @@ def get_or_set_last_reflex_version_check_datetime(): return last_version_check_datetime +def set_last_reflex_run_time(): + """Set the last Reflex run time.""" + path_ops.update_json_file( + get_web_dir() / constants.Reflex.JSON, + {"last_reflex_run_datetime": str(datetime.now())}, + ) + + def check_node_version() -> bool: """Check the version of Node.js. From 4b3d05621282b449aaf11c3f6d4982536d558797 Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Thu, 3 Oct 2024 17:35:34 +0000 Subject: [PATCH 088/201] [ENG-3476] Setting State Vars that are not defined should raise an error (#4007) --- reflex/state.py | 15 +++++++++++++ reflex/utils/exceptions.py | 4 ++++ tests/units/test_state.py | 43 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) diff --git a/reflex/state.py b/reflex/state.py index cda36a0a9..64ea960e1 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -74,6 +74,7 @@ from reflex.utils.exceptions import ( EventHandlerShadowsBuiltInStateMethod, ImmutableStateError, LockExpiredError, + SetUndefinedStateVarError, ) from reflex.utils.exec import is_testing_env from reflex.utils.serializers import serializer @@ -1260,6 +1261,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Args: name: The name of the attribute. value: The value of the attribute. + + Raises: + SetUndefinedStateVarError: If a value of a var is set without first defining it. """ if isinstance(value, MutableProxy): # unwrap proxy objects when assigning back to the state @@ -1277,6 +1281,17 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): self._mark_dirty() return + if ( + name not in self.vars + and name not in self.get_skip_vars() + and not name.startswith("__") + and not name.startswith(f"_{type(self).__name__}__") + ): + raise SetUndefinedStateVarError( + f"The state variable '{name}' has not been defined in '{type(self).__name__}'. " + f"All state variables must be declared before they can be set." + ) + # Set the attribute. super().__setattr__(name, value) diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 7c3532861..9c79a387a 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -115,3 +115,7 @@ class PrimitiveUnserializableToJSON(ReflexError, ValueError): class InvalidLifespanTaskType(ReflexError, TypeError): """Raised when an invalid task type is registered as a lifespan task.""" + + +class SetUndefinedStateVarError(ReflexError, AttributeError): + """Raised when setting the value of a var without first declaring it.""" diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 205162b9f..5bfac7628 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -41,6 +41,7 @@ from reflex.state import ( ) from reflex.testing import chdir from reflex.utils import format, prerequisites, types +from reflex.utils.exceptions import SetUndefinedStateVarError from reflex.utils.format import json_dumps from reflex.vars.base import ComputedVar, Var from tests.units.states.mutation import MutableSQLAModel, MutableTestState @@ -3262,3 +3263,45 @@ def test_child_mixin_state() -> None: assert "computed" in ChildUsesMixinState.inherited_vars assert "computed" not in ChildUsesMixinState.computed_vars + + +def test_assignment_to_undeclared_vars(): + """Test that an attribute error is thrown when undeclared vars are set.""" + + class State(BaseState): + val: str + _val: str + __val: str # type: ignore + + def handle_supported_regular_vars(self): + self.val = "no underscore" + self._val = "single leading underscore" + self.__val = "double leading undercore" + + def handle_regular_var(self): + self.num = 5 + + def handle_backend_var(self): + self._num = 5 + + def handle_non_var(self): + self.__num = 5 + + class Substate(State): + def handle_var(self): + self.value = 20 + + state = State() # type: ignore + sub_state = Substate() # type: ignore + + with pytest.raises(SetUndefinedStateVarError): + state.handle_regular_var() + + with pytest.raises(SetUndefinedStateVarError): + sub_state.handle_var() + + with pytest.raises(SetUndefinedStateVarError): + state.handle_backend_var() + + state.handle_supported_regular_vars() + state.handle_non_var() From 27bb7179d62c83547fd8fae2d2e3c69d8e5215a4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 3 Oct 2024 12:24:56 -0700 Subject: [PATCH 089/201] default should be warning for subprocesses not info (#4049) --- reflex/constants/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/constants/base.py b/reflex/constants/base.py index 05675643f..b86f083cc 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -199,7 +199,7 @@ class LogLevel(str, Enum): Returns: The log level for the subprocess """ - return self if self != LogLevel.DEFAULT else LogLevel.INFO + return self if self != LogLevel.DEFAULT else LogLevel.WARNING # Server socket configuration variables From 56709a210b0b722c05b72dc515634d19afb1586b Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 3 Oct 2024 13:01:19 -0700 Subject: [PATCH 090/201] add of_type to _evaluate (#4051) * add of_type to _evaluate * get it right pyright --- reflex/state.py | 20 ++++++++++++++++---- tests/integration/test_dynamic_components.py | 4 +++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 64ea960e1..1746835be 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -699,11 +699,14 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): ) @classmethod - def _evaluate(cls, f: Callable[[Self], Any]) -> Var: + def _evaluate( + cls, f: Callable[[Self], Any], of_type: Union[type, None] = None + ) -> Var: """Evaluate a function to a ComputedVar. Experimental. Args: f: The function to evaluate. + of_type: The type of the ComputedVar. Defaults to Component. Returns: The ComputedVar. @@ -711,14 +714,23 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): console.warn( "The _evaluate method is experimental and may be removed in future versions." ) - from reflex.components.base.fragment import fragment from reflex.components.component import Component + of_type = of_type or Component + unique_var_name = get_unique_variable_name() - @computed_var(_js_expr=unique_var_name, return_type=Component) + @computed_var(_js_expr=unique_var_name, return_type=of_type) def computed_var_func(state: Self): - return fragment(f(state)) + result = f(state) + + if not isinstance(result, of_type): + console.warn( + f"Inline ComputedVar {f} expected type {of_type}, got {type(result)}. " + "You can specify expected type with `of_type` argument." + ) + + return result setattr(cls, unique_var_name, computed_var_func) cls.computed_vars[unique_var_name] = computed_var_func diff --git a/tests/integration/test_dynamic_components.py b/tests/integration/test_dynamic_components.py index 5a4d99f9e..aeebd10e9 100644 --- a/tests/integration/test_dynamic_components.py +++ b/tests/integration/test_dynamic_components.py @@ -65,7 +65,9 @@ def DynamicComponents(): DynamicComponentsState.client_token_component, DynamicComponentsState.button, rx.text( - DynamicComponentsState._evaluate(lambda state: factorial(state.value)), + DynamicComponentsState._evaluate( + lambda state: factorial(state.value), of_type=int + ), id="factorial", ), ) From 40f1880932cec15231262e705566033835920594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 3 Oct 2024 14:18:28 -0700 Subject: [PATCH 091/201] move router dataclasses in their own file (#4044) --- reflex/istate/data.py | 126 ++++++++++++++++++++++++++++++++++++++++++ reflex/state.py | 120 +--------------------------------------- 2 files changed, 127 insertions(+), 119 deletions(-) create mode 100644 reflex/istate/data.py diff --git a/reflex/istate/data.py b/reflex/istate/data.py new file mode 100644 index 000000000..9f6e3b3f4 --- /dev/null +++ b/reflex/istate/data.py @@ -0,0 +1,126 @@ +"""This module contains the dataclasses representing the router object.""" + +import dataclasses +from typing import Optional + +from reflex import constants +from reflex.utils import format + + +@dataclasses.dataclass(frozen=True) +class HeaderData: + """An object containing headers data.""" + + host: str = "" + origin: str = "" + upgrade: str = "" + connection: str = "" + cookie: str = "" + pragma: str = "" + cache_control: str = "" + user_agent: str = "" + sec_websocket_version: str = "" + sec_websocket_key: str = "" + sec_websocket_extensions: str = "" + accept_encoding: str = "" + accept_language: str = "" + + def __init__(self, router_data: Optional[dict] = None): + """Initalize the HeaderData object based on router_data. + + Args: + router_data: the router_data dict. + """ + if router_data: + for k, v in router_data.get(constants.RouteVar.HEADERS, {}).items(): + object.__setattr__(self, format.to_snake_case(k), v) + else: + for k in dataclasses.fields(self): + object.__setattr__(self, k.name, "") + + +@dataclasses.dataclass(frozen=True) +class PageData: + """An object containing page data.""" + + host: str = "" # repeated with self.headers.origin (remove or keep the duplicate?) + path: str = "" + raw_path: str = "" + full_path: str = "" + full_raw_path: str = "" + params: dict = dataclasses.field(default_factory=dict) + + def __init__(self, router_data: Optional[dict] = None): + """Initalize the PageData object based on router_data. + + Args: + router_data: the router_data dict. + """ + if router_data: + object.__setattr__( + self, + "host", + router_data.get(constants.RouteVar.HEADERS, {}).get("origin", ""), + ) + object.__setattr__( + self, "path", router_data.get(constants.RouteVar.PATH, "") + ) + object.__setattr__( + self, "raw_path", router_data.get(constants.RouteVar.ORIGIN, "") + ) + object.__setattr__(self, "full_path", f"{self.host}{self.path}") + object.__setattr__(self, "full_raw_path", f"{self.host}{self.raw_path}") + object.__setattr__( + self, "params", router_data.get(constants.RouteVar.QUERY, {}) + ) + else: + object.__setattr__(self, "host", "") + object.__setattr__(self, "path", "") + object.__setattr__(self, "raw_path", "") + object.__setattr__(self, "full_path", "") + object.__setattr__(self, "full_raw_path", "") + object.__setattr__(self, "params", {}) + + +@dataclasses.dataclass(frozen=True, init=False) +class SessionData: + """An object containing session data.""" + + client_token: str = "" + client_ip: str = "" + session_id: str = "" + + def __init__(self, router_data: Optional[dict] = None): + """Initalize the SessionData object based on router_data. + + Args: + router_data: the router_data dict. + """ + if router_data: + client_token = router_data.get(constants.RouteVar.CLIENT_TOKEN, "") + client_ip = router_data.get(constants.RouteVar.CLIENT_IP, "") + session_id = router_data.get(constants.RouteVar.SESSION_ID, "") + else: + client_token = client_ip = session_id = "" + object.__setattr__(self, "client_token", client_token) + object.__setattr__(self, "client_ip", client_ip) + object.__setattr__(self, "session_id", session_id) + + +@dataclasses.dataclass(frozen=True, init=False) +class RouterData: + """An object containing RouterData.""" + + session: SessionData = dataclasses.field(default_factory=SessionData) + headers: HeaderData = dataclasses.field(default_factory=HeaderData) + page: PageData = dataclasses.field(default_factory=PageData) + + def __init__(self, router_data: Optional[dict] = None): + """Initialize the RouterData object. + + Args: + router_data: the router_data dict. + """ + object.__setattr__(self, "session", SessionData(router_data)) + object.__setattr__(self, "headers", HeaderData(router_data)) + object.__setattr__(self, "page", PageData(router_data)) diff --git a/reflex/state.py b/reflex/state.py index 1746835be..b1988e38a 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -38,6 +38,7 @@ from sqlalchemy.orm import DeclarativeBase from typing_extensions import Self from reflex.config import get_config +from reflex.istate.data import RouterData from reflex.vars.base import ( ComputedVar, DynamicRouteVar, @@ -93,125 +94,6 @@ var = computed_var TOO_LARGE_SERIALIZED_STATE = 100 * 1024 # 100kb -@dataclasses.dataclass(frozen=True) -class HeaderData: - """An object containing headers data.""" - - host: str = "" - origin: str = "" - upgrade: str = "" - connection: str = "" - cookie: str = "" - pragma: str = "" - cache_control: str = "" - user_agent: str = "" - sec_websocket_version: str = "" - sec_websocket_key: str = "" - sec_websocket_extensions: str = "" - accept_encoding: str = "" - accept_language: str = "" - - def __init__(self, router_data: Optional[dict] = None): - """Initalize the HeaderData object based on router_data. - - Args: - router_data: the router_data dict. - """ - if router_data: - for k, v in router_data.get(constants.RouteVar.HEADERS, {}).items(): - object.__setattr__(self, format.to_snake_case(k), v) - else: - for k in dataclasses.fields(self): - object.__setattr__(self, k.name, "") - - -@dataclasses.dataclass(frozen=True) -class PageData: - """An object containing page data.""" - - host: str = "" # repeated with self.headers.origin (remove or keep the duplicate?) - path: str = "" - raw_path: str = "" - full_path: str = "" - full_raw_path: str = "" - params: dict = dataclasses.field(default_factory=dict) - - def __init__(self, router_data: Optional[dict] = None): - """Initalize the PageData object based on router_data. - - Args: - router_data: the router_data dict. - """ - if router_data: - object.__setattr__( - self, - "host", - router_data.get(constants.RouteVar.HEADERS, {}).get("origin", ""), - ) - object.__setattr__( - self, "path", router_data.get(constants.RouteVar.PATH, "") - ) - object.__setattr__( - self, "raw_path", router_data.get(constants.RouteVar.ORIGIN, "") - ) - object.__setattr__(self, "full_path", f"{self.host}{self.path}") - object.__setattr__(self, "full_raw_path", f"{self.host}{self.raw_path}") - object.__setattr__( - self, "params", router_data.get(constants.RouteVar.QUERY, {}) - ) - else: - object.__setattr__(self, "host", "") - object.__setattr__(self, "path", "") - object.__setattr__(self, "raw_path", "") - object.__setattr__(self, "full_path", "") - object.__setattr__(self, "full_raw_path", "") - object.__setattr__(self, "params", {}) - - -@dataclasses.dataclass(frozen=True, init=False) -class SessionData: - """An object containing session data.""" - - client_token: str = "" - client_ip: str = "" - session_id: str = "" - - def __init__(self, router_data: Optional[dict] = None): - """Initalize the SessionData object based on router_data. - - Args: - router_data: the router_data dict. - """ - if router_data: - client_token = router_data.get(constants.RouteVar.CLIENT_TOKEN, "") - client_ip = router_data.get(constants.RouteVar.CLIENT_IP, "") - session_id = router_data.get(constants.RouteVar.SESSION_ID, "") - else: - client_token = client_ip = session_id = "" - object.__setattr__(self, "client_token", client_token) - object.__setattr__(self, "client_ip", client_ip) - object.__setattr__(self, "session_id", session_id) - - -@dataclasses.dataclass(frozen=True, init=False) -class RouterData: - """An object containing RouterData.""" - - session: SessionData = dataclasses.field(default_factory=SessionData) - headers: HeaderData = dataclasses.field(default_factory=HeaderData) - page: PageData = dataclasses.field(default_factory=PageData) - - def __init__(self, router_data: Optional[dict] = None): - """Initialize the RouterData object. - - Args: - router_data: the router_data dict. - """ - object.__setattr__(self, "session", SessionData(router_data)) - object.__setattr__(self, "headers", HeaderData(router_data)) - object.__setattr__(self, "page", PageData(router_data)) - - def _no_chain_background_task( state_cls: Type["BaseState"], name: str, fn: Callable ) -> Callable: From a66e0f2e11bea56c1664fe1ae740b7d81d8e88f1 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 3 Oct 2024 14:18:53 -0700 Subject: [PATCH 092/201] [ENG-3870] rx.call_script with f-string var produces incorrect code (#4039) * Add additional test cases for rx.call_script Include internal vars inside an f-string to be properly rendered on the backend and frontend. * [ENG-3870] rx.call_script with f-string var produces incorrect code Avoid casting javascript code with embedded Var as LiteralStringVar There are two cases that need to be handled: 1. The javascript code contains Vars with VarData, these can only be evaluated in the component context, since they may use hooks. Vars with VarData cannot be used from the backend. In this case, we cast the given code as a raw js expression and include the extracted VarData. 2. The javascript code has no VarData. In this case, we pass the code as the raw js expression and cast to a python str to get a js literal string to eval. * use VarData.__bool__ instead of `is None` --- reflex/event.py | 10 ++ tests/integration/test_call_script.py | 159 ++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) diff --git a/reflex/event.py b/reflex/event.py index 95358ace1..9b54eddeb 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -839,6 +839,16 @@ def call_script( ), ), } + if isinstance(javascript_code, str): + # When there is VarData, include it and eval the JS code inline on the client. + javascript_code, original_code = ( + LiteralVar.create(javascript_code), + javascript_code, + ) + if not javascript_code._get_all_var_data(): + # Without VarData, cast to string and eval the code in the event loop. + javascript_code = str(Var(_js_expr=original_code)) + return server_side( "_call_script", get_fn_signature(call_script), diff --git a/tests/integration/test_call_script.py b/tests/integration/test_call_script.py index 5a3b83abf..744d83d16 100644 --- a/tests/integration/test_call_script.py +++ b/tests/integration/test_call_script.py @@ -46,6 +46,7 @@ def CallScript(): inline_counter: int = 0 external_counter: int = 0 value: str = "Initial" + last_result: str = "" def call_script_callback(self, result): self.results.append(result) @@ -137,6 +138,32 @@ def CallScript(): callback=CallScriptState.set_external_counter, # type: ignore ) + def call_with_var_f_string(self): + return rx.call_script( + f"{rx.Var('inline_counter')} + {rx.Var('external_counter')}", + callback=CallScriptState.set_last_result, # type: ignore + ) + + def call_with_var_str_cast(self): + return rx.call_script( + f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}", + callback=CallScriptState.set_last_result, # type: ignore + ) + + def call_with_var_f_string_wrapped(self): + return rx.call_script( + rx.Var(f"{rx.Var('inline_counter')} + {rx.Var('external_counter')}"), + callback=CallScriptState.set_last_result, # type: ignore + ) + + def call_with_var_str_cast_wrapped(self): + return rx.call_script( + rx.Var( + f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}" + ), + callback=CallScriptState.set_last_result, # type: ignore + ) + def reset_(self): yield rx.call_script("inline_counter = 0; external_counter = 0") self.reset() @@ -234,6 +261,68 @@ def CallScript(): id="update_value", ), rx.button("Reset", id="reset", on_click=CallScriptState.reset_), + rx.input( + value=CallScriptState.last_result, + id="last_result", + read_only=True, + on_click=CallScriptState.set_last_result(""), # type: ignore + ), + rx.button( + "call_with_var_f_string", + on_click=CallScriptState.call_with_var_f_string, + id="call_with_var_f_string", + ), + rx.button( + "call_with_var_str_cast", + on_click=CallScriptState.call_with_var_str_cast, + id="call_with_var_str_cast", + ), + rx.button( + "call_with_var_f_string_wrapped", + on_click=CallScriptState.call_with_var_f_string_wrapped, + id="call_with_var_f_string_wrapped", + ), + rx.button( + "call_with_var_str_cast_wrapped", + on_click=CallScriptState.call_with_var_str_cast_wrapped, + id="call_with_var_str_cast_wrapped", + ), + rx.button( + "call_with_var_f_string_inline", + on_click=rx.call_script( + f"{rx.Var('inline_counter')} + {CallScriptState.last_result}", + callback=CallScriptState.set_last_result, # type: ignore + ), + id="call_with_var_f_string_inline", + ), + rx.button( + "call_with_var_str_cast_inline", + on_click=rx.call_script( + f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}", + callback=CallScriptState.set_last_result, # type: ignore + ), + id="call_with_var_str_cast_inline", + ), + rx.button( + "call_with_var_f_string_wrapped_inline", + on_click=rx.call_script( + rx.Var( + f"{rx.Var('inline_counter')} + {CallScriptState.last_result}" + ), + callback=CallScriptState.set_last_result, # type: ignore + ), + id="call_with_var_f_string_wrapped_inline", + ), + rx.button( + "call_with_var_str_cast_wrapped_inline", + on_click=rx.call_script( + rx.Var( + f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}" + ), + callback=CallScriptState.set_last_result, # type: ignore + ), + id="call_with_var_str_cast_wrapped_inline", + ), ) @@ -363,3 +452,73 @@ def test_call_script( call_script.poll_for_content(update_value_button, exp_not_equal="Initial") == "updated" ) + + +def test_call_script_w_var( + call_script: AppHarness, + driver: WebDriver, +): + """Test evaluating javascript expressions containing Vars. + + Args: + call_script: harness for CallScript app. + driver: WebDriver instance. + """ + assert_token(driver) + last_result = driver.find_element(By.ID, "last_result") + assert last_result.get_attribute("value") == "" + + inline_return_button = driver.find_element(By.ID, "inline_return") + + call_with_var_f_string_button = driver.find_element(By.ID, "call_with_var_f_string") + call_with_var_str_cast_button = driver.find_element(By.ID, "call_with_var_str_cast") + call_with_var_f_string_wrapped_button = driver.find_element( + By.ID, "call_with_var_f_string_wrapped" + ) + call_with_var_str_cast_wrapped_button = driver.find_element( + By.ID, "call_with_var_str_cast_wrapped" + ) + call_with_var_f_string_inline_button = driver.find_element( + By.ID, "call_with_var_f_string_inline" + ) + call_with_var_str_cast_inline_button = driver.find_element( + By.ID, "call_with_var_str_cast_inline" + ) + call_with_var_f_string_wrapped_inline_button = driver.find_element( + By.ID, "call_with_var_f_string_wrapped_inline" + ) + call_with_var_str_cast_wrapped_inline_button = driver.find_element( + By.ID, "call_with_var_str_cast_wrapped_inline" + ) + + inline_return_button.click() + call_with_var_f_string_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="") == "1" + + inline_return_button.click() + call_with_var_str_cast_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="1") == "2" + + inline_return_button.click() + call_with_var_f_string_wrapped_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="2") == "3" + + inline_return_button.click() + call_with_var_str_cast_wrapped_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="3") == "4" + + inline_return_button.click() + call_with_var_f_string_inline_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="4") == "9" + + inline_return_button.click() + call_with_var_str_cast_inline_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="9") == "6" + + inline_return_button.click() + call_with_var_f_string_wrapped_inline_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="6") == "13" + + inline_return_button.click() + call_with_var_str_cast_wrapped_inline_button.click() + assert call_script.poll_for_value(last_result, exp_not_equal="13") == "8" From ad0827c59ce249e94330c0b0c7dd414d7c2e8b25 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 3 Oct 2024 14:25:21 -0700 Subject: [PATCH 093/201] bundle chakra in window for CSR (#4042) * bundle chakra in window for CSR * remove repeated chakra ui reference * use dynamically generated libraries * remove js from it --- .../.templates/jinja/web/pages/_app.js.jinja2 | 14 ++++---- reflex/compiler/compiler.py | 24 ++++++++++++++ reflex/components/dynamic.py | 33 ++++++++++++++----- reflex/utils/exceptions.py | 4 +++ 4 files changed, 59 insertions(+), 16 deletions(-) diff --git a/reflex/.templates/jinja/web/pages/_app.js.jinja2 b/reflex/.templates/jinja/web/pages/_app.js.jinja2 index 97c31925d..c893e19e2 100644 --- a/reflex/.templates/jinja/web/pages/_app.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/_app.js.jinja2 @@ -7,10 +7,9 @@ import '/styles/styles.css' {% block declaration %} import { EventLoopProvider, StateProvider, defaultColorMode } from "/utils/context.js"; import { ThemeProvider } from 'next-themes' -import * as React from "react"; -import * as utils_context from "/utils/context.js"; -import * as utils_state from "/utils/state.js"; -import * as radix from "@radix-ui/themes"; +{% for library_alias, library_path in window_libraries %} +import * as {{library_alias}} from "{{library_path}}"; +{% endfor %} {% for custom_code in custom_codes %} {{custom_code}} @@ -33,10 +32,9 @@ export default function MyApp({ Component, pageProps }) { React.useEffect(() => { // Make contexts and state objects available globally for dynamic eval'd components let windowImports = { - "react": React, - "@radix-ui/themes": radix, - "/utils/context": utils_context, - "/utils/state": utils_state, +{% for library_alias, library_path in window_libraries %} + "{{library_path}}": {{library_alias}}, +{% endfor %} }; window["__reflex"] = windowImports; }, []); diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index 343bda3e1..0c29f941d 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -40,6 +40,20 @@ def _compile_document_root(root: Component) -> str: ) +def _normalize_library_name(lib: str) -> str: + """Normalize the library name. + + Args: + lib: The library name to normalize. + + Returns: + The normalized library name. + """ + if lib == "react": + return "React" + return lib.replace("@", "").replace("/", "_").replace("-", "_") + + def _compile_app(app_root: Component) -> str: """Compile the app template component. @@ -49,10 +63,20 @@ def _compile_app(app_root: Component) -> str: Returns: The compiled app. """ + from reflex.components.dynamic import bundled_libraries + + window_libraries = [ + (_normalize_library_name(name), name) for name in bundled_libraries + ] + [ + ("utils_context", f"/{constants.Dirs.UTILS}/context"), + ("utils_state", f"/{constants.Dirs.UTILS}/state"), + ] + return templates.APP_ROOT.render( imports=utils.compile_imports(app_root._get_all_imports()), custom_codes=app_root._get_all_custom_code(), hooks={**app_root._get_all_hooks_internal(), **app_root._get_all_hooks()}, + window_libraries=window_libraries, render=app_root.render(), ) diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py index 390b6e688..2e336027b 100644 --- a/reflex/components/dynamic.py +++ b/reflex/components/dynamic.py @@ -1,12 +1,18 @@ """Components that are dynamically generated on the backend.""" +from typing import TYPE_CHECKING + from reflex import constants from reflex.utils import imports +from reflex.utils.exceptions import DynamicComponentMissingLibrary from reflex.utils.format import format_library_name from reflex.utils.serializers import serializer from reflex.vars import Var, get_unique_variable_name from reflex.vars.base import VarData, transform +if TYPE_CHECKING: + from reflex.components.component import Component + def get_cdn_url(lib: str) -> str: """Get the CDN URL for a library. @@ -20,6 +26,23 @@ def get_cdn_url(lib: str) -> str: return f"https://cdn.jsdelivr.net/npm/{lib}" + "/+esm" +bundled_libraries = {"react", "@radix-ui/themes"} + + +def bundle_library(component: "Component"): + """Bundle a library with the component. + + Args: + component: The component to bundle the library with. + + Raises: + DynamicComponentMissingLibrary: Raised when a dynamic component is missing a library. + """ + if component.library is None: + raise DynamicComponentMissingLibrary("Component must have a library to bundle.") + bundled_libraries.add(format_library_name(component.library)) + + def load_dynamic_serializer(): """Load the serializer for dynamic components.""" # Causes a circular import, so we import here. @@ -58,10 +81,7 @@ def load_dynamic_serializer(): ) ] = None - libs_in_window = [ - "react", - "@radix-ui/themes", - ] + libs_in_window = bundled_libraries imports = {} for lib, names in component._get_all_imports().items(): @@ -69,10 +89,7 @@ def load_dynamic_serializer(): if ( not lib.startswith((".", "/")) and not lib.startswith("http") - and all( - formatted_lib_name != lib_in_window - for lib_in_window in libs_in_window - ) + and formatted_lib_name not in libs_in_window ): imports[get_cdn_url(lib)] = names else: diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 9c79a387a..0383f7ba6 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -117,5 +117,9 @@ class InvalidLifespanTaskType(ReflexError, TypeError): """Raised when an invalid task type is registered as a lifespan task.""" +class DynamicComponentMissingLibrary(ReflexError, ValueError): + """Raised when a dynamic component is missing a library.""" + + class SetUndefinedStateVarError(ReflexError, AttributeError): """Raised when setting the value of a var without first declaring it.""" From 73e8a4e0abfd2fb63fae10b69a9af830bf7a5c93 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 3 Oct 2024 15:33:51 -0700 Subject: [PATCH 094/201] support eventspec/eventchain in var operations (#4038) --- reflex/.templates/web/utils/state.js | 22 ++- reflex/app.py | 4 +- reflex/components/component.py | 50 ++++-- reflex/event.py | 193 ++++++++++++++++++++- reflex/utils/format.py | 14 +- reflex/vars/base.py | 81 +++++---- tests/units/components/base/test_script.py | 6 +- tests/units/components/test_component.py | 8 +- tests/units/utils/test_format.py | 22 ++- 9 files changed, 310 insertions(+), 90 deletions(-) diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 78e671809..0fe0db8c1 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -544,13 +544,19 @@ export const uploadFiles = async ( /** * Create an event object. - * @param name The name of the event. - * @param payload The payload of the event. - * @param handler The client handler to process event. + * @param {string} name The name of the event. + * @param {Object.} payload The payload of the event. + * @param {Object.} event_actions The actions to take on the event. + * @param {string} handler The client handler to process event. * @returns The event object. */ -export const Event = (name, payload = {}, handler = null) => { - return { name, payload, handler }; +export const Event = ( + name, + payload = {}, + event_actions = {}, + handler = null +) => { + return { name, payload, handler, event_actions }; }; /** @@ -676,6 +682,12 @@ export const useEventLoop = ( if (!(args instanceof Array)) { args = [args]; } + + event_actions = events.reduce( + (acc, e) => ({ ...acc, ...e.event_actions }), + event_actions ?? {} + ); + const _e = args.filter((o) => o?.preventDefault !== undefined)[0]; if (event_actions?.preventDefault && _e?.preventDefault) { diff --git a/reflex/app.py b/reflex/app.py index 111dd9dfd..d8a6f2590 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -1536,7 +1536,9 @@ class EventNamespace(AsyncNamespace): """ fields = json.loads(data) # Get the event. - event = Event(**{k: v for k, v in fields.items() if k != "handler"}) + event = Event( + **{k: v for k, v in fields.items() if k not in ("handler", "event_actions")} + ) self.token_to_sid[event.token] = sid self.sid_to_token[sid] = event.token diff --git a/reflex/components/component.py b/reflex/components/component.py index 9bdd12f0e..26ea2fd3f 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -38,8 +38,10 @@ from reflex.constants import ( ) from reflex.event import ( EventChain, + EventChainVar, EventHandler, EventSpec, + EventVar, call_event_fn, call_event_handler, get_handler_args, @@ -514,7 +516,7 @@ class Component(BaseComponent, ABC): Var, EventHandler, EventSpec, - List[Union[EventHandler, EventSpec]], + List[Union[EventHandler, EventSpec, EventVar]], Callable, ], ) -> Union[EventChain, Var]: @@ -532,11 +534,16 @@ class Component(BaseComponent, ABC): """ # If it's an event chain var, return it. if isinstance(value, Var): - if value._var_type is not EventChain: + if isinstance(value, EventChainVar): + return value + elif isinstance(value, EventVar): + value = [value] + elif issubclass(value._var_type, (EventChain, EventSpec)): + return self._create_event_chain(args_spec, value.guess_type()) + else: raise ValueError( - f"Invalid event chain: {repr(value)} of type {type(value)}" + f"Invalid event chain: {str(value)} of type {value._var_type}" ) - return value elif isinstance(value, EventChain): # Trust that the caller knows what they're doing passing an EventChain directly return value @@ -547,7 +554,7 @@ class Component(BaseComponent, ABC): # If the input is a list of event handlers, create an event chain. if isinstance(value, List): - events: list[EventSpec] = [] + events: List[Union[EventSpec, EventVar]] = [] for v in value: if isinstance(v, (EventHandler, EventSpec)): # Call the event handler to get the event. @@ -561,6 +568,8 @@ class Component(BaseComponent, ABC): "lambda inside an EventChain list." ) events.extend(result) + elif isinstance(v, EventVar): + events.append(v) else: raise ValueError(f"Invalid event: {v}") @@ -570,32 +579,30 @@ class Component(BaseComponent, ABC): if isinstance(result, Var): # Recursively call this function if the lambda returned an EventChain Var. return self._create_event_chain(args_spec, result) - events = result + events = [*result] # Otherwise, raise an error. else: raise ValueError(f"Invalid event chain: {value}") # Add args to the event specs if necessary. - events = [e.with_args(get_handler_args(e)) for e in events] - - # Collect event_actions from each spec - event_actions = {} - for e in events: - event_actions.update(e.event_actions) + events = [ + (e.with_args(get_handler_args(e)) if isinstance(e, EventSpec) else e) + for e in events + ] # Return the event chain. if isinstance(args_spec, Var): return EventChain( events=events, args_spec=None, - event_actions=event_actions, + event_actions={}, ) else: return EventChain( events=events, args_spec=args_spec, - event_actions=event_actions, + event_actions={}, ) def get_event_triggers(self) -> Dict[str, Any]: @@ -1030,8 +1037,11 @@ class Component(BaseComponent, ABC): elif isinstance(event, EventChain): event_args = [] for spec in event.events: - for args in spec.args: - event_args.extend(args) + if isinstance(spec, EventSpec): + for args in spec.args: + event_args.extend(args) + else: + event_args.append(spec) yield event_trigger, event_args def _get_vars(self, include_children: bool = False) -> list[Var]: @@ -1105,8 +1115,12 @@ class Component(BaseComponent, ABC): for trigger in self.event_triggers.values(): if isinstance(trigger, EventChain): for event in trigger.events: - if event.handler.state_full_name: - return True + if isinstance(event, EventSpec): + if event.handler.state_full_name: + return True + else: + if event._var_state: + return True elif isinstance(trigger, Var) and trigger._var_state: return True return False diff --git a/reflex/event.py b/reflex/event.py index 9b54eddeb..7384cf5bf 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -4,16 +4,19 @@ from __future__ import annotations import dataclasses import inspect +import sys import types import urllib.parse from base64 import b64encode from typing import ( Any, Callable, + ClassVar, Dict, List, Optional, Tuple, + Type, Union, get_type_hints, ) @@ -25,8 +28,15 @@ from reflex.utils import format from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.types import ArgsSpec, GenericType from reflex.vars import VarData -from reflex.vars.base import LiteralVar, Var -from reflex.vars.function import FunctionStringVar, FunctionVar +from reflex.vars.base import ( + CachedVarOperation, + LiteralNoneVar, + LiteralVar, + ToOperation, + Var, + cached_property_no_lock, +) +from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar, FunctionVar from reflex.vars.object import ObjectVar try: @@ -375,7 +385,7 @@ class CallableEventSpec(EventSpec): class EventChain(EventActionsMixin): """Container for a chain of events that will be executed in order.""" - events: List[EventSpec] = dataclasses.field(default_factory=list) + events: List[Union[EventSpec, EventVar]] = dataclasses.field(default_factory=list) args_spec: Optional[Callable] = dataclasses.field(default=None) @@ -478,7 +488,7 @@ class FileUpload: if isinstance(events, Var): raise ValueError(f"{on_upload_progress} cannot return a var {events}.") on_upload_progress_chain = EventChain( - events=events, + events=[*events], args_spec=self.on_upload_progress_args_spec, ) formatted_chain = str(format.format_prop(on_upload_progress_chain)) @@ -1136,3 +1146,178 @@ def get_fn_signature(fn: Callable) -> inspect.Signature: "state", inspect.Parameter.POSITIONAL_OR_KEYWORD, annotation=Any ) return signature.replace(parameters=(new_param, *signature.parameters.values())) + + +class EventVar(ObjectVar): + """Base class for event vars.""" + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class LiteralEventVar(CachedVarOperation, LiteralVar, EventVar): + """A literal event var.""" + + _var_value: EventSpec = dataclasses.field(default=None) # type: ignore + + def __hash__(self) -> int: + """Get the hash of the var. + + Returns: + The hash of the var. + """ + return hash((self.__class__.__name__, self._js_expr)) + + @cached_property_no_lock + def _cached_var_name(self) -> str: + """The name of the var. + + Returns: + The name of the var. + """ + return str( + FunctionStringVar("Event").call( + # event handler name + ".".join( + filter( + None, + format.get_event_handler_parts(self._var_value.handler), + ) + ), + # event handler args + {str(name): value for name, value in self._var_value.args}, + # event actions + self._var_value.event_actions, + # client handler name + *( + [self._var_value.client_handler_name] + if self._var_value.client_handler_name + else [] + ), + ) + ) + + @classmethod + def create( + cls, + value: EventSpec, + _var_data: VarData | None = None, + ) -> LiteralEventVar: + """Create a new LiteralEventVar instance. + + Args: + value: The value of the var. + _var_data: The data of the var. + + Returns: + The created LiteralEventVar instance. + """ + return cls( + _js_expr="", + _var_type=EventSpec, + _var_data=_var_data, + _var_value=value, + ) + + +class EventChainVar(FunctionVar): + """Base class for event chain vars.""" + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class LiteralEventChainVar(CachedVarOperation, LiteralVar, EventChainVar): + """A literal event chain var.""" + + _var_value: EventChain = dataclasses.field(default=None) # type: ignore + + def __hash__(self) -> int: + """Get the hash of the var. + + Returns: + The hash of the var. + """ + return hash((self.__class__.__name__, self._js_expr)) + + @cached_property_no_lock + def _cached_var_name(self) -> str: + """The name of the var. + + Returns: + The name of the var. + """ + sig = inspect.signature(self._var_value.args_spec) # type: ignore + if sig.parameters: + arg_def = tuple((f"_{p}" for p in sig.parameters)) + arg_def_expr = LiteralVar.create([Var(_js_expr=arg) for arg in arg_def]) + else: + # add a default argument for addEvents if none were specified in value.args_spec + # used to trigger the preventDefault() on the event. + arg_def = ("...args",) + arg_def_expr = Var(_js_expr="args") + + return str( + ArgsFunctionOperation.create( + arg_def, + FunctionStringVar.create("addEvents").call( + LiteralVar.create( + [LiteralVar.create(event) for event in self._var_value.events] + ), + arg_def_expr, + self._var_value.event_actions, + ), + ) + ) + + @classmethod + def create( + cls, + value: EventChain, + _var_data: VarData | None = None, + ) -> LiteralEventChainVar: + """Create a new LiteralEventChainVar instance. + + Args: + value: The value of the var. + _var_data: The data of the var. + + Returns: + The created LiteralEventChainVar instance. + """ + return cls( + _js_expr="", + _var_type=EventChain, + _var_data=_var_data, + _var_value=value, + ) + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class ToEventVarOperation(ToOperation, EventVar): + """Result of a cast to an event var.""" + + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + + _default_var_type: ClassVar[Type] = EventSpec + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class ToEventChainVarOperation(ToOperation, EventChainVar): + """Result of a cast to an event chain var.""" + + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + + _default_var_type: ClassVar[Type] = EventChain diff --git a/reflex/utils/format.py b/reflex/utils/format.py index 4029bd275..65c0f049b 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -359,19 +359,7 @@ def format_prop( # Handle event props. if isinstance(prop, EventChain): - sig = inspect.signature(prop.args_spec) # type: ignore - if sig.parameters: - arg_def = ",".join(f"_{p}" for p in sig.parameters) - arg_def_expr = f"[{arg_def}]" - else: - # add a default argument for addEvents if none were specified in prop.args_spec - # used to trigger the preventDefault() on the event. - arg_def = "...args" - arg_def_expr = "args" - - chain = ",".join([format_event(event) for event in prop.events]) - event = f"addEvents([{chain}], {arg_def_expr}, {json_dumps(prop.event_actions)})" - prop = f"({arg_def}) => {event}" + return str(Var.create(prop)) # Handle other types. elif isinstance(prop, str): diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 2d78a14be..0f8a80f8d 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -385,6 +385,15 @@ class Var(Generic[VAR_TYPE]): Returns: The converted var. """ + from reflex.event import ( + EventChain, + EventChainVar, + EventSpec, + EventVar, + ToEventChainVarOperation, + ToEventVarOperation, + ) + from .function import FunctionVar, ToFunctionOperation from .number import ( BooleanVar, @@ -416,6 +425,10 @@ class Var(Generic[VAR_TYPE]): return self.to(BooleanVar, output) if fixed_output_type is None: return ToNoneOperation.create(self) + if fixed_output_type is EventSpec: + return self.to(EventVar, output) + if fixed_output_type is EventChain: + return self.to(EventChainVar, output) if issubclass(fixed_output_type, Base): return self.to(ObjectVar, output) if dataclasses.is_dataclass(fixed_output_type) and not issubclass( @@ -453,10 +466,13 @@ class Var(Generic[VAR_TYPE]): if issubclass(output, StringVar): return ToStringOperation.create(self, var_type or str) - if issubclass(output, (ObjectVar, Base)): - return ToObjectOperation.create(self, var_type or dict) + if issubclass(output, EventVar): + return ToEventVarOperation.create(self, var_type or EventSpec) - if dataclasses.is_dataclass(output): + if issubclass(output, EventChainVar): + return ToEventChainVarOperation.create(self, var_type or EventChain) + + if issubclass(output, (ObjectVar, Base)): return ToObjectOperation.create(self, var_type or dict) if issubclass(output, FunctionVar): @@ -469,6 +485,9 @@ class Var(Generic[VAR_TYPE]): if issubclass(output, NoneVar): return ToNoneOperation.create(self) + if dataclasses.is_dataclass(output): + return ToObjectOperation.create(self, var_type or dict) + # If we can't determine the first argument, we just replace the _var_type. if not issubclass(output, Var) or var_type is None: return dataclasses.replace( @@ -494,6 +513,8 @@ class Var(Generic[VAR_TYPE]): Raises: TypeError: If the type is not supported for guessing. """ + from reflex.event import EventChain, EventChainVar, EventSpec, EventVar + from .number import BooleanVar, NumberVar from .object import ObjectVar from .sequence import ArrayVar, StringVar @@ -539,6 +560,10 @@ class Var(Generic[VAR_TYPE]): return self.to(ArrayVar, self._var_type) if issubclass(fixed_type, str): return self.to(StringVar, self._var_type) + if issubclass(fixed_type, EventSpec): + return self.to(EventVar, self._var_type) + if issubclass(fixed_type, EventChain): + return self.to(EventChainVar, self._var_type) if issubclass(fixed_type, Base): return self.to(ObjectVar, self._var_type) if dataclasses.is_dataclass(fixed_type): @@ -1029,47 +1054,22 @@ class LiteralVar(Var): if value is None: return LiteralNoneVar.create(_var_data=_var_data) - from reflex.event import EventChain, EventHandler, EventSpec + from reflex.event import ( + EventChain, + EventHandler, + EventSpec, + LiteralEventChainVar, + LiteralEventVar, + ) from reflex.utils.format import get_event_handler_parts - from .function import ArgsFunctionOperation, FunctionStringVar from .object import LiteralObjectVar if isinstance(value, EventSpec): - event_name = LiteralVar.create( - ".".join(filter(None, get_event_handler_parts(value.handler))) - ) - event_args = LiteralVar.create( - {str(name): value for name, value in value.args} - ) - event_client_name = LiteralVar.create(value.client_handler_name) - return FunctionStringVar("Event").call( - event_name, - event_args, - *([event_client_name] if value.client_handler_name else []), - ) + return LiteralEventVar.create(value, _var_data=_var_data) if isinstance(value, EventChain): - sig = inspect.signature(value.args_spec) # type: ignore - if sig.parameters: - arg_def = tuple((f"_{p}" for p in sig.parameters)) - arg_def_expr = LiteralVar.create([Var(_js_expr=arg) for arg in arg_def]) - else: - # add a default argument for addEvents if none were specified in value.args_spec - # used to trigger the preventDefault() on the event. - arg_def = ("...args",) - arg_def_expr = Var(_js_expr="args") - - return ArgsFunctionOperation.create( - arg_def, - FunctionStringVar.create("addEvents").call( - LiteralVar.create( - [LiteralVar.create(event) for event in value.events] - ), - arg_def_expr, - LiteralVar.create(value.event_actions), - ), - ) + return LiteralEventChainVar.create(value, _var_data=_var_data) if isinstance(value, EventHandler): return Var(_js_expr=".".join(filter(None, get_event_handler_parts(value)))) @@ -2126,9 +2126,16 @@ class NoneVar(Var[None]): """A var representing None.""" +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) class LiteralNoneVar(LiteralVar, NoneVar): """A var representing None.""" + _var_value: None = None + def json(self) -> str: """Serialize the var to a JSON string. diff --git a/tests/units/components/base/test_script.py b/tests/units/components/base/test_script.py index c6b67da11..be62276f2 100644 --- a/tests/units/components/base/test_script.py +++ b/tests/units/components/base/test_script.py @@ -58,14 +58,14 @@ def test_script_event_handler(): ) render_dict = component.render() assert ( - f'onReady={{((...args) => ((addEvents([(Event("{EvState.get_full_name()}.on_ready", ({{ }})))], args, ({{ }})))))}}' + f'onReady={{((...args) => ((addEvents([(Event("{EvState.get_full_name()}.on_ready", ({{ }}), ({{ }})))], args, ({{ }})))))}}' in render_dict["props"] ) assert ( - f'onLoad={{((...args) => ((addEvents([(Event("{EvState.get_full_name()}.on_load", ({{ }})))], args, ({{ }})))))}}' + f'onLoad={{((...args) => ((addEvents([(Event("{EvState.get_full_name()}.on_load", ({{ }}), ({{ }})))], args, ({{ }})))))}}' in render_dict["props"] ) assert ( - f'onError={{((...args) => ((addEvents([(Event("{EvState.get_full_name()}.on_error", ({{ }})))], args, ({{ }})))))}}' + f'onError={{((...args) => ((addEvents([(Event("{EvState.get_full_name()}.on_error", ({{ }}), ({{ }})))], args, ({{ }})))))}}' in render_dict["props"] ) diff --git a/tests/units/components/test_component.py b/tests/units/components/test_component.py index 73d3f611b..5e94db052 100644 --- a/tests/units/components/test_component.py +++ b/tests/units/components/test_component.py @@ -832,7 +832,7 @@ def test_component_event_trigger_arbitrary_args(): assert comp.render()["props"][0] == ( "onFoo={((__e, _alpha, _bravo, _charlie) => ((addEvents(" - f'[(Event("{C1State.get_full_name()}.mock_handler", ({{ ["_e"] : __e["target"]["value"], ["_bravo"] : _bravo["nested"], ["_charlie"] : (_charlie["custom"] + 42) }})))], ' + f'[(Event("{C1State.get_full_name()}.mock_handler", ({{ ["_e"] : __e["target"]["value"], ["_bravo"] : _bravo["nested"], ["_charlie"] : (_charlie["custom"] + 42) }}), ({{ }})))], ' "[__e, _alpha, _bravo, _charlie], ({ })))))}" ) @@ -1178,7 +1178,7 @@ TEST_VAR = LiteralVar.create("test")._replace( ) FORMATTED_TEST_VAR = LiteralVar.create(f"foo{TEST_VAR}bar") STYLE_VAR = TEST_VAR._replace(_js_expr="style") -EVENT_CHAIN_VAR = TEST_VAR._replace(_var_type=EventChain) +EVENT_CHAIN_VAR = TEST_VAR.to(EventChain) ARG_VAR = Var(_js_expr="arg") TEST_VAR_DICT_OF_DICT = LiteralVar.create({"a": {"b": "test"}})._replace( @@ -2159,7 +2159,7 @@ class TriggerState(rx.State): rx.text("random text", on_click=TriggerState.do_something), rx.text( "random text", - on_click=Var(_js_expr="toggleColorMode", _var_type=EventChain), + on_click=Var(_js_expr="toggleColorMode").to(EventChain), ), ), True, @@ -2169,7 +2169,7 @@ class TriggerState(rx.State): rx.text("random text", on_click=rx.console_log("log")), rx.text( "random text", - on_click=Var(_js_expr="toggleColorMode", _var_type=EventChain), + on_click=Var(_js_expr="toggleColorMode").to(EventChain), ), ), False, diff --git a/tests/units/utils/test_format.py b/tests/units/utils/test_format.py index 042c3f323..d7b0c791e 100644 --- a/tests/units/utils/test_format.py +++ b/tests/units/utils/test_format.py @@ -374,7 +374,7 @@ def test_format_match( events=[EventSpec(handler=EventHandler(fn=mock_event))], args_spec=lambda: [], ), - '((...args) => ((addEvents([(Event("mock_event", ({ })))], args, ({ })))))', + '((...args) => ((addEvents([(Event("mock_event", ({ }), ({ })))], args, ({ })))))', ), ( EventChain( @@ -395,7 +395,7 @@ def test_format_match( ], args_spec=lambda e: [e.target.value], ), - '((_e) => ((addEvents([(Event("mock_event", ({ ["arg"] : _e["target"]["value"] })))], [_e], ({ })))))', + '((_e) => ((addEvents([(Event("mock_event", ({ ["arg"] : _e["target"]["value"] }), ({ })))], [_e], ({ })))))', ), ( EventChain( @@ -403,7 +403,19 @@ def test_format_match( args_spec=lambda: [], event_actions={"stopPropagation": True}, ), - '((...args) => ((addEvents([(Event("mock_event", ({ })))], args, ({ ["stopPropagation"] : true })))))', + '((...args) => ((addEvents([(Event("mock_event", ({ }), ({ })))], args, ({ ["stopPropagation"] : true })))))', + ), + ( + EventChain( + events=[ + EventSpec( + handler=EventHandler(fn=mock_event), + event_actions={"stopPropagation": True}, + ) + ], + args_spec=lambda: [], + ), + '((...args) => ((addEvents([(Event("mock_event", ({ }), ({ ["stopPropagation"] : true })))], args, ({ })))))', ), ( EventChain( @@ -411,7 +423,7 @@ def test_format_match( args_spec=lambda: [], event_actions={"preventDefault": True}, ), - '((...args) => ((addEvents([(Event("mock_event", ({ })))], args, ({ ["preventDefault"] : true })))))', + '((...args) => ((addEvents([(Event("mock_event", ({ }), ({ })))], args, ({ ["preventDefault"] : true })))))', ), ({"a": "red", "b": "blue"}, '({ ["a"] : "red", ["b"] : "blue" })'), (Var(_js_expr="var", _var_type=int).guess_type(), "var"), @@ -519,7 +531,7 @@ def test_format_event_handler(input, output): [ ( EventSpec(handler=EventHandler(fn=mock_event)), - '(Event("mock_event", ({ })))', + '(Event("mock_event", ({ }), ({ })))', ), ], ) From 0f8630fb2df80873a248508d4bf112e354364a77 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 3 Oct 2024 15:58:04 -0700 Subject: [PATCH 095/201] remove var operation error (#4053) * remove var operation error * dang it darglint --- reflex/app.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index d8a6f2590..584b8a321 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -431,25 +431,12 @@ class App(MiddlewareMixin, LifespanMixin, Base): The generated component. Raises: - VarOperationTypeError: When an invalid component var related function is passed. - TypeError: When an invalid component function is passed. exceptions.MatchTypeError: If the return types of match cases in rx.match are different. """ - from reflex.utils.exceptions import VarOperationTypeError - try: return component if isinstance(component, Component) else component() except exceptions.MatchTypeError: raise - except TypeError as e: - message = str(e) - if "Var" in message: - raise VarOperationTypeError( - "You may be trying to use an invalid Python function on a state var. " - "When referencing a var inside your render code, only limited var operations are supported. " - "See the var operation docs here: https://reflex.dev/docs/vars/var-operations/" - ) from e - raise e def add_page( self, From fafdeb892e575ac89315c4e632c15d9abedb685f Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 3 Oct 2024 15:58:42 -0700 Subject: [PATCH 096/201] Include emotion inside of dynamic components (#4052) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bundle chakra in window for CSR * remove repeated chakra ui reference * use dynamically generated libraries * remove js from it * include emotion react for dynamic components * make code more readable Co-authored-by: Thomas Brandého * jsx yea * what --------- Co-authored-by: Thomas Brandého --- reflex/components/dynamic.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py index 2e336027b..8d0bab669 100644 --- a/reflex/components/dynamic.py +++ b/reflex/components/dynamic.py @@ -26,7 +26,11 @@ def get_cdn_url(lib: str) -> str: return f"https://cdn.jsdelivr.net/npm/{lib}" + "/+esm" -bundled_libraries = {"react", "@radix-ui/themes"} +bundled_libraries = { + "react", + "@radix-ui/themes", + "@emotion/react", +} def bundle_library(component: "Component"): @@ -127,7 +131,14 @@ def load_dynamic_serializer(): module_code_lines.insert(0, "const React = window.__reflex.react;") - return "//__reflex_evaluate\n" + "\n".join(module_code_lines) + return "\n".join( + [ + "//__reflex_evaluate", + "/** @jsx jsx */", + "const { jsx } = window.__reflex['@emotion/react']", + *module_code_lines, + ] + ) @transform def evaluate_component(js_string: Var[str]) -> Var[Component]: From d77b900bd7a9b05f2d60d6f70120c1e61c08b162 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 3 Oct 2024 19:19:06 -0700 Subject: [PATCH 097/201] [ENG-3867] Garden Variety Pickle (#4054) * Use regular `pickle` module from stdlib * Avoid recreating the rx.State tree for every `get_state` * Remove dill dependency * relock deps --- poetry.lock | 96 +++++++++++++++++--------------------- pyproject.toml | 1 - reflex/state.py | 87 ++++++++++++++++++++++------------ reflex/utils/exceptions.py | 4 ++ 4 files changed, 103 insertions(+), 85 deletions(-) diff --git a/poetry.lock b/poetry.lock index f94a3832a..928731c26 100644 --- a/poetry.lock +++ b/poetry.lock @@ -516,21 +516,6 @@ files = [ {file = "darglint-1.8.1.tar.gz", hash = "sha256:080d5106df149b199822e7ee7deb9c012b49891538f14a11be681044f0bb20da"}, ] -[[package]] -name = "dill" -version = "0.3.8" -description = "serialize all of Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, - {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, -] - -[package.extras] -graph = ["objgraph (>=1.7.2)"] -profile = ["gprof2dot (>=2022.7.29)"] - [[package]] name = "distlib" version = "0.3.8" @@ -719,13 +704,13 @@ files = [ [[package]] name = "httpcore" -version = "1.0.5" +version = "1.0.6" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"}, - {file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"}, + {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"}, + {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"}, ] [package.dependencies] @@ -736,7 +721,7 @@ h11 = ">=0.13,<0.15" asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<0.26.0)"] +trio = ["trio (>=0.22.0,<1.0)"] [[package]] name = "httpx" @@ -863,21 +848,25 @@ test = ["portend", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-c [[package]] name = "jaraco-functools" -version = "4.0.2" +version = "4.1.0" description = "Functools like those found in stdlib" optional = false python-versions = ">=3.8" files = [ - {file = "jaraco.functools-4.0.2-py3-none-any.whl", hash = "sha256:c9d16a3ed4ccb5a889ad8e0b7a343401ee5b2a71cee6ed192d3f68bc351e94e3"}, - {file = "jaraco_functools-4.0.2.tar.gz", hash = "sha256:3460c74cd0d32bf82b9576bbb3527c4364d5b27a21f5158a62aed6c4b42e23f5"}, + {file = "jaraco.functools-4.1.0-py3-none-any.whl", hash = "sha256:ad159f13428bc4acbf5541ad6dec511f91573b90fba04df61dafa2a1231cf649"}, + {file = "jaraco_functools-4.1.0.tar.gz", hash = "sha256:70f7e0e2ae076498e212562325e805204fc092d7b4c17e0e86c959e249701a9d"}, ] [package.dependencies] more-itertools = "*" [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["jaraco.classes", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["jaraco.classes", "pytest (>=6,!=8.1.*)"] +type = ["pytest-mypy"] [[package]] name = "jeepney" @@ -1788,13 +1777,13 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pyproject-hooks" -version = "1.1.0" +version = "1.2.0" description = "Wrappers to call pyproject.toml-based build backend hooks." optional = false python-versions = ">=3.7" files = [ - {file = "pyproject_hooks-1.1.0-py3-none-any.whl", hash = "sha256:7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2"}, - {file = "pyproject_hooks-1.1.0.tar.gz", hash = "sha256:4b37730834edbd6bd37f26ece6b44802fb1c1ee2ece0e54ddff8bfc06db86965"}, + {file = "pyproject_hooks-1.2.0-py3-none-any.whl", hash = "sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913"}, + {file = "pyproject_hooks-1.2.0.tar.gz", hash = "sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8"}, ] [[package]] @@ -1992,13 +1981,13 @@ docs = ["sphinx"] [[package]] name = "python-multipart" -version = "0.0.10" +version = "0.0.12" description = "A streaming multipart parser for Python" optional = false python-versions = ">=3.8" files = [ - {file = "python_multipart-0.0.10-py3-none-any.whl", hash = "sha256:2b06ad9e8d50c7a8db80e3b56dab590137b323410605af2be20d62a5f1ba1dc8"}, - {file = "python_multipart-0.0.10.tar.gz", hash = "sha256:46eb3c6ce6fdda5fb1a03c7e11d490e407c6930a2703fe7aef4da71c374688fa"}, + {file = "python_multipart-0.0.12-py3-none-any.whl", hash = "sha256:43dcf96cf65888a9cd3423544dd0d75ac10f7aa0c3c28a175bbcd00c9ce1aebf"}, + {file = "python_multipart-0.0.12.tar.gz", hash = "sha256:045e1f98d719c1ce085ed7f7e1ef9d8ccc8c02ba02b5566d5f7521410ced58cb"}, ] [[package]] @@ -2143,31 +2132,31 @@ md = ["cmarkgfm (>=0.8.0)"] [[package]] name = "redis" -version = "5.0.8" +version = "5.1.0" description = "Python client for Redis database and key-value store" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "redis-5.0.8-py3-none-any.whl", hash = "sha256:56134ee08ea909106090934adc36f65c9bcbbaecea5b21ba704ba6fb561f8eb4"}, - {file = "redis-5.0.8.tar.gz", hash = "sha256:0c5b10d387568dfe0698c6fad6615750c24170e548ca2deac10c649d463e9870"}, + {file = "redis-5.1.0-py3-none-any.whl", hash = "sha256:fd4fccba0d7f6aa48c58a78d76ddb4afc698f5da4a2c1d03d916e4fd7ab88cdd"}, + {file = "redis-5.1.0.tar.gz", hash = "sha256:b756df1e4a3858fcc0ef861f3fc53623a96c41e2b1f5304e09e0fe758d333d40"}, ] [package.dependencies] async-timeout = {version = ">=4.0.3", markers = "python_full_version < \"3.11.3\""} [package.extras] -hiredis = ["hiredis (>1.0.0)"] -ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] +hiredis = ["hiredis (>=3.0.0)"] +ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==23.2.1)", "requests (>=2.31.0)"] [[package]] name = "reflex-chakra" -version = "0.6.0" +version = "0.6.1" description = "reflex using chakra components" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_chakra-0.6.0-py3-none-any.whl", hash = "sha256:eca1593fca67289e05591dd21fbcc8632c119d64a08bdc41fd995055a114cc91"}, - {file = "reflex_chakra-0.6.0.tar.gz", hash = "sha256:db1c7b48f1ba547bf91e5af103fce6fc7191d7225b414ebfbada7d983e33dd87"}, + {file = "reflex_chakra-0.6.1-py3-none-any.whl", hash = "sha256:824d461264b6d2c836ba4a2a430e677a890b82e83da149672accfc58786442fa"}, + {file = "reflex_chakra-0.6.1.tar.gz", hash = "sha256:4b9b3c8bada19cbb4d1b8d8bc4ab0460ec008a91f380010c34d416d5b613dc07"}, ] [package.dependencies] @@ -2247,18 +2236,19 @@ idna2008 = ["idna"] [[package]] name = "rich" -version = "13.8.1" +version = "13.9.1" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false -python-versions = ">=3.7.0" +python-versions = ">=3.8.0" files = [ - {file = "rich-13.8.1-py3-none-any.whl", hash = "sha256:1760a3c0848469b97b558fc61c85233e3dafb69c7a071b4d60c38099d3cd4c06"}, - {file = "rich-13.8.1.tar.gz", hash = "sha256:8260cda28e3db6bf04d2d1ef4dbc03ba80a824c88b0e7668a0f23126a424844a"}, + {file = "rich-13.9.1-py3-none-any.whl", hash = "sha256:b340e739f30aa58921dc477b8adaa9ecdb7cecc217be01d93730ee1bc8aa83be"}, + {file = "rich-13.9.1.tar.gz", hash = "sha256:097cffdf85db1babe30cc7deba5ab3a29e1b9885047dab24c57e9a7f8a9c1466"}, ] [package.dependencies] markdown-it-py = ">=2.2.0" pygments = ">=2.13.0,<3.0.0" +typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.11\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<9)"] @@ -2595,13 +2585,13 @@ files = [ [[package]] name = "tomli" -version = "2.0.1" +version = "2.0.2" description = "A lil' TOML parser" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, + {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"}, + {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, ] [[package]] @@ -2734,13 +2724,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "uvicorn" -version = "0.30.6" +version = "0.31.0" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" files = [ - {file = "uvicorn-0.30.6-py3-none-any.whl", hash = "sha256:65fd46fe3fda5bdc1b03b94eb634923ff18cd35b2f084813ea79d1f103f711b5"}, - {file = "uvicorn-0.30.6.tar.gz", hash = "sha256:4b15decdda1e72be08209e860a1e10e92439ad5b97cf44cc945fcbee66fc5788"}, + {file = "uvicorn-0.31.0-py3-none-any.whl", hash = "sha256:cac7be4dd4d891c363cd942160a7b02e69150dcbc7a36be04d5f4af4b17c8ced"}, + {file = "uvicorn-0.31.0.tar.gz", hash = "sha256:13bc21373d103859f68fe739608e2eb054a816dea79189bc3ca08ea89a275906"}, ] [package.dependencies] @@ -2753,13 +2743,13 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [[package]] name = "virtualenv" -version = "20.26.5" +version = "20.26.6" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.26.5-py3-none-any.whl", hash = "sha256:4f3ac17b81fba3ce3bd6f4ead2749a72da5929c01774948e243db9ba41df4ff6"}, - {file = "virtualenv-20.26.5.tar.gz", hash = "sha256:ce489cac131aa58f4b25e321d6d186171f78e6cb13fafbf32a840cee67733ff4"}, + {file = "virtualenv-20.26.6-py3-none-any.whl", hash = "sha256:7345cc5b25405607a624d8418154577459c3e0277f5466dd79c49d5e492995f2"}, + {file = "virtualenv-20.26.6.tar.gz", hash = "sha256:280aede09a2a5c317e409a00102e7077c6432c5a38f0ef938e643805a7ad2c48"}, ] [package.dependencies] @@ -3011,4 +3001,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "adccd071775567aeefe219261aeb9e222906c865745f03edb1e770edc79c44ac" +content-hash = "e4b462ebfae90550ba7fa49b360d7110c0d344ee616c23989c22d866ef8f6f31" diff --git a/pyproject.toml b/pyproject.toml index 08c4fbdbc..281741368 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ packages = [ [tool.poetry.dependencies] python = "^3.9" -dill = ">=0.3.8,<0.4" fastapi = ">=0.96.0,!=0.111.0,!=0.111.1" gunicorn = ">=20.1.0,<24.0" jinja2 = ">=3.1.2,<4.0" diff --git a/reflex/state.py b/reflex/state.py index b1988e38a..5798564fa 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -9,6 +9,7 @@ import dataclasses import functools import inspect import os +import pickle import uuid from abc import ABC, abstractmethod from collections import defaultdict @@ -19,6 +20,7 @@ from typing import ( TYPE_CHECKING, Any, AsyncIterator, + BinaryIO, Callable, ClassVar, Dict, @@ -33,7 +35,6 @@ from typing import ( get_type_hints, ) -import dill from sqlalchemy.orm import DeclarativeBase from typing_extensions import Self @@ -76,6 +77,7 @@ from reflex.utils.exceptions import ( ImmutableStateError, LockExpiredError, SetUndefinedStateVarError, + StateSchemaMismatchError, ) from reflex.utils.exec import is_testing_env from reflex.utils.serializers import serializer @@ -1914,7 +1916,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): def __getstate__(self): """Get the state for redis serialization. - This method is called by cloudpickle to serialize the object. + This method is called by pickle to serialize the object. It explicitly removes parent_state and substates because those are serialized separately by the StateManagerRedis to allow for better horizontal scaling as state size increases. @@ -1930,6 +1932,43 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): state["__dict__"].pop("_was_touched", None) return state + def _serialize(self) -> bytes: + """Serialize the state for redis. + + Returns: + The serialized state. + """ + return pickle.dumps((state_to_schema(self), self)) + + @classmethod + def _deserialize( + cls, data: bytes | None = None, fp: BinaryIO | None = None + ) -> BaseState: + """Deserialize the state from redis/disk. + + data and fp are mutually exclusive, but one must be provided. + + Args: + data: The serialized state data. + fp: The file pointer to the serialized state data. + + Returns: + The deserialized state. + + Raises: + ValueError: If both data and fp are provided, or neither are provided. + StateSchemaMismatchError: If the state schema does not match the expected schema. + """ + if data is not None and fp is None: + (substate_schema, state) = pickle.loads(data) + elif fp is not None and data is None: + (substate_schema, state) = pickle.load(fp) + else: + raise ValueError("Only one of `data` or `fp` must be provided") + if substate_schema != state_to_schema(state): + raise StateSchemaMismatchError() + return state + class State(BaseState): """The app Base State.""" @@ -2086,7 +2125,11 @@ class ComponentState(State, mixin=True): """ cls._per_component_state_instance_count += 1 state_cls_name = f"{cls.__name__}_n{cls._per_component_state_instance_count}" - component_state = type(state_cls_name, (cls, State), {}, mixin=False) + component_state = type( + state_cls_name, (cls, State), {"__module__": __name__}, mixin=False + ) + # Save a reference to the dynamic state for pickle/unpickle. + globals()[state_cls_name] = component_state component = component_state.get_component(*children, **props) component.State = component_state return component @@ -2552,7 +2595,7 @@ def is_serializable(value: Any) -> bool: Whether the value is serializable. """ try: - return bool(dill.dumps(value)) + return bool(pickle.dumps(value)) except Exception: return False @@ -2688,8 +2731,7 @@ class StateManagerDisk(StateManager): if token_path.exists(): try: with token_path.open(mode="rb") as file: - (substate_schema, substate) = dill.load(file) - if substate_schema == state_to_schema(substate): + substate = BaseState._deserialize(fp=file) await self.populate_substates(client_token, substate, root_state) return substate except Exception: @@ -2731,10 +2773,12 @@ class StateManagerDisk(StateManager): client_token, substate_address = _split_substate_key(token) root_state_token = _substate_key(client_token, substate_address.split(".")[0]) + root_state = self.states.get(root_state_token) + if root_state is None: + # Create a new root state which will be persisted in the next set_state call. + root_state = self.state(_reflex_internal_init=True) - return await self.load_state( - root_state_token, self.state(_reflex_internal_init=True) - ) + return await self.load_state(root_state_token, root_state) async def set_state_for_substate(self, client_token: str, substate: BaseState): """Set the state for a substate. @@ -2747,7 +2791,7 @@ class StateManagerDisk(StateManager): self.states[substate_token] = substate - state_dilled = dill.dumps((state_to_schema(substate), substate)) + state_dilled = substate._serialize() if not self.states_directory.exists(): self.states_directory.mkdir(parents=True, exist_ok=True) self.token_path(substate_token).write_bytes(state_dilled) @@ -2790,25 +2834,6 @@ class StateManagerDisk(StateManager): await self.set_state(token, state) -# Workaround https://github.com/cloudpipe/cloudpickle/issues/408 for dynamic pydantic classes -if not isinstance(State.validate.__func__, FunctionType): - cython_function_or_method = type(State.validate.__func__) - - @dill.register(cython_function_or_method) - def _dill_reduce_cython_function_or_method(pickler, obj): - # Ignore cython function when pickling. - pass - - -@dill.register(type(State)) -def _dill_reduce_state(pickler, obj): - if obj is not State and issubclass(obj, State): - # Avoid serializing subclasses of State, instead get them by reference from the State class. - pickler.save_reduce(State.get_class_substate, (obj.get_full_name(),), obj=obj) - else: - dill.Pickler.dispatch[type](pickler, obj) - - def _default_lock_expiration() -> int: """Get the default lock expiration time. @@ -2948,7 +2973,7 @@ class StateManagerRedis(StateManager): if redis_state is not None: # Deserialize the substate. - state = dill.loads(redis_state) + state = BaseState._deserialize(data=redis_state) # Populate parent state if missing and requested. if parent_state is None: @@ -3060,7 +3085,7 @@ class StateManagerRedis(StateManager): ) # Persist only the given state (parents or substates are excluded by BaseState.__getstate__). if state._get_was_touched(): - pickle_state = dill.dumps(state, byref=True) + pickle_state = state._serialize() self._warn_if_too_large(state, len(pickle_state)) await self.redis.set( _substate_key(client_token, state), diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 0383f7ba6..8bce605b5 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -123,3 +123,7 @@ class DynamicComponentMissingLibrary(ReflexError, ValueError): class SetUndefinedStateVarError(ReflexError, AttributeError): """Raised when setting the value of a var without first declaring it.""" + + +class StateSchemaMismatchError(ReflexError, TypeError): + """Raised when the serialized schema of a state class does not match the current schema.""" From 9b5a36814ab46ced35638854dfdd1098db0065a0 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 4 Oct 2024 12:27:52 -0700 Subject: [PATCH 098/201] bump version to 0.6.3dev1 (#4061) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 281741368..7d79ddf2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "reflex" -version = "0.6.2dev1" +version = "0.6.3dev1" description = "Web apps in pure Python." license = "Apache-2.0" authors = [ From 12b81ad7543b08fc84ad1b0854d645eaa5cde7e7 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 4 Oct 2024 13:56:25 -0700 Subject: [PATCH 099/201] convert literal type to its variants (#4062) --- reflex/vars/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 0f8a80f8d..7eab62c68 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -547,6 +547,10 @@ class Var(Generic[VAR_TYPE]): return self + if fixed_type is Literal: + args = get_args(var_type) + fixed_type = unionize(*(type(arg) for arg in args)) + if not inspect.isclass(fixed_type): raise TypeError(f"Unsupported type {var_type} for guess_type.") From 1f3be6340ca65cb5c775911ad300f79fab3a95ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 7 Oct 2024 09:27:36 -0700 Subject: [PATCH 100/201] catch CancelledError in lifespan hack for windows (#4083) --- reflex/utils/compat.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/reflex/utils/compat.py b/reflex/utils/compat.py index 27c4753db..b6d198fd4 100644 --- a/reflex/utils/compat.py +++ b/reflex/utils/compat.py @@ -19,10 +19,13 @@ async def windows_hot_reload_lifespan_hack(): import asyncio import sys - while True: - sys.stderr.write("\0") - sys.stderr.flush() - await asyncio.sleep(0.5) + try: + while True: + sys.stderr.write("\0") + sys.stderr.flush() + await asyncio.sleep(0.5) + except asyncio.CancelledError: + pass @contextlib.contextmanager From aa69234b76199812c38f59858dfbb3006e60e2bb Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 7 Oct 2024 09:33:16 -0700 Subject: [PATCH 101/201] Optimize StateManagerDisk (#4056) * Simplify StateManagerDisk implementation * Act more like the memory state manager and only track the root state in self.states * .load_state always loads a single state or returns None * .populate_states is the new entry point in loading from disk and it only occurs when the root state is not known * much fast * StateManagerDisk now acts much more like StateManagerMemory Treat StateManagerDisk like StateManagerMemory for AppHarness * Handle root_state deserialized from disk In this case, we need to initialize the whole state tree, so any non-persistent states will still get default values, whereas on-disk states will overwrite the defaults. * Cache root_state under client_token for StateManagerMemory compatibility Mainly this just makes it easier for us to write tests that work against either Disk or Memory state managers. --- reflex/state.py | 60 ++++++++++++++++++++------------------- reflex/testing.py | 2 -- tests/units/test_state.py | 17 +++-------- 3 files changed, 35 insertions(+), 44 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 5798564fa..96435dbaf 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -2711,34 +2711,24 @@ class StateManagerDisk(StateManager): self.states_directory / f"{md5(token.encode()).hexdigest()}.pkl" ).absolute() - async def load_state(self, token: str, root_state: BaseState) -> BaseState: + async def load_state(self, token: str) -> BaseState | None: """Load a state object based on the provided token. Args: token: The token used to identify the state object. - root_state: The root state object. Returns: - The loaded state object. + The loaded state object or None. """ - if token in self.states: - return self.states[token] - - client_token, substate_address = _split_substate_key(token) - token_path = self.token_path(token) if token_path.exists(): try: with token_path.open(mode="rb") as file: - substate = BaseState._deserialize(fp=file) - await self.populate_substates(client_token, substate, root_state) - return substate + return BaseState._deserialize(fp=file) except Exception: pass - return root_state.get_substate(substate_address.split(".")[1:]) - async def populate_substates( self, client_token: str, state: BaseState, root_state: BaseState ): @@ -2752,10 +2742,13 @@ class StateManagerDisk(StateManager): for substate in state.get_substates(): substate_token = _substate_key(client_token, substate) - substate = await self.load_state(substate_token, root_state) + instance = await self.load_state(substate_token) + if instance is None: + instance = await root_state.get_state(substate) + state.substates[substate.get_name()] = instance + instance.parent_state = state - state.substates[substate.get_name()] = substate - substate.parent_state = state + await self.populate_substates(client_token, instance, root_state) @override async def get_state( @@ -2770,15 +2763,24 @@ class StateManagerDisk(StateManager): Returns: The state for the token. """ - client_token, substate_address = _split_substate_key(token) + client_token = _split_substate_key(token)[0] + root_state = self.states.get(client_token) + if root_state is not None: + # Retrieved state from memory. + return root_state - root_state_token = _substate_key(client_token, substate_address.split(".")[0]) - root_state = self.states.get(root_state_token) + # Deserialize root state from disk. + root_state = await self.load_state(_substate_key(client_token, self.state)) + # Create a new root state tree with all substates instantiated. + fresh_root_state = self.state(_reflex_internal_init=True) if root_state is None: - # Create a new root state which will be persisted in the next set_state call. - root_state = self.state(_reflex_internal_init=True) - - return await self.load_state(root_state_token, root_state) + root_state = fresh_root_state + else: + # Ensure all substates exist, even if they were not serialized previously. + root_state.substates = fresh_root_state.substates + self.states[client_token] = root_state + await self.populate_substates(client_token, root_state, root_state) + return root_state async def set_state_for_substate(self, client_token: str, substate: BaseState): """Set the state for a substate. @@ -2789,12 +2791,12 @@ class StateManagerDisk(StateManager): """ substate_token = _substate_key(client_token, substate) - self.states[substate_token] = substate - - state_dilled = substate._serialize() - if not self.states_directory.exists(): - self.states_directory.mkdir(parents=True, exist_ok=True) - self.token_path(substate_token).write_bytes(state_dilled) + if substate._get_was_touched(): + substate._was_touched = False # Reset the touched flag after serializing. + pickle_state = substate._serialize() + if not self.states_directory.exists(): + self.states_directory.mkdir(parents=True, exist_ok=True) + self.token_path(substate_token).write_bytes(pickle_state) for substate_substate in substate.substates.values(): await self.set_state_for_substate(client_token, substate_substate) diff --git a/reflex/testing.py b/reflex/testing.py index bdbd3dc94..7ea524f1c 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -292,8 +292,6 @@ class AppHarness: if isinstance(self.app_instance._state_manager, StateManagerRedis): # Create our own redis connection for testing. self.state_manager = StateManagerRedis.create(self.app_instance.state) - elif isinstance(self.app_instance._state_manager, StateManagerDisk): - self.state_manager = StateManagerDisk.create(self.app_instance.state) else: self.state_manager = self.app_instance._state_manager diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 5bfac7628..4e783b532 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -1884,11 +1884,11 @@ async def test_state_proxy(grandchild_state: GrandchildState, mock_app: rx.App): async with sp: assert sp._self_actx is not None assert sp._self_mutable # proxy is mutable inside context - if isinstance(mock_app.state_manager, StateManagerMemory): + if isinstance(mock_app.state_manager, (StateManagerMemory, StateManagerDisk)): # For in-process store, only one instance of the state exists assert sp.__wrapped__ is grandchild_state else: - # When redis or disk is used, a new+updated instance is assigned to the proxy + # When redis is used, a new+updated instance is assigned to the proxy assert sp.__wrapped__ is not grandchild_state sp.value2 = "42" assert not sp._self_mutable # proxy is not mutable after exiting context @@ -1899,7 +1899,7 @@ async def test_state_proxy(grandchild_state: GrandchildState, mock_app: rx.App): gotten_state = await mock_app.state_manager.get_state( _substate_key(grandchild_state.router.session.client_token, grandchild_state) ) - if isinstance(mock_app.state_manager, StateManagerMemory): + if isinstance(mock_app.state_manager, (StateManagerMemory, StateManagerDisk)): # For in-process store, only one instance of the state exists assert gotten_state is parent_state else: @@ -2922,7 +2922,7 @@ async def test_get_state(mock_app: rx.App, token: str): _substate_key(token, ChildState2) ) assert isinstance(new_test_state, TestState) - if isinstance(mock_app.state_manager, StateManagerMemory): + if isinstance(mock_app.state_manager, (StateManagerMemory, StateManagerDisk)): # In memory, it's the same instance assert new_test_state is test_state test_state._clean() @@ -2932,15 +2932,6 @@ async def test_get_state(mock_app: rx.App, token: str): ChildState2.get_name(), ChildState3.get_name(), ) - elif isinstance(mock_app.state_manager, StateManagerDisk): - # On disk, it's a new instance - assert new_test_state is not test_state - # All substates are available - assert tuple(sorted(new_test_state.substates)) == ( - ChildState.get_name(), - ChildState2.get_name(), - ChildState3.get_name(), - ) else: # With redis, we get a whole new instance assert new_test_state is not test_state From 5c0518053d6007af4e0b787c59bb17486b9243e9 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 7 Oct 2024 09:33:44 -0700 Subject: [PATCH 102/201] Get default for backend var defined in mixin (#4060) * Get default for backend var defined in mixin If the backend var is defined in a mixin class, it won't appear in `cls.__dict__`, but the value is still retrievable via `getattr` on `cls`. Prefer to use the actual defined default before using `Var.get_default_value()`. If `Var.get_default_value()` fails, set the default to `None` such that the backend var still gets recognized as a backend var when it is used on `self`. ---- Update test_component_state to include backend vars Extra coverage for backend vars with and without defaults, defined in a ComponentState/mixin class. * fix integration test --- reflex/state.py | 24 +++++++++++- tests/integration/test_component_state.py | 46 ++++++++++++++++++++++- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 96435dbaf..26bef5d7e 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -461,10 +461,10 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): for name, value in cls.__dict__.items() if types.is_backend_base_variable(name, cls) } - # Add annotated backend vars that do not have a default value. + # Add annotated backend vars that may not have a default value. new_backend_vars.update( { - name: Var("", _var_type=annotation_value).get_default_value() + name: cls._get_var_default(name, annotation_value) for name, annotation_value in get_type_hints(cls).items() if name not in new_backend_vars and types.is_backend_base_variable(name, cls) @@ -990,6 +990,26 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): # Ensure frontend uses null coalescing when accessing. object.__setattr__(prop, "_var_type", Optional[prop._var_type]) + @classmethod + def _get_var_default(cls, name: str, annotation_value: Any) -> Any: + """Get the default value of a (backend) var. + + Args: + name: The name of the var. + annotation_value: The annotation value of the var. + + Returns: + The default value of the var or None. + """ + try: + return getattr(cls, name) + except AttributeError: + try: + return Var("", _var_type=annotation_value).get_default_value() + except TypeError: + pass + return None + @staticmethod def _get_base_functions() -> dict[str, FunctionType]: """Get all functions of the state class excluding dunder methods. diff --git a/tests/integration/test_component_state.py b/tests/integration/test_component_state.py index 77b8b3fa1..7b35f8116 100644 --- a/tests/integration/test_component_state.py +++ b/tests/integration/test_component_state.py @@ -5,6 +5,7 @@ from typing import Generator import pytest from selenium.webdriver.common.by import By +from reflex.state import State, _substate_key from reflex.testing import AppHarness from . import utils @@ -12,13 +13,21 @@ from . import utils def ComponentStateApp(): """App using per component state.""" + from typing import Generic, TypeVar + import reflex as rx - class MultiCounter(rx.ComponentState): + E = TypeVar("E") + + class MultiCounter(rx.ComponentState, Generic[E]): count: int = 0 + _be: E + _be_int: int + _be_str: str = "42" def increment(self): self.count += 1 + self._be = self.count # type: ignore @classmethod def get_component(cls, *children, **props): @@ -48,6 +57,14 @@ def ComponentStateApp(): on_click=mc_a.State.increment, # type: ignore id="inc-a", ), + rx.text( + mc_a.State.get_name() if mc_a.State is not None else "", + id="a_state_name", + ), + rx.text( + mc_b.State.get_name() if mc_b.State is not None else "", + id="b_state_name", + ), ) @@ -80,6 +97,7 @@ async def test_component_state_app(component_state_app: AppHarness): ss = utils.SessionStorage(driver) assert AppHarness._poll_for(lambda: ss.get("token") is not None), "token not found" + root_state_token = _substate_key(ss.get("token"), State) count_a = driver.find_element(By.ID, "count-a") count_b = driver.find_element(By.ID, "count-b") @@ -87,6 +105,18 @@ async def test_component_state_app(component_state_app: AppHarness): button_b = driver.find_element(By.ID, "button-b") button_inc_a = driver.find_element(By.ID, "inc-a") + # Check that backend vars in mixins are okay + a_state_name = driver.find_element(By.ID, "a_state_name").text + b_state_name = driver.find_element(By.ID, "b_state_name").text + root_state = await component_state_app.get_state(root_state_token) + a_state = root_state.substates[a_state_name] + b_state = root_state.substates[b_state_name] + assert a_state._backend_vars == a_state.backend_vars + assert a_state._backend_vars == b_state._backend_vars + assert a_state._backend_vars["_be"] is None + assert a_state._backend_vars["_be_int"] == 0 + assert a_state._backend_vars["_be_str"] == "42" + assert count_a.text == "0" button_a.click() @@ -98,6 +128,14 @@ async def test_component_state_app(component_state_app: AppHarness): button_inc_a.click() assert component_state_app.poll_for_content(count_a, exp_not_equal="2") == "3" + root_state = await component_state_app.get_state(root_state_token) + a_state = root_state.substates[a_state_name] + b_state = root_state.substates[b_state_name] + assert a_state._backend_vars != a_state.backend_vars + assert a_state._be == a_state._backend_vars["_be"] == 3 + assert b_state._be is None + assert b_state._backend_vars["_be"] is None + assert count_b.text == "0" button_b.click() @@ -105,3 +143,9 @@ async def test_component_state_app(component_state_app: AppHarness): button_b.click() assert component_state_app.poll_for_content(count_b, exp_not_equal="1") == "2" + + root_state = await component_state_app.get_state(root_state_token) + a_state = root_state.substates[a_state_name] + b_state = root_state.substates[b_state_name] + assert b_state._backend_vars != b_state.backend_vars + assert b_state._be == b_state._backend_vars["_be"] == 2 From edd17208c05596766451b31f59e2817342b95c6a Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 7 Oct 2024 09:34:36 -0700 Subject: [PATCH 103/201] Reduce pickle size (#4063) * Only serialize base vars * Never serialize router/router_data in substates * Hash the schema to reduce serialized size * lru_cache the schema to avoid recomputing it --- reflex/state.py | 76 ++++++++++++++---------- tests/integration/test_dynamic_routes.py | 6 +- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 26bef5d7e..8210c1500 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -691,6 +691,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): parent_state.get_parent_state(), ) + # Reset cached schema value + cls._to_schema.cache_clear() + @classmethod def _check_overridden_methods(cls): """Check for shadow methods and raise error if any. @@ -1945,20 +1948,58 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): The state dict for serialization. """ state = super().__getstate__() - # Never serialize parent_state or substates state["__dict__"] = state["__dict__"].copy() + if state["__dict__"].get("parent_state") is not None: + # Do not serialize router data in substates (only the root state). + state["__dict__"].pop("router", None) + state["__dict__"].pop("router_data", None) + # Never serialize parent_state or substates. state["__dict__"]["parent_state"] = None state["__dict__"]["substates"] = {} state["__dict__"].pop("_was_touched", None) + # Remove all inherited vars. + for inherited_var_name in self.inherited_vars: + state["__dict__"].pop(inherited_var_name, None) return state + @classmethod + @functools.lru_cache() + def _to_schema(cls) -> str: + """Convert a state to a schema. + + Returns: + The hash of the schema. + """ + + def _field_tuple( + field_name: str, + ) -> Tuple[str, str, Any, Union[bool, None], Any]: + model_field = cls.__fields__[field_name] + return ( + field_name, + model_field.name, + _serialize_type(model_field.type_), + ( + model_field.required + if isinstance(model_field.required, bool) + else None + ), + (model_field.default if is_serializable(model_field.default) else None), + ) + + return md5( + pickle.dumps( + list(sorted(_field_tuple(field_name) for field_name in cls.base_vars)) + ) + ).hexdigest() + def _serialize(self) -> bytes: """Serialize the state for redis. Returns: The serialized state. """ - return pickle.dumps((state_to_schema(self), self)) + return pickle.dumps((self._to_schema(), self)) @classmethod def _deserialize( @@ -1985,7 +2026,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): (substate_schema, state) = pickle.load(fp) else: raise ValueError("Only one of `data` or `fp` must be provided") - if substate_schema != state_to_schema(state): + if substate_schema != state._to_schema(): raise StateSchemaMismatchError() return state @@ -2620,35 +2661,6 @@ def is_serializable(value: Any) -> bool: return False -def state_to_schema( - state: BaseState, -) -> List[Tuple[str, str, Any, Union[bool, None], Any]]: - """Convert a state to a schema. - - Args: - state: The state to convert to a schema. - - Returns: - The schema. - """ - return list( - sorted( - ( - field_name, - model_field.name, - _serialize_type(model_field.type_), - ( - model_field.required - if isinstance(model_field.required, bool) - else None - ), - (model_field.default if is_serializable(model_field.default) else None), - ) - for field_name, model_field in state.__fields__.items() - ) - ) - - def reset_disk_state_manager(): """Reset the disk state manager.""" states_directory = prerequisites.get_web_dir() / constants.Dirs.STATES diff --git a/tests/integration/test_dynamic_routes.py b/tests/integration/test_dynamic_routes.py index 5ba0b7bda..35b83790f 100644 --- a/tests/integration/test_dynamic_routes.py +++ b/tests/integration/test_dynamic_routes.py @@ -41,13 +41,13 @@ def DynamicRoute(): return rx.fragment( rx.input( value=DynamicState.router.session.client_token, - is_read_only=True, + read_only=True, id="token", ), - rx.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore + rx.input(value=rx.State.page_id, read_only=True, id="page_id"), # type: ignore rx.input( value=DynamicState.router.page.raw_path, - is_read_only=True, + read_only=True, id="raw_path", ), rx.link("index", href="/", id="link_index"), From 47230198bbd5d39d530c2f1297c6f601106cc5f8 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 7 Oct 2024 09:36:22 -0700 Subject: [PATCH 104/201] bundle next link in window (#4064) --- reflex/components/dynamic.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py index 8d0bab669..9c498fb61 100644 --- a/reflex/components/dynamic.py +++ b/reflex/components/dynamic.py @@ -1,6 +1,6 @@ """Components that are dynamically generated on the backend.""" -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Union from reflex import constants from reflex.utils import imports @@ -26,14 +26,10 @@ def get_cdn_url(lib: str) -> str: return f"https://cdn.jsdelivr.net/npm/{lib}" + "/+esm" -bundled_libraries = { - "react", - "@radix-ui/themes", - "@emotion/react", -} +bundled_libraries = {"react", "@radix-ui/themes", "@emotion/react", "next/link"} -def bundle_library(component: "Component"): +def bundle_library(component: Union["Component", str]): """Bundle a library with the component. Args: @@ -42,6 +38,9 @@ def bundle_library(component: "Component"): Raises: DynamicComponentMissingLibrary: Raised when a dynamic component is missing a library. """ + if isinstance(component, str): + bundled_libraries.add(component) + return if component.library is None: raise DynamicComponentMissingLibrary("Component must have a library to bundle.") bundled_libraries.add(format_library_name(component.library)) From 7cd5c904cb0c72e0e6f596f150eeedb18af0a6e8 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 7 Oct 2024 09:37:44 -0700 Subject: [PATCH 105/201] misc var improvements (#4068) --- reflex/vars/object.py | 2 ++ reflex/vars/sequence.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/reflex/vars/object.py b/reflex/vars/object.py index 1158bba9a..a9175a703 100644 --- a/reflex/vars/object.py +++ b/reflex/vars/object.py @@ -119,6 +119,8 @@ class ObjectVar(Var[OBJECT_TYPE]): """ return object_entries_operation(self) + items = entries + def merge(self, other: ObjectVar): """Merge two objects. diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 15c7411a6..3374ee10f 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -884,6 +884,12 @@ class ArrayVar(Var[ARRAY_VAR_TYPE]): i: int | NumberVar, ) -> ArrayVar[Set[INNER_ARRAY_VAR]]: ... + @overload + def __getitem__( + self: ARRAY_VAR_OF_LIST_ELEMENT[Tuple[KEY_TYPE, VALUE_TYPE]], + i: int | NumberVar, + ) -> ArrayVar[Tuple[KEY_TYPE, VALUE_TYPE]]: ... + @overload def __getitem__( self: ARRAY_VAR_OF_LIST_ELEMENT[Tuple[INNER_ARRAY_VAR, ...]], From 59dd54c049e62562b92b6d4ecdfe4a9965d86daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 7 Oct 2024 11:57:02 -0700 Subject: [PATCH 106/201] add workflow to check dependencies on release branch (#4050) * add workflow to check dependencies on release branch * rename action to follow convention of other actions * update workflow * bump poetry version * relock deps * update check to ignore pyright and ruff * oops, you saw nothing * split dep check in two job * fix frontend dep check * fix stuff * hmm yeah * nope nope nope * sigh * bump js versions for some packages * fix some warnings in tests * fix tests * try some options * try to set asyncio policy * debug dep check * fix attempt for backend dep * clean up output for backend check * run bun outdated on reflex-web to catch most of the packages * fix python version * fix python version * add missing env * fix bun command * fix workdir of frontend check * update packages version * up-pin plotly.js version * add debug ouput * clean frontend dep check output * fix output * fix async tests for redis * relock poetry.lock * Non-async functions do not need pytest_asyncio.fixture * test_state: close StateManagerRedis connection in test to avoid warning --------- Co-authored-by: Masen Furer --- .github/actions/setup_build_env/action.yml | 2 +- .../workflows/check_outdated_dependencies.yml | 88 +++++++++ poetry.lock | 185 +++++++++--------- pyproject.toml | 12 +- reflex/components/core/upload.py | 2 +- reflex/components/datadisplay/dataeditor.py | 4 +- reflex/components/gridjs/datatable.py | 4 +- reflex/components/markdown/markdown.py | 10 +- reflex/components/plotly/plotly.py | 2 +- reflex/components/radix/primitives/form.py | 2 +- .../components/react_player/react_player.py | 2 +- reflex/components/sonner/toast.py | 2 +- reflex/constants/installer.py | 28 +-- reflex/constants/style.py | 2 +- tests/units/components/core/test_cond.py | 4 +- tests/units/components/core/test_foreach.py | 4 +- tests/units/components/core/test_upload.py | 14 +- tests/{ => units}/components/el/test_svg.py | 0 tests/units/conftest.py | 6 + tests/units/test_app.py | 3 +- tests/units/test_state.py | 23 ++- tests/units/test_state_tree.py | 12 +- tests/units/utils/test_serializers.py | 8 +- 23 files changed, 267 insertions(+), 152 deletions(-) create mode 100644 .github/workflows/check_outdated_dependencies.yml rename tests/{ => units}/components/el/test_svg.py (100%) diff --git a/.github/actions/setup_build_env/action.yml b/.github/actions/setup_build_env/action.yml index 560b53749..a25f0ae44 100644 --- a/.github/actions/setup_build_env/action.yml +++ b/.github/actions/setup_build_env/action.yml @@ -18,7 +18,7 @@ inputs: poetry-version: description: 'Poetry version to install' required: false - default: '1.3.1' + default: '1.8.3' run-poetry-install: description: 'Whether to run poetry install on current dir' required: false diff --git a/.github/workflows/check_outdated_dependencies.yml b/.github/workflows/check_outdated_dependencies.yml new file mode 100644 index 000000000..d5b9292f6 --- /dev/null +++ b/.github/workflows/check_outdated_dependencies.yml @@ -0,0 +1,88 @@ +name: check-outdated-dependencies + +on: + push: # This will trigger the action when a pull request is opened or updated. + branches: + - 'release/**' # This will trigger the action when any branch starting with "release/" is created. + workflow_dispatch: # Allow manual triggering if needed. + +jobs: + backend: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - uses: ./.github/actions/setup_build_env + with: + python-version: '3.9' + run-poetry-install: true + create-venv-at-path: .venv + + - name: Check outdated backend dependencies + run: | + outdated=$(poetry show -oT) + echo "Outdated:" + echo "$outdated" + + filtered_outdated=$(echo "$outdated" | grep -vE 'pyright|ruff' || true) + + if [ ! -z "$filtered_outdated" ]; then + echo "Outdated dependencies found:" + echo "$filtered_outdated" + exit 1 + else + echo "All dependencies are up to date. (pyright and ruff are ignored)" + fi + + + frontend: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + - uses: ./.github/actions/setup_build_env + with: + python-version: '3.10.11' + run-poetry-install: true + create-venv-at-path: .venv + - name: Clone Reflex Website Repo + uses: actions/checkout@v4 + with: + repository: reflex-dev/reflex-web + ref: main + path: reflex-web + - name: Install Requirements for reflex-web + working-directory: ./reflex-web + run: poetry run uv pip install -r requirements.txt + - name: Install additional dependencies for DB access + run: poetry run uv pip install psycopg2-binary + - name: Init Website for reflex-web + working-directory: ./reflex-web + run: poetry run reflex init + - name: Run Website and Check for errors + run: | + poetry run bash scripts/integration.sh ./reflex-web dev + - name: Check outdated frontend dependencies + working-directory: ./reflex-web/.web + run: | + raw_outdated=$(/home/runner/.local/share/reflex/bun/bin/bun outdated) + outdated=$(echo "$raw_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\|' || true) + echo "Outdated:" + echo "$outdated" + + # Ignore 3rd party dependencies that are not updated. + filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion' || true) + no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true) + + + if [ ! -z "$no_extra" ]; then + echo "Outdated dependencies found:" + echo "$filtered_outdated" + exit 1 + else + echo "All dependencies are up to date. (3rd party packages are ignored)" + fi + diff --git a/poetry.lock b/poetry.lock index 928731c26..158574222 100644 --- a/poetry.lock +++ b/poetry.lock @@ -121,13 +121,13 @@ files = [ [[package]] name = "build" -version = "1.2.2" +version = "1.2.2.post1" description = "A simple, correct Python build frontend" optional = false python-versions = ">=3.8" files = [ - {file = "build-1.2.2-py3-none-any.whl", hash = "sha256:277ccc71619d98afdd841a0e96ac9fe1593b823af481d3b0cea748e8894e0613"}, - {file = "build-1.2.2.tar.gz", hash = "sha256:119b2fb462adef986483438377a13b2f42064a2a3a4161f24a0cca698a07ac8c"}, + {file = "build-1.2.2.post1-py3-none-any.whl", hash = "sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5"}, + {file = "build-1.2.2.post1.tar.gz", hash = "sha256:b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7"}, ] [package.dependencies] @@ -1174,64 +1174,64 @@ files = [ [[package]] name = "numpy" -version = "2.1.1" +version = "2.1.2" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.10" files = [ - {file = "numpy-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8a0e34993b510fc19b9a2ce7f31cb8e94ecf6e924a40c0c9dd4f62d0aac47d9"}, - {file = "numpy-2.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7dd86dfaf7c900c0bbdcb8b16e2f6ddf1eb1fe39c6c8cca6e94844ed3152a8fd"}, - {file = "numpy-2.1.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:5889dd24f03ca5a5b1e8a90a33b5a0846d8977565e4ae003a63d22ecddf6782f"}, - {file = "numpy-2.1.1-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:59ca673ad11d4b84ceb385290ed0ebe60266e356641428c845b39cd9df6713ab"}, - {file = "numpy-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:13ce49a34c44b6de5241f0b38b07e44c1b2dcacd9e36c30f9c2fcb1bb5135db7"}, - {file = "numpy-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:913cc1d311060b1d409e609947fa1b9753701dac96e6581b58afc36b7ee35af6"}, - {file = "numpy-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:caf5d284ddea7462c32b8d4a6b8af030b6c9fd5332afb70e7414d7fdded4bfd0"}, - {file = "numpy-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:57eb525e7c2a8fdee02d731f647146ff54ea8c973364f3b850069ffb42799647"}, - {file = "numpy-2.1.1-cp310-cp310-win32.whl", hash = "sha256:9a8e06c7a980869ea67bbf551283bbed2856915f0a792dc32dd0f9dd2fb56728"}, - {file = "numpy-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:d10c39947a2d351d6d466b4ae83dad4c37cd6c3cdd6d5d0fa797da56f710a6ae"}, - {file = "numpy-2.1.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0d07841fd284718feffe7dd17a63a2e6c78679b2d386d3e82f44f0108c905550"}, - {file = "numpy-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b5613cfeb1adfe791e8e681128f5f49f22f3fcaa942255a6124d58ca59d9528f"}, - {file = "numpy-2.1.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:0b8cc2715a84b7c3b161f9ebbd942740aaed913584cae9cdc7f8ad5ad41943d0"}, - {file = "numpy-2.1.1-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:b49742cdb85f1f81e4dc1b39dcf328244f4d8d1ded95dea725b316bd2cf18c95"}, - {file = "numpy-2.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8d5f8a8e3bc87334f025194c6193e408903d21ebaeb10952264943a985066ca"}, - {file = "numpy-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d51fc141ddbe3f919e91a096ec739f49d686df8af254b2053ba21a910ae518bf"}, - {file = "numpy-2.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:98ce7fb5b8063cfdd86596b9c762bf2b5e35a2cdd7e967494ab78a1fa7f8b86e"}, - {file = "numpy-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:24c2ad697bd8593887b019817ddd9974a7f429c14a5469d7fad413f28340a6d2"}, - {file = "numpy-2.1.1-cp311-cp311-win32.whl", hash = "sha256:397bc5ce62d3fb73f304bec332171535c187e0643e176a6e9421a6e3eacef06d"}, - {file = "numpy-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:ae8ce252404cdd4de56dcfce8b11eac3c594a9c16c231d081fb705cf23bd4d9e"}, - {file = "numpy-2.1.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c803b7934a7f59563db459292e6aa078bb38b7ab1446ca38dd138646a38203e"}, - {file = "numpy-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6435c48250c12f001920f0751fe50c0348f5f240852cfddc5e2f97e007544cbe"}, - {file = "numpy-2.1.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3269c9eb8745e8d975980b3a7411a98976824e1fdef11f0aacf76147f662b15f"}, - {file = "numpy-2.1.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:fac6e277a41163d27dfab5f4ec1f7a83fac94e170665a4a50191b545721c6521"}, - {file = "numpy-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fcd8f556cdc8cfe35e70efb92463082b7f43dd7e547eb071ffc36abc0ca4699b"}, - {file = "numpy-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b9cd92c8f8e7b313b80e93cedc12c0112088541dcedd9197b5dee3738c1201"}, - {file = "numpy-2.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:afd9c680df4de71cd58582b51e88a61feed4abcc7530bcd3d48483f20fc76f2a"}, - {file = "numpy-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8661c94e3aad18e1ea17a11f60f843a4933ccaf1a25a7c6a9182af70610b2313"}, - {file = "numpy-2.1.1-cp312-cp312-win32.whl", hash = "sha256:950802d17a33c07cba7fd7c3dcfa7d64705509206be1606f196d179e539111ed"}, - {file = "numpy-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:3fc5eabfc720db95d68e6646e88f8b399bfedd235994016351b1d9e062c4b270"}, - {file = "numpy-2.1.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:046356b19d7ad1890c751b99acad5e82dc4a02232013bd9a9a712fddf8eb60f5"}, - {file = "numpy-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:6e5a9cb2be39350ae6c8f79410744e80154df658d5bea06e06e0ac5bb75480d5"}, - {file = "numpy-2.1.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:d4c57b68c8ef5e1ebf47238e99bf27657511ec3f071c465f6b1bccbef12d4136"}, - {file = "numpy-2.1.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:8ae0fd135e0b157365ac7cc31fff27f07a5572bdfc38f9c2d43b2aff416cc8b0"}, - {file = "numpy-2.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:981707f6b31b59c0c24bcda52e5605f9701cb46da4b86c2e8023656ad3e833cb"}, - {file = "numpy-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ca4b53e1e0b279142113b8c5eb7d7a877e967c306edc34f3b58e9be12fda8df"}, - {file = "numpy-2.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e097507396c0be4e547ff15b13dc3866f45f3680f789c1a1301b07dadd3fbc78"}, - {file = "numpy-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7506387e191fe8cdb267f912469a3cccc538ab108471291636a96a54e599556"}, - {file = "numpy-2.1.1-cp313-cp313-win32.whl", hash = "sha256:251105b7c42abe40e3a689881e1793370cc9724ad50d64b30b358bbb3a97553b"}, - {file = "numpy-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:f212d4f46b67ff604d11fff7cc62d36b3e8714edf68e44e9760e19be38c03eb0"}, - {file = "numpy-2.1.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:920b0911bb2e4414c50e55bd658baeb78281a47feeb064ab40c2b66ecba85553"}, - {file = "numpy-2.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:bab7c09454460a487e631ffc0c42057e3d8f2a9ddccd1e60c7bb8ed774992480"}, - {file = "numpy-2.1.1-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:cea427d1350f3fd0d2818ce7350095c1a2ee33e30961d2f0fef48576ddbbe90f"}, - {file = "numpy-2.1.1-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:e30356d530528a42eeba51420ae8bf6c6c09559051887196599d96ee5f536468"}, - {file = "numpy-2.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8dfa9e94fc127c40979c3eacbae1e61fda4fe71d84869cc129e2721973231ef"}, - {file = "numpy-2.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:910b47a6d0635ec1bd53b88f86120a52bf56dcc27b51f18c7b4a2e2224c29f0f"}, - {file = "numpy-2.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:13cc11c00000848702322af4de0147ced365c81d66053a67c2e962a485b3717c"}, - {file = "numpy-2.1.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:53e27293b3a2b661c03f79aa51c3987492bd4641ef933e366e0f9f6c9bf257ec"}, - {file = "numpy-2.1.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7be6a07520b88214ea85d8ac8b7d6d8a1839b0b5cb87412ac9f49fa934eb15d5"}, - {file = "numpy-2.1.1-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:52ac2e48f5ad847cd43c4755520a2317f3380213493b9d8a4c5e37f3b87df504"}, - {file = "numpy-2.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50a95ca3560a6058d6ea91d4629a83a897ee27c00630aed9d933dff191f170cd"}, - {file = "numpy-2.1.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:99f4a9ee60eed1385a86e82288971a51e71df052ed0b2900ed30bc840c0f2e39"}, - {file = "numpy-2.1.1.tar.gz", hash = "sha256:d0cf7d55b1051387807405b3898efafa862997b4cba8aa5dbe657be794afeafd"}, + {file = "numpy-2.1.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:30d53720b726ec36a7f88dc873f0eec8447fbc93d93a8f079dfac2629598d6ee"}, + {file = "numpy-2.1.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e8d3ca0a72dd8846eb6f7dfe8f19088060fcb76931ed592d29128e0219652884"}, + {file = "numpy-2.1.2-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:fc44e3c68ff00fd991b59092a54350e6e4911152682b4782f68070985aa9e648"}, + {file = "numpy-2.1.2-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:7c1c60328bd964b53f8b835df69ae8198659e2b9302ff9ebb7de4e5a5994db3d"}, + {file = "numpy-2.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6cdb606a7478f9ad91c6283e238544451e3a95f30fb5467fbf715964341a8a86"}, + {file = "numpy-2.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d666cb72687559689e9906197e3bec7b736764df6a2e58ee265e360663e9baf7"}, + {file = "numpy-2.1.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c6eef7a2dbd0abfb0d9eaf78b73017dbfd0b54051102ff4e6a7b2980d5ac1a03"}, + {file = "numpy-2.1.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:12edb90831ff481f7ef5f6bc6431a9d74dc0e5ff401559a71e5e4611d4f2d466"}, + {file = "numpy-2.1.2-cp310-cp310-win32.whl", hash = "sha256:a65acfdb9c6ebb8368490dbafe83c03c7e277b37e6857f0caeadbbc56e12f4fb"}, + {file = "numpy-2.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:860ec6e63e2c5c2ee5e9121808145c7bf86c96cca9ad396c0bd3e0f2798ccbe2"}, + {file = "numpy-2.1.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b42a1a511c81cc78cbc4539675713bbcf9d9c3913386243ceff0e9429ca892fe"}, + {file = "numpy-2.1.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:faa88bc527d0f097abdc2c663cddf37c05a1c2f113716601555249805cf573f1"}, + {file = "numpy-2.1.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:c82af4b2ddd2ee72d1fc0c6695048d457e00b3582ccde72d8a1c991b808bb20f"}, + {file = "numpy-2.1.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:13602b3174432a35b16c4cfb5de9a12d229727c3dd47a6ce35111f2ebdf66ff4"}, + {file = "numpy-2.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ebec5fd716c5a5b3d8dfcc439be82a8407b7b24b230d0ad28a81b61c2f4659a"}, + {file = "numpy-2.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2b49c3c0804e8ecb05d59af8386ec2f74877f7ca8fd9c1e00be2672e4d399b1"}, + {file = "numpy-2.1.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2cbba4b30bf31ddbe97f1c7205ef976909a93a66bb1583e983adbd155ba72ac2"}, + {file = "numpy-2.1.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8e00ea6fc82e8a804433d3e9cedaa1051a1422cb6e443011590c14d2dea59146"}, + {file = "numpy-2.1.2-cp311-cp311-win32.whl", hash = "sha256:5006b13a06e0b38d561fab5ccc37581f23c9511879be7693bd33c7cd15ca227c"}, + {file = "numpy-2.1.2-cp311-cp311-win_amd64.whl", hash = "sha256:f1eb068ead09f4994dec71c24b2844f1e4e4e013b9629f812f292f04bd1510d9"}, + {file = "numpy-2.1.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7bf0a4f9f15b32b5ba53147369e94296f5fffb783db5aacc1be15b4bf72f43b"}, + {file = "numpy-2.1.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b1d0fcae4f0949f215d4632be684a539859b295e2d0cb14f78ec231915d644db"}, + {file = "numpy-2.1.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:f751ed0a2f250541e19dfca9f1eafa31a392c71c832b6bb9e113b10d050cb0f1"}, + {file = "numpy-2.1.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:bd33f82e95ba7ad632bc57837ee99dba3d7e006536200c4e9124089e1bf42426"}, + {file = "numpy-2.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b8cde4f11f0a975d1fd59373b32e2f5a562ade7cde4f85b7137f3de8fbb29a0"}, + {file = "numpy-2.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d95f286b8244b3649b477ac066c6906fbb2905f8ac19b170e2175d3d799f4df"}, + {file = "numpy-2.1.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ab4754d432e3ac42d33a269c8567413bdb541689b02d93788af4131018cbf366"}, + {file = "numpy-2.1.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e585c8ae871fd38ac50598f4763d73ec5497b0de9a0ab4ef5b69f01c6a046142"}, + {file = "numpy-2.1.2-cp312-cp312-win32.whl", hash = "sha256:9c6c754df29ce6a89ed23afb25550d1c2d5fdb9901d9c67a16e0b16eaf7e2550"}, + {file = "numpy-2.1.2-cp312-cp312-win_amd64.whl", hash = "sha256:456e3b11cb79ac9946c822a56346ec80275eaf2950314b249b512896c0d2505e"}, + {file = "numpy-2.1.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a84498e0d0a1174f2b3ed769b67b656aa5460c92c9554039e11f20a05650f00d"}, + {file = "numpy-2.1.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4d6ec0d4222e8ffdab1744da2560f07856421b367928026fb540e1945f2eeeaf"}, + {file = "numpy-2.1.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:259ec80d54999cc34cd1eb8ded513cb053c3bf4829152a2e00de2371bd406f5e"}, + {file = "numpy-2.1.2-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:675c741d4739af2dc20cd6c6a5c4b7355c728167845e3c6b0e824e4e5d36a6c3"}, + {file = "numpy-2.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:05b2d4e667895cc55e3ff2b56077e4c8a5604361fc21a042845ea3ad67465aa8"}, + {file = "numpy-2.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:43cca367bf94a14aca50b89e9bc2061683116cfe864e56740e083392f533ce7a"}, + {file = "numpy-2.1.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:76322dcdb16fccf2ac56f99048af32259dcc488d9b7e25b51e5eca5147a3fb98"}, + {file = "numpy-2.1.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:32e16a03138cabe0cb28e1007ee82264296ac0983714094380b408097a418cfe"}, + {file = "numpy-2.1.2-cp313-cp313-win32.whl", hash = "sha256:242b39d00e4944431a3cd2db2f5377e15b5785920421993770cddb89992c3f3a"}, + {file = "numpy-2.1.2-cp313-cp313-win_amd64.whl", hash = "sha256:f2ded8d9b6f68cc26f8425eda5d3877b47343e68ca23d0d0846f4d312ecaa445"}, + {file = "numpy-2.1.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:2ffef621c14ebb0188a8633348504a35c13680d6da93ab5cb86f4e54b7e922b5"}, + {file = "numpy-2.1.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:ad369ed238b1959dfbade9018a740fb9392c5ac4f9b5173f420bd4f37ba1f7a0"}, + {file = "numpy-2.1.2-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:d82075752f40c0ddf57e6e02673a17f6cb0f8eb3f587f63ca1eaab5594da5b17"}, + {file = "numpy-2.1.2-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:1600068c262af1ca9580a527d43dc9d959b0b1d8e56f8a05d830eea39b7c8af6"}, + {file = "numpy-2.1.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a26ae94658d3ba3781d5e103ac07a876b3e9b29db53f68ed7df432fd033358a8"}, + {file = "numpy-2.1.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13311c2db4c5f7609b462bc0f43d3c465424d25c626d95040f073e30f7570e35"}, + {file = "numpy-2.1.2-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:2abbf905a0b568706391ec6fa15161fad0fb5d8b68d73c461b3c1bab6064dd62"}, + {file = "numpy-2.1.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:ef444c57d664d35cac4e18c298c47d7b504c66b17c2ea91312e979fcfbdfb08a"}, + {file = "numpy-2.1.2-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:bdd407c40483463898b84490770199d5714dcc9dd9b792f6c6caccc523c00952"}, + {file = "numpy-2.1.2-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:da65fb46d4cbb75cb417cddf6ba5e7582eb7bb0b47db4b99c9fe5787ce5d91f5"}, + {file = "numpy-2.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c193d0b0238638e6fc5f10f1b074a6993cb13b0b431f64079a509d63d3aa8b7"}, + {file = "numpy-2.1.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a7d80b2e904faa63068ead63107189164ca443b42dd1930299e0d1cb041cec2e"}, + {file = "numpy-2.1.2.tar.gz", hash = "sha256:13532a088217fa624c99b843eeb54640de23b3414b14aa66d023805eb731066c"}, ] [[package]] @@ -1553,13 +1553,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "3.8.0" +version = "4.0.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false python-versions = ">=3.9" files = [ - {file = "pre_commit-3.8.0-py2.py3-none-any.whl", hash = "sha256:9a90a53bf82fdd8778d58085faf8d83df56e40dfe18f45b19446e26bf1b3a63f"}, - {file = "pre_commit-3.8.0.tar.gz", hash = "sha256:8bb6494d4a20423842e198980c9ecf9f96607a07ea29549e180eef9ae80fe7af"}, + {file = "pre_commit-4.0.0-py2.py3-none-any.whl", hash = "sha256:0ca2341cf94ac1865350970951e54b1a50521e57b7b500403307aed4315a1234"}, + {file = "pre_commit-4.0.0.tar.gz", hash = "sha256:5d9807162cc5537940f94f266cbe2d716a75cfad0d78a317a92cac16287cfed6"}, ] [package.dependencies] @@ -1818,13 +1818,13 @@ files = [ [[package]] name = "pytest" -version = "7.4.4" +version = "8.3.3" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, - {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, + {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"}, + {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"}, ] [package.dependencies] @@ -1832,29 +1832,29 @@ colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} +pluggy = ">=1.5,<2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-asyncio" -version = "0.21.2" +version = "0.24.0" description = "Pytest support for asyncio" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pytest_asyncio-0.21.2-py3-none-any.whl", hash = "sha256:ab664c88bb7998f711d8039cacd4884da6430886ae8bbd4eded552ed2004f16b"}, - {file = "pytest_asyncio-0.21.2.tar.gz", hash = "sha256:d67738fc232b94b326b9d060750beb16e0074210b98dd8b58a5239fa2a154f45"}, + {file = "pytest_asyncio-0.24.0-py3-none-any.whl", hash = "sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b"}, + {file = "pytest_asyncio-0.24.0.tar.gz", hash = "sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276"}, ] [package.dependencies] -pytest = ">=7.0.0" +pytest = ">=8.2,<9" [package.extras] docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] -testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] +testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] [[package]] name = "pytest-base-url" @@ -1896,13 +1896,13 @@ histogram = ["pygal", "pygaljs"] [[package]] name = "pytest-cov" -version = "4.1.0" +version = "5.0.0" description = "Pytest plugin for measuring coverage." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, - {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, + {file = "pytest-cov-5.0.0.tar.gz", hash = "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857"}, + {file = "pytest_cov-5.0.0-py3-none-any.whl", hash = "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652"}, ] [package.dependencies] @@ -1910,7 +1910,7 @@ coverage = {version = ">=5.2.1", extras = ["toml"]} pytest = ">=4.6" [package.extras] -testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] [[package]] name = "pytest-mock" @@ -2132,13 +2132,13 @@ md = ["cmarkgfm (>=0.8.0)"] [[package]] name = "redis" -version = "5.1.0" +version = "5.1.1" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.8" files = [ - {file = "redis-5.1.0-py3-none-any.whl", hash = "sha256:fd4fccba0d7f6aa48c58a78d76ddb4afc698f5da4a2c1d03d916e4fd7ab88cdd"}, - {file = "redis-5.1.0.tar.gz", hash = "sha256:b756df1e4a3858fcc0ef861f3fc53623a96c41e2b1f5304e09e0fe758d333d40"}, + {file = "redis-5.1.1-py3-none-any.whl", hash = "sha256:f8ea06b7482a668c6475ae202ed8d9bcaa409f6e87fb77ed1043d912afd62e24"}, + {file = "redis-5.1.1.tar.gz", hash = "sha256:f6c997521fedbae53387307c5d0bf784d9acc28d9f1d058abeac566ec4dbed72"}, ] [package.dependencies] @@ -2236,13 +2236,13 @@ idna2008 = ["idna"] [[package]] name = "rich" -version = "13.9.1" +version = "13.9.2" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false python-versions = ">=3.8.0" files = [ - {file = "rich-13.9.1-py3-none-any.whl", hash = "sha256:b340e739f30aa58921dc477b8adaa9ecdb7cecc217be01d93730ee1bc8aa83be"}, - {file = "rich-13.9.1.tar.gz", hash = "sha256:097cffdf85db1babe30cc7deba5ab3a29e1b9885047dab24c57e9a7f8a9c1466"}, + {file = "rich-13.9.2-py3-none-any.whl", hash = "sha256:8c82a3d3f8dcfe9e734771313e606b39d8247bb6b826e196f4914b333b743cf1"}, + {file = "rich-13.9.2.tar.gz", hash = "sha256:51a2c62057461aaf7152b4d611168f93a9fc73068f8ded2790f29fe2b5366d0c"}, ] [package.dependencies] @@ -2315,18 +2315,23 @@ websocket-client = ">=1.8,<2.0" [[package]] name = "setuptools" -version = "70.1.1" +version = "75.1.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.1.1-py3-none-any.whl", hash = "sha256:a58a8fde0541dab0419750bcc521fbdf8585f6e5cb41909df3a472ef7b81ca95"}, - {file = "setuptools-70.1.1.tar.gz", hash = "sha256:937a48c7cdb7a21eb53cd7f9b59e525503aa8abaf3584c730dc5f7a5bec3a650"}, + {file = "setuptools-75.1.0-py3-none-any.whl", hash = "sha256:35ab7fd3bcd95e6b7fd704e4a1539513edad446c097797f2985e0e4b960772f2"}, + {file = "setuptools-75.1.0.tar.gz", hash = "sha256:d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.11.*)", "pytest-mypy"] [[package]] name = "shellingham" @@ -3001,4 +3006,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "e4b462ebfae90550ba7fa49b360d7110c0d344ee616c23989c22d866ef8f6f31" +content-hash = "73182556dcb255bdc74f3ea607b4c04dac29e31b78d8b498220584e5fd2d81f2" diff --git a/pyproject.toml b/pyproject.toml index 7d79ddf2f..9c7395772 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ reflex-hosting-cli = ">=0.1.2,<2.0" charset-normalizer = ">=3.3.2,<4.0" wheel = ">=0.42.0,<1.0" build = ">=1.0.3,<2.0" -setuptools = ">=69.1.1,<70.2" +setuptools = ">=75.0" httpx = ">=0.25.1,<1.0" twine = ">=4.0.0,<6.0" tomlkit = ">=0.12.4,<1.0" @@ -61,13 +61,13 @@ lazy_loader = ">=0.4" reflex-chakra = ">=0.6.0" [tool.poetry.group.dev.dependencies] -pytest = ">=7.1.2,<8.0" +pytest = ">=7.1.2,<9.0" pytest-mock = ">=3.10.0,<4.0" pyright = ">=1.1.229,<1.1.335" darglint = ">=1.8.1,<2.0" toml = ">=0.10.2,<1.0" -pytest-asyncio = ">=0.20.1,<0.22.0" # https://github.com/pytest-dev/pytest-asyncio/issues/706 -pytest-cov = ">=4.0.0,<5.0" +pytest-asyncio = ">=0.24.0" +pytest-cov = ">=4.0.0,<6.0" ruff = "^0.4.9" pandas = ">=2.1.1,<3.0" pillow = ">=10.0.0,<11.0" @@ -100,3 +100,7 @@ lint.pydocstyle.convention = "google" "reflex/.templates/*.py" = ["D100", "D103", "D104"] "*.pyi" = ["D301", "D415", "D417", "D418", "E742"] "*/blank.py" = ["I001"] + +[tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" +asyncio_mode = "auto" \ No newline at end of file diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index 62a46d823..ac7d5f164 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -179,7 +179,7 @@ class UploadFilesProvider(Component): class Upload(MemoizationLeaf): """A file upload component.""" - library = "react-dropzone@14.2.3" + library = "react-dropzone@14.2.9" tag = "ReactDropzone" diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index 9d1ecc775..f80ad4ec6 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -125,10 +125,10 @@ class DataEditor(NoSSRComponent): tag = "DataEditor" is_default = True - library: str = "@glideapps/glide-data-grid@^5.3.0" + library: str = "@glideapps/glide-data-grid@^6.0.3" lib_dependencies: List[str] = [ "lodash@^4.17.21", - "marked@^4.0.10", + "marked@^14.1.2", "react-responsive-carousel@^3.2.7", ] diff --git a/reflex/components/gridjs/datatable.py b/reflex/components/gridjs/datatable.py index 34ca62605..bd568d84a 100644 --- a/reflex/components/gridjs/datatable.py +++ b/reflex/components/gridjs/datatable.py @@ -15,9 +15,9 @@ from reflex.vars.base import LiteralVar, Var, is_computed_var class Gridjs(Component): """A component that wraps a nivo bar component.""" - library = "gridjs-react@6.0.1" + library = "gridjs-react@6.1.1" - lib_dependencies: List[str] = ["gridjs@6.0.6"] + lib_dependencies: List[str] = ["gridjs@6.2.0"] class DataTable(Gridjs): diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index 1665144fd..d6edca18c 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -75,7 +75,7 @@ def get_base_component_map() -> dict[str, Callable]: class Markdown(Component): """A markdown component.""" - library = "react-markdown@8.0.7" + library = "react-markdown@9.0.1" tag = "ReactMarkdown" @@ -157,19 +157,19 @@ class Markdown(Component): return [ { "": "katex/dist/katex.min.css", - "remark-math@5.1.1": ImportVar( + "remark-math@6.0.0": ImportVar( tag=_REMARK_MATH._js_expr, is_default=True ), - "remark-gfm@3.0.1": ImportVar( + "remark-gfm@4.0.0": ImportVar( tag=_REMARK_GFM._js_expr, is_default=True ), "remark-unwrap-images@4.0.0": ImportVar( tag=_REMARK_UNWRAP_IMAGES._js_expr, is_default=True ), - "rehype-katex@6.0.3": ImportVar( + "rehype-katex@7.0.1": ImportVar( tag=_REHYPE_KATEX._js_expr, is_default=True ), - "rehype-raw@6.1.1": ImportVar( + "rehype-raw@7.0.0": ImportVar( tag=_REHYPE_RAW._js_expr, is_default=True ), }, diff --git a/reflex/components/plotly/plotly.py b/reflex/components/plotly/plotly.py index eb12bbc1c..c93488d40 100644 --- a/reflex/components/plotly/plotly.py +++ b/reflex/components/plotly/plotly.py @@ -94,7 +94,7 @@ class Plotly(NoSSRComponent): library = "react-plotly.js@2.6.0" - lib_dependencies: List[str] = ["plotly.js@2.22.0"] + lib_dependencies: List[str] = ["plotly.js@2.35.2"] tag = "Plot" diff --git a/reflex/components/radix/primitives/form.py b/reflex/components/radix/primitives/form.py index 63a4056e0..895f6dbeb 100644 --- a/reflex/components/radix/primitives/form.py +++ b/reflex/components/radix/primitives/form.py @@ -17,7 +17,7 @@ from .base import RadixPrimitiveComponentWithClassName class FormComponent(RadixPrimitiveComponentWithClassName): """Base class for all @radix-ui/react-form components.""" - library = "@radix-ui/react-form@^0.0.3" + library = "@radix-ui/react-form@^0.1.0" class FormRoot(FormComponent, HTMLForm): diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index 08c6df017..db5d9e77c 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -12,7 +12,7 @@ class ReactPlayer(NoSSRComponent): reference: https://github.com/cookpete/react-player. """ - library = "react-player@2.12.0" + library = "react-player@2.16.0" tag = "ReactPlayer" diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index b29b71875..02c320ac6 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -192,7 +192,7 @@ class ToastProps(PropsBase): class Toaster(Component): """A Toaster Component for displaying toast notifications.""" - library: str = "sonner@1.4.41" + library: str = "sonner@1.5.0" tag = "Toaster" diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index a815b1284..6c7487228 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -35,7 +35,7 @@ class Bun(SimpleNamespace): """Bun constants.""" # The Bun version. - VERSION = "1.1.10" + VERSION = "1.1.29" # Min Bun Version MIN_VERSION = "0.7.0" # The directory to store the bun. @@ -116,21 +116,21 @@ class PackageJson(SimpleNamespace): PATH = "package.json" DEPENDENCIES = { - "@babel/standalone": "7.25.3", - "@emotion/react": "11.11.1", - "axios": "1.6.0", + "@babel/standalone": "7.25.7", + "@emotion/react": "11.13.3", + "axios": "1.7.7", "json5": "2.2.3", - "next": "14.2.13", - "next-sitemap": "4.1.8", - "next-themes": "0.2.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-focus-lock": "2.11.3", - "socket.io-client": "4.6.1", - "universal-cookie": "4.0.4", + "next": "14.2.14", + "next-sitemap": "4.2.3", + "next-themes": "0.3.0", + "react": "18.3.1", + "react-dom": "18.3.1", + "react-focus-lock": "2.13.2", + "socket.io-client": "4.8.0", + "universal-cookie": "7.2.0", } DEV_DEPENDENCIES = { - "autoprefixer": "10.4.14", - "postcss": "8.4.31", + "autoprefixer": "10.4.20", + "postcss": "8.4.47", "postcss-import": "16.1.0", } diff --git a/reflex/constants/style.py b/reflex/constants/style.py index 2130ab4e0..9cd51da79 100644 --- a/reflex/constants/style.py +++ b/reflex/constants/style.py @@ -7,7 +7,7 @@ class Tailwind(SimpleNamespace): """Tailwind constants.""" # The Tailwindcss version - VERSION = "tailwindcss@3.3.2" + VERSION = "tailwindcss@3.4.13" # The Tailwind config. CONFIG = "tailwind.config.js" # Default Tailwind content paths diff --git a/tests/units/components/core/test_cond.py b/tests/units/components/core/test_cond.py index f5b6c0895..87b0572cb 100644 --- a/tests/units/components/core/test_cond.py +++ b/tests/units/components/core/test_cond.py @@ -6,7 +6,7 @@ import pytest from reflex.components.base.fragment import Fragment from reflex.components.core.cond import Cond, cond from reflex.components.radix.themes.typography.text import Text -from reflex.state import BaseState, State +from reflex.state import BaseState from reflex.utils.format import format_state_name from reflex.vars.base import LiteralVar, Var, computed_var @@ -124,7 +124,7 @@ def test_cond_no_else(): def test_cond_computed_var(): """Test if cond works with computed vars.""" - class CondStateComputed(State): + class CondStateComputed(BaseState): @computed_var def computed_int(self) -> int: return 0 diff --git a/tests/units/components/core/test_foreach.py b/tests/units/components/core/test_foreach.py index 43b9d8d55..9914e080d 100644 --- a/tests/units/components/core/test_foreach.py +++ b/tests/units/components/core/test_foreach.py @@ -47,7 +47,7 @@ class ForEachState(BaseState): color_index_tuple: Tuple[int, str] = (0, "red") -class TestComponentState(ComponentState): +class ComponentStateTest(ComponentState): """A test component state.""" foo: bool @@ -288,5 +288,5 @@ def test_foreach_component_state(): with pytest.raises(TypeError): Foreach.create( ForEachState.colors_list, - TestComponentState.create, + ComponentStateTest.create, ) diff --git a/tests/units/components/core/test_upload.py b/tests/units/components/core/test_upload.py index 83f04b3e6..1379956e2 100644 --- a/tests/units/components/core/test_upload.py +++ b/tests/units/components/core/test_upload.py @@ -11,7 +11,7 @@ from reflex.state import State from reflex.vars.base import LiteralVar, Var -class TestUploadState(State): +class UploadStateTest(State): """Test upload state.""" def drop_handler(self, files): @@ -55,7 +55,7 @@ def test_upload_create(): up_comp_2 = Upload.create( id="foo_id", - on_drop=TestUploadState.drop_handler([]), # type: ignore + on_drop=UploadStateTest.drop_handler([]), # type: ignore ) assert isinstance(up_comp_2, Upload) assert up_comp_2.is_used @@ -65,7 +65,7 @@ def test_upload_create(): up_comp_3 = Upload.create( id="foo_id", - on_drop=TestUploadState.drop_handler, + on_drop=UploadStateTest.drop_handler, ) assert isinstance(up_comp_3, Upload) assert up_comp_3.is_used @@ -75,7 +75,7 @@ def test_upload_create(): up_comp_4 = Upload.create( id="foo_id", - on_drop=TestUploadState.not_drop_handler([]), # type: ignore + on_drop=UploadStateTest.not_drop_handler([]), # type: ignore ) assert isinstance(up_comp_4, Upload) assert up_comp_4.is_used @@ -91,7 +91,7 @@ def test_styled_upload_create(): styled_up_comp_2 = StyledUpload.create( id="foo_id", - on_drop=TestUploadState.drop_handler([]), # type: ignore + on_drop=UploadStateTest.drop_handler([]), # type: ignore ) assert isinstance(styled_up_comp_2, StyledUpload) assert styled_up_comp_2.is_used @@ -101,7 +101,7 @@ def test_styled_upload_create(): styled_up_comp_3 = StyledUpload.create( id="foo_id", - on_drop=TestUploadState.drop_handler, + on_drop=UploadStateTest.drop_handler, ) assert isinstance(styled_up_comp_3, StyledUpload) assert styled_up_comp_3.is_used @@ -111,7 +111,7 @@ def test_styled_upload_create(): styled_up_comp_4 = StyledUpload.create( id="foo_id", - on_drop=TestUploadState.not_drop_handler([]), # type: ignore + on_drop=UploadStateTest.not_drop_handler([]), # type: ignore ) assert isinstance(styled_up_comp_4, StyledUpload) assert styled_up_comp_4.is_used diff --git a/tests/components/el/test_svg.py b/tests/units/components/el/test_svg.py similarity index 100% rename from tests/components/el/test_svg.py rename to tests/units/components/el/test_svg.py diff --git a/tests/units/conftest.py b/tests/units/conftest.py index 589d35cd7..2f619a941 100644 --- a/tests/units/conftest.py +++ b/tests/units/conftest.py @@ -1,5 +1,6 @@ """Test fixtures.""" +import asyncio import contextlib import os import platform @@ -24,6 +25,11 @@ from .states import ( ) +def pytest_configure(config): + if config.getoption("asyncio_mode") == "auto": + asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy()) + + @pytest.fixture def app() -> App: """A base app. diff --git a/tests/units/test_app.py b/tests/units/test_app.py index 0c22c38e3..31acd53f5 100644 --- a/tests/units/test_app.py +++ b/tests/units/test_app.py @@ -765,7 +765,8 @@ async def test_upload_file(tmp_path, state, delta, token: str, mocker): ) state._tmp_path = tmp_path # The App state must be the "root" of the state tree - app = App(state=State) + app = App() + app._enable_state() app.event_namespace.emit = AsyncMock() # type: ignore current_state = await app.state_manager.get_state(_substate_key(token, state)) data = b"This is binary data" diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 4e783b532..830cfbafb 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -9,10 +9,11 @@ import json import os import sys from textwrap import dedent -from typing import Any, Callable, Dict, Generator, List, Optional, Union +from typing import Any, AsyncGenerator, Callable, Dict, List, Optional, Union from unittest.mock import AsyncMock, Mock import pytest +import pytest_asyncio from plotly.graph_objects import Figure import reflex as rx @@ -1597,8 +1598,10 @@ async def test_state_with_invalid_yield(capsys, mock_app): assert "must only return/yield: None, Events or other EventHandlers" in captured.out -@pytest.fixture(scope="function", params=["in_process", "disk", "redis"]) -def state_manager(request) -> Generator[StateManager, None, None]: +@pytest_asyncio.fixture( + loop_scope="function", scope="function", params=["in_process", "disk", "redis"] +) +async def state_manager(request) -> AsyncGenerator[StateManager, None]: """Instance of state manager parametrized for redis and in-process. Args: @@ -1622,7 +1625,7 @@ def state_manager(request) -> Generator[StateManager, None, None]: yield state_manager if isinstance(state_manager, StateManagerRedis): - asyncio.get_event_loop().run_until_complete(state_manager.close()) + await state_manager.close() @pytest.fixture() @@ -1710,8 +1713,8 @@ async def test_state_manager_contend( assert not state_manager._states_locks[token].locked() -@pytest.fixture(scope="function") -def state_manager_redis() -> Generator[StateManager, None, None]: +@pytest_asyncio.fixture(loop_scope="function", scope="function") +async def state_manager_redis() -> AsyncGenerator[StateManager, None]: """Instance of state manager for redis only. Yields: @@ -1724,7 +1727,7 @@ def state_manager_redis() -> Generator[StateManager, None, None]: yield state_manager - asyncio.get_event_loop().run_until_complete(state_manager.close()) + await state_manager.close() @pytest.fixture() @@ -2790,6 +2793,9 @@ async def test_preprocess(app_module_mock, token, test_state, expected, mocker): } assert (await state._process(events[1]).__anext__()).delta == exp_is_hydrated(state) + if isinstance(app.state_manager, StateManagerRedis): + await app.state_manager.close() + @pytest.mark.asyncio async def test_preprocess_multiple_load_events(app_module_mock, token, mocker): @@ -2837,6 +2843,9 @@ async def test_preprocess_multiple_load_events(app_module_mock, token, mocker): } assert (await state._process(events[2]).__anext__()).delta == exp_is_hydrated(state) + if isinstance(app.state_manager, StateManagerRedis): + await app.state_manager.close() + @pytest.mark.asyncio async def test_get_state(mock_app: rx.App, token: str): diff --git a/tests/units/test_state_tree.py b/tests/units/test_state_tree.py index 7c1e13a91..ebdd877de 100644 --- a/tests/units/test_state_tree.py +++ b/tests/units/test_state_tree.py @@ -1,9 +1,9 @@ """Specialized test for a larger state tree.""" -import asyncio -from typing import Generator +from typing import AsyncGenerator import pytest +import pytest_asyncio import reflex as rx from reflex.state import BaseState, StateManager, StateManagerRedis, _substate_key @@ -210,8 +210,10 @@ ALWAYS_COMPUTED_DICT_KEYS = [ ] -@pytest.fixture(scope="function") -def state_manager_redis(app_module_mock) -> Generator[StateManager, None, None]: +@pytest_asyncio.fixture(loop_scope="function", scope="function") +async def state_manager_redis( + app_module_mock, +) -> AsyncGenerator[StateManager, None]: """Instance of state manager for redis only. Args: @@ -228,7 +230,7 @@ def state_manager_redis(app_module_mock) -> Generator[StateManager, None, None]: yield state_manager - asyncio.get_event_loop().run_until_complete(state_manager.close()) + await state_manager.close() @pytest.mark.asyncio diff --git a/tests/units/utils/test_serializers.py b/tests/units/utils/test_serializers.py index 630187309..8050470c6 100644 --- a/tests/units/utils/test_serializers.py +++ b/tests/units/utils/test_serializers.py @@ -96,7 +96,7 @@ class StrEnum(str, Enum): BAR = "bar" -class TestEnum(Enum): +class FooBarEnum(Enum): """A lone enum class.""" FOO = "foo" @@ -151,10 +151,10 @@ class BaseSubclass(Base): "key2": "prefix_bar", }, ), - (TestEnum.FOO, "foo"), - ([TestEnum.FOO, TestEnum.BAR], ["foo", "bar"]), + (FooBarEnum.FOO, "foo"), + ([FooBarEnum.FOO, FooBarEnum.BAR], ["foo", "bar"]), ( - {"key1": TestEnum.FOO, "key2": TestEnum.BAR}, + {"key1": FooBarEnum.FOO, "key2": FooBarEnum.BAR}, { "key1": "foo", "key2": "bar", From c7c830de80bd233fb79081371f3b62dde7c1a5fe Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 7 Oct 2024 11:59:33 -0700 Subject: [PATCH 107/201] fail safely when pickling (#4085) * fail safely when pickling * why did i do that --- reflex/state.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 8210c1500..ef07278d9 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1999,7 +1999,14 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Returns: The serialized state. """ - return pickle.dumps((self._to_schema(), self)) + try: + return pickle.dumps((self._to_schema(), self)) + except pickle.PicklingError: + console.warn( + f"Failed to serialize state {self.get_full_name()} due to unpicklable object. " + "This state will not be persisted." + ) + return b"" @classmethod def _deserialize( @@ -2826,9 +2833,10 @@ class StateManagerDisk(StateManager): if substate._get_was_touched(): substate._was_touched = False # Reset the touched flag after serializing. pickle_state = substate._serialize() - if not self.states_directory.exists(): - self.states_directory.mkdir(parents=True, exist_ok=True) - self.token_path(substate_token).write_bytes(pickle_state) + if pickle_state: + if not self.states_directory.exists(): + self.states_directory.mkdir(parents=True, exist_ok=True) + self.token_path(substate_token).write_bytes(pickle_state) for substate_substate in substate.substates.values(): await self.set_state_for_substate(client_token, substate_substate) @@ -3121,11 +3129,12 @@ class StateManagerRedis(StateManager): if state._get_was_touched(): pickle_state = state._serialize() self._warn_if_too_large(state, len(pickle_state)) - await self.redis.set( - _substate_key(client_token, state), - pickle_state, - ex=self.token_expiration, - ) + if pickle_state: + await self.redis.set( + _substate_key(client_token, state), + pickle_state, + ex=self.token_expiration, + ) # Wait for substates to be persisted. for t in tasks: From bec73109d60c08f0e27d407858f8048b2d5c354c Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 7 Oct 2024 13:24:23 -0700 Subject: [PATCH 108/201] upgrade default node to current lts (#4086) --- reflex/constants/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 6c7487228..12e4c9f20 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -79,7 +79,7 @@ class Node(SimpleNamespace): """Node/ NPM constants.""" # The Node version. - VERSION = "18.17.0" + VERSION = "20.18.0" # The minimum required node version. MIN_VERSION = "18.17.0" From 0e99ce91c1bef833f06d66c4736f56c0bb7d4df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 7 Oct 2024 14:52:36 -0700 Subject: [PATCH 109/201] update ruff to latest version (#4081) * update ruff to latest version * fix pyi --- .pre-commit-config.yaml | 4 +-- poetry.lock | 39 +++++++++++---------- pyproject.toml | 2 +- reflex/components/datadisplay/dataeditor.py | 2 +- reflex/components/el/__init__.pyi | 1 + reflex/components/tags/iter_tag.py | 4 +-- reflex/utils/compat.py | 4 +-- reflex/utils/telemetry.py | 4 +-- reflex/utils/types.py | 4 +-- reflex/vars/base.py | 2 +- tests/units/components/core/test_cond.py | 2 +- tests/units/components/core/test_foreach.py | 10 +++--- tests/units/components/core/test_match.py | 10 +++--- tests/units/components/test_tag.py | 2 +- tests/units/test_state.py | 8 ++--- tests/units/test_var.py | 4 +-- tests/units/utils/test_utils.py | 4 ++- 17 files changed, 53 insertions(+), 53 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 609364a6e..4d2e76b31 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ fail_fast: true repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.4.10 + rev: v0.6.9 hooks: - id: ruff-format args: [reflex, tests] @@ -25,7 +25,7 @@ repos: rev: v1.1.313 hooks: - id: pyright - args: [integration, reflex, tests] + args: [reflex, tests] language: system - repo: https://github.com/terrencepreilly/darglint diff --git a/poetry.lock b/poetry.lock index 158574222..144547342 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2255,28 +2255,29 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "ruff" -version = "0.4.10" +version = "0.6.9" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.4.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5c2c4d0859305ac5a16310eec40e4e9a9dec5dcdfbe92697acd99624e8638dac"}, - {file = "ruff-0.4.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a79489607d1495685cdd911a323a35871abfb7a95d4f98fc6f85e799227ac46e"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1dd1681dfa90a41b8376a61af05cc4dc5ff32c8f14f5fe20dba9ff5deb80cd6"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c75c53bb79d71310dc79fb69eb4902fba804a81f374bc86a9b117a8d077a1784"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18238c80ee3d9100d3535d8eb15a59c4a0753b45cc55f8bf38f38d6a597b9739"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d8f71885bce242da344989cae08e263de29752f094233f932d4f5cfb4ef36a81"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:330421543bd3222cdfec481e8ff3460e8702ed1e58b494cf9d9e4bf90db52b9d"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9e9b6fb3a37b772628415b00c4fc892f97954275394ed611056a4b8a2631365e"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f54c481b39a762d48f64d97351048e842861c6662d63ec599f67d515cb417f6"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:67fe086b433b965c22de0b4259ddfe6fa541c95bf418499bedb9ad5fb8d1c631"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:acfaaab59543382085f9eb51f8e87bac26bf96b164839955f244d07125a982ef"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3cea07079962b2941244191569cf3a05541477286f5cafea638cd3aa94b56815"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:338a64ef0748f8c3a80d7f05785930f7965d71ca260904a9321d13be24b79695"}, - {file = "ruff-0.4.10-py3-none-win32.whl", hash = "sha256:ffe3cd2f89cb54561c62e5fa20e8f182c0a444934bf430515a4b422f1ab7b7ca"}, - {file = "ruff-0.4.10-py3-none-win_amd64.whl", hash = "sha256:67f67cef43c55ffc8cc59e8e0b97e9e60b4837c8f21e8ab5ffd5d66e196e25f7"}, - {file = "ruff-0.4.10-py3-none-win_arm64.whl", hash = "sha256:dd1fcee327c20addac7916ca4e2653fbbf2e8388d8a6477ce5b4e986b68ae6c0"}, - {file = "ruff-0.4.10.tar.gz", hash = "sha256:3aa4f2bc388a30d346c56524f7cacca85945ba124945fe489952aadb6b5cd804"}, + {file = "ruff-0.6.9-py3-none-linux_armv6l.whl", hash = "sha256:064df58d84ccc0ac0fcd63bc3090b251d90e2a372558c0f057c3f75ed73e1ccd"}, + {file = "ruff-0.6.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:140d4b5c9f5fc7a7b074908a78ab8d384dd7f6510402267bc76c37195c02a7ec"}, + {file = "ruff-0.6.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:53fd8ca5e82bdee8da7f506d7b03a261f24cd43d090ea9db9a1dc59d9313914c"}, + {file = "ruff-0.6.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:645d7d8761f915e48a00d4ecc3686969761df69fb561dd914a773c1a8266e14e"}, + {file = "ruff-0.6.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eae02b700763e3847595b9d2891488989cac00214da7f845f4bcf2989007d577"}, + {file = "ruff-0.6.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d5ccc9e58112441de8ad4b29dcb7a86dc25c5f770e3c06a9d57e0e5eba48829"}, + {file = "ruff-0.6.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:417b81aa1c9b60b2f8edc463c58363075412866ae4e2b9ab0f690dc1e87ac1b5"}, + {file = "ruff-0.6.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c866b631f5fbce896a74a6e4383407ba7507b815ccc52bcedabb6810fdb3ef7"}, + {file = "ruff-0.6.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7b118afbb3202f5911486ad52da86d1d52305b59e7ef2031cea3425142b97d6f"}, + {file = "ruff-0.6.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a67267654edc23c97335586774790cde402fb6bbdb3c2314f1fc087dee320bfa"}, + {file = "ruff-0.6.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3ef0cc774b00fec123f635ce5c547dac263f6ee9fb9cc83437c5904183b55ceb"}, + {file = "ruff-0.6.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:12edd2af0c60fa61ff31cefb90aef4288ac4d372b4962c2864aeea3a1a2460c0"}, + {file = "ruff-0.6.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:55bb01caeaf3a60b2b2bba07308a02fca6ab56233302406ed5245180a05c5625"}, + {file = "ruff-0.6.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:925d26471fa24b0ce5a6cdfab1bb526fb4159952385f386bdcc643813d472039"}, + {file = "ruff-0.6.9-py3-none-win32.whl", hash = "sha256:eb61ec9bdb2506cffd492e05ac40e5bc6284873aceb605503d8494180d6fc84d"}, + {file = "ruff-0.6.9-py3-none-win_amd64.whl", hash = "sha256:785d31851c1ae91f45b3d8fe23b8ae4b5170089021fbb42402d811135f0b7117"}, + {file = "ruff-0.6.9-py3-none-win_arm64.whl", hash = "sha256:a9641e31476d601f83cd602608739a0840e348bda93fec9f1ee816f8b6798b93"}, + {file = "ruff-0.6.9.tar.gz", hash = "sha256:b076ef717a8e5bc819514ee1d602bbdca5b4420ae13a9cf61a0c0a4f53a2baa2"}, ] [[package]] @@ -3006,4 +3007,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "73182556dcb255bdc74f3ea607b4c04dac29e31b78d8b498220584e5fd2d81f2" +content-hash = "796ddba36f031ad2b47cae43ce6c49102e2cb98f92823b265d9779e6684333f6" diff --git a/pyproject.toml b/pyproject.toml index 9c7395772..17ee4d132 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,7 @@ darglint = ">=1.8.1,<2.0" toml = ">=0.10.2,<1.0" pytest-asyncio = ">=0.24.0" pytest-cov = ">=4.0.0,<6.0" -ruff = "^0.4.9" +ruff = "^0.6.9" pandas = ">=2.1.1,<3.0" pillow = ">=10.0.0,<11.0" plotly = ">=5.13.0,<6.0" diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index f80ad4ec6..1c778f52a 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -329,7 +329,7 @@ class DataEditor(NoSSRComponent): columns = props.get("columns", []) data = props.get("data", []) - rows = props.get("rows", None) + rows = props.get("rows") # If rows is not provided, determine from data. if rows is None: diff --git a/reflex/components/el/__init__.pyi b/reflex/components/el/__init__.pyi index adf657b7e..4815bcd27 100644 --- a/reflex/components/el/__init__.pyi +++ b/reflex/components/el/__init__.pyi @@ -3,6 +3,7 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from . import elements as elements from .elements.forms import Button as Button from .elements.forms import Fieldset as Fieldset from .elements.forms import Form as Form diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index 86e5a57fc..fec27f3d9 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -48,10 +48,10 @@ class IterTag(Tag): """ iterable = self.iterable try: - if iterable._var_type.mro()[0] == dict: + if iterable._var_type.mro()[0] is dict: # Arg is a tuple of (key, value). return Tuple[get_args(iterable._var_type)] # type: ignore - elif iterable._var_type.mro()[0] == tuple: + elif iterable._var_type.mro()[0] is tuple: # Arg is a union of any possible values in the tuple. return Union[get_args(iterable._var_type)] # type: ignore else: diff --git a/reflex/utils/compat.py b/reflex/utils/compat.py index b6d198fd4..e63492a6b 100644 --- a/reflex/utils/compat.py +++ b/reflex/utils/compat.py @@ -87,6 +87,4 @@ def sqlmodel_field_has_primary_key(field) -> bool: return True if getattr(field.field_info, "sa_column", None) is None: return False - if getattr(field.field_info.sa_column, "primary_key", None) is True: - return True - return False + return bool(getattr(field.field_info.sa_column, "primary_key", None)) diff --git a/reflex/utils/telemetry.py b/reflex/utils/telemetry.py index af3994ff8..9ae165ea2 100644 --- a/reflex/utils/telemetry.py +++ b/reflex/utils/telemetry.py @@ -94,9 +94,7 @@ def _raise_on_missing_project_hash() -> bool: False when compilation should be skipped (i.e. no .web directory is required). Otherwise return True. """ - if should_skip_compile(): - return False - return True + return not should_skip_compile() def _prepare_event(event: str, **kwargs) -> dict: diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 41e1ed49a..6bedf5b61 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -374,7 +374,7 @@ def get_base_class(cls: GenericType) -> Type: if is_literal(cls): # only literals of the same type are supported. arg_type = type(get_args(cls)[0]) - if not all(type(arg) == arg_type for arg in get_args(cls)): + if not all(type(arg) is arg_type for arg in get_args(cls)): raise TypeError("only literals of the same type are supported") return type(get_args(cls)[0]) @@ -538,7 +538,7 @@ def is_backend_base_variable(name: str, cls: Type) -> bool: if name in cls.__dict__: value = cls.__dict__[name] - if type(value) == classmethod: + if type(value) is classmethod: return False if callable(value): return False diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 7eab62c68..a22fd83f1 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -239,7 +239,7 @@ class Var(Generic[VAR_TYPE]): **kwargs, ) - if (js_expr := kwargs.get("_js_expr", None)) is not None: + if (js_expr := kwargs.get("_js_expr")) is not None: object.__setattr__(value_with_replaced, "_js_expr", js_expr) return value_with_replaced diff --git a/tests/units/components/core/test_cond.py b/tests/units/components/core/test_cond.py index 87b0572cb..f9bdc7d60 100644 --- a/tests/units/components/core/test_cond.py +++ b/tests/units/components/core/test_cond.py @@ -45,7 +45,7 @@ def test_validate_cond(cond_state: BaseState): Text.create("cond is True"), Text.create("cond is False"), ) - cond_dict = cond_component.render() if type(cond_component) == Fragment else {} + cond_dict = cond_component.render() if type(cond_component) is Fragment else {} assert cond_dict["name"] == "Fragment" [condition] = cond_dict["children"] diff --git a/tests/units/components/core/test_foreach.py b/tests/units/components/core/test_foreach.py index 9914e080d..228165d3e 100644 --- a/tests/units/components/core/test_foreach.py +++ b/tests/units/components/core/test_foreach.py @@ -67,7 +67,7 @@ class ComponentStateTest(ComponentState): def display_color(color): - assert color._var_type == str + assert color._var_type is str return box(text(color)) @@ -106,18 +106,18 @@ def display_nested_color_with_shades_v2(color): def display_color_tuple(color): - assert color._var_type == str + assert color._var_type is str return box(text(color)) def display_colors_set(color): - assert color._var_type == str + assert color._var_type is str return box(text(color)) def display_nested_list_element(element: ArrayVar[List[str]], index: NumberVar[int]): assert element._var_type == List[str] - assert index._var_type == int + assert index._var_type is int return box(text(element[index])) @@ -240,7 +240,7 @@ def test_foreach_render(state_var, render_fn, render_dict): arg_index = rend["arg_index"] assert isinstance(arg_index, Var) assert arg_index._js_expr not in seen_index_vars - assert arg_index._var_type == int + assert arg_index._var_type is int seen_index_vars.add(arg_index._js_expr) diff --git a/tests/units/components/core/test_match.py b/tests/units/components/core/test_match.py index 583bfa1e2..f09e800e5 100644 --- a/tests/units/components/core/test_match.py +++ b/tests/units/components/core/test_match.py @@ -41,15 +41,15 @@ def test_match_components(): assert len(match_cases) == 6 assert match_cases[0][0]._js_expr == "1" - assert match_cases[0][0]._var_type == int + assert match_cases[0][0]._var_type is int first_return_value_render = match_cases[0][1].render() assert first_return_value_render["name"] == "RadixThemesText" assert first_return_value_render["children"][0]["contents"] == '{"first value"}' assert match_cases[1][0]._js_expr == "2" - assert match_cases[1][0]._var_type == int + assert match_cases[1][0]._var_type is int assert match_cases[1][1]._js_expr == "3" - assert match_cases[1][1]._var_type == int + assert match_cases[1][1]._var_type is int second_return_value_render = match_cases[1][2].render() assert second_return_value_render["name"] == "RadixThemesText" assert second_return_value_render["children"][0]["contents"] == '{"second value"}' @@ -61,7 +61,7 @@ def test_match_components(): assert third_return_value_render["children"][0]["contents"] == '{"third value"}' assert match_cases[3][0]._js_expr == '"random"' - assert match_cases[3][0]._var_type == str + assert match_cases[3][0]._var_type is str fourth_return_value_render = match_cases[3][1].render() assert fourth_return_value_render["name"] == "RadixThemesText" assert fourth_return_value_render["children"][0]["contents"] == '{"fourth value"}' @@ -73,7 +73,7 @@ def test_match_components(): assert fifth_return_value_render["children"][0]["contents"] == '{"fifth value"}' assert match_cases[5][0]._js_expr == f"({MatchState.get_name()}.num + 1)" - assert match_cases[5][0]._var_type == int + assert match_cases[5][0]._var_type is int fifth_return_value_render = match_cases[5][1].render() assert fifth_return_value_render["name"] == "RadixThemesText" assert fifth_return_value_render["children"][0]["contents"] == '{"sixth value"}' diff --git a/tests/units/components/test_tag.py b/tests/units/components/test_tag.py index c41246e3f..a69e40b8b 100644 --- a/tests/units/components/test_tag.py +++ b/tests/units/components/test_tag.py @@ -119,7 +119,7 @@ def test_format_cond_tag(): tag_dict["false_value"], ) assert cond._js_expr == "logged_in" - assert cond._var_type == bool + assert cond._var_type is bool assert true_value["name"] == "h1" assert true_value["contents"] == "True content" diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 830cfbafb..38cf65fee 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -274,9 +274,9 @@ def test_base_class_vars(test_state): assert isinstance(prop, Var) assert prop._js_expr.split(".")[-1] == field - assert cls.num1._var_type == int - assert cls.num2._var_type == float - assert cls.key._var_type == str + assert cls.num1._var_type is int + assert cls.num2._var_type is float + assert cls.key._var_type is str def test_computed_class_var(test_state): @@ -526,7 +526,7 @@ def test_set_class_var(): TestState._set_var(Var(_js_expr="num3", _var_type=int)._var_set_state(TestState)) var = TestState.num3 # type: ignore assert var._js_expr == TestState.get_full_name() + ".num3" - assert var._var_type == int + assert var._var_type is int assert var._var_state == TestState.get_full_name() diff --git a/tests/units/test_var.py b/tests/units/test_var.py index 227b01d85..8f907c24a 100644 --- a/tests/units/test_var.py +++ b/tests/units/test_var.py @@ -490,7 +490,7 @@ def test_var_indexing_str(): # Test that indexing gives a type of Var[str]. assert isinstance(str_var[0], Var) - assert str_var[0]._var_type == str + assert str_var[0]._var_type is str # Test basic indexing. assert str(str_var[0]) == "str.at(0)" @@ -623,7 +623,7 @@ def test_str_var_slicing(): # Test that slicing gives a type of Var[str]. assert isinstance(str_var[:1], Var) - assert str_var[:1]._var_type == str + assert str_var[:1]._var_type is str # Test basic slicing. assert str(str_var[:1]) == 'str.split("").slice(undefined, 1).join("")' diff --git a/tests/units/utils/test_utils.py b/tests/units/utils/test_utils.py index 41bd4e661..81579acc7 100644 --- a/tests/units/utils/test_utils.py +++ b/tests/units/utils/test_utils.py @@ -542,7 +542,9 @@ def test_style_prop_with_event_handler_value(callable): style = { "color": ( - EventHandler(fn=callable) if type(callable) != EventHandler else callable + EventHandler(fn=callable) + if type(callable) is not EventHandler + else callable ) } From 7529bb0c64791c98daa67b2b1852ffe08e86a7f0 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 7 Oct 2024 14:58:41 -0700 Subject: [PATCH 110/201] [ENG-2287] Avoid fetching same state from redis multiple times (#4055) * Avoid fetching substates multiple times In the presence of computed vars, substates may be cached more than once. * Consolidate logic in StateManagerRedis.get_state * Suppress StateSchemaMismatchError and create a new state instance. If the serialized state's schema does not match the current corresponding state schema, then we have to create a new instance. --- reflex/state.py | 62 ++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index ef07278d9..ff6ad1405 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -2916,11 +2916,14 @@ class StateManagerRedis(StateManager): # Only warn about each state class size once. _warned_about_state_size: ClassVar[Set[str]] = set() - async def _get_parent_state(self, token: str) -> BaseState | None: + async def _get_parent_state( + self, token: str, state: BaseState | None = None + ) -> BaseState | None: """Get the parent state for the state requested in the token. Args: token: The token to get the state for (_substate_key). + state: The state instance to get parent state for. Returns: The parent state for the state requested by the token or None if there is no such parent. @@ -2929,11 +2932,15 @@ class StateManagerRedis(StateManager): client_token, state_path = _split_substate_key(token) parent_state_name = state_path.rpartition(".")[0] if parent_state_name: + cached_substates = None + if state is not None: + cached_substates = [state] # Retrieve the parent state to populate event handlers onto this substate. parent_state = await self.get_state( token=_substate_key(client_token, parent_state_name), top_level=False, get_substates=False, + cached_substates=cached_substates, ) return parent_state @@ -2965,6 +2972,8 @@ class StateManagerRedis(StateManager): tasks = {} # Retrieve the necessary substates from redis. for substate_cls in fetch_substates: + if substate_cls.get_name() in state.substates: + continue substate_name = substate_cls.get_name() tasks[substate_name] = asyncio.create_task( self.get_state( @@ -2985,6 +2994,7 @@ class StateManagerRedis(StateManager): top_level: bool = True, get_substates: bool = True, parent_state: BaseState | None = None, + cached_substates: list[BaseState] | None = None, ) -> BaseState: """Get the state for a token. @@ -2993,6 +3003,7 @@ class StateManagerRedis(StateManager): top_level: If true, return an instance of the top-level state (self.state). get_substates: If true, also retrieve substates. parent_state: If provided, use this parent_state instead of getting it from redis. + cached_substates: If provided, attach these substates to the state. Returns: The state for the token. @@ -3010,45 +3021,38 @@ class StateManagerRedis(StateManager): "StateManagerRedis requires token to be specified in the form of {token}_{state_full_name}" ) + # The deserialized or newly created (sub)state instance. + state = None + # Fetch the serialized substate from redis. redis_state = await self.redis.get(token) if redis_state is not None: # Deserialize the substate. - state = BaseState._deserialize(data=redis_state) - - # Populate parent state if missing and requested. - if parent_state is None: - parent_state = await self._get_parent_state(token) - # Set up Bidirectional linkage between this state and its parent. - if parent_state is not None: - parent_state.substates[state.get_name()] = state - state.parent_state = parent_state - # Populate substates if requested. - await self._populate_substates(token, state, all_substates=get_substates) - - # To retain compatibility with previous implementation, by default, we return - # the top-level state by chasing `parent_state` pointers up the tree. - if top_level: - return state._get_root_state() - return state - - # TODO: dedupe the following logic with the above block - # Key didn't exist so we have to create a new instance for this token. + with contextlib.suppress(StateSchemaMismatchError): + state = BaseState._deserialize(data=redis_state) + if state is None: + # Key didn't exist or schema mismatch so create a new instance for this token. + state = state_cls( + init_substates=False, + _reflex_internal_init=True, + ) + # Populate parent state if missing and requested. if parent_state is None: - parent_state = await self._get_parent_state(token) - # Instantiate the new state class (but don't persist it yet). - state = state_cls( - parent_state=parent_state, - init_substates=False, - _reflex_internal_init=True, - ) + parent_state = await self._get_parent_state(token, state) # Set up Bidirectional linkage between this state and its parent. if parent_state is not None: parent_state.substates[state.get_name()] = state state.parent_state = parent_state - # Populate substates for the newly created state. + # Avoid fetching substates multiple times. + if cached_substates: + for substate in cached_substates: + state.substates[substate.get_name()] = substate + if substate.parent_state is None: + substate.parent_state = state + # Populate substates if requested. await self._populate_substates(token, state, all_substates=get_substates) + # To retain compatibility with previous implementation, by default, we return # the top-level state by chasing `parent_state` pointers up the tree. if top_level: From 8663d4f9782c9c7f215a6930c1bf4b7e0f74cac4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 7 Oct 2024 14:59:02 -0700 Subject: [PATCH 111/201] [ENG-3749] type safe vars (#4066) * type safe vars * fix behavior for dict and list --- reflex/__init__.py | 2 +- reflex/__init__.pyi | 2 ++ reflex/state.py | 9 ++++-- reflex/vars/__init__.py | 2 ++ reflex/vars/base.py | 65 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 3 deletions(-) diff --git a/reflex/__init__.py b/reflex/__init__.py index 63de1f386..57e7768ea 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -331,7 +331,7 @@ _MAPPING: dict = { "style": ["Style", "toggle_color_mode"], "utils.imports": ["ImportVar"], "utils.serializers": ["serializer"], - "vars": ["Var"], + "vars": ["Var", "field", "Field"], } _SUBMODULES: set[str] = { diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index ef5bcfd8f..28d768c35 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -189,7 +189,9 @@ from .style import Style as Style from .style import toggle_color_mode as toggle_color_mode from .utils.imports import ImportVar as ImportVar from .utils.serializers import serializer as serializer +from .vars import Field as Field from .vars import Var as Var +from .vars import field as field del compat RADIX_THEMES_MAPPING: dict diff --git a/reflex/state.py b/reflex/state.py index ff6ad1405..2040d7228 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -32,6 +32,7 @@ from typing import ( Type, Union, cast, + get_args, get_type_hints, ) @@ -81,7 +82,7 @@ from reflex.utils.exceptions import ( ) from reflex.utils.exec import is_testing_env from reflex.utils.serializers import serializer -from reflex.utils.types import override +from reflex.utils.types import get_origin, override from reflex.vars import VarData if TYPE_CHECKING: @@ -240,12 +241,16 @@ def get_var_for_field(cls: Type[BaseState], f: ModelField): Returns: The Var instance. """ + from reflex.vars import Field + field_name = format.format_state_name(cls.get_full_name()) + "." + f.name return dispatch( field_name=field_name, var_data=VarData.from_state(cls, f.name), - result_var_type=f.outer_type_, + result_var_type=f.outer_type_ + if get_origin(f.outer_type_) is not Field + else get_args(f.outer_type_)[0], ) diff --git a/reflex/vars/__init__.py b/reflex/vars/__init__.py index 56d304cd6..1a4cebe19 100644 --- a/reflex/vars/__init__.py +++ b/reflex/vars/__init__.py @@ -1,8 +1,10 @@ """Immutable-Based Var System.""" +from .base import Field as Field from .base import LiteralVar as LiteralVar from .base import Var as Var from .base import VarData as VarData +from .base import field as field from .base import get_unique_variable_name as get_unique_variable_name from .base import get_uuid_string_var as get_uuid_string_var from .base import var_operation as var_operation diff --git a/reflex/vars/base.py b/reflex/vars/base.py index a22fd83f1..58a73e025 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -2832,3 +2832,68 @@ def dispatch( _var_data=var_data, _var_type=result_var_type, ).guess_type() + + +V = TypeVar("V") + + +class Field(Generic[T]): + """Shadow class for Var to allow for type hinting in the IDE.""" + + def __set__(self, instance, value: T): + """Set the Var. + + Args: + instance: The instance of the class setting the Var. + value: The value to set the Var to. + """ + + @overload + def __get__(self: Field[bool], instance: None, owner) -> BooleanVar: ... + + @overload + def __get__(self: Field[int], instance: None, owner) -> NumberVar: ... + + @overload + def __get__(self: Field[str], instance: None, owner) -> StringVar: ... + + @overload + def __get__(self: Field[None], instance: None, owner) -> NoneVar: ... + + @overload + def __get__( + self: Field[List[V]] | Field[Set[V]] | Field[Tuple[V, ...]], + instance: None, + owner, + ) -> ArrayVar[List[V]]: ... + + @overload + def __get__( + self: Field[Dict[str, V]], instance: None, owner + ) -> ObjectVar[Dict[str, V]]: ... + + @overload + def __get__(self, instance: None, owner) -> Var[T]: ... + + @overload + def __get__(self, instance, owner) -> T: ... + + def __get__(self, instance, owner): # type: ignore + """Get the Var. + + Args: + instance: The instance of the class accessing the Var. + owner: The class that the Var is attached to. + """ + + +def field(value: T) -> Field[T]: + """Create a Field with a value. + + Args: + value: The value of the Field. + + Returns: + The Field. + """ + return value # type: ignore From af83161feddf9d7927941cb3088b36da75b60946 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 7 Oct 2024 15:04:01 -0700 Subject: [PATCH 112/201] reset backend vars in state.reset() (#4087) --- reflex/state.py | 4 ++++ tests/units/test_state.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/reflex/state.py b/reflex/state.py index 2040d7228..5d1d51b91 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1243,6 +1243,10 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): default = copy.deepcopy(field.default) setattr(self, prop_name, default) + # Reset the backend vars. + for prop_name, value in self.backend_vars.items(): + setattr(self, prop_name, copy.deepcopy(value)) + # Recursively reset the substates. for substate in self.substates.values(): substate.reset() diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 38cf65fee..a890c2aa4 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -105,6 +105,7 @@ class TestState(BaseState): complex: Dict[int, Object] = {1: Object(), 2: Object()} fig: Figure = Figure() dt: datetime.datetime = datetime.datetime.fromisoformat("1989-11-09T18:53:00+01:00") + _backend: int = 0 @ComputedVar def sum(self) -> float: @@ -706,6 +707,7 @@ def test_reset(test_state, child_state): # Set some values. test_state.num1 = 1 test_state.num2 = 2 + test_state._backend = 3 child_state.value = "test" # Reset the state. @@ -714,6 +716,7 @@ def test_reset(test_state, child_state): # The values should be reset. assert test_state.num1 == 0 assert test_state.num2 == 3.14 + assert test_state._backend == 0 assert child_state.value == "" expected_dirty_vars = { @@ -729,6 +732,7 @@ def test_reset(test_state, child_state): "map_key", "mapping", "dt", + "_backend", } # The dirty vars should be reset. From 37508676cf3592a69726d6e07a2aeda6552360a8 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 8 Oct 2024 07:16:54 -0700 Subject: [PATCH 113/201] Revert Markdown-related frontend dep bumps (#4088) * Revert markdown version bumps * Ignore markdown related dependencies (these are pinned now) --- .github/workflows/check_outdated_dependencies.yml | 2 +- reflex/components/markdown/markdown.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_outdated_dependencies.yml b/.github/workflows/check_outdated_dependencies.yml index d5b9292f6..fb28bb318 100644 --- a/.github/workflows/check_outdated_dependencies.yml +++ b/.github/workflows/check_outdated_dependencies.yml @@ -74,7 +74,7 @@ jobs: echo "$outdated" # Ignore 3rd party dependencies that are not updated. - filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion' || true) + filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion|react-markdown|remark-math|remark-gfm|rehype-katex|rehype-raw' || true) no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true) diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index d6edca18c..1665144fd 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -75,7 +75,7 @@ def get_base_component_map() -> dict[str, Callable]: class Markdown(Component): """A markdown component.""" - library = "react-markdown@9.0.1" + library = "react-markdown@8.0.7" tag = "ReactMarkdown" @@ -157,19 +157,19 @@ class Markdown(Component): return [ { "": "katex/dist/katex.min.css", - "remark-math@6.0.0": ImportVar( + "remark-math@5.1.1": ImportVar( tag=_REMARK_MATH._js_expr, is_default=True ), - "remark-gfm@4.0.0": ImportVar( + "remark-gfm@3.0.1": ImportVar( tag=_REMARK_GFM._js_expr, is_default=True ), "remark-unwrap-images@4.0.0": ImportVar( tag=_REMARK_UNWRAP_IMAGES._js_expr, is_default=True ), - "rehype-katex@7.0.1": ImportVar( + "rehype-katex@6.0.3": ImportVar( tag=_REHYPE_KATEX._js_expr, is_default=True ), - "rehype-raw@7.0.0": ImportVar( + "rehype-raw@6.1.1": ImportVar( tag=_REHYPE_RAW._js_expr, is_default=True ), }, From 876426c581412546c3542a2cf44bb2ac9172f5e6 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 8 Oct 2024 09:14:35 -0700 Subject: [PATCH 114/201] test_dynamic_routes: log on_loads and poll for 60 seconds on order (#4089) Assert on `list(...order)` so the error message prints actual value instead of MutableProxy's repr. Not sure if this fixes it... --- tests/integration/test_dynamic_routes.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_dynamic_routes.py b/tests/integration/test_dynamic_routes.py index 35b83790f..31b7fa419 100644 --- a/tests/integration/test_dynamic_routes.py +++ b/tests/integration/test_dynamic_routes.py @@ -23,11 +23,15 @@ def DynamicRoute(): order: List[str] = [] def on_load(self): - self.order.append(f"{self.router.page.path}-{self.page_id or 'no page id'}") + page_data = f"{self.router.page.path}-{self.page_id or 'no page id'}" + print(f"on_load: {page_data}") + self.order.append(page_data) def on_load_redir(self): query_params = self.router.page.params - self.order.append(f"on_load_redir-{query_params}") + page_data = f"on_load_redir-{query_params}" + print(f"on_load_redir: {page_data}") + self.order.append(page_data) return rx.redirect(f"/page/{query_params['page_id']}") @rx.var @@ -221,8 +225,11 @@ def poll_for_order( dynamic_state_name ].order == exp_order - await AppHarness._poll_for_async(_check) - assert (await _backend_state()).substates[dynamic_state_name].order == exp_order + await AppHarness._poll_for_async(_check, timeout=60) + assert ( + list((await _backend_state()).substates[dynamic_state_name].order) + == exp_order + ) return _poll_for_order From 5e3cfecdeab4182e4a405e94fb2d78f7b70eb16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 8 Oct 2024 09:15:56 -0700 Subject: [PATCH 115/201] fix custom component init (#4123) --- reflex/custom_components/custom_components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/custom_components/custom_components.py b/reflex/custom_components/custom_components.py index 146bb12c2..ee24a7cd0 100644 --- a/reflex/custom_components/custom_components.py +++ b/reflex/custom_components/custom_components.py @@ -260,7 +260,7 @@ def _validate_library_name(library_name: str | None) -> NameVariants: # Module name is the snake case. module_name = "_".join(name_parts) - custom_component_module_dir = f"reflex_{module_name}" + custom_component_module_dir = Path(f"reflex_{module_name}") console.debug(f"Custom component source directory: {custom_component_module_dir}") # Use the same name for the directory and the app. From 02d4428e390c86820124a38c6c60ccf7e510ea81 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:36:19 +0200 Subject: [PATCH 116/201] default props comment for CartesianAxis (#4127) --- reflex/components/recharts/cartesian.py | 23 +++++++++++++---------- reflex/components/recharts/cartesian.pyi | 20 +++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 06ca80dc5..a2c19df93 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -811,28 +811,31 @@ class CartesianAxis(Grid): alias = "RechartsCartesianAxis" - # The orientation of axis 'top' | 'bottom' | 'left' | 'right' + # The orientation of axis 'top' | 'bottom' | 'left' | 'right'. Default: "bottom" orientation: Var[LiteralOrientationTopBottomLeftRight] - # If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. + # The box of viewing area. Default: {"x": 0, "y": 0, "width": 0, "height": 0} + view_box: Var[Dict[str, Any]] + + # If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. Default: True axis_line: Var[bool] - # If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. + # If set false, no ticks will be drawn. + tick: Var[bool] + + # If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. Default: True tick_line: Var[bool] - # The length of tick line. + # The length of tick line. Default: 6 tick_size: Var[int] - # If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. + # If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" interval: Var[LiteralInterval] - # If set false, no ticks will be drawn. - ticks: Var[bool] - # If set a string or a number, default label will be drawn, and the option is content. - label: Var[str] + label: Var[Union[str, int]] - # If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. + # If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False mirror: Var[bool] # The margin between tick line and tick. diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index e7b186f6f..354e31db9 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -2179,7 +2179,9 @@ class CartesianAxis(Grid): Var[Literal["bottom", "left", "right", "top"]], ] ] = None, + view_box: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, axis_line: Optional[Union[Var[bool], bool]] = None, + tick: Optional[Union[Var[bool], bool]] = None, tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, interval: Optional[ @@ -2188,8 +2190,7 @@ class CartesianAxis(Grid): Var[Literal["preserveEnd", "preserveStart", "preserveStartEnd"]], ] ] = None, - ticks: Optional[Union[Var[bool], bool]] = None, - label: Optional[Union[Var[str], str]] = None, + label: Optional[Union[Var[Union[int, str]], int, str]] = None, mirror: Optional[Union[Var[bool], bool]] = None, tick_margin: Optional[Union[Var[int], int]] = None, x: Optional[Union[Var[int], int]] = None, @@ -2243,14 +2244,15 @@ class CartesianAxis(Grid): Args: *children: The children of the component. - orientation: The orientation of axis 'top' | 'bottom' | 'left' | 'right' - axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. - tick_line: If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. - tick_size: The length of tick line. - interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. - ticks: If set false, no ticks will be drawn. + orientation: The orientation of axis 'top' | 'bottom' | 'left' | 'right'. Default: "bottom" + view_box: The box of viewing area. Default: {"x": 0, "y": 0, "width": 0, "height": 0} + axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. Default: True + tick: If set false, no ticks will be drawn. + tick_line: If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. Default: True + tick_size: The length of tick line. Default: 6 + interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" label: If set a string or a number, default label will be drawn, and the option is content. - mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. + mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False tick_margin: The margin between tick line and tick. x: The x-coordinate of grid. y: The y-coordinate of grid. From 4982b450fe6ac63049dc79b78d4154348773cc5f Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:36:27 +0200 Subject: [PATCH 117/201] default props comment for CartesianGrid (#4126) --- reflex/components/recharts/cartesian.py | 14 +++++++------- reflex/components/recharts/cartesian.pyi | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index a2c19df93..b44f3b22b 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -779,28 +779,28 @@ class CartesianGrid(Grid): alias = "RechartsCartesianGrid" - # The horizontal line configuration. + # The horizontal line configuration. Default: True horizontal: Var[bool] - # The vertical line configuration. + # The vertical line configuration. Default: True vertical: Var[bool] - # The x-coordinates in pixel values of all vertical lines. + # The x-coordinates in pixel values of all vertical lines. Default: [] vertical_points: Var[List[Union[str, int]]] - # The x-coordinates in pixel values of all vertical lines. + # The x-coordinates in pixel values of all vertical lines. Default: [] horizontal_points: Var[List[Union[str, int]]] # The background of grid. fill: Var[Union[str, Color]] - # The opacity of the background used to fill the space between grid lines + # The opacity of the background used to fill the space between grid lines. fill_opacity: Var[float] - # The pattern of dashes and gaps used to paint the lines of the grid + # The pattern of dashes and gaps used to paint the lines of the grid. stroke_dasharray: Var[str] - # the stroke color of grid + # the stroke color of grid. Default: rx.color("gray", 7) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 7)) diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 354e31db9..77d41e2c2 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -2142,14 +2142,14 @@ class CartesianGrid(Grid): Args: *children: The children of the component. - horizontal: The horizontal line configuration. - vertical: The vertical line configuration. - vertical_points: The x-coordinates in pixel values of all vertical lines. - horizontal_points: The x-coordinates in pixel values of all vertical lines. + horizontal: The horizontal line configuration. Default: True + vertical: The vertical line configuration. Default: True + vertical_points: The x-coordinates in pixel values of all vertical lines. Default: [] + horizontal_points: The x-coordinates in pixel values of all vertical lines. Default: [] fill: The background of grid. - fill_opacity: The opacity of the background used to fill the space between grid lines - stroke_dasharray: The pattern of dashes and gaps used to paint the lines of the grid - stroke: the stroke color of grid + fill_opacity: The opacity of the background used to fill the space between grid lines. + stroke_dasharray: The pattern of dashes and gaps used to paint the lines of the grid. + stroke: the stroke color of grid. Default: rx.color("gray", 7) x: The x-coordinate of grid. y: The y-coordinate of grid. width: The width of grid. From cb4ff24dc097f738a53c623fa9217dfbe5287ee8 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:37:10 +0200 Subject: [PATCH 118/201] default props comment for ReferenceLine (#4122) --- reflex/components/recharts/cartesian.py | 2 +- reflex/components/recharts/cartesian.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index b44f3b22b..3bec9335f 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -652,7 +652,7 @@ class ReferenceLine(Reference): # The color of the reference line. stroke: Var[Union[str, Color]] - # The width of the stroke. + # The width of the stroke. Default: 1 stroke_width: Var[Union[str, int]] # Valid children components diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 77d41e2c2..e52ac466d 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1795,7 +1795,7 @@ class ReferenceLine(Reference): x: If set a string or a number, a vertical line perpendicular to the x-axis specified by xAxisId will be drawn. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys, otherwise no line will be drawn. y: If set a string or a number, a horizontal line perpendicular to the y-axis specified by yAxisId will be drawn. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys, otherwise no line will be drawn. stroke: The color of the reference line. - stroke_width: The width of the stroke. + stroke_width: The width of the stroke. Default: 1 segment: Array of endpoints in { x, y } format. These endpoints would be used to draw the ReferenceLine. x_axis_id: The id of x-axis which is corresponding to the data. y_axis_id: The id of y-axis which is corresponding to the data. From c619c722119e4c3033c32b91995262475e8ec6d9 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 8 Oct 2024 13:25:49 -0700 Subject: [PATCH 119/201] use system npm when REFLEX_USE_SYSTEM_NODE is passed (#4133) --- reflex/utils/path_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index 1de635b88..79596716c 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -196,7 +196,7 @@ def get_npm_path() -> str | None: The path to the npm binary file. """ npm_path = Path(constants.Node.NPM_PATH) - if not npm_path.exists(): + if use_system_node() or not npm_path.exists(): return str(which("npm")) return str(npm_path) From 567cf7ea380d45520b3a7c0eabcb6b0633277684 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:49:30 +0200 Subject: [PATCH 120/201] default props comment for ReferenceArea (#4124) --- reflex/components/recharts/cartesian.py | 4 ++-- reflex/components/recharts/cartesian.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 3bec9335f..108024fa6 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -746,10 +746,10 @@ class ReferenceArea(Recharts): # A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis. y2: Var[Union[str, int]] - # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. + # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" if_overflow: Var[LiteralIfOverflow] - # If set true, the line will be rendered in front of bars in BarChart, etc. + # If set true, the line will be rendered in front of bars in BarChart, etc. Default: False is_front: Var[bool] # Valid children components diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index e52ac466d..05a7afee1 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1984,8 +1984,8 @@ class ReferenceArea(Recharts): x2: A boundary value of the area. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys. If one of x1 or x2 is invalidate, the area will cover along x-axis. y1: A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis. y2: A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis. - if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. - is_front: If set true, the line will be rendered in front of bars in BarChart, etc. + if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" + is_front: If set true, the line will be rendered in front of bars in BarChart, etc. Default: False style: The style of the component. key: A unique key for the component. id: The id for the component. From be980c6b1efb68e06c378e739a15d3a03ed9fe86 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:54:42 +0200 Subject: [PATCH 121/201] default props comment for Scatter (#4118) --- reflex/components/recharts/cartesian.py | 29 +++++++++++------------- reflex/components/recharts/cartesian.pyi | 28 +++++++++++------------ 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 108024fa6..627b42ea0 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -459,46 +459,43 @@ class Scatter(Recharts): # The source data, in which each element is an object. data: Var[List[Dict[str, Any]]] - # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none' + # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'. Default: "circle" legend_type: Var[LiteralLegendType] - # The id of x-axis which is corresponding to the data. + # The id of x-axis which is corresponding to the data. Default: 0 x_axis_id: Var[Union[str, int]] - # The id of y-axis which is corresponding to the data. + # The id of y-axis which is corresponding to the data. Default: 0 y_axis_id: Var[Union[str, int]] - # The id of z-axis which is corresponding to the data. - z_axis_id: Var[str] + # The id of z-axis which is corresponding to the data. Default: 0 + z_axis_id: Var[Union[str, int]] - # If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. + # If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. Default: False line: Var[bool] - # If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' + # If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'. Default: "circle" shape: Var[LiteralShape] - # If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting' + # If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting'. Default: "joint" line_type: Var[LiteralLineType] - # The fill + # The fill color of the scatter. Default: rx.color("accent", 9) fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9)) - # the name - name: Var[Union[str, int]] - # Valid children components. _valid_children: List[str] = ["LabelList", "ErrorBar"] - # If set false, animation of bar will be disabled. + # If set false, animation of bar will be disabled. Default: True in CSR, False in SSR is_animation_active: Var[bool] - # Specifies when the animation should begin, the unit of this option is ms, default 0. + # Specifies when the animation should begin, the unit of this option is ms. Default: 0 animation_begin: Var[int] - # Specifies the duration of animation, the unit of this option is ms, default 1500. + # Specifies the duration of animation, the unit of this option is ms. Default: 1500 animation_duration: Var[int] - # The type of easing function, default 'ease' + # The type of easing function. Default: "ease" animation_easing: Var[LiteralAnimationEasing] # The customized event handler of click on the component in this group diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 05a7afee1..9b61b46f8 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1331,7 +1331,7 @@ class Scatter(Recharts): ] = None, x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, - z_axis_id: Optional[Union[Var[str], str]] = None, + z_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, line: Optional[Union[Var[bool], bool]] = None, shape: Optional[ Union[ @@ -1355,7 +1355,6 @@ class Scatter(Recharts): Union[Literal["fitting", "joint"], Var[Literal["fitting", "joint"]]] ] = None, fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, - name: Optional[Union[Var[Union[int, str]], int, str]] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_begin: Optional[Union[Var[int], int]] = None, animation_duration: Optional[Union[Var[int], int]] = None, @@ -1413,19 +1412,18 @@ class Scatter(Recharts): Args: *children: The children of the component. data: The source data, in which each element is an object. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none' - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - z_axis_id: The id of z-axis which is corresponding to the data. - line: If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. - shape: If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' - line_type: If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting' - fill: The fill - name: the name - is_animation_active: If set false, animation of bar will be disabled. - animation_begin: Specifies when the animation should begin, the unit of this option is ms, default 0. - animation_duration: Specifies the duration of animation, the unit of this option is ms, default 1500. - animation_easing: The type of easing function, default 'ease' + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'. Default: "circle" + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + z_axis_id: The id of z-axis which is corresponding to the data. Default: 0 + line: If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. Default: False + shape: If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'. Default: "circle" + line_type: If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting'. Default: "joint" + fill: The fill color of the scatter. Default: rx.color("accent", 9) + is_animation_active: If set false, animation of bar will be disabled. Default: True in CSR, False in SSR + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. Default: "ease" style: The style of the component. key: A unique key for the component. id: The id for the component. From abf0329cd97f494e1d61cf289f8f9848ed8a3f61 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:56:11 +0200 Subject: [PATCH 122/201] default props comment for Area (#4115) --- reflex/components/recharts/cartesian.py | 29 +++++++++++++----------- reflex/components/recharts/cartesian.pyi | 26 ++++++++++++--------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 627b42ea0..d982d1a0e 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -295,22 +295,22 @@ class Area(Cartesian): alias = "RechartsArea" - # The color of the line stroke. + # The color of the line stroke. Default: rx.color("accent", 9) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9)) - # The width of the line stroke. - stroke_width: Var[int] = LiteralVar.create(1) + # The width of the line stroke. Default: 1 + stroke_width: Var[int] - # The color of the area fill. + # The color of the area fill. Default: rx.color("accent", 5) fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 5)) - # The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | + # The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter'. Default: "monotone" type_: Var[LiteralAreaType] = LiteralVar.create("monotone") - # If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. + # If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. Default: False dot: Var[Union[bool, Dict[str, Any]]] - # The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. + # The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {stroke: rx.color("accent", 2), fill: rx.color("accent", 10)} active_dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create( { "stroke": Color("accent", 2), @@ -318,17 +318,20 @@ class Area(Cartesian): } ) - # If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. + # If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. Default: False label: Var[bool] + # The value which can describle the line, usually calculated internally. + base_line: Var[Union[str, List[Dict[str, Any]]]] + + # The coordinates of all the points in the area, usually calculated internally. + points: Var[List[Dict[str, Any]]] + # The stack id of area, when two areas have the same value axis and same stack_id, then the two areas are stacked in order. stack_id: Var[Union[str, int]] - # The unit of data. This option will be used in tooltip. - unit: Var[Union[str, int]] - - # The name of data. This option will be used in tooltip and legend to represent a bar. If no value was set to this option, the value of dataKey will be used alternatively. - name: Var[Union[str, int]] + # Whether to connect a graph area across null points. Default: False + connect_nulls: Var[bool] # Valid children components _valid_children: List[str] = ["LabelList"] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 9b61b46f8..94b109531 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -843,9 +843,12 @@ class Area(Cartesian): Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, label: Optional[Union[Var[bool], bool]] = None, + base_line: Optional[ + Union[List[Dict[str, Any]], Var[Union[List[Dict[str, Any]], str]], str] + ] = None, + points: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, stack_id: Optional[Union[Var[Union[int, str]], int, str]] = None, - unit: Optional[Union[Var[Union[int, str]], int, str]] = None, - name: Optional[Union[Var[Union[int, str]], int, str]] = None, + connect_nulls: Optional[Union[Var[bool], bool]] = None, layout: Optional[ Union[ Literal["horizontal", "vertical"], @@ -934,16 +937,17 @@ class Area(Cartesian): Args: *children: The children of the component. - stroke: The color of the line stroke. - stroke_width: The width of the line stroke. - fill: The color of the area fill. - type_: The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | - dot: If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. - active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. - label: If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. + stroke: The color of the line stroke. Default: rx.color("accent", 9) + stroke_width: The width of the line stroke. Default: 1 + fill: The color of the area fill. Default: rx.color("accent", 5) + type_: The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter'. Default: "monotone" + dot: If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. Default: False + active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {stroke: rx.color("accent", 2), fill: rx.color("accent", 10)} + label: If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. Default: False + base_line: The value which can describle the line, usually calculated internally. + points: The coordinates of all the points in the area, usually calculated internally. stack_id: The stack id of area, when two areas have the same value axis and same stack_id, then the two areas are stacked in order. - unit: The unit of data. This option will be used in tooltip. - name: The name of data. This option will be used in tooltip and legend to represent a bar. If no value was set to this option, the value of dataKey will be used alternatively. + connect_nulls: Whether to connect a graph area across null points. Default: False layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical' data_key: The key of a group of data which should be unique in an area chart. x_axis_id: The id of x-axis which is corresponding to the data. From 2652a04be8d7914bf33f657531fbeca346f9787a Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:57:11 +0200 Subject: [PATCH 123/201] default props comment for Line (#4117) --- reflex/components/recharts/cartesian.py | 19 +++++++++++-------- reflex/components/recharts/cartesian.pyi | 18 ++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index d982d1a0e..2d0655866 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -411,13 +411,13 @@ class Line(Cartesian): # The interpolation type of line. And customized interpolation function can be set to type. It's the same as type in Area. type_: Var[LiteralAreaType] - # The color of the line stroke. + # The color of the line stroke. Default: rx.color("accent", 9) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9)) - # The width of the line stroke. + # The width of the line stroke. Default: 1 stroke_width: Var[int] - # The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. + # The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 10), "fill": rx.color("accent", 4)} dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create( { "stroke": Color("accent", 10), @@ -425,7 +425,7 @@ class Line(Cartesian): } ) - # The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. + # The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 2), "fill": rx.color("accent", 10)} active_dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create( { "stroke": Color("accent", 2), @@ -433,10 +433,10 @@ class Line(Cartesian): } ) - # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. + # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False label: Var[bool] - # Hides the line when true, useful when toggling visibility state via legend. + # Hides the line when true, useful when toggling visibility state via legend. Default: False hide: Var[bool] # Whether to connect a graph line across null points. @@ -445,8 +445,11 @@ class Line(Cartesian): # The unit of data. This option will be used in tooltip. unit: Var[Union[str, int]] - # The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. - name: Var[Union[str, int]] + # The coordinates of all the points in the line, usually calculated internally. + points: Var[List[Dict[str, Any]]] + + # The pattern of dashes and gaps used to paint the line. + stroke_dasharray: Var[str] # Valid children components _valid_children: List[str] = ["LabelList", "ErrorBar"] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 94b109531..26479b394 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1177,7 +1177,8 @@ class Line(Cartesian): hide: Optional[Union[Var[bool], bool]] = None, connect_nulls: Optional[Union[Var[bool], bool]] = None, unit: Optional[Union[Var[Union[int, str]], int, str]] = None, - name: Optional[Union[Var[Union[int, str]], int, str]] = None, + points: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, + stroke_dasharray: Optional[Union[Var[str], str]] = None, layout: Optional[ Union[ Literal["horizontal", "vertical"], @@ -1267,15 +1268,16 @@ class Line(Cartesian): Args: *children: The children of the component. type_: The interpolation type of line. And customized interpolation function can be set to type. It's the same as type in Area. - stroke: The color of the line stroke. - stroke_width: The width of the line stroke. - dot: The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. - active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. - label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. - hide: Hides the line when true, useful when toggling visibility state via legend. + stroke: The color of the line stroke. Default: rx.color("accent", 9) + stroke_width: The width of the line stroke. Default: 1 + dot: The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 10), "fill": rx.color("accent", 4)} + active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 2), "fill": rx.color("accent", 10)} + label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False + hide: Hides the line when true, useful when toggling visibility state via legend. Default: False connect_nulls: Whether to connect a graph line across null points. unit: The unit of data. This option will be used in tooltip. - name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. + points: The coordinates of all the points in the line, usually calculated internally. + stroke_dasharray: The pattern of dashes and gaps used to paint the line. layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical' data_key: The key of a group of data which should be unique in an area chart. x_axis_id: The id of x-axis which is corresponding to the data. From 7b88c54d138003ef9237f38fecaadf7b5fc3fc12 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:58:22 +0200 Subject: [PATCH 124/201] default props comment for Bar (#4116) --- reflex/components/recharts/cartesian.py | 28 ++++++------------------ reflex/components/recharts/cartesian.pyi | 27 +++++------------------ 2 files changed, 12 insertions(+), 43 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 2d0655866..b37c036f4 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -350,12 +350,13 @@ class Bar(Cartesian): # The width of the line stroke. stroke_width: Var[int] - # The width of the line stroke. + # The width of the line stroke. Default: Color("accent", 9) fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9)) - # If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally. + + # If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally. Default: False background: Var[bool] - # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. + # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False label: Var[bool] # The stack id of bar, when two bars have the same value axis and same stack_id, then the two bars are stacked in order. @@ -376,30 +377,15 @@ class Bar(Cartesian): # Max size of the bar max_bar_size: Var[int] + # If set a value, the option is the radius of all the rounded corners. If set a array, the option are in turn the radiuses of top-left corner, top-right corner, bottom-right corner, bottom-left corner. Default: 0 + radius: Var[Union[int, List[int]]] + # The active bar is shown when a user enters a bar chart and this chart has tooltip. If set to false, no active bar will be drawn. If set to true, active bar will be drawn with the props calculated internally. If passed an object, active bar will be drawn, and the internally calculated props will be merged with the key value pairs of the passed object. # active_bar: Var[Union[bool, Dict[str, Any]]] # Valid children components _valid_children: List[str] = ["Cell", "LabelList", "ErrorBar"] - # If set false, animation of bar will be disabled. - is_animation_active: Var[bool] - - # Specifies when the animation should begin, the unit of this option is ms, default 0. - animation_begin: Var[int] - - # Specifies the duration of animation, the unit of this option is ms, default 1500. - animation_duration: Var[int] - - # The type of easing function, default 'ease' - animation_easing: Var[LiteralAnimationEasing] - - # The customized event handler of animation start - on_animation_start: EventHandler[lambda: []] - - # The customized event handler of animation end - on_animation_end: EventHandler[lambda: []] - class Line(Cartesian): """A Line component in Recharts.""" diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 26479b394..9971116df 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -983,15 +983,7 @@ class Bar(Cartesian): name: Optional[Union[Var[Union[int, str]], int, str]] = None, bar_size: Optional[Union[Var[int], int]] = None, max_bar_size: Optional[Union[Var[int], int]] = None, - is_animation_active: Optional[Union[Var[bool], bool]] = None, - animation_begin: Optional[Union[Var[int], int]] = None, - animation_duration: Optional[Union[Var[int], int]] = None, - animation_easing: Optional[ - Union[ - Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], - Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], - ] - ] = None, + radius: Optional[Union[List[int], Var[Union[List[int], int]], int]] = None, layout: Optional[ Union[ Literal["horizontal", "vertical"], @@ -1039,12 +1031,6 @@ class Bar(Cartesian): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ @@ -1088,19 +1074,16 @@ class Bar(Cartesian): *children: The children of the component. stroke: The color of the line stroke. stroke_width: The width of the line stroke. - fill: The width of the line stroke. - background: If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally. - label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. + fill: The width of the line stroke. Default: Color("accent", 9) + background: If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally. Default: False + label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False stack_id: The stack id of bar, when two bars have the same value axis and same stack_id, then the two bars are stacked in order. unit: The unit of data. This option will be used in tooltip. min_point_size: The minimal height of a bar in a horizontal BarChart, or the minimal width of a bar in a vertical BarChart. By default, 0 values are not shown. To visualize a 0 (or close to zero) point, set the minimal point size to a pixel value like 3. In stacked bar charts, minPointSize might not be respected for tightly packed values. So we strongly recommend not using this prop in stacked BarCharts. name: The name of data. This option will be used in tooltip and legend to represent a bar. If no value was set to this option, the value of dataKey will be used alternatively. bar_size: Size of the bar (if one bar_size is set then a bar_size must be set for all bars) max_bar_size: Max size of the bar - is_animation_active: If set false, animation of bar will be disabled. - animation_begin: Specifies when the animation should begin, the unit of this option is ms, default 0. - animation_duration: Specifies the duration of animation, the unit of this option is ms, default 1500. - animation_easing: The type of easing function, default 'ease' + radius: If set a value, the option is the radius of all the rounded corners. If set a array, the option are in turn the radiuses of top-left corner, top-right corner, bottom-right corner, bottom-left corner. Default: 0 layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical' data_key: The key of a group of data which should be unique in an area chart. x_axis_id: The id of x-axis which is corresponding to the data. From 4843081089b45c0d00007996139d201a6ba1d0f0 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:05:22 +0200 Subject: [PATCH 125/201] default props comment for Brush (#4113) --- reflex/components/recharts/cartesian.py | 22 +++++++++++----------- reflex/components/recharts/cartesian.pyi | 18 +++++++++--------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index b37c036f4..29b48d800 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -192,40 +192,40 @@ class Brush(Recharts): alias = "RechartsBrush" - # Stroke color + # Stroke color. Default: rx.color("gray", 9) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 9)) - # The fill color of brush. + # The fill color of brush. Default: rx.color("gray", 2) fill: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 2)) # The key of data displayed in the axis. data_key: Var[Union[str, int]] - # The x-coordinate of brush. + # The x-coordinate of brush. Default: 0 x: Var[int] - # The y-coordinate of brush. + # The y-coordinate of brush. Default: 0 y: Var[int] - # The width of brush. + # The width of brush. Default: 0 width: Var[int] - # The height of brush. + # The height of brush. Default: 40 height: Var[int] - # The data domain of brush, [min, max]. + # The original data of a LineChart, a BarChart or an AreaChart. data: Var[List[Any]] - # The width of each traveller. + # The width of each traveller. Default: 5 traveller_width: Var[int] - # The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time + # The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time. Default: 1 gap: Var[int] - # The default start index of brush. If the option is not set, the start index will be 0. + # The default start index of brush. If the option is not set, the start index will be 0. Default: 0 start_index: Var[int] - # The default end index of brush. If the option is not set, the end index will be 1. + # The default end index of brush. If the option is not set, the end index will be calculated by the length of data. end_index: Var[int] # The fill color of brush diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 9971116df..846424331 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -653,15 +653,15 @@ class Brush(Recharts): stroke: The stroke color of brush fill: The fill color of brush data_key: The key of data displayed in the axis. - x: The x-coordinate of brush. - y: The y-coordinate of brush. - width: The width of brush. - height: The height of brush. - data: The data domain of brush, [min, max]. - traveller_width: The width of each traveller. - gap: The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time - start_index: The default start index of brush. If the option is not set, the start index will be 0. - end_index: The default end index of brush. If the option is not set, the end index will be 1. + x: The x-coordinate of brush. Default: 0 + y: The y-coordinate of brush. Default: 0 + width: The width of brush. Default: 0 + height: The height of brush. Default: 40 + data: The original data of a LineChart, a BarChart or an AreaChart. + traveller_width: The width of each traveller. Default: 5 + gap: The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time. Default: 1 + start_index: The default start index of brush. If the option is not set, the start index will be 0. Default: 0 + end_index: The default end index of brush. If the option is not set, the end index will be calculated by the length of data. style: The style of the component. key: A unique key for the component. id: The id for the component. From c3b7caaf13a044211073f8968fbe7131eeee259a Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:06:05 +0200 Subject: [PATCH 126/201] default props comment for ZAxis (#4112) --- reflex/components/recharts/cartesian.py | 7 +++++-- reflex/components/recharts/cartesian.pyi | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 29b48d800..2a6e88e59 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -172,7 +172,10 @@ class ZAxis(Recharts): # The key of data displayed in the axis. data_key: Var[Union[str, int]] - # The range of axis. + # The unique id of z-axis. Default: 0 + z_axis_id: Var[Union[str, int]] + + # The range of axis. Default: [10, 10] range: Var[List[int]] # The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. @@ -181,7 +184,7 @@ class ZAxis(Recharts): # The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. name: Var[Union[str, int]] - # If 'auto' set, the scale function is decided by the type of chart, and the props type. + # If 'auto' set, the scale function is decided by the type of chart, and the props type. Default: "auto" scale: Var[LiteralScale] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 846424331..e8d0dfc5c 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -510,6 +510,7 @@ class ZAxis(Recharts): cls, *children, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + z_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, range: Optional[Union[List[int], Var[List[int]]]] = None, unit: Optional[Union[Var[Union[int, str]], int, str]] = None, name: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -601,10 +602,11 @@ class ZAxis(Recharts): Args: *children: The children of the component. data_key: The key of data displayed in the axis. - range: The range of axis. + z_axis_id: The unique id of z-axis. Default: 0 + range: The range of axis. Default: [10, 10] unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. - scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. + scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. Default: "auto" style: The style of the component. key: A unique key for the component. id: The id for the component. From 19df34d94109fdcb258def604d9eb7e1f59f2650 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:07:24 +0200 Subject: [PATCH 127/201] default props comment for YAxis (#4111) * default props comment for YAxis * axis id --- reflex/components/recharts/cartesian.py | 8 ++++---- reflex/components/recharts/cartesian.pyi | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 2a6e88e59..a0ab1ddf8 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -152,14 +152,14 @@ class YAxis(Axis): alias = "RechartsYAxis" - # The orientation of axis 'left' | 'right' + # The orientation of axis 'left' | 'right'. Default: "left" orientation: Var[LiteralOrientationLeftRight] - # The id of y-axis which is corresponding to the data. + # The id of y-axis which is corresponding to the data. Default: 0 y_axis_id: Var[Union[str, int]] - # The range of the axis. Work best in conjuction with allow_data_overflow. - domain: Var[List] + # Specify the padding of y-axis. Default: {"top": 0, "bottom": 0} + padding: Var[Dict[str, int]] class ZAxis(Recharts): diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index e8d0dfc5c..f9d9686dd 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -348,7 +348,7 @@ class YAxis(Axis): Union[Literal["left", "right"], Var[Literal["left", "right"]]] ] = None, y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, - domain: Optional[Union[List, Var[List]]] = None, + padding: Optional[Union[Dict[str, int], Var[Dict[str, int]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, hide: Optional[Union[Var[bool], bool]] = None, width: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -464,9 +464,9 @@ class YAxis(Axis): Args: *children: The children of the component. - orientation: The orientation of axis 'left' | 'right' - y_axis_id: The id of y-axis which is corresponding to the data. - domain: The range of the axis. Work best in conjuction with allow_data_overflow. + orientation: The orientation of axis 'left' | 'right'. Default: "left" + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + padding: Specify the padding of y-axis. Default: {"top": 0, "bottom": 0} data_key: The key of data displayed in the axis. hide: If set true, the axis do not display in the chart. width: The width of axis which is usually calculated internally. From 9c7de9b1891ac1bd9ea755e4cbc2f98073b07dc3 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:09:03 +0200 Subject: [PATCH 128/201] default props comment for XAxis (#4110) * default props comment for XAxis * axis id --- reflex/components/recharts/cartesian.py | 16 ++++++++-------- reflex/components/recharts/cartesian.pyi | 12 +++++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index a0ab1ddf8..5515162cc 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -129,20 +129,20 @@ class XAxis(Axis): alias = "RechartsXAxis" - # The orientation of axis 'top' | 'bottom' + # The orientation of axis 'top' | 'bottom'. Default: "bottom" orientation: Var[LiteralOrientationTopBottom] - # The id of x-axis which is corresponding to the data. + # The id of x-axis which is corresponding to the data. Default: 0 x_axis_id: Var[Union[str, int]] - # Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden - include_hidden: Var[bool] = LiteralVar.create(False) + # Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden. Default: False + include_hidden: Var[bool] - # The range of the axis. Work best in conjuction with allow_data_overflow. - domain: Var[List] + # The angle of axis ticks. Default: 0 + angle: Var[int] - # The range of the axis. Work best in conjuction with allow_data_overflow. - domain: Var[List] + # Specify the padding of x-axis. Default: {"left": 0, "right": 0} + padding: Var[Dict[str, int]] class YAxis(Axis): diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index f9d9686dd..30f6a4160 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -182,7 +182,8 @@ class XAxis(Axis): ] = None, x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, include_hidden: Optional[Union[Var[bool], bool]] = None, - domain: Optional[Union[List, Var[List]]] = None, + angle: Optional[Union[Var[int], int]] = None, + padding: Optional[Union[Dict[str, int], Var[Dict[str, int]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, hide: Optional[Union[Var[bool], bool]] = None, width: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -298,10 +299,11 @@ class XAxis(Axis): Args: *children: The children of the component. - orientation: The orientation of axis 'top' | 'bottom' - x_axis_id: The id of x-axis which is corresponding to the data. - include_hidden: Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden - domain: The range of the axis. Work best in conjuction with allow_data_overflow. + orientation: The orientation of axis 'top' | 'bottom'. Default: "bottom" + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + include_hidden: Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden. Default: False + angle: The angle of axis ticks. Default: 0 + padding: Specify the padding of x-axis. Default: {"left": 0, "right": 0} data_key: The key of data displayed in the axis. hide: If set true, the axis do not display in the chart. width: The width of axis which is usually calculated internally. From e633cd0385687e86695357b7a734fe729b1c821a Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:11:32 +0200 Subject: [PATCH 129/201] default props comment for Legend (#4100) --- reflex/components/recharts/general.py | 11 +++++++---- reflex/components/recharts/general.pyi | 14 +++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index cc252de57..25c742227 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -73,21 +73,24 @@ class Legend(Recharts): # The height of legend container. Number height: Var[int] - # The layout of legend items. 'horizontal' | 'vertical' + # The layout of legend items. 'horizontal' | 'vertical'. Default: "horizontal" layout: Var[LiteralLayout] - # The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. + # The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. Default: "center" align: Var[LiteralLegendAlign] - # The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. + # The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. Default: "bottom" vertical_align: Var[LiteralVerticalAlign] - # The size of icon in each legend item. + # The size of icon in each legend item. Default: 14 icon_size: Var[int] # The type of icon in each legend item. 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' icon_type: Var[LiteralIconType] + # The source data of the content to be displayed in the legend, usually calculated internally. Default: [] + payload: Var[List[Dict[str, Any]]] + # The width of chart container, usually calculated internally. chart_width: Var[int] diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index 0e21c8b85..3b77e32d0 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -3,7 +3,7 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color @@ -150,6 +150,9 @@ class Legend(Recharts): ], ] ] = None, + payload: Optional[ + Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]] + ] = None, chart_width: Optional[Union[Var[int], int]] = None, chart_height: Optional[Union[Var[int], int]] = None, margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, @@ -202,11 +205,12 @@ class Legend(Recharts): *children: The children of the component. width: The width of legend container. Number height: The height of legend container. Number - layout: The layout of legend items. 'horizontal' | 'vertical' - align: The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. - vertical_align: The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. - icon_size: The size of icon in each legend item. + layout: The layout of legend items. 'horizontal' | 'vertical'. Default: "horizontal" + align: The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. Default: "center" + vertical_align: The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. Default: "bottom" + icon_size: The size of icon in each legend item. Default: 14 icon_type: The type of icon in each legend item. 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' + payload: The source data of the content to be displayed in the legend, usually calculated internally. Default: [] chart_width: The width of chart container, usually calculated internally. chart_height: The height of chart container, usually calculated internally. margin: The margin of chart container, usually calculated internally. From 2718cb51eb29c62d5b1dbde900b6af9328cb371e Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:17:14 +0200 Subject: [PATCH 130/201] default props comment for PolarAgnleAxis (#4106) --- reflex/components/recharts/polar.py | 20 ++++++++++---------- reflex/components/recharts/polar.pyi | 24 ++++++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index adeb0eb91..30def03da 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -211,28 +211,28 @@ class PolarAngleAxis(Recharts): # The outer radius of circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. radius: Var[Union[int, str]] - # If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. + # If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. Default: True axis_line: Var[Union[bool, Dict[str, Any]]] - # The type of axis line. - axis_line_type: Var[str] + # The type of axis line. Default: "polygon" + axis_line_type: Var[LiteralGridType] - # If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. + # If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. Default: False tick_line: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(False) - # The width or height of tick. - tick: Var[Union[int, str]] + # If false set, ticks will not be drawn. If true set, ticks will be drawn which have the props calculated internally. If object set, ticks will be drawn which have the props mergered by the internal calculated props and the option. Default: True + tick: Var[Union[bool, Dict[str, Any]]] # The array of every tick's value and angle. ticks: Var[List[Dict[str, Any]]] - # The orientation of axis text. - orient: Var[str] + # The orientation of axis text. Default: "outer" + orientation: Var[str] - # The stroke color of axis + # The stroke color of axis. Default: rx.color("gray", 10) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) - # Allow the axis has duplicated categorys or not when the type of axis is "category". + # Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True allow_duplicated_category: Var[bool] # Valid children components. diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 9d793f3da..12a330950 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -312,13 +312,17 @@ class PolarAngleAxis(Recharts): axis_line: Optional[ Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, - axis_line_type: Optional[Union[Var[str], str]] = None, + axis_line_type: Optional[ + Union[Literal["circle", "polygon"], Var[Literal["circle", "polygon"]]] + ] = None, tick_line: Optional[ Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, - tick: Optional[Union[Var[Union[int, str]], int, str]] = None, + tick: Optional[ + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] + ] = None, ticks: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, - orient: Optional[Union[Var[str], str]] = None, + orientation: Optional[Union[Var[str], str]] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, allow_duplicated_category: Optional[Union[Var[bool], bool]] = None, style: Optional[Style] = None, @@ -372,14 +376,14 @@ class PolarAngleAxis(Recharts): cx: The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. cy: The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. radius: The outer radius of circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. - axis_line: If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. - axis_line_type: The type of axis line. - tick_line: If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. - tick: The width or height of tick. + axis_line: If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. Default: True + axis_line_type: The type of axis line. Default: "polygon" + tick_line: If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. Default: False + tick: If false set, ticks will not be drawn. If true set, ticks will be drawn which have the props calculated internally. If object set, ticks will be drawn which have the props mergered by the internal calculated props and the option. Default: True ticks: The array of every tick's value and angle. - orient: The orientation of axis text. - stroke: The stroke color of axis - allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". + orientation: The orientation of axis text. Default: "outer" + stroke: The stroke color of axis. Default: rx.color("gray", 10) + allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True style: The style of the component. key: A unique key for the component. id: The id for the component. From f05da7ceadef7e033bea8178489e36cee9a08f9c Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:17:59 +0200 Subject: [PATCH 131/201] default props comment for LabelList (#4102) --- reflex/components/recharts/general.py | 8 ++++---- reflex/components/recharts/general.pyi | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index 25c742227..559362f69 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -227,16 +227,16 @@ class LabelList(Recharts): # The key of a group of label values in data. data_key: Var[Union[str, int]] - # The position of each label relative to it view box。"Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" + # The position of each label relative to it view box. "Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" position: Var[LiteralPosition] - # The offset to the specified "position" + # The offset to the specified "position". Default: 5 offset: Var[int] - # The fill color of each label + # The fill color of each label. Default: rx.color("gray", 10) fill: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) - # The stroke color of each label + # The stroke color of each label. Default: "none" stroke: Var[Union[str, Color]] = LiteralVar.create("none") diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index 3b77e32d0..f9603041e 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -557,10 +557,10 @@ class LabelList(Recharts): Args: *children: The children of the component. data_key: The key of a group of label values in data. - position: The position of each label relative to it view box。"Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" - offset: The offset to the specified "position" - fill: The fill color of each label - stroke: The stroke color of each label + position: The position of each label relative to it view box. "Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" + offset: The offset to the specified "position". Default: 5 + fill: The fill color of each label. Default: rx.color("gray", 10) + stroke: The stroke color of each label. Default: "none" style: The style of the component. key: A unique key for the component. id: The id for the component. From 9f11b83fa96ac4bd9593848a9d15905457e3cf55 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:25:47 +0200 Subject: [PATCH 132/201] default props comment for treemap (#4098) --- reflex/components/recharts/charts.py | 17 ++++++++++------- reflex/components/recharts/charts.pyi | 16 +++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 6f79a70ae..40a99c81a 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -457,31 +457,34 @@ class Treemap(RechartsCharts): alias = "RechartsTreemap" - # The width of chart container. String or Integer + # The width of chart container. String or Integer. Default: "100%" width: Var[Union[str, int]] = "100%" # type: ignore - # The height of chart container. + # The height of chart container. String or Integer. Default: "100%" height: Var[Union[str, int]] = "100%" # type: ignore # data of treemap. Array data: Var[List[Dict[str, Any]]] - # The key of a group of data which should be unique in a treemap. String | Number | Function + # The key of a group of data which should be unique in a treemap. String | Number. Default: "value" data_key: Var[Union[str, int]] + # The key of each sector's name. String. Default: "name" + name_key: Var[str] + # The treemap will try to keep every single rectangle's aspect ratio near the aspectRatio given. Number aspect_ratio: Var[int] - # If set false, animation of area will be disabled. + # If set false, animation of area will be disabled. Default: True is_animation_active: Var[bool] - # Specifies when the animation should begin, the unit of this option is ms. + # Specifies when the animation should begin, the unit of this option is ms. Default: 0 animation_begin: Var[int] - # Specifies the duration of animation, the unit of this option is ms. + # Specifies the duration of animation, the unit of this option is ms. Default: 1500 animation_duration: Var[int] - # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" animation_easing: Var[LiteralAnimationEasing] # The customized event handler of animation start diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 2d5036656..de097bc8e 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -957,6 +957,7 @@ class Treemap(RechartsCharts): height: Optional[Union[Var[Union[int, str]], int, str]] = None, data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + name_key: Optional[Union[Var[str], str]] = None, aspect_ratio: Optional[Union[Var[int], int]] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_begin: Optional[Union[Var[int], int]] = None, @@ -1020,15 +1021,16 @@ class Treemap(RechartsCharts): Args: *children: The children of the chart component. - width: The width of chart container. String or Integer - height: The height of chart container. + width: The width of chart container. String or Integer. Default: "100%" + height: The height of chart container. String or Integer. Default: "100%" data: data of treemap. Array - data_key: The key of a group of data which should be unique in a treemap. String | Number | Function + data_key: The key of a group of data which should be unique in a treemap. String | Number. Default: "value" + name_key: The key of each sector's name. String. Default: "name" aspect_ratio: The treemap will try to keep every single rectangle's aspect ratio near the aspectRatio given. Number - is_animation_active: If set false, animation of area will be disabled. - animation_begin: Specifies when the animation should begin, the unit of this option is ms. - animation_duration: Specifies the duration of animation, the unit of this option is ms. - animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + is_animation_active: If set false, animation of area will be disabled. Default: True + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" style: The style of the component. key: A unique key for the component. id: The id for the component. From 2f8205216a2b87525d7d8426420689db8667674b Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:28:15 +0200 Subject: [PATCH 133/201] default props comment for ResponsiveContainer (#4099) --- reflex/components/recharts/general.py | 11 +++++++---- reflex/components/recharts/general.pyi | 9 +++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index 559362f69..270707a82 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -30,21 +30,24 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): # The aspect ratio of the container. The final aspect ratio of the SVG element will be (width / height) * aspect. Number aspect: Var[int] - # The width of chart container. Can be a number or string + # The width of chart container. Can be a number or string. Default: "100%" width: Var[Union[int, str]] - # The height of chart container. Number + # The height of chart container. Can be a number or string. Default: "100%" height: Var[Union[int, str]] - # The minimum width of chart container. + # The minimum width of chart container. Number min_width: Var[int] # The minimum height of chart container. Number min_height: Var[int] - # If specified a positive number, debounced function will be used to handle the resize event. + # If specified a positive number, debounced function will be used to handle the resize event. Default: 0 debounce: Var[int] + # If specified provides a callback providing the updated chart width and height values. + on_resize: EventHandler[lambda: []] + # Valid children components _valid_children: List[str] = [ "AreaChart", diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index f9603041e..9aa88a2d3 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -64,6 +64,7 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): on_mouse_up: Optional[ Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_resize: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ Union[EventHandler, EventSpec, list, Callable, Var] @@ -75,11 +76,11 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): Args: *children: The children of the component. aspect: The aspect ratio of the container. The final aspect ratio of the SVG element will be (width / height) * aspect. Number - width: The width of chart container. Can be a number or string - height: The height of chart container. Number - min_width: The minimum width of chart container. + width: The width of chart container. Can be a number or string. Default: "100%" + height: The height of chart container. Can be a number or string. Default: "100%" + min_width: The minimum width of chart container. Number min_height: The minimum height of chart container. Number - debounce: If specified a positive number, debounced function will be used to handle the resize event. + debounce: If specified a positive number, debounced function will be used to handle the resize event. Default: 0 style: The style of the component. key: A unique key for the component. id: The id for the component. From b0de28208fe9ef936f66867e3dfaeca342e6508b Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:30:34 +0200 Subject: [PATCH 134/201] default props comment for scatterchart (#4096) --- reflex/components/recharts/charts.py | 2 +- reflex/components/recharts/charts.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 40a99c81a..e2170d7e8 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -394,7 +394,7 @@ class ScatterChart(ChartBase): alias = "RechartsScatterChart" - # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + # The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5} margin: Var[Dict[str, Any]] # Valid children components diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index de097bc8e..d39167b4d 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -855,7 +855,7 @@ class ScatterChart(ChartBase): Args: *children: The children of the chart component. - margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + margin: The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5} width: The width of chart container. String or Integer height: The height of chart container. style: The style of the component. From 32a3cb61c1684fa6bb6022b534e4ccf96c5ed64b Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:41:40 +0200 Subject: [PATCH 135/201] default props comment for radarchart (#4094) --- reflex/components/recharts/charts.py | 14 +++++++------- reflex/components/recharts/charts.pyi | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index e2170d7e8..89c3e38fd 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -292,25 +292,25 @@ class RadarChart(ChartBase): # The source data, in which each element is an object. data: Var[List[Dict[str, Any]]] - # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. Default: {"top": 0, "right": 0, "left": 0, "bottom": 0} margin: Var[Dict[str, Any]] - # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage + # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage. Default: "50%" cx: Var[Union[int, str]] - # The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage + # The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage. Default: "50%" cy: Var[Union[int, str]] - # The angle of first radial direction line. + # The angle of first radial direction line. Default: 90 start_angle: Var[int] - # The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. + # The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. Default: -270 end_angle: Var[int] - # The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage + # The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: 0 inner_radius: Var[Union[int, str]] - # The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage + # The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "80%" outer_radius: Var[Union[int, str]] # Valid children components diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index d39167b4d..d79a8371c 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -697,13 +697,13 @@ class RadarChart(ChartBase): Args: *children: The children of the chart component. data: The source data, in which each element is an object. - margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. - cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage - cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage - start_angle: The angle of first radial direction line. - end_angle: The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. - inner_radius: The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage - outer_radius: The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage + margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. Default: {"top": 0, "right": 0, "left": 0, "bottom": 0} + cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage. Default: "50%" + cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage. Default: "50%" + start_angle: The angle of first radial direction line. Default: 90 + end_angle: The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. Default: -270 + inner_radius: The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: 0 + outer_radius: The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "80%" width: The width of chart container. String or Integer height: The height of chart container. style: The style of the component. From 1bf8c7728e7f6dca0bf5255d2f1dc5b95cf596c6 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:42:32 +0200 Subject: [PATCH 136/201] default props comment for radialbarchart (#4095) --- reflex/components/recharts/charts.py | 18 +++++++++--------- reflex/components/recharts/charts.pyi | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 89c3e38fd..69325bc11 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -346,31 +346,31 @@ class RadialBarChart(ChartBase): # The source data which each element is an object. data: Var[List[Dict[str, Any]]] - # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + # The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "left": 5 "bottom": 5} margin: Var[Dict[str, Any]] - # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage + # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage. Default: "50%" cx: Var[Union[int, str]] - # The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage + # The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage. Default: "50%" cy: Var[Union[int, str]] - # The angle of first radial direction line. + # The angle of first radial direction line. Default: 0 start_angle: Var[int] - # The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. + # The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. Default: 360 end_angle: Var[int] - # The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage + # The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "30%" inner_radius: Var[Union[int, str]] - # The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage + # The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "100%" outer_radius: Var[Union[int, str]] - # The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number + # The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%" bar_category_gap: Var[Union[int, str]] - # The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number + # The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number. Default: 4 bar_gap: Var[str] # The size of each bar. If the barSize is not specified, the size of bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups. diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index d79a8371c..8a756f9da 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -786,15 +786,15 @@ class RadialBarChart(ChartBase): Args: *children: The children of the chart component. data: The source data which each element is an object. - margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. - cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage - cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage - start_angle: The angle of first radial direction line. - end_angle: The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. - inner_radius: The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage - outer_radius: The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage - bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number - bar_gap: The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number + margin: The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "left": 5 "bottom": 5} + cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage. Default: "50%" + cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage. Default: "50%" + start_angle: The angle of first radial direction line. Default: 0 + end_angle: The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. Default: 360 + inner_radius: The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "30%" + outer_radius: The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "100%" + bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%" + bar_gap: The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number. Default: 4 bar_size: The size of each bar. If the barSize is not specified, the size of bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups. width: The width of chart container. String or Integer height: The height of chart container. From 068b3bab42d6a7343c3619a92ab5f74898193c32 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:42:41 +0200 Subject: [PATCH 137/201] default props comment for barchart (#4092) --- reflex/components/recharts/charts.py | 14 +++++++------- reflex/components/recharts/charts.pyi | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 69325bc11..d86eeae95 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -9,7 +9,7 @@ from reflex.components.recharts.general import ResponsiveContainer from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.vars.base import LiteralVar, Var +from reflex.vars.base import Var from .recharts import ( LiteralAnimationEasing, @@ -155,11 +155,11 @@ class BarChart(CategoricalChartBase): alias = "RechartsBarChart" - # The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number - bar_category_gap: Var[Union[str, int]] = LiteralVar.create("10%") + # The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%" + bar_category_gap: Var[Union[str, int]] - # The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number - bar_gap: Var[Union[str, int]] = LiteralVar.create(4) # type: ignore + # The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number. Default: 4 + bar_gap: Var[Union[str, int]] # The width of all the bars in the chart. Number bar_size: Var[int] @@ -167,10 +167,10 @@ class BarChart(CategoricalChartBase): # The maximum width of all the bars in a horizontal BarChart, or maximum height in a vertical BarChart. max_bar_size: Var[int] - # The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. + # The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. Default: "none" stack_offset: Var[LiteralStackOffset] - # If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.) + # If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.) Default: False reverse_stack_order: Var[bool] # Valid children components diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 8a756f9da..691d9621f 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -358,12 +358,12 @@ class BarChart(CategoricalChartBase): Args: *children: The children of the chart component. - bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number - bar_gap: The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number + bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%" + bar_gap: The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number. Default: 4 bar_size: The width of all the bars in the chart. Number max_bar_size: The maximum width of all the bars in a horizontal BarChart, or maximum height in a vertical BarChart. stack_offset: The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. 'expand' | 'none' | 'wiggle' | 'silhouette' - reverse_stack_order: If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.) + reverse_stack_order: If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.) Default: False data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. From 240b12a7f3dc6028198089069ebe495cbd3121b2 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:45:18 +0200 Subject: [PATCH 138/201] default props comment for composedchart (#4093) --- reflex/components/recharts/charts.py | 14 +++++++------- reflex/components/recharts/charts.pyi | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index d86eeae95..a9f9b0d16 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -217,19 +217,19 @@ class ComposedChart(CategoricalChartBase): alias = "RechartsComposedChart" - # The base value of area. Number | 'dataMin' | 'dataMax' | 'auto' + # The base value of area. Number | 'dataMin' | 'dataMax' | 'auto'. Default: "auto" base_value: Var[Union[int, LiteralComposedChartBaseValue]] - # The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number - bar_category_gap: Var[Union[str, int]] # type: ignore + # The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%" + bar_category_gap: Var[Union[str, int]] - # The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number - bar_gap: Var[Union[str, int]] # type: ignore + # The gap between two bars in the same category. Default: 4 + bar_gap: Var[int] - # The width of all the bars in the chart. Number + # The width or height of each bar. If the barSize is not specified, the size of the bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups. bar_size: Var[int] - # If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.) + # If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position). Default: False reverse_stack_order: Var[bool] # Valid children components diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 691d9621f..41548aed4 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -492,7 +492,7 @@ class ComposedChart(CategoricalChartBase): ] ] = None, bar_category_gap: Optional[Union[Var[Union[int, str]], int, str]] = None, - bar_gap: Optional[Union[Var[Union[int, str]], int, str]] = None, + bar_gap: Optional[Union[Var[int], int]] = None, bar_size: Optional[Union[Var[int], int]] = None, reverse_stack_order: Optional[Union[Var[bool], bool]] = None, data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, @@ -562,11 +562,11 @@ class ComposedChart(CategoricalChartBase): Args: *children: The children of the chart component. - base_value: The base value of area. Number | 'dataMin' | 'dataMax' | 'auto' - bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number - bar_gap: The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number - bar_size: The width of all the bars in the chart. Number - reverse_stack_order: If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.) + base_value: The base value of area. Number | 'dataMin' | 'dataMax' | 'auto'. Default: "auto" + bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%" + bar_gap: The gap between two bars in the same category. Default: 4 + bar_size: The width or height of each bar. If the barSize is not specified, the size of the bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups. + reverse_stack_order: If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position). Default: False data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. From 65c174ed78e8843340c49a45bc50c978a2bf702c Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:45:29 +0200 Subject: [PATCH 139/201] areachart default value for base_value (#4090) --- reflex/components/recharts/charts.py | 2 +- reflex/components/recharts/charts.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index a9f9b0d16..7aa8ce4dc 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -129,7 +129,7 @@ class AreaChart(CategoricalChartBase): alias = "RechartsAreaChart" - # The base value of area. Number | 'dataMin' | 'dataMax' | 'auto' + # The base value of area. Number | 'dataMin' | 'dataMax' | 'auto'. Default: "auto" base_value: Var[Union[int, LiteralComposedChartBaseValue]] # Valid children components diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 41548aed4..fea25a96c 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -258,7 +258,7 @@ class AreaChart(CategoricalChartBase): Args: *children: The children of the chart component. - base_value: The base value of area. Number | 'dataMin' | 'dataMax' | 'auto' + base_value: The base value of area. Number | 'dataMin' | 'dataMax' | 'auto'. Default: "auto" data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. From ce8695c14c0c26bc853f46a53bd1f899c0975a8e Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:45:43 +0200 Subject: [PATCH 140/201] default props comment for categoricalchartbase (#4091) --- reflex/components/recharts/charts.py | 4 ++-- reflex/components/recharts/charts.pyi | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 7aa8ce4dc..bc54eb740 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -112,10 +112,10 @@ class CategoricalChartBase(ChartBase): # If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. sync_id: Var[str] - # When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function + # When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function. Default: "index" sync_method: Var[LiteralSyncMethod] - # The layout of area in the chart. 'horizontal' | 'vertical' + # The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal" layout: Var[LiteralLayout] # The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. 'expand' | 'none' | 'wiggle' | 'silhouette' diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index fea25a96c..2dab3fe7b 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -160,8 +160,8 @@ class CategoricalChartBase(ChartBase): data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. - sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function - layout: The layout of area in the chart. 'horizontal' | 'vertical' + sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function. Default: "index" + layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal" stack_offset: The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. 'expand' | 'none' | 'wiggle' | 'silhouette' width: The width of chart container. String or Integer height: The height of chart container. @@ -262,8 +262,8 @@ class AreaChart(CategoricalChartBase): data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. - sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function - layout: The layout of area in the chart. 'horizontal' | 'vertical' + sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function. Default: "index" + layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal" stack_offset: The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. 'expand' | 'none' | 'wiggle' | 'silhouette' width: The width of chart container. String or Integer height: The height of chart container. @@ -367,8 +367,8 @@ class BarChart(CategoricalChartBase): data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. - sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function - layout: The layout of area in the chart. 'horizontal' | 'vertical' + sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function. Default: "index" + layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal" width: The width of chart container. String or Integer height: The height of chart container. style: The style of the component. @@ -460,8 +460,8 @@ class LineChart(CategoricalChartBase): data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. - sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function - layout: The layout of area in the chart. 'horizontal' | 'vertical' + sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function. Default: "index" + layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal" stack_offset: The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. 'expand' | 'none' | 'wiggle' | 'silhouette' width: The width of chart container. String or Integer height: The height of chart container. @@ -570,8 +570,8 @@ class ComposedChart(CategoricalChartBase): data: The source data, in which each element is an object. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush. - sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function - layout: The layout of area in the chart. 'horizontal' | 'vertical' + sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function. Default: "index" + layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal" stack_offset: The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. 'expand' | 'none' | 'wiggle' | 'silhouette' width: The width of chart container. String or Integer height: The height of chart container. From 4a3fd592e9a0d5dca93cd74e13928405094ec65c Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:51:26 +0200 Subject: [PATCH 141/201] default props comment for PolarGrid (#4107) --- reflex/components/recharts/polar.py | 16 ++++++++-------- reflex/components/recharts/polar.pyi | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 30def03da..2451e224f 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -270,17 +270,17 @@ class PolarGrid(Recharts): alias = "RechartsPolarGrid" - # The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. - cx: Var[Union[int, str]] + # The x-coordinate of center. + cx: Var[int] - # The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. - cy: Var[Union[int, str]] + # The y-coordinate of center. + cy: Var[int] # The radius of the inner polar grid. - inner_radius: Var[Union[int, str]] + inner_radius: Var[int] # The radius of the outer polar grid. - outer_radius: Var[Union[int, str]] + outer_radius: Var[int] # The array of every line grid's angle. polar_angles: Var[List[int]] @@ -288,10 +288,10 @@ class PolarGrid(Recharts): # The array of every line grid's radius. polar_radius: Var[List[int]] - # The type of polar grids. 'polygon' | 'circle' + # The type of polar grids. 'polygon' | 'circle'. Default: "polygon" grid_type: Var[LiteralGridType] - # The stroke color of grid + # The stroke color of grid. Default: rx.color("gray", 10) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) # Valid children components diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 12a330950..0e023f62e 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -403,10 +403,10 @@ class PolarGrid(Recharts): def create( # type: ignore cls, *children, - cx: Optional[Union[Var[Union[int, str]], int, str]] = None, - cy: Optional[Union[Var[Union[int, str]], int, str]] = None, - inner_radius: Optional[Union[Var[Union[int, str]], int, str]] = None, - outer_radius: Optional[Union[Var[Union[int, str]], int, str]] = None, + cx: Optional[Union[Var[int], int]] = None, + cy: Optional[Union[Var[int], int]] = None, + inner_radius: Optional[Union[Var[int], int]] = None, + outer_radius: Optional[Union[Var[int], int]] = None, polar_angles: Optional[Union[List[int], Var[List[int]]]] = None, polar_radius: Optional[Union[List[int], Var[List[int]]]] = None, grid_type: Optional[ @@ -460,14 +460,14 @@ class PolarGrid(Recharts): Args: *children: The children of the component. - cx: The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. - cy: The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. + cx: The x-coordinate of center. + cy: The y-coordinate of center. inner_radius: The radius of the inner polar grid. outer_radius: The radius of the outer polar grid. polar_angles: The array of every line grid's angle. polar_radius: The array of every line grid's radius. - grid_type: The type of polar grids. 'polygon' | 'circle' - stroke: The stroke color of grid + grid_type: The type of polar grids. 'polygon' | 'circle'. Default: "polygon" + stroke: The stroke color of grid. Default: rx.color("gray", 10) style: The style of the component. key: A unique key for the component. id: The id for the component. From c244418aaaeebe9b6a21ac4a803aaf306b707b6e Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:51:36 +0200 Subject: [PATCH 142/201] default props comment for Reference (#4121) --- reflex/components/recharts/cartesian.py | 8 ++++---- reflex/components/recharts/cartesian.pyi | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 5515162cc..67474126d 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -612,19 +612,19 @@ class ErrorBar(Recharts): class Reference(Recharts): """A base class for reference components in Reference.""" - # The id of x-axis which is corresponding to the data. + # The id of x-axis which is corresponding to the data. Default: 0 x_axis_id: Var[Union[str, int]] - # The id of y-axis which is corresponding to the data. + # The id of y-axis which is corresponding to the data. Default: 0 y_axis_id: Var[Union[str, int]] - # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. + # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" if_overflow: Var[LiteralIfOverflow] # If set a string or a number, default label will be drawn, and the option is content. label: Var[Union[str, int]] - # If set true, the line will be rendered in front of bars in BarChart, etc. + # If set true, the line will be rendered in front of bars in BarChart, etc. Default: False is_front: Var[bool] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 30f6a4160..dc6965299 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1697,11 +1697,11 @@ class Reference(Recharts): Args: *children: The children of the component. - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" label: If set a string or a number, default label will be drawn, and the option is content. - is_front: If set true, the line will be rendered in front of bars in BarChart, etc. + is_front: If set true, the line will be rendered in front of bars in BarChart, etc. Default: False style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -1788,11 +1788,11 @@ class ReferenceLine(Reference): stroke: The color of the reference line. stroke_width: The width of the stroke. Default: 1 segment: Array of endpoints in { x, y } format. These endpoints would be used to draw the ReferenceLine. - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" label: If set a string or a number, default label will be drawn, and the option is content. - is_front: If set true, the line will be rendered in front of bars in BarChart, etc. + is_front: If set true, the line will be rendered in front of bars in BarChart, etc. Default: False style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -1879,11 +1879,11 @@ class ReferenceDot(Reference): r: The radius of dot. fill: The color of the area fill. stroke: The color of the line stroke. - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" label: If set a string or a number, default label will be drawn, and the option is content. - is_front: If set true, the line will be rendered in front of bars in BarChart, etc. + is_front: If set true, the line will be rendered in front of bars in BarChart, etc. Default: False style: The style of the component. key: A unique key for the component. id: The id for the component. From 535c8f904d2eff8677a4fe752345b49794884d0c Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:54:45 +0200 Subject: [PATCH 143/201] default props comment for funnelchart (#4097) --- reflex/components/recharts/charts.py | 4 ++-- reflex/components/recharts/charts.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index bc54eb740..d1fd419a7 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -437,10 +437,10 @@ class FunnelChart(ChartBase): alias = "RechartsFunnelChart" - # The layout of bars in the chart. centeric + # The layout of bars in the chart. Default: "centric" layout: Var[str] - # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + # The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5} margin: Var[Dict[str, Any]] # The stroke color of each bar. String | Object diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 2dab3fe7b..cda2c0f04 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -929,8 +929,8 @@ class FunnelChart(ChartBase): Args: *children: The children of the chart component. - layout: The layout of bars in the chart. centeric - margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + layout: The layout of bars in the chart. Default: "centric" + margin: The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5} stroke: The stroke color of each bar. String | Object width: The width of chart container. String or Integer height: The height of chart container. From ffcf87d587da885dbe04bcda8ed5db16435f45e3 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 02:00:42 +0200 Subject: [PATCH 144/201] default props comment for Radar (#4104) --- reflex/components/recharts/polar.py | 34 +++++++---- reflex/components/recharts/polar.pyi | 87 +++++++++++++++------------- 2 files changed, 70 insertions(+), 51 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 2451e224f..5e95fb1cd 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -106,36 +106,50 @@ class Radar(Recharts): # The coordinates of all the vertexes of the radar shape, like [{ x, y }]. points: Var[List[Dict[str, Any]]] - # If false set, dots will not be drawn + # If false set, dots will not be drawn. Default: True dot: Var[bool] - # Stoke color + # Stoke color. Default: rx.color("accent", 9) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9)) - # Fill color + # Fill color. Default: rx.color("accent", 3) fill: Var[str] = LiteralVar.create(Color("accent", 3)) - # opacity + # opacity. Default: 0.6 fill_opacity: Var[float] = LiteralVar.create(0.6) - # The type of icon in legend. If set to 'none', no legend item will be rendered. - legend_type: Var[str] + # The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" + legend_type: Var[LiteralLegendType] - # If false set, labels will not be drawn + # If false set, labels will not be drawn. Default: True label: Var[bool] - # Specifies when the animation should begin, the unit of this option is ms. + # If set false, animation of polygon will be disabled. Default: True in CSR, and False in SSR + is_animation_active: Var[bool] + + # Specifies when the animation should begin, the unit of this option is ms. Default: 0 animation_begin: Var[int] - # Specifies the duration of animation, the unit of this option is ms. + # Specifies the duration of animation, the unit of this option is ms. Default: 1500 animation_duration: Var[int] - # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" animation_easing: Var[LiteralAnimationEasing] # Valid children components _valid_children: List[str] = ["LabelList"] + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + """Get the event triggers that pass the component's value to the handler. + + Returns: + A dict mapping the event trigger to the var that is passed to the handler. + """ + return { + EventTriggers.ON_ANIMATION_START: lambda: [], + EventTriggers.ON_ANIMATION_END: lambda: [], + } + class RadialBar(Recharts): """A RadialBar chart component in Recharts.""" diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 0e023f62e..32e7e5b76 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -126,6 +126,7 @@ class Pie(Recharts): ... class Radar(Recharts): + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -137,8 +138,40 @@ class Radar(Recharts): stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, fill: Optional[Union[Var[str], str]] = None, fill_opacity: Optional[Union[Var[float], float]] = None, - legend_type: Optional[Union[Var[str], str]] = None, + legend_type: Optional[ + Union[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] + ], + ] + ] = None, label: Optional[Union[Var[bool], bool]] = None, + is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_begin: Optional[Union[Var[int], int]] = None, animation_duration: Optional[Union[Var[int], int]] = None, animation_easing: Optional[ @@ -153,39 +186,10 @@ class Radar(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ + on_animation_end: Optional[ Union[EventHandler, EventSpec, list, Callable, Var] ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ + on_animation_start: Optional[ Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, @@ -196,15 +200,16 @@ class Radar(Recharts): *children: The children of the component. data_key: The key of a group of data which should be unique in a radar chart. points: The coordinates of all the vertexes of the radar shape, like [{ x, y }]. - dot: If false set, dots will not be drawn - stroke: Stoke color - fill: Fill color - fill_opacity: opacity - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. - label: If false set, labels will not be drawn - animation_begin: Specifies when the animation should begin, the unit of this option is ms. - animation_duration: Specifies the duration of animation, the unit of this option is ms. - animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + dot: If false set, dots will not be drawn. Default: True + stroke: Stoke color. Default: rx.color("accent", 9) + fill: Fill color. Default: rx.color("accent", 3) + fill_opacity: opacity. Default: 0.6 + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" + label: If false set, labels will not be drawn. Default: True + is_animation_active: If set false, animation of polygon will be disabled. Default: True in CSR, and False in SSR + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" style: The style of the component. key: A unique key for the component. id: The id for the component. From 0e7627d1c4b2a19a0bfa1adfb3ae39e859c4f571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Minh=20Ph=C3=BA?= Date: Wed, 9 Oct 2024 22:58:08 +0700 Subject: [PATCH 145/201] Add Vietnamese README docs (#4138) --- README.md | 2 +- docs/vi/README.md | 267 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 docs/vi/README.md diff --git a/README.md b/README.md index c249aea9f..9c965b00f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ --- -[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) +[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md) --- diff --git a/docs/vi/README.md b/docs/vi/README.md new file mode 100644 index 000000000..df7a31530 --- /dev/null +++ b/docs/vi/README.md @@ -0,0 +1,267 @@ +```diff ++ Bạn đang tìm kiếm Pynecone? Bạn đã tìm đúng. Pynecone đã được đổi tên thành Reflex. + +``` + +
+Reflex Logo +Reflex Logo + +
+ +### **✨ Ứng dụng web hiệu suất cao, tùy chỉnh bằng Python thuần. Deploy trong vài giây. ✨** +[![PyPI version](https://badge.fury.io/py/reflex.svg)](https://badge.fury.io/py/reflex) +![versions](https://img.shields.io/pypi/pyversions/reflex.svg) +[![Documentation](https://img.shields.io/badge/Documentation%20-Introduction%20-%20%23007ec6)](https://reflex.dev/docs/getting-started/introduction) +[![Discord](https://img.shields.io/discord/1029853095527727165?color=%237289da&label=Discord)](https://discord.gg/T5WSbC2YtQ) +
+ +--- + +[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md) + +--- + +# Reflex + +Reflex là một thư viện để xây dựng ứng dụng web toàn bộ bằng Python thuần. + +Các tính năng chính: +* **Python thuần tuý** - Viết toàn bộ ứng dụng cả backend và frontend hoàn toàn bằng Python, không cần học JavaScript. +* **Full Flexibility** - Reflex dễ dàng để bắt đầu, nhưng cũng có thể mở rộng lên các ứng dụng phức tạp. +* **Deploy Instantly** - Sau khi xây dựng ứng dụng, bạn có thể triển khai bằng [một dòng lệnh](https://reflex.dev/docs/hosting/deploy-quick-start/) hoặc triển khai trên server của riêng bạn. + +Đọc [bài viết về kiến trúc hệ thống](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) để hiểu rõ các hoạt động của Reflex. + +## ⚙️ Cài đặt + +Mở cửa sổ lệnh và chạy (Yêu cầu Python phiên bản 3.9+): + +```bash +pip install reflex +``` + +## 🥳 Tạo ứng dụng đầu tiên + +Cài đặt `reflex` cũng như cài đặt công cụ dòng lệnh `reflex`. + +Kiểm tra việc cài đặt đã thành công hay chưa bằng cách tạo mới một ứng dụng. (Thay `my_app_name` bằng tên ứng dụng của bạn): + +```bash +mkdir my_app_name +cd my_app_name +reflex init +``` + +Lệnh này tạo ra một ứng dụng mẫu trong một thư mục mới. + +Bạn có thể chạy ứng dụng ở chế độ phát triển. + +```bash +reflex run +``` + +Bạn có thể xem ứng dụng của bạn ở địa chỉ http://localhost:3000. + +Bạn có thể thay đổi mã nguồn ở `my_app_name/my_app_name.py`. Reflex nhanh chóng làm mới và bạn có thể thấy thay đổi trên ứng dụng của bạn ngay lập tức khi bạn lưu file. + + +## 🫧 Ứng dụng ví dụ + +Bắt đầu với ví dụ: tạo một ứng dụng tạo ảnh bằng [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). Để cho đơn giản, chúng ta sẽ sử dụng [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), nhưng bạn có thể sử dụng model của chính bạn được triển khai trên local. + +  + +
+A frontend wrapper for DALL·E, shown in the process of generating an image. +
+ +  + +Đây là toàn bộ đoạn mã để xây dựng ứng dụng trên. Nó được viết hoàn toàn trong một file Python! + + + +```python +import reflex as rx +import openai + +openai_client = openai.OpenAI() + + +class State(rx.State): + """The app state.""" + + prompt = "" + image_url = "" + processing = False + complete = False + + def get_image(self): + """Get the image from the prompt.""" + if self.prompt == "": + return rx.window_alert("Prompt Empty") + + self.processing, self.complete = True, False + yield + response = openai_client.images.generate( + prompt=self.prompt, n=1, size="1024x1024" + ) + self.image_url = response.data[0].url + self.processing, self.complete = False, True + + +def index(): + return rx.center( + rx.vstack( + rx.heading("DALL-E", font_size="1.5em"), + rx.input( + placeholder="Enter a prompt..", + on_blur=State.set_prompt, + width="25em", + ), + rx.button( + "Generate Image", + on_click=State.get_image, + width="25em", + loading=State.processing + ), + rx.cond( + State.complete, + rx.image(src=State.image_url, width="20em"), + ), + align="center", + ), + width="100%", + height="100vh", + ) + +# Add state and page to the app. +app = rx.App() +app.add_page(index, title="Reflex:DALL-E") +``` + + + + + +## Hãy phân tích chi tiết. + +
+Explaining the differences between backend and frontend parts of the DALL-E app. +
+ + +### **Reflex UI** + +Bắt đầu với giao diện chính. + +```python +def index(): + return rx.center( + ... + ) +``` + +Hàm `index` định nghĩa phần giao diện chính của ứng dụng. + +Chúng tôi sử dụng các component (thành phần) khác nhau như `center`, `vstack`, `input` và `button` để xây dựng giao diện phía trước. +Các component có thể được lồng vào nhau để tạo ra các bố cục phức tạp. Và bạn cũng có thể sử dụng từ khoá `args` để tận dụng đầy đủ sức mạnh của CSS. + +Reflex có đến hơn [60 component được xây dựng sẵn](https://reflex.dev/docs/library) để giúp bạn bắt đầu. Chúng ta có thể tạo ra một component mới khá dễ dàng, thao khảo: [xây dựng component của riêng bạn](https://reflex.dev/docs/wrapping-react/overview/). + +### **State** + +Reflex biểu diễn giao diện bằng các hàm của state (trạng thái). + +```python +class State(rx.State): + """The app state.""" + prompt = "" + image_url = "" + processing = False + complete = False + +``` + +Một state định nghĩa các biến (được gọi là vars) có thể thay đổi trong một ứng dụng và cho phép các hàm có thể thay đổi chúng. + +Tại đây state được cấu thành từ một `prompt` và `image_url`. +Có cũng những biến boolean `processing` và `complete` +để chỉ ra khi nào tắt nút (trong quá trình tạo hình ảnh) +và khi nào hiển thị hình ảnh kết quả. + +### **Event Handlers** + +```python +def get_image(self): + """Get the image from the prompt.""" + if self.prompt == "": + return rx.window_alert("Prompt Empty") + + self.processing, self.complete = True, False + yield + response = openai_client.images.generate( + prompt=self.prompt, n=1, size="1024x1024" + ) + self.image_url = response.data[0].url + self.processing, self.complete = False, True +``` + +Với các state, chúng ta định nghĩa các hàm có thể thay đổi state vars được gọi là event handlers. Event handler là cách chúng ta có thể thay đổi state trong Reflex. Chúng có thể là phản hồi khi người dùng thao tác, chằng hạn khi nhấn vào nút hoặc khi đang nhập trong text box. Các hành động này được gọi là event. + +Ứng dụng DALL·E. của chúng ta có một event handler, `get_image` để lấy hình ảnh từ OpenAI API. Sử dụng từ khoá `yield` in ở giữa event handler để cập nhật giao diện. Hoặc giao diện có thể cập nhật ở cuối event handler. + +### **Routing** + +Cuối cùng, chúng ta định nghĩa một ứng dụng. + +```python +app = rx.App() +``` + +Chúng ta thêm một trang ở đầu ứng dụng bằng index component. Chúng ta cũng thêm tiêu đề của ứng dụng để hiển thị lên trình duyệt. + + +```python +app.add_page(index, title="DALL-E") +``` + +Bạn có thể tạo một ứng dụng nhiều trang bằng cách thêm trang. + +## 📑 Tài liệu + +
+ +📑 [Docs](https://reflex.dev/docs/getting-started/introduction)   |   🗞️ [Blog](https://reflex.dev/blog)   |   📱 [Component Library](https://reflex.dev/docs/library)   |   🖼️ [Gallery](https://reflex.dev/docs/gallery)   |   🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start)   + +
+ + +## ✅ Status + +Reflex phát hành vào tháng 12/2022 với tên là Pynecone. + +Đến tháng 02/2024, chúng tôi tạo ra dịch vụ dưới phiên bản alpha! Trong thời gian này mọi người có thể triển khai ứng dụng hoàn toàn miễn phí. Xem [roadmap](https://github.com/reflex-dev/reflex/issues/2727) để biết thêm chi tiết. + +Reflex ra phiên bản mới với các tính năng mới hàng tuần! Hãy :star: star và :eyes: watch repo này để thấy các cập nhật mới nhất. + +## Contributing + +Chúng tôi chào đón mọi đóng góp dù lớn hay nhỏ. Dưới đây là các cách để bắt đầu với cộng đồng Reflex. + +- **Discord**: [Discord](https://discord.gg/T5WSbC2YtQ) của chúng tôi là nơi tốt nhất để nhờ sự giúp đỡ và thảo luận các bạn có thể đóng góp. +- **GitHub Discussions**: Là cách tốt nhất để thảo luận về các tính năng mà bạn có thể đóng góp hoặc những điều bạn chưa rõ. +- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) là nơi tốt nhất để thông báo. Ngoài ra bạn có thể sửa chữa các vấn đề bằng cách tạo PR. + +Chúng tôi luôn sẵn sàng tìm kiếm các contributor, bất kể kinh nghiệm. Để tham gia đóng góp, xin mời xem +[CONTIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) + + +## Xin cảm ơn các Contributors: + + + + +## License + +Reflex là mã nguồn mở và sử dụng giấy phép [Apache License 2.0](LICENSE). From f3b8b2e33646c962bc2c5ea3a125e22517c4c412 Mon Sep 17 00:00:00 2001 From: ruhz3 <96fbgudwn@gmail.com> Date: Thu, 10 Oct 2024 03:36:33 +0900 Subject: [PATCH 146/201] First use environment variable as npm registry (#4082) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * First use environment variable as npm registry * use NPM_CONFIG_REGISTRY as env variable --------- Co-authored-by: 류형주/인공지능팀 --- reflex/utils/prerequisites.py | 4 ++-- reflex/utils/registry.py | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 3c2875204..34ed5f53f 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -37,7 +37,7 @@ from reflex.config import Config, get_config from reflex.utils import console, net, path_ops, processes from reflex.utils.exceptions import GeneratedCodeHasNoFunctionDefs from reflex.utils.format import format_library_name -from reflex.utils.registry import _get_best_registry +from reflex.utils.registry import _get_npm_registry CURRENTLY_INSTALLING_NODE = False @@ -620,7 +620,7 @@ def initialize_package_json(): code = _compile_package_json() output_path.write_text(code) - best_registry = _get_best_registry() + best_registry = _get_npm_registry() bun_config_path = get_web_dir() / constants.Bun.CONFIG_PATH bun_config_path.write_text( f""" diff --git a/reflex/utils/registry.py b/reflex/utils/registry.py index 551292f2d..6b87c163d 100644 --- a/reflex/utils/registry.py +++ b/reflex/utils/registry.py @@ -1,8 +1,10 @@ """Utilities for working with registries.""" +import os + import httpx -from reflex.utils import console +from reflex.utils import console, net def latency(registry: str) -> int: @@ -15,7 +17,7 @@ def latency(registry: str) -> int: int: The latency of the registry in microseconds. """ try: - return httpx.get(registry).elapsed.microseconds + return net.get(registry).elapsed.microseconds except httpx.HTTPError: console.info(f"Failed to connect to {registry}.") return 10_000_000 @@ -34,7 +36,7 @@ def average_latency(registry, attempts: int = 3) -> int: return sum(latency(registry) for _ in range(attempts)) // attempts -def _get_best_registry() -> str: +def get_best_registry() -> str: """Get the best registry based on latency. Returns: @@ -46,3 +48,15 @@ def _get_best_registry() -> str: ] return min(registries, key=average_latency) + + +def _get_npm_registry() -> str: + """Get npm registry. If environment variable is set, use it first. + + Returns: + str: + """ + if npm_registry := os.environ.get("NPM_CONFIG_REGISTRY", ""): + return npm_registry + else: + return get_best_registry() From 60b6d4e7f2cab34e12af81f1869a3a8c31433437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 9 Oct 2024 13:24:03 -0700 Subject: [PATCH 147/201] only run macOS job on merge (#4139) * update workflow * skip more in unit tests * try something else to prevent adding macos job to pool * exclude too much * fix units-text with macOS excluded * also drop macOS job in integration tests * readd macos job separately to only run on merge --- .github/workflows/integration_tests.yml | 47 +++++++++++++++++++++++-- .github/workflows/unit_tests.yml | 31 ++++++++++++++-- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index e9fecc81a..106ac1383 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -42,7 +42,7 @@ jobs: fail-fast: false matrix: # Show OS combos first in GUI - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest] python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] exclude: - os: windows-latest @@ -122,7 +122,7 @@ jobs: fail-fast: false matrix: # Show OS combos first in GUI - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest] python-version: ['3.10.11', '3.11.4'] env: @@ -161,4 +161,45 @@ jobs: poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}" --python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}" --pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}" - --app-name "reflex-web" --path ./reflex-web/.web \ No newline at end of file + --app-name "reflex-web" --path ./reflex-web/.web + + reflex-web-macos: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + strategy: + fail-fast: false + matrix: + python-version: ['3.11.5', '3.12.0'] + runs-on: macos-12 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_build_env + with: + python-version: ${{ matrix.python-version }} + run-poetry-install: true + create-venv-at-path: .venv + - name: Clone Reflex Website Repo + uses: actions/checkout@v4 + with: + repository: reflex-dev/reflex-web + ref: main + path: reflex-web + - name: Install Requirements for reflex-web + working-directory: ./reflex-web + run: poetry run uv pip install -r requirements.txt + - name: Install additional dependencies for DB access + run: poetry run uv pip install psycopg2-binary + - name: Init Website for reflex-web + working-directory: ./reflex-web + run: poetry run reflex init + - name: Run Website and Check for errors + run: | + # Check that npm is home + npm -v + poetry run bash scripts/integration.sh ./reflex-web prod + - name: Measure and upload .web size + run: + poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}" + --python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}" + --pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}" + --app-name "reflex-web" --path ./reflex-web/.web + \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 09e489949..c76918583 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-12] + os: [ubuntu-latest, windows-latest] python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] # Windows is a bit behind on Python version availability in Github exclude: @@ -41,6 +41,7 @@ jobs: - os: windows-latest python-version: '3.9.13' runs-on: ${{ matrix.os }} + # Service containers to run with `runner-job` services: # Label used to access the service container @@ -78,4 +79,30 @@ jobs: export PYTHONUNBUFFERED=1 poetry run uv pip install "pydantic~=1.10" poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= - - run: poetry run coverage html + - name: Generate coverage report + run: poetry run coverage html + + unit-tests-macos: + timeout-minutes: 30 + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + strategy: + fail-fast: false + matrix: + python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0'] + runs-on: macos-12 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_build_env + with: + python-version: ${{ matrix.python-version }} + run-poetry-install: true + create-venv-at-path: .venv + - name: Run unit tests + run: | + export PYTHONUNBUFFERED=1 + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= + - name: Run unit tests w/ pydantic v1 + run: | + export PYTHONUNBUFFERED=1 + poetry run uv pip install "pydantic~=1.10" + poetry run pytest tests/units --cov --no-cov-on-fail --cov-report= \ No newline at end of file From 91ab8ac574e9333282e2f564745bd68c788f2c08 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 9 Oct 2024 13:25:41 -0700 Subject: [PATCH 148/201] Remove wrong event handlers (#4136) * remove wrong target value * add keyboard event * simplify empty ones * remove events from text_area * empty tuples are empty bruh * dangit darglint --- reflex/components/base/script.py | 8 +- reflex/components/datadisplay/dataeditor.py | 6 +- reflex/components/el/elements/forms.py | 30 ++++--- reflex/components/next/image.py | 6 +- reflex/components/radix/primitives/drawer.py | 38 ++++++--- reflex/components/radix/primitives/form.py | 4 +- .../radix/themes/components/dropdown_menu.py | 4 +- .../radix/themes/components/text_area.py | 16 ---- .../radix/themes/components/text_field.py | 12 +-- .../radix/themes/components/tooltip.py | 6 +- .../components/react_player/react_player.py | 24 +++--- reflex/components/recharts/cartesian.py | 84 +++++++++---------- reflex/components/recharts/charts.py | 22 ++--- reflex/components/recharts/general.py | 20 ++--- reflex/components/recharts/polar.py | 18 ++-- reflex/event.py | 82 +++++++++++++++--- tests/units/components/test_component.py | 14 +++- .../test_component_future_annotations.py | 6 +- tests/units/utils/test_format.py | 4 +- 19 files changed, 240 insertions(+), 164 deletions(-) diff --git a/reflex/components/base/script.py b/reflex/components/base/script.py index 0eba03f49..eb37d53e7 100644 --- a/reflex/components/base/script.py +++ b/reflex/components/base/script.py @@ -8,7 +8,7 @@ from __future__ import annotations from typing import Literal from reflex.components.component import Component -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars.base import LiteralVar, Var @@ -35,13 +35,13 @@ class Script(Component): ) # Triggered when the script is loading - on_load: EventHandler[lambda: []] + on_load: EventHandler[empty_event] # Triggered when the script has loaded - on_ready: EventHandler[lambda: []] + on_ready: EventHandler[empty_event] # Triggered when the script has errored - on_error: EventHandler[lambda: []] + on_error: EventHandler[empty_event] @classmethod def create(cls, *children, **props) -> Component: diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index 1c778f52a..ab84ad3f7 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -8,7 +8,7 @@ from typing import Any, Dict, List, Literal, Optional, Union from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.components.literals import LiteralRowMarker -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.utils import console, format, types from reflex.utils.imports import ImportDict, ImportVar from reflex.utils.serializers import serializer @@ -262,10 +262,10 @@ class DataEditor(NoSSRComponent): on_finished_editing: EventHandler[lambda new_value, movement: [new_value, movement]] # Fired when a row is appended. - on_row_appended: EventHandler[lambda: []] + on_row_appended: EventHandler[empty_event] # Fired when the selection is cleared. - on_selection_cleared: EventHandler[lambda: []] + on_selection_cleared: EventHandler[empty_event] # Fired when a column is resized. on_column_resize: EventHandler[lambda col, width: [col, width]] diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index 1963f8b37..05168e66c 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -10,7 +10,13 @@ from jinja2 import Environment from reflex.components.el.element import Element from reflex.components.tags.tag import Tag from reflex.constants import Dirs, EventTriggers -from reflex.event import EventChain, EventHandler, prevent_default +from reflex.event import ( + EventChain, + EventHandler, + input_event, + key_event, + prevent_default, +) from reflex.utils.imports import ImportDict from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var @@ -345,19 +351,19 @@ class Input(BaseHTML): value: Var[Union[str, int, float]] # Fired when the input value changes - on_change: EventHandler[lambda e0: [e0.target.value]] + on_change: EventHandler[input_event] # Fired when the input gains focus - on_focus: EventHandler[lambda e0: [e0.target.value]] + on_focus: EventHandler[input_event] # Fired when the input loses focus - on_blur: EventHandler[lambda e0: [e0.target.value]] + on_blur: EventHandler[input_event] # Fired when a key is pressed down - on_key_down: EventHandler[lambda e0: [e0.key]] + on_key_down: EventHandler[key_event] # Fired when a key is released - on_key_up: EventHandler[lambda e0: [e0.key]] + on_key_up: EventHandler[key_event] class Label(BaseHTML): @@ -496,7 +502,7 @@ class Select(BaseHTML): size: Var[Union[str, int, bool]] # Fired when the select value changes - on_change: EventHandler[lambda e0: [e0.target.value]] + on_change: EventHandler[input_event] AUTO_HEIGHT_JS = """ @@ -586,19 +592,19 @@ class Textarea(BaseHTML): wrap: Var[Union[str, int, bool]] # Fired when the input value changes - on_change: EventHandler[lambda e0: [e0.target.value]] + on_change: EventHandler[input_event] # Fired when the input gains focus - on_focus: EventHandler[lambda e0: [e0.target.value]] + on_focus: EventHandler[input_event] # Fired when the input loses focus - on_blur: EventHandler[lambda e0: [e0.target.value]] + on_blur: EventHandler[input_event] # Fired when a key is pressed down - on_key_down: EventHandler[lambda e0: [e0.key]] + on_key_down: EventHandler[key_event] # Fired when a key is released - on_key_up: EventHandler[lambda e0: [e0.key]] + on_key_up: EventHandler[key_event] def _exclude_props(self) -> list[str]: return super()._exclude_props() + [ diff --git a/reflex/components/next/image.py b/reflex/components/next/image.py index 9e2f71821..fe74b0935 100644 --- a/reflex/components/next/image.py +++ b/reflex/components/next/image.py @@ -2,7 +2,7 @@ from typing import Any, Literal, Optional, Union -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.utils import types from reflex.vars.base import Var @@ -56,10 +56,10 @@ class Image(NextComponent): blurDataURL: Var[str] # Fires when the image has loaded. - on_load: EventHandler[lambda: []] + on_load: EventHandler[empty_event] # Fires when the image has an error. - on_error: EventHandler[lambda: []] + on_error: EventHandler[empty_event] @classmethod def create( diff --git a/reflex/components/radix/primitives/drawer.py b/reflex/components/radix/primitives/drawer.py index b814e878f..f0efa7e18 100644 --- a/reflex/components/radix/primitives/drawer.py +++ b/reflex/components/radix/primitives/drawer.py @@ -11,6 +11,7 @@ from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import Theme from reflex.components.radix.themes.layout.flex import Flex from reflex.event import EventHandler +from reflex.utils import console from reflex.vars.base import Var @@ -127,20 +128,20 @@ class DrawerContent(DrawerComponent): base_style.update(style) return {"css": base_style} - # Fired when the drawer content is opened. - on_open_auto_focus: EventHandler[lambda e0: [e0.target.value]] + # Fired when the drawer content is opened. Deprecated. + on_open_auto_focus: EventHandler[lambda e0: []] - # Fired when the drawer content is closed. - on_close_auto_focus: EventHandler[lambda e0: [e0.target.value]] + # Fired when the drawer content is closed. Deprecated. + on_close_auto_focus: EventHandler[lambda e0: []] - # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0.target.value]] + # Fired when the escape key is pressed. Deprecated. + on_escape_key_down: EventHandler[lambda e0: []] - # Fired when the pointer is down outside the drawer content. - on_pointer_down_outside: EventHandler[lambda e0: [e0.target.value]] + # Fired when the pointer is down outside the drawer content. Deprecated. + on_pointer_down_outside: EventHandler[lambda e0: []] - # Fired when interacting outside the drawer content. - on_interact_outside: EventHandler[lambda e0: [e0.target.value]] + # Fired when interacting outside the drawer content. Deprecated. + on_interact_outside: EventHandler[lambda e0: []] @classmethod def create(cls, *children, **props): @@ -157,6 +158,23 @@ class DrawerContent(DrawerComponent): Returns: The drawer content. """ + deprecated_properties = [ + "on_open_auto_focus", + "on_close_auto_focus", + "on_escape_key_down", + "on_pointer_down_outside", + "on_interact_outside", + ] + + for prop in deprecated_properties: + if prop in props: + console.deprecate( + feature_name="drawer content events", + reason=f"The `{prop}` event is deprecated and will be removed in 0.7.0.", + deprecation_version="0.6.3", + removal_version="0.7.0", + ) + comp = super().create(*children, **props) return Theme.create(comp) diff --git a/reflex/components/radix/primitives/form.py b/reflex/components/radix/primitives/form.py index 895f6dbeb..4d4be7e40 100644 --- a/reflex/components/radix/primitives/form.py +++ b/reflex/components/radix/primitives/form.py @@ -8,7 +8,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.debounce import DebounceInput from reflex.components.el.elements.forms import Form as HTMLForm from reflex.components.radix.themes.components.text_field import TextFieldRoot -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars.base import Var from .base import RadixPrimitiveComponentWithClassName @@ -28,7 +28,7 @@ class FormRoot(FormComponent, HTMLForm): alias = "RadixFormRoot" # Fired when the errors are cleared. - on_clear_server_errors: EventHandler[lambda: []] + on_clear_server_errors: EventHandler[empty_event] def add_style(self) -> dict[str, Any] | None: """Add style to the component. diff --git a/reflex/components/radix/themes/components/dropdown_menu.py b/reflex/components/radix/themes/components/dropdown_menu.py index 5ed1f9f64..c853619dd 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.py +++ b/reflex/components/radix/themes/components/dropdown_menu.py @@ -164,7 +164,7 @@ class DropdownMenuSub(RadixThemesComponent): default_open: Var[bool] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0.target.value]] + on_open_change: EventHandler[lambda e0: [e0]] class DropdownMenuSubContent(RadixThemesComponent): @@ -240,7 +240,7 @@ class DropdownMenuItem(RadixThemesComponent): _valid_parents: List[str] = ["DropdownMenuContent", "DropdownMenuSubContent"] # Fired when the item is selected. - on_select: EventHandler[lambda e0: [e0.target.value]] + on_select: EventHandler[lambda e0: []] class DropdownMenuSeparator(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/text_area.py b/reflex/components/radix/themes/components/text_area.py index 8b3b531cb..9f006c2e3 100644 --- a/reflex/components/radix/themes/components/text_area.py +++ b/reflex/components/radix/themes/components/text_area.py @@ -6,7 +6,6 @@ from reflex.components.component import Component from reflex.components.core.breakpoints import Responsive from reflex.components.core.debounce import DebounceInput from reflex.components.el import elements -from reflex.event import EventHandler from reflex.vars.base import Var from ..base import ( @@ -82,21 +81,6 @@ class TextArea(RadixThemesComponent, elements.Textarea): # How the text in the textarea is to be wrapped when submitting the form wrap: Var[str] - # Fired when the value of the textarea changes. - on_change: EventHandler[lambda e0: [e0.target.value]] - - # Fired when the textarea is focused. - on_focus: EventHandler[lambda e0: [e0.target.value]] - - # Fired when the textarea is blurred. - on_blur: EventHandler[lambda e0: [e0.target.value]] - - # Fired when a key is pressed down. - on_key_down: EventHandler[lambda e0: [e0.key]] - - # Fired when a key is released. - on_key_up: EventHandler[lambda e0: [e0.key]] - @classmethod def create(cls, *children, **props) -> Component: """Create an Input component. diff --git a/reflex/components/radix/themes/components/text_field.py b/reflex/components/radix/themes/components/text_field.py index 6c3372985..4277e93e0 100644 --- a/reflex/components/radix/themes/components/text_field.py +++ b/reflex/components/radix/themes/components/text_field.py @@ -8,7 +8,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.core.debounce import DebounceInput from reflex.components.el import elements -from reflex.event import EventHandler +from reflex.event import EventHandler, input_event, key_event from reflex.vars.base import Var from ..base import ( @@ -72,19 +72,19 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): value: Var[Union[str, int, float]] # Fired when the value of the textarea changes. - on_change: EventHandler[lambda e0: [e0.target.value]] + on_change: EventHandler[input_event] # Fired when the textarea is focused. - on_focus: EventHandler[lambda e0: [e0.target.value]] + on_focus: EventHandler[input_event] # Fired when the textarea is blurred. - on_blur: EventHandler[lambda e0: [e0.target.value]] + on_blur: EventHandler[input_event] # Fired when a key is pressed down. - on_key_down: EventHandler[lambda e0: [e0.key]] + on_key_down: EventHandler[key_event] # Fired when a key is released. - on_key_up: EventHandler[lambda e0: [e0.key]] + on_key_up: EventHandler[key_event] @classmethod def create(cls, *children, **props) -> Component: diff --git a/reflex/components/radix/themes/components/tooltip.py b/reflex/components/radix/themes/components/tooltip.py index f39de68a8..7fd181465 100644 --- a/reflex/components/radix/themes/components/tooltip.py +++ b/reflex/components/radix/themes/components/tooltip.py @@ -85,13 +85,13 @@ class Tooltip(RadixThemesComponent): aria_label: Var[str] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0.target.value]] + on_open_change: EventHandler[lambda e0: [e0]] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0.target.value]] + on_escape_key_down: EventHandler[lambda e0: []] # Fired when the pointer is down outside the tooltip. - on_pointer_down_outside: EventHandler[lambda e0: [e0.target.value]] + on_pointer_down_outside: EventHandler[lambda e0: []] @classmethod def create(cls, *children, **props) -> Component: diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index db5d9e77c..9da878b64 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -3,7 +3,7 @@ from __future__ import annotations from reflex.components.component import NoSSRComponent -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars.base import Var @@ -46,13 +46,13 @@ class ReactPlayer(NoSSRComponent): height: Var[str] # Called when media is loaded and ready to play. If playing is set to true, media will play immediately. - on_ready: EventHandler[lambda: []] + on_ready: EventHandler[empty_event] # Called when media starts playing. - on_start: EventHandler[lambda: []] + on_start: EventHandler[empty_event] # Called when media starts or resumes playing after pausing or buffering. - on_play: EventHandler[lambda: []] + on_play: EventHandler[empty_event] # Callback containing played and loaded progress as a fraction, and playedSeconds and loadedSeconds in seconds. eg { played: 0.12, playedSeconds: 11.3, loaded: 0.34, loadedSeconds: 16.7 } on_progress: EventHandler[lambda progress: [progress]] @@ -61,13 +61,13 @@ class ReactPlayer(NoSSRComponent): on_duration: EventHandler[lambda seconds: [seconds]] # Called when media is paused. - on_pause: EventHandler[lambda: []] + on_pause: EventHandler[empty_event] # Called when media starts buffering. - on_buffer: EventHandler[lambda: []] + on_buffer: EventHandler[empty_event] # Called when media has finished buffering. Works for files, YouTube and Facebook. - on_buffer_end: EventHandler[lambda: []] + on_buffer_end: EventHandler[empty_event] # Called when media seeks with seconds parameter. on_seek: EventHandler[lambda seconds: [seconds]] @@ -79,16 +79,16 @@ class ReactPlayer(NoSSRComponent): on_playback_quality_change: EventHandler[lambda e0: []] # Called when media finishes playing. Does not fire when loop is set to true. - on_ended: EventHandler[lambda: []] + on_ended: EventHandler[empty_event] # Called when an error occurs whilst attempting to play media. - on_error: EventHandler[lambda: []] + on_error: EventHandler[empty_event] # Called when user clicks the light mode preview. - on_click_preview: EventHandler[lambda: []] + on_click_preview: EventHandler[empty_event] # Called when picture-in-picture mode is enabled. - on_enable_pip: EventHandler[lambda: []] + on_enable_pip: EventHandler[empty_event] # Called when picture-in-picture mode is disabled. - on_disable_pip: EventHandler[lambda: []] + on_disable_pip: EventHandler[empty_event] diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 67474126d..e4028053e 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Union from reflex.constants import EventTriggers from reflex.constants.colors import Color -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars.base import LiteralVar, Var from .recharts import ( @@ -101,25 +101,25 @@ class Axis(Recharts): text_anchor: Var[str] # 'start', 'middle', 'end' # The customized event handler of click on the ticks of this axis - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mousedown on the ticks of this axis - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the ticks of this axis - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mousemove on the ticks of this axis - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseout on the ticks of this axis - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] # The customized event handler of mouseenter on the ticks of this axis - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mouseleave on the ticks of this axis - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] class XAxis(Axis): @@ -267,28 +267,28 @@ class Cartesian(Recharts): legend_type: Var[LiteralLegendType] # The customized event handler of click on the component in this group - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mousedown on the component in this group - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the component in this group - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mousemove on the component in this group - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseover on the component in this group - on_mouse_over: EventHandler[lambda: []] + on_mouse_over: EventHandler[empty_event] # The customized event handler of mouseout on the component in this group - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] # The customized event handler of mouseenter on the component in this group - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mouseleave on the component in this group - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] class Area(Cartesian): @@ -494,28 +494,28 @@ class Scatter(Recharts): animation_easing: Var[LiteralAnimationEasing] # The customized event handler of click on the component in this group - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mousedown on the component in this group - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the component in this group - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mousemove on the component in this group - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseover on the component in this group - on_mouse_over: EventHandler[lambda: []] + on_mouse_over: EventHandler[empty_event] # The customized event handler of mouseout on the component in this group - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] # The customized event handler of mouseenter on the component in this group - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mouseleave on the component in this group - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] class Funnel(Recharts): @@ -556,34 +556,34 @@ class Funnel(Recharts): _valid_children: List[str] = ["LabelList", "Cell"] # The customized event handler of animation start - on_animation_start: EventHandler[lambda: []] + on_animation_start: EventHandler[empty_event] # The customized event handler of animation end - on_animation_end: EventHandler[lambda: []] + on_animation_end: EventHandler[empty_event] # The customized event handler of click on the component in this group - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mousedown on the component in this group - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the component in this group - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mousemove on the component in this group - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseover on the component in this group - on_mouse_over: EventHandler[lambda: []] + on_mouse_over: EventHandler[empty_event] # The customized event handler of mouseout on the component in this group - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] # The customized event handler of mouseenter on the component in this group - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mouseleave on the component in this group - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] class ErrorBar(Recharts): @@ -680,28 +680,28 @@ class ReferenceDot(Reference): _valid_children: List[str] = ["Label"] # The customized event handler of click on the component in this chart - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mousedown on the component in this chart - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the component in this chart - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mouseover on the component in this chart - on_mouse_over: EventHandler[lambda: []] + on_mouse_over: EventHandler[empty_event] # The customized event handler of mouseout on the component in this chart - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] # The customized event handler of mouseenter on the component in this chart - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mousemove on the component in this chart - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseleave on the component in this chart - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] class ReferenceArea(Recharts): diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index d1fd419a7..d4785f6c4 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -8,7 +8,7 @@ from reflex.components.component import Component from reflex.components.recharts.general import ResponsiveContainer from reflex.constants import EventTriggers from reflex.constants.colors import Color -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars.base import Var from .recharts import ( @@ -31,16 +31,16 @@ class ChartBase(RechartsCharts): height: Var[Union[str, int]] = "100%" # type: ignore # The customized event handler of click on the component in this chart - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mouseenter on the component in this chart - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mousemove on the component in this chart - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseleave on the component in this chart - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] @staticmethod def _ensure_valid_dimension(name: str, value: Any) -> None: @@ -270,16 +270,16 @@ class PieChart(ChartBase): ] # The customized event handler of mousedown on the sectors in this group - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the sectors in this group - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mouseover on the sectors in this group - on_mouse_over: EventHandler[lambda: []] + on_mouse_over: EventHandler[empty_event] # The customized event handler of mouseout on the sectors in this group - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] class RadarChart(ChartBase): @@ -488,10 +488,10 @@ class Treemap(RechartsCharts): animation_easing: Var[LiteralAnimationEasing] # The customized event handler of animation start - on_animation_start: EventHandler[lambda: []] + on_animation_start: EventHandler[empty_event] # The customized event handler of animation end - on_animation_end: EventHandler[lambda: []] + on_animation_end: EventHandler[empty_event] @classmethod def create(cls, *children, **props) -> Component: diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index 270707a82..641e1562a 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Union from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars.base import LiteralVar, Var from .recharts import ( @@ -46,7 +46,7 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): debounce: Var[int] # If specified provides a callback providing the updated chart width and height values. - on_resize: EventHandler[lambda: []] + on_resize: EventHandler[empty_event] # Valid children components _valid_children: List[str] = [ @@ -104,28 +104,28 @@ class Legend(Recharts): margin: Var[Dict[str, Any]] # The customized event handler of click on the items in this group - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mousedown on the items in this group - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the items in this group - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mousemove on the items in this group - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseover on the items in this group - on_mouse_over: EventHandler[lambda: []] + on_mouse_over: EventHandler[empty_event] # The customized event handler of mouseout on the items in this group - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] # The customized event handler of mouseenter on the items in this group - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mouseleave on the items in this group - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] class GraphingTooltip(Recharts): diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 5e95fb1cd..828000447 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Union from reflex.constants import EventTriggers from reflex.constants.colors import Color -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars.base import LiteralVar, Var from .recharts import ( @@ -253,28 +253,28 @@ class PolarAngleAxis(Recharts): _valid_children: List[str] = ["Label"] # The customized event handler of click on the ticks of this axis. - on_click: EventHandler[lambda: []] + on_click: EventHandler[empty_event] # The customized event handler of mousedown on the the ticks of this axis. - on_mouse_down: EventHandler[lambda: []] + on_mouse_down: EventHandler[empty_event] # The customized event handler of mouseup on the ticks of this axis. - on_mouse_up: EventHandler[lambda: []] + on_mouse_up: EventHandler[empty_event] # The customized event handler of mousemove on the ticks of this axis. - on_mouse_move: EventHandler[lambda: []] + on_mouse_move: EventHandler[empty_event] # The customized event handler of mouseover on the ticks of this axis. - on_mouse_over: EventHandler[lambda: []] + on_mouse_over: EventHandler[empty_event] # The customized event handler of mouseout on the ticks of this axis. - on_mouse_out: EventHandler[lambda: []] + on_mouse_out: EventHandler[empty_event] # The customized event handler of moustenter on the ticks of this axis. - on_mouse_enter: EventHandler[lambda: []] + on_mouse_enter: EventHandler[empty_event] # The customized event handler of mouseleave on the ticks of this axis. - on_mouse_leave: EventHandler[lambda: []] + on_mouse_leave: EventHandler[empty_event] class PolarGrid(Recharts): diff --git a/reflex/event.py b/reflex/event.py index 7384cf5bf..d2bebaa3f 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -24,7 +24,7 @@ from typing import ( from typing_extensions import get_args, get_origin from reflex import constants -from reflex.utils import format +from reflex.utils import console, format from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.types import ArgsSpec, GenericType from reflex.vars import VarData @@ -399,23 +399,63 @@ prevent_default = EventChain(events=[], args_spec=lambda: []).prevent_default init=True, frozen=True, ) -class Target: - """A Javascript event target.""" +class JavascriptHTMLInputElement: + """Interface for a Javascript HTMLInputElement https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement.""" - checked: bool = False - value: Any = None + value: str = "" @dataclasses.dataclass( init=True, frozen=True, ) -class FrontendEvent: - """A Javascript event.""" +class JavascriptInputEvent: + """Interface for a Javascript InputEvent https://developer.mozilla.org/en-US/docs/Web/API/InputEvent.""" + + target: JavascriptHTMLInputElement = JavascriptHTMLInputElement() + + +@dataclasses.dataclass( + init=True, + frozen=True, +) +class JavasciptKeyboardEvent: + """Interface for a Javascript KeyboardEvent https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.""" - target: Target = Target() key: str = "" - value: Any = None + + +def input_event(e: Var[JavascriptInputEvent]) -> Tuple[str]: + """Get the value from an input event. + + Args: + e: The input event. + + Returns: + The value from the input event. + """ + return (e.target.value,) + + +def key_event(e: Var[JavasciptKeyboardEvent]) -> Tuple[str]: + """Get the key from a keyboard event. + + Args: + e: The keyboard event. + + Returns: + The key from the keyboard event. + """ + return (e.key,) + + +def empty_event() -> Tuple[()]: + """Empty event handler. + + Returns: + An empty tuple. + """ + return tuple() # type: ignore @dataclasses.dataclass( @@ -946,6 +986,28 @@ def unwrap_var_annotation(annotation: GenericType): return annotation +def resolve_annotation(annotations: dict[str, Any], arg_name: str): + """Resolve the annotation for the given argument name. + + Args: + annotations: The annotations. + arg_name: The argument name. + + Returns: + The resolved annotation. + """ + annotation = annotations.get(arg_name) + if annotation is None: + console.deprecate( + feature_name="Unannotated event handler arguments", + reason="Provide type annotations for event handler arguments.", + deprecation_version="0.6.3", + removal_version="0.7.0", + ) + return JavascriptInputEvent + return annotation + + def parse_args_spec(arg_spec: ArgsSpec): """Parse the args provided in the ArgsSpec of an event trigger. @@ -961,7 +1023,7 @@ def parse_args_spec(arg_spec: ArgsSpec): return arg_spec( *[ Var(f"_{l_arg}").to( - unwrap_var_annotation(annotations.get(l_arg, FrontendEvent)) + unwrap_var_annotation(resolve_annotation(annotations, l_arg)) ) for l_arg in spec.args ] diff --git a/tests/units/components/test_component.py b/tests/units/components/test_component.py index 5e94db052..b54ce1bbe 100644 --- a/tests/units/components/test_component.py +++ b/tests/units/components/test_component.py @@ -16,7 +16,13 @@ from reflex.components.component import ( ) from reflex.components.radix.themes.layout.box import Box from reflex.constants import EventTriggers -from reflex.event import EventChain, EventHandler, parse_args_spec +from reflex.event import ( + EventChain, + EventHandler, + empty_event, + input_event, + parse_args_spec, +) from reflex.state import BaseState from reflex.style import Style from reflex.utils import imports @@ -1778,7 +1784,7 @@ def test_custom_component_declare_event_handlers_in_fields(): return { **super().get_event_triggers(), "on_a": lambda e0: [e0], - "on_b": lambda e0: [e0.target.value], + "on_b": input_event, "on_c": lambda e0: [], "on_d": lambda: [], "on_e": lambda: [], @@ -1787,9 +1793,9 @@ def test_custom_component_declare_event_handlers_in_fields(): class TestComponent(Component): on_a: EventHandler[lambda e0: [e0]] - on_b: EventHandler[lambda e0: [e0.target.value]] + on_b: EventHandler[input_event] on_c: EventHandler[lambda e0: []] - on_d: EventHandler[lambda: []] + on_d: EventHandler[empty_event] on_e: EventHandler on_f: EventHandler[lambda a, b, c: [c, b, a]] diff --git a/tests/units/components/test_component_future_annotations.py b/tests/units/components/test_component_future_annotations.py index 37aeb813a..791fef7c9 100644 --- a/tests/units/components/test_component_future_annotations.py +++ b/tests/units/components/test_component_future_annotations.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Any from reflex.components.component import Component -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, input_event # This is a repeat of its namesake in test_component.py. @@ -25,9 +25,9 @@ def test_custom_component_declare_event_handlers_in_fields(): class TestComponent(Component): on_a: EventHandler[lambda e0: [e0]] - on_b: EventHandler[lambda e0: [e0.target.value]] + on_b: EventHandler[input_event] on_c: EventHandler[lambda e0: []] - on_d: EventHandler[lambda: []] + on_d: EventHandler[empty_event] custom_component = ReferenceComponent.create() test_component = TestComponent.create() diff --git a/tests/units/utils/test_format.py b/tests/units/utils/test_format.py index d7b0c791e..17485d52e 100644 --- a/tests/units/utils/test_format.py +++ b/tests/units/utils/test_format.py @@ -8,7 +8,7 @@ import plotly.graph_objects as go import pytest from reflex.components.tags.tag import Tag -from reflex.event import EventChain, EventHandler, EventSpec, FrontendEvent +from reflex.event import EventChain, EventHandler, EventSpec, JavascriptInputEvent from reflex.style import Style from reflex.utils import format from reflex.utils.serializers import serialize_figure @@ -387,7 +387,7 @@ def test_format_match( Var( _js_expr="_e", ) - .to(ObjectVar, FrontendEvent) + .to(ObjectVar, JavascriptInputEvent) .target.value, ), ), From 7a971e584262238bc91d2a2618cce13dd8744355 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Wed, 9 Oct 2024 22:42:44 +0200 Subject: [PATCH 149/201] fix docstring (#4140) --- reflex/state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/state.py b/reflex/state.py index 5d1d51b91..0941dfe07 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -2520,7 +2520,7 @@ class StateManager(Base, ABC): state: The state class to use. Returns: - The state manager (either memory or redis). + The state manager (either disk or redis). """ redis = prerequisites.get_redis() if redis is not None: From 87648af3eed2213552c84c80e11bf16a09b0eef5 Mon Sep 17 00:00:00 2001 From: abulvenz Date: Thu, 10 Oct 2024 00:33:34 +0000 Subject: [PATCH 150/201] fix: Determine var type from value. (#4143) --- reflex/vars/sequence.py | 5 ++++- tests/units/test_var.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 3374ee10f..9b65507b7 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -545,7 +545,7 @@ class LiteralStringVar(LiteralVar, StringVar): def create( cls, value: str, - _var_type: GenericType | None = str, + _var_type: GenericType | None = None, _var_data: VarData | None = None, ) -> StringVar: """Create a var from a string value. @@ -558,6 +558,9 @@ class LiteralStringVar(LiteralVar, StringVar): Returns: The var. """ + # Determine var type in case the value is inherited from str. + _var_type = _var_type or type(value) or str + if REFLEX_VAR_OPENING_TAG in value: strings_and_vals: list[Var | str] = [] offset = 0 diff --git a/tests/units/test_var.py b/tests/units/test_var.py index 8f907c24a..c02acefe6 100644 --- a/tests/units/test_var.py +++ b/tests/units/test_var.py @@ -1809,3 +1809,6 @@ def test_to_string_operation(): assert cast(Var, TestState.email)._var_type == Email assert cast(Var, TestState.optional_email)._var_type == Optional[Email] + + single_var = Var.create(Email()) + assert single_var._var_type == Email From 8ec3cf615725109904b67cdcb1d40e8d7f226a45 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 10 Oct 2024 12:18:18 -0700 Subject: [PATCH 151/201] remove dictify from state dict (#4141) --- reflex/state.py | 7 +------ tests/units/test_state.py | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 0941dfe07..f488602fa 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -1879,13 +1879,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): self.dirty_vars.update(self._always_dirty_computed_vars) self._mark_dirty() - def dictify(value: Any): - if dataclasses.is_dataclass(value) and not isinstance(value, type): - return dataclasses.asdict(value) - return value - base_vars = { - prop_name: dictify(self.get_value(getattr(self, prop_name))) + prop_name: self.get_value(getattr(self, prop_name)) for prop_name in self.base_vars } if initial and include_computed: diff --git a/tests/units/test_state.py b/tests/units/test_state.py index a890c2aa4..6246618f6 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -1290,19 +1290,19 @@ def test_computed_var_depends_on_parent_non_cached(): assert ps.dirty_vars == set() assert cs.dirty_vars == set() - dict1 = ps.dict() + dict1 = json.loads(json_dumps(ps.dict())) assert dict1[ps.get_full_name()] == { "no_cache_v": 1, "router": formatted_router, } assert dict1[cs.get_full_name()] == {"dep_v": 2} - dict2 = ps.dict() + dict2 = json.loads(json_dumps(ps.dict())) assert dict2[ps.get_full_name()] == { "no_cache_v": 3, "router": formatted_router, } assert dict2[cs.get_full_name()] == {"dep_v": 4} - dict3 = ps.dict() + dict3 = json.loads(json_dumps(ps.dict())) assert dict3[ps.get_full_name()] == { "no_cache_v": 5, "router": formatted_router, From 1aed39a848e5013f118d9d9600098191080cc0ca Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:18:57 +0200 Subject: [PATCH 152/201] catch ValueError("I/O operation on closed file.") if frontend crashes (#4150) --- reflex/testing.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/reflex/testing.py b/reflex/testing.py index 7ea524f1c..6a45c51eb 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -394,9 +394,14 @@ class AppHarness: def consume_frontend_output(): while True: - line = ( - self.frontend_process.stdout.readline() # pyright: ignore [reportOptionalMemberAccess] - ) + try: + line = ( + self.frontend_process.stdout.readline() # pyright: ignore [reportOptionalMemberAccess] + ) + # catch I/O operation on closed file. + except ValueError as e: + print(e) + break if not line: break print(line) From 6f586c8b8ff761dc41db707c8416adeeb82eab25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 10 Oct 2024 12:22:35 -0700 Subject: [PATCH 153/201] let users pick state manager mode (#4041) --- reflex/config.py | 16 ++++++++++++++++ reflex/constants/__init__.py | 2 ++ reflex/constants/state.py | 11 +++++++++++ reflex/state.py | 35 +++++++++++++++++++++++------------ reflex/utils/exceptions.py | 8 ++++++++ tests/units/test_state.py | 1 + 6 files changed, 61 insertions(+), 12 deletions(-) create mode 100644 reflex/constants/state.py diff --git a/reflex/config.py b/reflex/config.py index a5d66cb52..719d5c21f 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -9,6 +9,8 @@ import urllib.parse from pathlib import Path from typing import Any, Dict, List, Optional, Set, Union +from reflex.utils.exceptions import ConfigError + try: import pydantic.v1 as pydantic except ModuleNotFoundError: @@ -220,6 +222,9 @@ class Config(Base): # Number of gunicorn workers from user gunicorn_workers: Optional[int] = None + # Indicate which type of state manager to use + state_manager_mode: constants.StateManagerMode = constants.StateManagerMode.DISK + # Maximum expiration lock time for redis state manager redis_lock_expiration: int = constants.Expiration.LOCK @@ -235,6 +240,9 @@ class Config(Base): Args: *args: The args to pass to the Pydantic init method. **kwargs: The kwargs to pass to the Pydantic init method. + + Raises: + ConfigError: If some values in the config are invalid. """ super().__init__(*args, **kwargs) @@ -248,6 +256,14 @@ class Config(Base): self._non_default_attributes.update(kwargs) self._replace_defaults(**kwargs) + if ( + self.state_manager_mode == constants.StateManagerMode.REDIS + and not self.redis_url + ): + raise ConfigError( + "REDIS_URL is required when using the redis state manager." + ) + @property def module(self) -> str: """Get the module name of the app. diff --git a/reflex/constants/__init__.py b/reflex/constants/__init__.py index e974ab915..8e61a3717 100644 --- a/reflex/constants/__init__.py +++ b/reflex/constants/__init__.py @@ -63,6 +63,7 @@ from .route import ( RouteRegex, RouteVar, ) +from .state import StateManagerMode from .style import Tailwind __ALL__ = [ @@ -115,6 +116,7 @@ __ALL__ = [ SETTER_PREFIX, SKIP_COMPILE_ENV_VAR, SocketEvent, + StateManagerMode, Tailwind, Templates, CompileVars, diff --git a/reflex/constants/state.py b/reflex/constants/state.py new file mode 100644 index 000000000..aa0e2f97f --- /dev/null +++ b/reflex/constants/state.py @@ -0,0 +1,11 @@ +"""State-related constants.""" + +from enum import Enum + + +class StateManagerMode(str, Enum): + """State manager constants.""" + + DISK = "disk" + MEMORY = "memory" + REDIS = "redis" diff --git a/reflex/state.py b/reflex/state.py index f488602fa..38289d081 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -76,6 +76,7 @@ from reflex.utils.exceptions import ( DynamicRouteArgShadowsStateVar, EventHandlerShadowsBuiltInStateMethod, ImmutableStateError, + InvalidStateManagerMode, LockExpiredError, SetUndefinedStateVarError, StateSchemaMismatchError, @@ -2514,20 +2515,30 @@ class StateManager(Base, ABC): Args: state: The state class to use. + Raises: + InvalidStateManagerMode: If the state manager mode is invalid. + Returns: - The state manager (either disk or redis). + The state manager (either disk, memory or redis). """ - redis = prerequisites.get_redis() - if redis is not None: - # make sure expiration values are obtained only from the config object on creation - config = get_config() - return StateManagerRedis( - state=state, - redis=redis, - token_expiration=config.redis_token_expiration, - lock_expiration=config.redis_lock_expiration, - ) - return StateManagerDisk(state=state) + config = get_config() + if config.state_manager_mode == constants.StateManagerMode.DISK: + return StateManagerMemory(state=state) + if config.state_manager_mode == constants.StateManagerMode.MEMORY: + return StateManagerDisk(state=state) + if config.state_manager_mode == constants.StateManagerMode.REDIS: + redis = prerequisites.get_redis() + if redis is not None: + # make sure expiration values are obtained only from the config object on creation + return StateManagerRedis( + state=state, + redis=redis, + token_expiration=config.redis_token_expiration, + lock_expiration=config.redis_lock_expiration, + ) + raise InvalidStateManagerMode( + f"Expected one of: DISK, MEMORY, REDIS, got {config.state_manager_mode}" + ) @abstractmethod async def get_state(self, token: str) -> BaseState: diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 8bce605b5..35f59a0e1 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -5,6 +5,14 @@ class ReflexError(Exception): """Base exception for all Reflex exceptions.""" +class ConfigError(ReflexError): + """Custom exception for config related errors.""" + + +class InvalidStateManagerMode(ReflexError, ValueError): + """Raised when an invalid state manager mode is provided.""" + + class ReflexRuntimeError(ReflexError, RuntimeError): """Custom RuntimeError for Reflex.""" diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 6246618f6..ae74cacce 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -3201,6 +3201,7 @@ import reflex as rx config = rx.Config( app_name="project1", redis_url="redis://localhost:6379", + state_manager_mode="redis", {config_items} ) """ From 11abaf8055c00ac640f8791ca9810b16724aa7a3 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:57:46 +0200 Subject: [PATCH 154/201] default props comment for Grid (#4125) --- reflex/components/recharts/cartesian.py | 8 ++++---- reflex/components/recharts/cartesian.pyi | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index e4028053e..1b3a4e497 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -751,16 +751,16 @@ class ReferenceArea(Recharts): class Grid(Recharts): """A base class for grid components in Recharts.""" - # The x-coordinate of grid. + # The x-coordinate of grid. Default: 0 x: Var[int] - # The y-coordinate of grid. + # The y-coordinate of grid. Default: 0 y: Var[int] - # The width of grid. + # The width of grid. Default: 0 width: Var[int] - # The height of grid. + # The height of grid. Default: 0 height: Var[int] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index dc6965299..18d98c27b 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -2047,10 +2047,10 @@ class Grid(Recharts): Args: *children: The children of the component. - x: The x-coordinate of grid. - y: The y-coordinate of grid. - width: The width of grid. - height: The height of grid. + x: The x-coordinate of grid. Default: 0 + y: The y-coordinate of grid. Default: 0 + width: The width of grid. Default: 0 + height: The height of grid. Default: 0 style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -2141,10 +2141,10 @@ class CartesianGrid(Grid): fill_opacity: The opacity of the background used to fill the space between grid lines. stroke_dasharray: The pattern of dashes and gaps used to paint the lines of the grid. stroke: the stroke color of grid. Default: rx.color("gray", 7) - x: The x-coordinate of grid. - y: The y-coordinate of grid. - width: The width of grid. - height: The height of grid. + x: The x-coordinate of grid. Default: 0 + y: The y-coordinate of grid. Default: 0 + width: The width of grid. Default: 0 + height: The height of grid. Default: 0 style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -2245,10 +2245,10 @@ class CartesianAxis(Grid): label: If set a string or a number, default label will be drawn, and the option is content. mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False tick_margin: The margin between tick line and tick. - x: The x-coordinate of grid. - y: The y-coordinate of grid. - width: The width of grid. - height: The height of grid. + x: The x-coordinate of grid. Default: 0 + y: The y-coordinate of grid. Default: 0 + width: The width of grid. Default: 0 + height: The height of grid. Default: 0 style: The style of the component. key: A unique key for the component. id: The id for the component. From 132a3d4d1d0b13b7d0ee4eb38b055469155fc075 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:58:38 +0200 Subject: [PATCH 155/201] default props comment for Funnel (#4119) * default props comment for Funnel * update --- reflex/components/recharts/cartesian.py | 19 +++++++++++-------- reflex/components/recharts/cartesian.pyi | 20 ++++++++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 1b3a4e497..457e35959 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -528,30 +528,33 @@ class Funnel(Recharts): # The source data, in which each element is an object. data: Var[List[Dict[str, Any]]] - # The key of a group of data which should be unique in an area chart. + # The key or getter of a group of data which should be unique in a FunnelChart. data_key: Var[Union[str, int]] - # The key or getter of a group of data which should be unique in a LineChart. + # The key of each sector's name. Default: "name" name_key: Var[str] - # The type of icon in legend. If set to 'none', no legend item will be rendered. + # The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "line" legend_type: Var[LiteralLegendType] - # If set false, animation of line will be disabled. + # If set false, animation of line will be disabled. Default: True is_animation_active: Var[bool] - # Specifies when the animation should begin, the unit of this option is ms. + # Specifies when the animation should begin, the unit of this option is ms. Default: 0 animation_begin: Var[int] - # Specifies the duration of animation, the unit of this option is ms. + # Specifies the duration of animation, the unit of this option is ms. Default: 1500 animation_duration: Var[int] - # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default "ease" animation_easing: Var[LiteralAnimationEasing] - # stroke color + # Stroke color. Default: rx.color("gray", 3) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 3)) + # The coordinates of all the trapezoids in the funnel, usually calculated internally. + trapezoids: Var[List[Dict[str, Any]]] + # Valid children components _valid_children: List[str] = ["LabelList", "Cell"] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 18d98c27b..9e1dfb3bf 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1481,6 +1481,9 @@ class Funnel(Recharts): ] ] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + trapezoids: Optional[ + Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]] + ] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -1535,14 +1538,15 @@ class Funnel(Recharts): Args: *children: The children of the component. data: The source data, in which each element is an object. - data_key: The key of a group of data which should be unique in an area chart. - name_key: The key or getter of a group of data which should be unique in a LineChart. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. - is_animation_active: If set false, animation of line will be disabled. - animation_begin: Specifies when the animation should begin, the unit of this option is ms. - animation_duration: Specifies the duration of animation, the unit of this option is ms. - animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' - stroke: stroke color + data_key: The key or getter of a group of data which should be unique in a FunnelChart. + name_key: The key of each sector's name. Default: "name" + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "line" + is_animation_active: If set false, animation of line will be disabled. Default: True + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default "ease" + stroke: Stroke color. Default: rx.color("gray", 3) + trapezoids: The coordinates of all the trapezoids in the funnel, usually calculated internally. style: The style of the component. key: A unique key for the component. id: The id for the component. From 4a314394fd4decbb72963fd9acb88d0e53018ffa Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:59:38 +0200 Subject: [PATCH 156/201] default props comment for ErrorBar (#4120) * default props comment for ErrorBar * union int float * update --- reflex/components/recharts/cartesian.py | 10 +++++----- reflex/components/recharts/cartesian.pyi | 14 ++++++-------- reflex/components/recharts/recharts.py | 2 +- reflex/components/recharts/recharts.pyi | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 457e35959..506a38235 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -596,20 +596,20 @@ class ErrorBar(Recharts): alias = "RechartsErrorBar" - # The direction of error bar. 'x' | 'y' | 'both' + # Only used for ScatterChart with error bars in two directions. Only accepts a value of "x" or "y" and makes the error bars lie in that direction. direction: Var[LiteralDirection] # The key of a group of data which should be unique in an area chart. data_key: Var[Union[str, int]] - # The width of the error bar ends. + # The width of the error bar ends. Default: 5 width: Var[int] - # The stroke color of error bar. + # The stroke color of error bar. Default: rx.color("gray", 8) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 8)) - # The stroke width of error bar. - stroke_width: Var[int] + # The stroke width of error bar. Default: 1.5 + stroke_width: Var[Union[int, float]] class Reference(Recharts): diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 9e1dfb3bf..2e5788bb2 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1566,13 +1566,11 @@ class ErrorBar(Recharts): def create( # type: ignore cls, *children, - direction: Optional[ - Union[Literal["both", "x", "y"], Var[Literal["both", "x", "y"]]] - ] = None, + direction: Optional[Union[Literal["x", "y"], Var[Literal["x", "y"]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, width: Optional[Union[Var[int], int]] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, - stroke_width: Optional[Union[Var[int], int]] = None, + stroke_width: Optional[Union[Var[Union[float, int]], float, int]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -1620,11 +1618,11 @@ class ErrorBar(Recharts): Args: *children: The children of the component. - direction: The direction of error bar. 'x' | 'y' | 'both' + direction: Only used for ScatterChart with error bars in two directions. Only accepts a value of "x" or "y" and makes the error bars lie in that direction. data_key: The key of a group of data which should be unique in an area chart. - width: The width of the error bar ends. - stroke: The stroke color of error bar. - stroke_width: The stroke width of error bar. + width: The width of the error bar ends. Default: 5 + stroke: The stroke color of error bar. Default: rx.color("gray", 8) + stroke_width: The stroke width of error bar. Default: 1.5 style: The style of the component. key: A unique key for the component. id: The id for the component. diff --git a/reflex/components/recharts/recharts.py b/reflex/components/recharts/recharts.py index adb7bfdf9..a9b54af83 100644 --- a/reflex/components/recharts/recharts.py +++ b/reflex/components/recharts/recharts.py @@ -131,6 +131,6 @@ LiteralAreaType = Literal[ "stepBefore", "stepAfter", ] -LiteralDirection = Literal["x", "y", "both"] +LiteralDirection = Literal["x", "y"] LiteralInterval = Literal["preserveStart", "preserveEnd", "preserveStartEnd"] LiteralSyncMethod = Literal["index", "value"] diff --git a/reflex/components/recharts/recharts.pyi b/reflex/components/recharts/recharts.pyi index 1f1937dc6..14065a213 100644 --- a/reflex/components/recharts/recharts.pyi +++ b/reflex/components/recharts/recharts.pyi @@ -242,6 +242,6 @@ LiteralAreaType = Literal[ "stepBefore", "stepAfter", ] -LiteralDirection = Literal["x", "y", "both"] +LiteralDirection = Literal["x", "y"] LiteralInterval = Literal["preserveStart", "preserveEnd", "preserveStartEnd"] LiteralSyncMethod = Literal["index", "value"] From ee3182a2df7e079e0d648ad24528ff93aa605d3f Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Thu, 10 Oct 2024 22:00:23 +0200 Subject: [PATCH 157/201] default props comment for Cartesian (#4114) * default props comment for Cartesian * add animation events * update --- reflex/components/recharts/cartesian.py | 30 +++++- reflex/components/recharts/cartesian.pyi | 112 ++++++++++++++++++++--- 2 files changed, 126 insertions(+), 16 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 506a38235..45ed0aea4 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -257,15 +257,39 @@ class Cartesian(Recharts): # The key of a group of data which should be unique in an area chart. data_key: Var[Union[str, int]] - # The id of x-axis which is corresponding to the data. + # The id of x-axis which is corresponding to the data. Default: 0 x_axis_id: Var[Union[str, int]] - # The id of y-axis which is corresponding to the data. + # The id of y-axis which is corresponding to the data. Default: 0 y_axis_id: Var[Union[str, int]] - # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none'optional + # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none' optional legend_type: Var[LiteralLegendType] + # If set false, animation of bar will be disabled. Default: True + is_animation_active: Var[bool] + + # Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_begin: Var[int] + + # Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_duration: Var[int] + + # The type of easing function. Default: "ease" + animation_easing: Var[LiteralAnimationEasing] + + # The unit of data. This option will be used in tooltip. + unit: Var[Union[str, int]] + + # The name of data. This option will be used in tooltip and legend to represent the component. If no value was set to this option, the value of dataKey will be used alternatively. + name: Var[Union[str, int]] + + # The customized event handler of animation start + on_animation_start: EventHandler[lambda: []] + + # The customized event handler of animation end + on_animation_end: EventHandler[lambda: []] + # The customized event handler of click on the component in this group on_click: EventHandler[empty_event] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 2e5788bb2..113790418 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -726,12 +726,29 @@ class Cartesian(Recharts): ], ] ] = None, + is_animation_active: Optional[Union[Var[bool], bool]] = None, + animation_begin: Optional[Union[Var[int], int]] = None, + animation_duration: Optional[Union[Var[int], int]] = None, + animation_easing: Optional[ + Union[ + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], + ] + ] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, 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, str]]] = None, + on_animation_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_animation_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ @@ -775,9 +792,15 @@ class Cartesian(Recharts): *children: The children of the component. layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical' data_key: The key of a group of data which should be unique in an area chart. - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none'optional + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none' optional + is_animation_active: If set false, animation of bar will be disabled. Default: True + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. Default: "ease" + unit: The unit of data. This option will be used in tooltip. + name: The name of data. This option will be used in tooltip and legend to represent the component. If no value was set to this option, the value of dataKey will be used alternatively. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -894,12 +917,29 @@ class Area(Cartesian): ], ] ] = None, + is_animation_active: Optional[Union[Var[bool], bool]] = None, + animation_begin: Optional[Union[Var[int], int]] = None, + animation_duration: Optional[Union[Var[int], int]] = None, + animation_easing: Optional[ + Union[ + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], + ] + ] = None, + unit: Optional[Union[Var[Union[int, str]], int, str]] = None, + name: Optional[Union[Var[Union[int, str]], int, 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, str]]] = None, + on_animation_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_animation_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ @@ -954,9 +994,15 @@ class Area(Cartesian): connect_nulls: Whether to connect a graph area across null points. Default: False layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical' data_key: The key of a group of data which should be unique in an area chart. - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none'optional + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none' optional + is_animation_active: If set false, animation of bar will be disabled. Default: True + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. Default: "ease" + unit: The unit of data. This option will be used in tooltip. + name: The name of data. This option will be used in tooltip and legend to represent the component. If no value was set to this option, the value of dataKey will be used alternatively. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -1029,12 +1075,27 @@ class Bar(Cartesian): ], ] ] = None, + is_animation_active: Optional[Union[Var[bool], bool]] = None, + animation_begin: Optional[Union[Var[int], int]] = None, + animation_duration: Optional[Union[Var[int], int]] = None, + animation_easing: Optional[ + Union[ + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], + ] + ] = 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, str]]] = None, + on_animation_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_animation_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ @@ -1084,15 +1145,19 @@ class Bar(Cartesian): stack_id: The stack id of bar, when two bars have the same value axis and same stack_id, then the two bars are stacked in order. unit: The unit of data. This option will be used in tooltip. min_point_size: The minimal height of a bar in a horizontal BarChart, or the minimal width of a bar in a vertical BarChart. By default, 0 values are not shown. To visualize a 0 (or close to zero) point, set the minimal point size to a pixel value like 3. In stacked bar charts, minPointSize might not be respected for tightly packed values. So we strongly recommend not using this prop in stacked BarCharts. - name: The name of data. This option will be used in tooltip and legend to represent a bar. If no value was set to this option, the value of dataKey will be used alternatively. + name: The name of data. This option will be used in tooltip and legend to represent the component. If no value was set to this option, the value of dataKey will be used alternatively. bar_size: Size of the bar (if one bar_size is set then a bar_size must be set for all bars) max_bar_size: Max size of the bar radius: If set a value, the option is the radius of all the rounded corners. If set a array, the option are in turn the radiuses of top-left corner, top-right corner, bottom-right corner, bottom-left corner. Default: 0 layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical' data_key: The key of a group of data which should be unique in an area chart. - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none'optional + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none' optional + is_animation_active: If set false, animation of bar will be disabled. Default: True + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. Default: "ease" style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -1207,12 +1272,28 @@ class Line(Cartesian): ], ] ] = None, + is_animation_active: Optional[Union[Var[bool], bool]] = None, + animation_begin: Optional[Union[Var[int], int]] = None, + animation_duration: Optional[Union[Var[int], int]] = None, + animation_easing: Optional[ + Union[ + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], + ] + ] = None, + name: Optional[Union[Var[Union[int, str]], int, 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, str]]] = None, + on_animation_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_animation_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ @@ -1267,9 +1348,14 @@ class Line(Cartesian): stroke_dasharray: The pattern of dashes and gaps used to paint the line. layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical' data_key: The key of a group of data which should be unique in an area chart. - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none'optional + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none' optional + is_animation_active: If set false, animation of bar will be disabled. Default: True + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. Default: "ease" + name: The name of data. This option will be used in tooltip and legend to represent the component. If no value was set to this option, the value of dataKey will be used alternatively. style: The style of the component. key: A unique key for the component. id: The id for the component. From ec6990fb71db466e8fe5204d6a012693cf7af49a Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Thu, 10 Oct 2024 22:04:49 +0200 Subject: [PATCH 158/201] default props comment for RadialBar (#4105) * default props comment for RadialBar * update --- reflex/components/recharts/polar.py | 21 +++++++----- reflex/components/recharts/polar.pyi | 51 +++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 18 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 828000447..158c0e729 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -158,31 +158,34 @@ class RadialBar(Recharts): alias = "RechartsRadialBar" + # The source data which each element is an object. + data: Var[List[Dict[str, Any]]] + # The key of a group of data which should be unique to show the meaning of angle axis. data_key: Var[Union[str, int]] - # Min angle of each bar. A positive value between 0 and 360. + # Min angle of each bar. A positive value between 0 and 360. Default: 0 min_angle: Var[int] - # Type of legend - legend_type: Var[str] + # The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" + legend_type: Var[LiteralLegendType] - # If false set, labels will not be drawn. + # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False label: Var[Union[bool, Dict[str, Any]]] - # If false set, background sector will not be drawn. + # If false set, background sector will not be drawn. Default: False background: Var[Union[bool, Dict[str, Any]]] - # If set false, animation of radial bars will be disabled. By default true in CSR, and false in SSR + # If set false, animation of radial bars will be disabled. Default: True is_animation_active: Var[bool] - # Specifies when the animation should begin, the unit of this option is ms. By default 0 + # Specifies when the animation should begin, the unit of this option is ms. Default: 0 animation_begin: Var[int] - # Specifies the duration of animation, the unit of this option is ms. By default 1500 + # Specifies the duration of animation, the unit of this option is ms. Default 1500 animation_duration: Var[int] - # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. By default 'ease' + # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" animation_easing: Var[LiteralAnimationEasing] # Valid children components diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 32e7e5b76..be3bd2d09 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -230,9 +230,41 @@ class RadialBar(Recharts): def create( # type: ignore cls, *children, + data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, min_angle: Optional[Union[Var[int], int]] = None, - legend_type: Optional[Union[Var[str], str]] = None, + legend_type: Optional[ + Union[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ], + Var[ + Literal[ + "circle", + "cross", + "diamond", + "line", + "none", + "plainline", + "rect", + "square", + "star", + "triangle", + "wye", + ] + ], + ] + ] = None, label: Optional[ Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, @@ -282,15 +314,16 @@ class RadialBar(Recharts): Args: *children: The children of the component. + data: The source data which each element is an object. data_key: The key of a group of data which should be unique to show the meaning of angle axis. - min_angle: Min angle of each bar. A positive value between 0 and 360. - legend_type: Type of legend - label: If false set, labels will not be drawn. - background: If false set, background sector will not be drawn. - is_animation_active: If set false, animation of radial bars will be disabled. By default true in CSR, and false in SSR - animation_begin: Specifies when the animation should begin, the unit of this option is ms. By default 0 - animation_duration: Specifies the duration of animation, the unit of this option is ms. By default 1500 - animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. By default 'ease' + min_angle: Min angle of each bar. A positive value between 0 and 360. Default: 0 + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" + label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False + background: If false set, background sector will not be drawn. Default: False + is_animation_active: If set false, animation of radial bars will be disabled. Default: True + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default 1500 + animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" style: The style of the component. key: A unique key for the component. id: The id for the component. From c3d7cd0da1fdd65ae9264425b619d2848954ceb4 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:10:11 +0200 Subject: [PATCH 159/201] default props comment for PolarRadiusAxis (#4108) * default props comment for PolarRadiusAxis * update --- reflex/components/recharts/polar.py | 33 +++++++++++----------- reflex/components/recharts/polar.pyi | 41 +++++++++++++++++----------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 158c0e729..a57f28782 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -13,6 +13,7 @@ from .recharts import ( LiteralAnimationEasing, LiteralGridType, LiteralLegendType, + LiteralOrientationLeftRightMiddle, LiteralPolarRadiusType, LiteralScale, Recharts, @@ -322,46 +323,46 @@ class PolarRadiusAxis(Recharts): alias = "RechartsPolarRadiusAxis" - # The angle of radial direction line to display axis text. + # The angle of radial direction line to display axis text. Default: 0 angle: Var[int] - # The type of axis line. 'number' | 'category' + # The type of axis line. 'number' | 'category'. Default: "category" type_: Var[LiteralPolarRadiusType] - # Allow the axis has duplicated categorys or not when the type of axis is "category". + # Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True allow_duplicated_category: Var[bool] # The x-coordinate of center. - cx: Var[Union[int, str]] + cx: Var[int] # The y-coordinate of center. - cy: Var[Union[int, str]] + cy: Var[int] - # If set to true, the ticks of this axis are reversed. + # If set to true, the ticks of this axis are reversed. Default: False reversed: Var[bool] - # The orientation of axis text. - orientation: Var[str] + # The orientation of axis text. Default: "right" + orientation: Var[LiteralOrientationLeftRightMiddle] - # If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. + # If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. Default: True axis_line: Var[Union[bool, Dict[str, Any]]] - # The width or height of tick. - tick: Var[Union[int, str]] + # If false set, ticks will not be drawn. If true set, ticks will be drawn which have the props calculated internally. If object set, ticks will be drawn which have the props mergered by the internal calculated props and the option. Default: True + tick: Var[Union[bool, Dict[str, Any]]] - # The count of ticks. + # The count of axis ticks. Not used if 'type' is 'category'. Default: 5 tick_count: Var[int] - # If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' + # If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" scale: Var[LiteralScale] # Valid children components _valid_children: List[str] = ["Label"] - # The domain of the polar radius axis, specifying the minimum and maximum values. - domain: Var[List[int]] = LiteralVar.create([0, 250]) + # The domain of the polar radius axis, specifying the minimum and maximum values. Default: [0, "auto"] + domain: Var[List[Union[int, str]]] - # The stroke color of axis + # The stroke color of axis. Default: rx.color("gray", 10) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) def get_event_triggers(self) -> dict[str, Union[Var, Any]]: diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index be3bd2d09..1f1d324ec 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -531,14 +531,21 @@ class PolarRadiusAxis(Recharts): Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, allow_duplicated_category: Optional[Union[Var[bool], bool]] = None, - cx: Optional[Union[Var[Union[int, str]], int, str]] = None, - cy: Optional[Union[Var[Union[int, str]], int, str]] = None, + cx: Optional[Union[Var[int], int]] = None, + cy: Optional[Union[Var[int], int]] = None, reversed: Optional[Union[Var[bool], bool]] = None, - orientation: Optional[Union[Var[str], str]] = None, + orientation: Optional[ + Union[ + Literal["left", "middle", "right"], + Var[Literal["left", "middle", "right"]], + ] + ] = None, axis_line: Optional[ Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, - tick: Optional[Union[Var[Union[int, str]], int, str]] = None, + tick: Optional[ + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] + ] = None, tick_count: Optional[Union[Var[int], int]] = None, scale: Optional[ Union[ @@ -580,7 +587,9 @@ class PolarRadiusAxis(Recharts): ], ] ] = None, - domain: Optional[Union[List[int], Var[List[int]]]] = None, + domain: Optional[ + Union[List[Union[int, str]], Var[List[Union[int, str]]]] + ] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, style: Optional[Style] = None, key: Optional[Any] = None, @@ -610,19 +619,19 @@ class PolarRadiusAxis(Recharts): Args: *children: The children of the component. - angle: The angle of radial direction line to display axis text. - type_: The type of axis line. 'number' | 'category' - allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". + angle: The angle of radial direction line to display axis text. Default: 0 + type_: The type of axis line. 'number' | 'category'. Default: "category" + allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True cx: The x-coordinate of center. cy: The y-coordinate of center. - reversed: If set to true, the ticks of this axis are reversed. - orientation: The orientation of axis text. - axis_line: If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. - tick: The width or height of tick. - tick_count: The count of ticks. - scale: If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' - domain: The domain of the polar radius axis, specifying the minimum and maximum values. - stroke: The stroke color of axis + reversed: If set to true, the ticks of this axis are reversed. Default: False + orientation: The orientation of axis text. Default: "right" + axis_line: If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. Default: True + tick: If false set, ticks will not be drawn. If true set, ticks will be drawn which have the props calculated internally. If object set, ticks will be drawn which have the props mergered by the internal calculated props and the option. Default: True + tick_count: The count of axis ticks. Not used if 'type' is 'category'. Default: 5 + scale: If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" + domain: The domain of the polar radius axis, specifying the minimum and maximum values. Default: [0, "auto"] + stroke: The stroke color of axis. Default: rx.color("gray", 10) style: The style of the component. key: A unique key for the component. id: The id for the component. From efd633e76a0d968a37cc576058edeb047bd4e948 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:10:28 +0200 Subject: [PATCH 160/201] default props comment for Pie (#4103) --- reflex/components/recharts/polar.py | 50 +++++++++++++++++++-------- reflex/components/recharts/polar.pyi | 51 ++++++++++++++++++++-------- 2 files changed, 71 insertions(+), 30 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index a57f28782..bcbd5abd3 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -27,57 +27,75 @@ class Pie(Recharts): alias = "RechartsPie" - # data + # The source data which each element is an object. data: Var[List[Dict[str, Any]]] # The key of each sector's value. data_key: Var[Union[str, int]] - # The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. + # The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. Default: "50%" cx: Var[Union[int, str]] - # The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. + # The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. Default: "50%" cy: Var[Union[int, str]] - # The inner radius of pie, which can be set to a percent value. + # The inner radius of pie, which can be set to a percent value. Default: 0 inner_radius: Var[Union[int, str]] - # The outer radius of pie, which can be set to a percent value. + # The outer radius of pie, which can be set to a percent value. Default: "80%" outer_radius: Var[Union[int, str]] - # The angle of first sector. + # The angle of first sector. Default: 0 start_angle: Var[int] - # The direction of sectors. 1 means clockwise and -1 means anticlockwise. + # The end angle of last sector, which should be unequal to start_angle. Default: 360 end_angle: Var[int] - # The minimum angle of each unzero data. + # The minimum angle of each unzero data. Default: 0 min_angle: Var[int] - # The angle between two sectors. + # The angle between two sectors. Default: 0 padding_angle: Var[int] - # The key of each sector's name. + # The key of each sector's name. Default: "name" name_key: Var[str] - # The type of icon in legend. If set to 'none', no legend item will be rendered. + # The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" legend_type: Var[LiteralLegendType] - # If false set, labels will not be drawn. + # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False label: Var[bool] = False # type: ignore - # If false set, label lines will not be drawn. + # If false set, label lines will not be drawn. If true set, label lines will be drawn which have the props calculated internally. Default: False label_line: Var[bool] + # The index of active sector in Pie, this option can be changed in mouse event handlers. + data: Var[List[Dict[str, Any]]] + # Valid children components _valid_children: List[str] = ["Cell", "LabelList"] - # Stoke color + # Stoke color. Default: rx.color("accent", 9) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9)) - # Fill color + # Fill color. Default: rx.color("accent", 3) fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 3)) + # If set false, animation of tooltip will be disabled. Default: true in CSR, and false in SSR + is_animation_active: Var[bool] + + # Specifies when the animation should begin, the unit of this option is ms. Default: 400 + animation_begin: Var[int] + + # Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_duration: Var[int] + + # The type of easing function. Default: "ease" + animation_easing: Var[LiteralAnimationEasing] + + # The tabindex of wrapper surrounding the cells. Default: 0 + root_tab_index: Var[int] + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. @@ -85,6 +103,8 @@ class Pie(Recharts): A dict mapping the event trigger to the var that is passed to the handler. """ return { + EventTriggers.ON_ANIMATION_START: lambda: [], + EventTriggers.ON_ANIMATION_END: lambda: [], EventTriggers.ON_CLICK: lambda: [], EventTriggers.ON_MOUSE_MOVE: lambda: [], EventTriggers.ON_MOUSE_OVER: lambda: [], diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 1f1d324ec..bc12157c9 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -68,12 +68,28 @@ class Pie(Recharts): label_line: Optional[Union[Var[bool], bool]] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, + is_animation_active: Optional[Union[Var[bool], bool]] = None, + animation_begin: Optional[Union[Var[int], int]] = None, + animation_duration: Optional[Union[Var[int], int]] = None, + animation_easing: Optional[ + Union[ + Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"], + Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]], + ] + ] = None, + root_tab_index: Optional[Union[Var[int], int]] = 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, str]]] = None, + on_animation_end: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, + on_animation_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, Var] + ] = None, on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ Union[EventHandler, EventSpec, list, Callable, Var] @@ -96,22 +112,27 @@ class Pie(Recharts): Args: *children: The children of the component. - data: data + data: The index of active sector in Pie, this option can be changed in mouse event handlers. data_key: The key of each sector's value. - cx: The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. - cy: The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. - inner_radius: The inner radius of pie, which can be set to a percent value. - outer_radius: The outer radius of pie, which can be set to a percent value. - start_angle: The angle of first sector. - end_angle: The direction of sectors. 1 means clockwise and -1 means anticlockwise. - min_angle: The minimum angle of each unzero data. - padding_angle: The angle between two sectors. - name_key: The key of each sector's name. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. - label: If false set, labels will not be drawn. - label_line: If false set, label lines will not be drawn. - stroke: Stoke color - fill: Fill color + cx: The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. Default: "50%" + cy: The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. Default: "50%" + inner_radius: The inner radius of pie, which can be set to a percent value. Default: 0 + outer_radius: The outer radius of pie, which can be set to a percent value. Default: "80%" + start_angle: The angle of first sector. Default: 0 + end_angle: The end angle of last sector, which should be unequal to start_angle. Default: 360 + min_angle: The minimum angle of each unzero data. Default: 0 + padding_angle: The angle between two sectors. Default: 0 + name_key: The key of each sector's name. Default: "name" + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect" + label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False + label_line: If false set, label lines will not be drawn. If true set, label lines will be drawn which have the props calculated internally. Default: False + stroke: Stoke color. Default: rx.color("accent", 9) + fill: Fill color. Default: rx.color("accent", 3) + is_animation_active: If set false, animation of tooltip will be disabled. Default: true in CSR, and false in SSR + animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 400 + animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500 + animation_easing: The type of easing function. Default: "ease" + root_tab_index: The tabindex of wrapper surrounding the cells. Default: 0 style: The style of the component. key: A unique key for the component. id: The id for the component. From 3da1a8d0826f137ac2134aaf5783822bd52264bb Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:10:42 +0200 Subject: [PATCH 161/201] default props comment for Axis (#4109) * default props comment for Axis * update --- reflex/components/recharts/cartesian.py | 40 +++-- reflex/components/recharts/cartesian.pyi | 180 +++++++++++++++++------ reflex/components/recharts/recharts.py | 4 + reflex/components/recharts/recharts.pyi | 4 + 4 files changed, 167 insertions(+), 61 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 45ed0aea4..153d3fb2a 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -15,6 +15,7 @@ from .recharts import ( LiteralDirection, LiteralIfOverflow, LiteralInterval, + LiteralIntervalAxis, LiteralLayout, LiteralLegendType, LiteralLineType, @@ -24,6 +25,7 @@ from .recharts import ( LiteralPolarRadiusType, LiteralScale, LiteralShape, + LiteralTextAnchor, Recharts, ) @@ -34,7 +36,7 @@ class Axis(Recharts): # The key of data displayed in the axis. data_key: Var[Union[str, int]] - # If set true, the axis do not display in the chart. + # If set true, the axis do not display in the chart. Default: False hide: Var[bool] # The width of axis which is usually calculated internally. @@ -46,28 +48,34 @@ class Axis(Recharts): # The type of axis 'number' | 'category' type_: Var[LiteralPolarRadiusType] - # Allow the ticks of XAxis to be decimals or not. + # If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" + interval: Var[Union[LiteralIntervalAxis, int]] + + # Allow the ticks of Axis to be decimals or not. Default: True allow_decimals: Var[bool] - # When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. + # When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. Default: False allow_data_overflow: Var[bool] - # Allow the axis has duplicated categorys or not when the type of axis is "category". + # Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True allow_duplicated_category: Var[bool] - # If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. + # The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + domain: Var[List] + + # If set false, no axis line will be drawn. Default: True axis_line: Var[bool] - # If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. + # If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False mirror: Var[bool] - # Reverse the ticks or not. + # Reverse the ticks or not. Default: False reversed: Var[bool] # The label of axis, which appears next to the axis. label: Var[Union[str, int, Dict[str, Any]]] - # If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function + # If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" scale: Var[LiteralScale] # The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. @@ -82,23 +90,23 @@ class Axis(Recharts): # If set false, no ticks will be drawn. tick: Var[bool] - # The count of axis ticks. + # The count of axis ticks. Not used if 'type' is 'category'. Default: 5 tick_count: Var[int] - # If set false, no axis tick lines will be drawn. - tick_line: Var[bool] = LiteralVar.create(False) + # If set false, no axis tick lines will be drawn. Default: True + tick_line: Var[bool] - # The length of tick line. + # The length of tick line. Default: 6 tick_size: Var[int] - # The minimum gap between two adjacent labels + # The minimum gap between two adjacent labels. Default: 5 min_tick_gap: Var[int] - # The stroke color of axis + # The stroke color of axis. Default: rx.color("gray", 9) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 9)) - # The text anchor of axis - text_anchor: Var[str] # 'start', 'middle', 'end' + # The text anchor of axis. Default: "middle" + text_anchor: Var[LiteralTextAnchor] # The customized event handler of click on the ticks of this axis on_click: EventHandler[empty_event] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 113790418..3205ee689 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -27,9 +27,32 @@ class Axis(Recharts): type_: Optional[ Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, + interval: Optional[ + Union[ + Literal[ + "equidistantPreserveStart", + "preserveEnd", + "preserveStart", + "preserveStartEnd", + ], + Var[ + Union[ + Literal[ + "equidistantPreserveStart", + "preserveEnd", + "preserveStart", + "preserveStartEnd", + ], + int, + ] + ], + int, + ] + ] = None, allow_decimals: Optional[Union[Var[bool], bool]] = None, allow_data_overflow: Optional[Union[Var[bool], bool]] = None, allow_duplicated_category: Optional[Union[Var[bool], bool]] = None, + domain: Optional[Union[List, Var[List]]] = None, axis_line: Optional[Union[Var[bool], bool]] = None, mirror: Optional[Union[Var[bool], bool]] = None, reversed: Optional[Union[Var[bool], bool]] = None, @@ -87,7 +110,12 @@ class Axis(Recharts): tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, - text_anchor: Optional[Union[Var[str], str]] = None, + text_anchor: Optional[ + Union[ + Literal["end", "middle", "start"], + Var[Literal["end", "middle", "start"]], + ] + ] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -136,28 +164,30 @@ class Axis(Recharts): Args: *children: The children of the component. data_key: The key of data displayed in the axis. - hide: If set true, the axis do not display in the chart. + hide: If set true, the axis do not display in the chart. Default: False width: The width of axis which is usually calculated internally. height: The height of axis, which can be setted by user. type_: The type of axis 'number' | 'category' - allow_decimals: Allow the ticks of XAxis to be decimals or not. - allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. - allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". - axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. - mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. - reversed: Reverse the ticks or not. + interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" + allow_decimals: Allow the ticks of Axis to be decimals or not. Default: True + allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. Default: False + allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True + domain: The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + axis_line: If set false, no axis line will be drawn. Default: True + mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False + reversed: Reverse the ticks or not. Default: False label: The label of axis, which appears next to the axis. - scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function + scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. ticks: Set the values of axis ticks manually. tick: If set false, no ticks will be drawn. - tick_count: The count of axis ticks. - tick_line: If set false, no axis tick lines will be drawn. - tick_size: The length of tick line. - min_tick_gap: The minimum gap between two adjacent labels - stroke: The stroke color of axis - text_anchor: The text anchor of axis + tick_count: The count of axis ticks. Not used if 'type' is 'category'. Default: 5 + tick_line: If set false, no axis tick lines will be drawn. Default: True + tick_size: The length of tick line. Default: 6 + min_tick_gap: The minimum gap between two adjacent labels. Default: 5 + stroke: The stroke color of axis. Default: rx.color("gray", 9) + text_anchor: The text anchor of axis. Default: "middle" style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -191,9 +221,32 @@ class XAxis(Axis): type_: Optional[ Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, + interval: Optional[ + Union[ + Literal[ + "equidistantPreserveStart", + "preserveEnd", + "preserveStart", + "preserveStartEnd", + ], + Var[ + Union[ + Literal[ + "equidistantPreserveStart", + "preserveEnd", + "preserveStart", + "preserveStartEnd", + ], + int, + ] + ], + int, + ] + ] = None, allow_decimals: Optional[Union[Var[bool], bool]] = None, allow_data_overflow: Optional[Union[Var[bool], bool]] = None, allow_duplicated_category: Optional[Union[Var[bool], bool]] = None, + domain: Optional[Union[List, Var[List]]] = None, axis_line: Optional[Union[Var[bool], bool]] = None, mirror: Optional[Union[Var[bool], bool]] = None, reversed: Optional[Union[Var[bool], bool]] = None, @@ -251,7 +304,12 @@ class XAxis(Axis): tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, - text_anchor: Optional[Union[Var[str], str]] = None, + text_anchor: Optional[ + Union[ + Literal["end", "middle", "start"], + Var[Literal["end", "middle", "start"]], + ] + ] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -305,28 +363,30 @@ class XAxis(Axis): angle: The angle of axis ticks. Default: 0 padding: Specify the padding of x-axis. Default: {"left": 0, "right": 0} data_key: The key of data displayed in the axis. - hide: If set true, the axis do not display in the chart. + hide: If set true, the axis do not display in the chart. Default: False width: The width of axis which is usually calculated internally. height: The height of axis, which can be setted by user. type_: The type of axis 'number' | 'category' - allow_decimals: Allow the ticks of XAxis to be decimals or not. - allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. - allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". - axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. - mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. - reversed: Reverse the ticks or not. + interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" + allow_decimals: Allow the ticks of Axis to be decimals or not. Default: True + allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. Default: False + allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True + domain: The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + axis_line: If set false, no axis line will be drawn. Default: True + mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False + reversed: Reverse the ticks or not. Default: False label: The label of axis, which appears next to the axis. - scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function + scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. ticks: Set the values of axis ticks manually. tick: If set false, no ticks will be drawn. - tick_count: The count of axis ticks. - tick_line: If set false, no axis tick lines will be drawn. - tick_size: The length of tick line. - min_tick_gap: The minimum gap between two adjacent labels - stroke: The stroke color of axis - text_anchor: The text anchor of axis + tick_count: The count of axis ticks. Not used if 'type' is 'category'. Default: 5 + tick_line: If set false, no axis tick lines will be drawn. Default: True + tick_size: The length of tick line. Default: 6 + min_tick_gap: The minimum gap between two adjacent labels. Default: 5 + stroke: The stroke color of axis. Default: rx.color("gray", 9) + text_anchor: The text anchor of axis. Default: "middle" style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -358,9 +418,32 @@ class YAxis(Axis): type_: Optional[ Union[Literal["category", "number"], Var[Literal["category", "number"]]] ] = None, + interval: Optional[ + Union[ + Literal[ + "equidistantPreserveStart", + "preserveEnd", + "preserveStart", + "preserveStartEnd", + ], + Var[ + Union[ + Literal[ + "equidistantPreserveStart", + "preserveEnd", + "preserveStart", + "preserveStartEnd", + ], + int, + ] + ], + int, + ] + ] = None, allow_decimals: Optional[Union[Var[bool], bool]] = None, allow_data_overflow: Optional[Union[Var[bool], bool]] = None, allow_duplicated_category: Optional[Union[Var[bool], bool]] = None, + domain: Optional[Union[List, Var[List]]] = None, axis_line: Optional[Union[Var[bool], bool]] = None, mirror: Optional[Union[Var[bool], bool]] = None, reversed: Optional[Union[Var[bool], bool]] = None, @@ -418,7 +501,12 @@ class YAxis(Axis): tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, - text_anchor: Optional[Union[Var[str], str]] = None, + text_anchor: Optional[ + Union[ + Literal["end", "middle", "start"], + Var[Literal["end", "middle", "start"]], + ] + ] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -470,28 +558,30 @@ class YAxis(Axis): y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 padding: Specify the padding of y-axis. Default: {"top": 0, "bottom": 0} data_key: The key of data displayed in the axis. - hide: If set true, the axis do not display in the chart. + hide: If set true, the axis do not display in the chart. Default: False width: The width of axis which is usually calculated internally. height: The height of axis, which can be setted by user. type_: The type of axis 'number' | 'category' - allow_decimals: Allow the ticks of XAxis to be decimals or not. - allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. - allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". - axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. - mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. - reversed: Reverse the ticks or not. + interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" + allow_decimals: Allow the ticks of Axis to be decimals or not. Default: True + allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain. Default: False + allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True + domain: The range of the axis. Work best in conjuction with allow_data_overflow. Default: [0, "auto"] + axis_line: If set false, no axis line will be drawn. Default: True + mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False + reversed: Reverse the ticks or not. Default: False label: The label of axis, which appears next to the axis. - scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function + scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'. Default: "auto" unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. ticks: Set the values of axis ticks manually. tick: If set false, no ticks will be drawn. - tick_count: The count of axis ticks. - tick_line: If set false, no axis tick lines will be drawn. - tick_size: The length of tick line. - min_tick_gap: The minimum gap between two adjacent labels - stroke: The stroke color of axis - text_anchor: The text anchor of axis + tick_count: The count of axis ticks. Not used if 'type' is 'category'. Default: 5 + tick_line: If set false, no axis tick lines will be drawn. Default: True + tick_size: The length of tick line. Default: 6 + min_tick_gap: The minimum gap between two adjacent labels. Default: 5 + stroke: The stroke color of axis. Default: rx.color("gray", 9) + text_anchor: The text anchor of axis. Default: "middle" style: The style of the component. key: A unique key for the component. id: The id for the component. diff --git a/reflex/components/recharts/recharts.py b/reflex/components/recharts/recharts.py index a9b54af83..9068cb396 100644 --- a/reflex/components/recharts/recharts.py +++ b/reflex/components/recharts/recharts.py @@ -60,6 +60,7 @@ LiteralScale = Literal[ "sequential", "threshold", ] +LiteralTextAnchor = Literal["start", "middle", "end"] LiteralLayout = Literal["horizontal", "vertical"] LiteralPolarRadiusType = Literal["number", "category"] LiteralGridType = Literal["polygon", "circle"] @@ -133,4 +134,7 @@ LiteralAreaType = Literal[ ] LiteralDirection = Literal["x", "y"] LiteralInterval = Literal["preserveStart", "preserveEnd", "preserveStartEnd"] +LiteralIntervalAxis = Literal[ + "preserveStart", "preserveEnd", "preserveStartEnd", "equidistantPreserveStart" +] LiteralSyncMethod = Literal["index", "value"] diff --git a/reflex/components/recharts/recharts.pyi b/reflex/components/recharts/recharts.pyi index 14065a213..71d308ce3 100644 --- a/reflex/components/recharts/recharts.pyi +++ b/reflex/components/recharts/recharts.pyi @@ -171,6 +171,7 @@ LiteralScale = Literal[ "sequential", "threshold", ] +LiteralTextAnchor = Literal["start", "middle", "end"] LiteralLayout = Literal["horizontal", "vertical"] LiteralPolarRadiusType = Literal["number", "category"] LiteralGridType = Literal["polygon", "circle"] @@ -244,4 +245,7 @@ LiteralAreaType = Literal[ ] LiteralDirection = Literal["x", "y"] LiteralInterval = Literal["preserveStart", "preserveEnd", "preserveStartEnd"] +LiteralIntervalAxis = Literal[ + "preserveStart", "preserveEnd", "preserveStartEnd", "equidistantPreserveStart" +] LiteralSyncMethod = Literal["index", "value"] From 210c1ed902f8122660b5fb6fcafea58fc5426d39 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 11 Oct 2024 11:39:31 -0700 Subject: [PATCH 162/201] fix union types for vars (#4152) --- reflex/vars/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 58a73e025..7bc5e4d92 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -441,7 +441,7 @@ class Var(Generic[VAR_TYPE]): if issubclass(output, NumberVar): if fixed_type is not None: - if fixed_type is Union: + if fixed_type in types.UnionTypes: inner_types = get_args(base_type) if not all(issubclass(t, (int, float)) for t in inner_types): raise TypeError( @@ -530,7 +530,7 @@ class Var(Generic[VAR_TYPE]): fixed_type = get_origin(var_type) or var_type - if fixed_type is Union: + if fixed_type in types.UnionTypes: inner_types = get_args(var_type) if all( From 189700ecb3a5b119cf47e7bf30c47ee3e3f43fba Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 11 Oct 2024 15:43:54 -0700 Subject: [PATCH 163/201] Change bun link (#4162) * change bun to download from us * make it use branch --- reflex/constants/installer.py | 3 +- scripts/bun_install.sh | 311 ++++++++++++++++++++++++++++++++++ 2 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 scripts/bun_install.sh diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 12e4c9f20..627db5ae8 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -44,7 +44,8 @@ class Bun(SimpleNamespace): DEFAULT_PATH = ROOT_PATH / "bin" / ("bun" if not IS_WINDOWS else "bun.exe") # URL to bun install script. - INSTALL_URL = "https://bun.sh/install" + INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/change-bun-link/scripts/bun_install.sh" + # URL to windows install script. WINDOWS_INSTALL_URL = ( "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/install.ps1" diff --git a/scripts/bun_install.sh b/scripts/bun_install.sh new file mode 100644 index 000000000..08a0817f6 --- /dev/null +++ b/scripts/bun_install.sh @@ -0,0 +1,311 @@ +#!/usr/bin/env bash +set -euo pipefail + +platform=$(uname -ms) + +if [[ ${OS:-} = Windows_NT ]]; then + if [[ $platform != MINGW64* ]]; then + powershell -c "irm bun.sh/install.ps1|iex" + exit $? + fi +fi + +# Reset +Color_Off='' + +# Regular Colors +Red='' +Green='' +Dim='' # White + +# Bold +Bold_White='' +Bold_Green='' + +if [[ -t 1 ]]; then + # Reset + Color_Off='\033[0m' # Text Reset + + # Regular Colors + Red='\033[0;31m' # Red + Green='\033[0;32m' # Green + Dim='\033[0;2m' # White + + # Bold + Bold_Green='\033[1;32m' # Bold Green + Bold_White='\033[1m' # Bold White +fi + +error() { + echo -e "${Red}error${Color_Off}:" "$@" >&2 + exit 1 +} + +info() { + echo -e "${Dim}$@ ${Color_Off}" +} + +info_bold() { + echo -e "${Bold_White}$@ ${Color_Off}" +} + +success() { + echo -e "${Green}$@ ${Color_Off}" +} + +command -v unzip >/dev/null || + error 'unzip is required to install bun' + +if [[ $# -gt 2 ]]; then + error 'Too many arguments, only 2 are allowed. The first can be a specific tag of bun to install. (e.g. "bun-v0.1.4") The second can be a build variant of bun to install. (e.g. "debug-info")' +fi + +case $platform in +'Darwin x86_64') + target=darwin-x64 + ;; +'Darwin arm64') + target=darwin-aarch64 + ;; +'Linux aarch64' | 'Linux arm64') + target=linux-aarch64 + ;; +'MINGW64'*) + target=windows-x64 + ;; +'Linux x86_64' | *) + target=linux-x64 + ;; +esac + +if [[ $target = darwin-x64 ]]; then + # Is this process running in Rosetta? + # redirect stderr to devnull to avoid error message when not running in Rosetta + if [[ $(sysctl -n sysctl.proc_translated 2>/dev/null) = 1 ]]; then + target=darwin-aarch64 + info "Your shell is running in Rosetta 2. Downloading bun for $target instead" + fi +fi + +GITHUB=${GITHUB-"https://github.com"} + +github_repo="$GITHUB/oven-sh/bun" + +if [[ $target = darwin-x64 ]]; then + # If AVX2 isn't supported, use the -baseline build + if [[ $(sysctl -a | grep machdep.cpu | grep AVX2) == '' ]]; then + target=darwin-x64-baseline + fi +fi + +if [[ $target = linux-x64 ]]; then + # If AVX2 isn't supported, use the -baseline build + if [[ $(cat /proc/cpuinfo | grep avx2) = '' ]]; then + target=linux-x64-baseline + fi +fi + +exe_name=bun + +if [[ $# = 2 && $2 = debug-info ]]; then + target=$target-profile + exe_name=bun-profile + info "You requested a debug build of bun. More information will be shown if a crash occurs." +fi + +if [[ $# = 0 ]]; then + bun_uri=$github_repo/releases/latest/download/bun-$target.zip +else + bun_uri=$github_repo/releases/download/$1/bun-$target.zip +fi + +install_env=BUN_INSTALL +bin_env=\$$install_env/bin + +install_dir=${!install_env:-$HOME/.bun} +bin_dir=$install_dir/bin +exe=$bin_dir/bun + +if [[ ! -d $bin_dir ]]; then + mkdir -p "$bin_dir" || + error "Failed to create install directory \"$bin_dir\"" +fi + +curl --fail --location --progress-bar --output "$exe.zip" "$bun_uri" || + error "Failed to download bun from \"$bun_uri\"" + +unzip -oqd "$bin_dir" "$exe.zip" || + error 'Failed to extract bun' + +mv "$bin_dir/bun-$target/$exe_name" "$exe" || + error 'Failed to move extracted bun to destination' + +chmod +x "$exe" || + error 'Failed to set permissions on bun executable' + +rm -r "$bin_dir/bun-$target" "$exe.zip" + +tildify() { + if [[ $1 = $HOME/* ]]; then + local replacement=\~/ + + echo "${1/$HOME\//$replacement}" + else + echo "$1" + fi +} + +success "bun was installed successfully to $Bold_Green$(tildify "$exe")" + +if command -v bun >/dev/null; then + # Install completions, but we don't care if it fails + IS_BUN_AUTO_UPDATE=true $exe completions &>/dev/null || : + + echo "Run 'bun --help' to get started" + exit +fi + +refresh_command='' + +tilde_bin_dir=$(tildify "$bin_dir") +quoted_install_dir=\"${install_dir//\"/\\\"}\" + +if [[ $quoted_install_dir = \"$HOME/* ]]; then + quoted_install_dir=${quoted_install_dir/$HOME\//\$HOME/} +fi + +echo + +case $(basename "$SHELL") in +fish) + # Install completions, but we don't care if it fails + IS_BUN_AUTO_UPDATE=true SHELL=fish $exe completions &>/dev/null || : + + commands=( + "set --export $install_env $quoted_install_dir" + "set --export PATH $bin_env \$PATH" + ) + + fish_config=$HOME/.config/fish/config.fish + tilde_fish_config=$(tildify "$fish_config") + + if [[ -w $fish_config ]]; then + { + echo -e '\n# bun' + + for command in "${commands[@]}"; do + echo "$command" + done + } >>"$fish_config" + + info "Added \"$tilde_bin_dir\" to \$PATH in \"$tilde_fish_config\"" + + refresh_command="source $tilde_fish_config" + else + echo "Manually add the directory to $tilde_fish_config (or similar):" + + for command in "${commands[@]}"; do + info_bold " $command" + done + fi + ;; +zsh) + # Install completions, but we don't care if it fails + IS_BUN_AUTO_UPDATE=true SHELL=zsh $exe completions &>/dev/null || : + + commands=( + "export $install_env=$quoted_install_dir" + "export PATH=\"$bin_env:\$PATH\"" + ) + + zsh_config=$HOME/.zshrc + tilde_zsh_config=$(tildify "$zsh_config") + + if [[ -w $zsh_config ]]; then + { + echo -e '\n# bun' + + for command in "${commands[@]}"; do + echo "$command" + done + } >>"$zsh_config" + + info "Added \"$tilde_bin_dir\" to \$PATH in \"$tilde_zsh_config\"" + + refresh_command="exec $SHELL" + else + echo "Manually add the directory to $tilde_zsh_config (or similar):" + + for command in "${commands[@]}"; do + info_bold " $command" + done + fi + ;; +bash) + # Install completions, but we don't care if it fails + IS_BUN_AUTO_UPDATE=true SHELL=bash $exe completions &>/dev/null || : + + commands=( + "export $install_env=$quoted_install_dir" + "export PATH=\"$bin_env:\$PATH\"" + ) + + bash_configs=( + "$HOME/.bashrc" + "$HOME/.bash_profile" + ) + + if [[ ${XDG_CONFIG_HOME:-} ]]; then + bash_configs+=( + "$XDG_CONFIG_HOME/.bash_profile" + "$XDG_CONFIG_HOME/.bashrc" + "$XDG_CONFIG_HOME/bash_profile" + "$XDG_CONFIG_HOME/bashrc" + ) + fi + + set_manually=true + for bash_config in "${bash_configs[@]}"; do + tilde_bash_config=$(tildify "$bash_config") + + if [[ -w $bash_config ]]; then + { + echo -e '\n# bun' + + for command in "${commands[@]}"; do + echo "$command" + done + } >>"$bash_config" + + info "Added \"$tilde_bin_dir\" to \$PATH in \"$tilde_bash_config\"" + + refresh_command="source $bash_config" + set_manually=false + break + fi + done + + if [[ $set_manually = true ]]; then + echo "Manually add the directory to $tilde_bash_config (or similar):" + + for command in "${commands[@]}"; do + info_bold " $command" + done + fi + ;; +*) + echo 'Manually add the directory to ~/.bashrc (or similar):' + info_bold " export $install_env=$quoted_install_dir" + info_bold " export PATH=\"$bin_env:\$PATH\"" + ;; +esac + +echo +info "To get started, run:" +echo + +if [[ $refresh_command ]]; then + info_bold " $refresh_command" +fi + +info_bold " bun --help" From 1eb92fa39b42fc6f4605dfec748bcc3562d682e2 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 11 Oct 2024 15:51:30 -0700 Subject: [PATCH 164/201] change bun install link to main (#4164) --- reflex/constants/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 627db5ae8..b12d56c78 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -44,7 +44,7 @@ class Bun(SimpleNamespace): DEFAULT_PATH = ROOT_PATH / "bin" / ("bun" if not IS_WINDOWS else "bun.exe") # URL to bun install script. - INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/change-bun-link/scripts/bun_install.sh" + INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/bun_install.sh" # URL to windows install script. WINDOWS_INSTALL_URL = ( From 0311dae5689c43e6bb16eb4e0f0b0d81bb4d9fde Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 11 Oct 2024 16:49:01 -0700 Subject: [PATCH 165/201] only read if it's *not* empty (#4165) --- reflex/utils/path_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index 79596716c..f597e0075 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -218,7 +218,7 @@ def update_json_file(file_path: str | Path, update_dict: dict[str, int | str]): # Read the existing json object from the file. json_object = {} - if fp.stat().st_size == 0: + if fp.stat().st_size: with open(fp) as f: json_object = json.load(f) From a2862bd1025b929fd48e26361410ad8110ae8e78 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 11 Oct 2024 16:49:40 -0700 Subject: [PATCH 166/201] Allow setting a different invocation function for EventChain (#4160) In rx.call_script scenario, the EventChain must call `queueEvents` and `processEvent` instead of `addEvents`, because the former are in scope in the call_script eval environment where `addEvents` is not. This is an escape hatch for certain wrapping scenarios. --- reflex/event.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reflex/event.py b/reflex/event.py index d2bebaa3f..659532ce2 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -389,6 +389,8 @@ class EventChain(EventActionsMixin): args_spec: Optional[Callable] = dataclasses.field(default=None) + invocation: Optional[Var] = dataclasses.field(default=None) + # These chains can be used for their side effects when no other events are desired. stop_propagation = EventChain(events=[], args_spec=lambda: []).stop_propagation @@ -1323,10 +1325,15 @@ class LiteralEventChainVar(CachedVarOperation, LiteralVar, EventChainVar): arg_def = ("...args",) arg_def_expr = Var(_js_expr="args") + if self._var_value.invocation is None: + invocation = FunctionStringVar.create("addEvents") + else: + invocation = self._var_value.invocation + return str( ArgsFunctionOperation.create( arg_def, - FunctionStringVar.create("addEvents").call( + invocation.call( LiteralVar.create( [LiteralVar.create(event) for event in self._var_value.events] ), From 736b2a6ea9e9be697cab3e5c03f29a4a7bf31741 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 11 Oct 2024 16:51:10 -0700 Subject: [PATCH 167/201] Handle rx.State subclasses defined in function (#4129) * Handle rx.State subclasses defined in function * create a new container module: `reflex.istate.dynamic` to save references to dynamically generated substates. * for substates with `` in the name, copy these to the container module and update the name to avoid duplication. * add test for "poor man" ComponentState Fix #4128 * test_state: disable local def handling for dupe-detection test * Track the original module and name for type hint evaluation Also use the original name when checking for the "mangled name" pattern when doing undeclared Var assignment checking. --- reflex/istate/dynamic.py | 3 ++ reflex/state.py | 52 +++++++++++++++++++++-- reflex/utils/types.py | 6 ++- tests/integration/test_component_state.py | 51 ++++++++++++++++++++++ tests/units/test_state.py | 3 ++ 5 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 reflex/istate/dynamic.py diff --git a/reflex/istate/dynamic.py b/reflex/istate/dynamic.py new file mode 100644 index 000000000..e5da36c26 --- /dev/null +++ b/reflex/istate/dynamic.py @@ -0,0 +1,3 @@ +"""A container for dynamically generated states.""" + +# This page intentionally left blank. diff --git a/reflex/state.py b/reflex/state.py index 38289d081..7b338b4d6 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -10,6 +10,7 @@ import functools import inspect import os import pickle +import sys import uuid from abc import ABC, abstractmethod from collections import defaultdict @@ -60,6 +61,7 @@ import wrapt from redis.asyncio import Redis from redis.exceptions import ResponseError +import reflex.istate.dynamic from reflex import constants from reflex.base import Base from reflex.event import ( @@ -425,6 +427,10 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if mixin: return + # Handle locally-defined states for pickling. + if "" in cls.__qualname__: + cls._handle_local_def() + # Validate the module name. cls._validate_module_name() @@ -471,7 +477,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): new_backend_vars.update( { name: cls._get_var_default(name, annotation_value) - for name, annotation_value in get_type_hints(cls).items() + for name, annotation_value in cls._get_type_hints().items() if name not in new_backend_vars and types.is_backend_base_variable(name, cls) } @@ -647,6 +653,39 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): ) ] + @classmethod + def _handle_local_def(cls): + """Handle locally-defined states for pickling.""" + known_names = dir(reflex.istate.dynamic) + proposed_name = cls.__name__ + for ix in range(len(known_names)): + if proposed_name not in known_names: + break + proposed_name = f"{cls.__name__}_{ix}" + setattr(reflex.istate.dynamic, proposed_name, cls) + cls.__original_name__ = cls.__name__ + cls.__original_module__ = cls.__module__ + cls.__name__ = cls.__qualname__ = proposed_name + cls.__module__ = reflex.istate.dynamic.__name__ + + @classmethod + def _get_type_hints(cls) -> dict[str, Any]: + """Get the type hints for this class. + + If the class is dynamic, evaluate the type hints with the original + module in the local namespace. + + Returns: + The type hints dict. + """ + original_module = getattr(cls, "__original_module__", None) + if original_module is not None: + localns = sys.modules[original_module].__dict__ + else: + localns = None + + return get_type_hints(cls, localns=localns) + @classmethod def _init_var_dependency_dicts(cls): """Initialize the var dependency tracking dicts. @@ -1210,7 +1249,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): name not in self.vars and name not in self.get_skip_vars() and not name.startswith("__") - and not name.startswith(f"_{type(self).__name__}__") + and not name.startswith( + f"_{getattr(type(self), '__original_name__', type(self).__name__)}__" + ) ): raise SetUndefinedStateVarError( f"The state variable '{name}' has not been defined in '{type(self).__name__}'. " @@ -2199,10 +2240,13 @@ class ComponentState(State, mixin=True): cls._per_component_state_instance_count += 1 state_cls_name = f"{cls.__name__}_n{cls._per_component_state_instance_count}" component_state = type( - state_cls_name, (cls, State), {"__module__": __name__}, mixin=False + state_cls_name, + (cls, State), + {"__module__": reflex.istate.dynamic.__name__}, + mixin=False, ) # Save a reference to the dynamic state for pickle/unpickle. - globals()[state_cls_name] = component_state + setattr(reflex.istate.dynamic, state_cls_name, component_state) component = component_state.get_component(*children, **props) component.State = component_state return component diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 6bedf5b61..5e963a7cb 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -525,7 +525,11 @@ def is_backend_base_variable(name: str, cls: Type) -> bool: if name.startswith(f"_{cls.__name__}__"): return False - hints = get_type_hints(cls) + # Extract the namespace of the original module if defined (dynamic substates). + if callable(getattr(cls, "_get_type_hints", None)): + hints = cls._get_type_hints() + else: + hints = get_type_hints(cls) if name in hints: hint = get_origin(hints[name]) if hint == ClassVar: diff --git a/tests/integration/test_component_state.py b/tests/integration/test_component_state.py index 7b35f8116..1555577d1 100644 --- a/tests/integration/test_component_state.py +++ b/tests/integration/test_component_state.py @@ -20,6 +20,8 @@ def ComponentStateApp(): E = TypeVar("E") class MultiCounter(rx.ComponentState, Generic[E]): + """ComponentState style.""" + count: int = 0 _be: E _be_int: int @@ -42,16 +44,47 @@ def ComponentStateApp(): **props, ) + def multi_counter_func(id: str = "default") -> rx.Component: + """Local-substate style. + + Args: + id: identifier for this instance + + Returns: + A new instance of the component with its own state. + """ + + class _Counter(rx.State): + count: int = 0 + + def increment(self): + self.count += 1 + + return rx.vstack( + rx.heading(_Counter.count, id=f"count-{id}"), + rx.button( + "Increment", + on_click=_Counter.increment, + id=f"button-{id}", + ), + State=_Counter, + ) + app = rx.App(state=rx.State) # noqa @rx.page() def index(): mc_a = MultiCounter.create(id="a") mc_b = MultiCounter.create(id="b") + mc_c = multi_counter_func(id="c") + mc_d = multi_counter_func(id="d") assert mc_a.State != mc_b.State + assert mc_c.State != mc_d.State return rx.vstack( mc_a, mc_b, + mc_c, + mc_d, rx.button( "Inc A", on_click=mc_a.State.increment, # type: ignore @@ -149,3 +182,21 @@ async def test_component_state_app(component_state_app: AppHarness): b_state = root_state.substates[b_state_name] assert b_state._backend_vars != b_state.backend_vars assert b_state._be == b_state._backend_vars["_be"] == 2 + + # Check locally-defined substate style + count_c = driver.find_element(By.ID, "count-c") + count_d = driver.find_element(By.ID, "count-d") + button_c = driver.find_element(By.ID, "button-c") + button_d = driver.find_element(By.ID, "button-d") + + assert component_state_app.poll_for_content(count_c, exp_not_equal="") == "0" + assert component_state_app.poll_for_content(count_d, exp_not_equal="") == "0" + button_c.click() + assert component_state_app.poll_for_content(count_c, exp_not_equal="0") == "1" + assert component_state_app.poll_for_content(count_d, exp_not_equal="") == "0" + button_c.click() + assert component_state_app.poll_for_content(count_c, exp_not_equal="1") == "2" + assert component_state_app.poll_for_content(count_d, exp_not_equal="") == "0" + button_d.click() + assert component_state_app.poll_for_content(count_c, exp_not_equal="1") == "2" + assert component_state_app.poll_for_content(count_d, exp_not_equal="0") == "1" diff --git a/tests/units/test_state.py b/tests/units/test_state.py index ae74cacce..610d69110 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -2502,7 +2502,10 @@ def test_mutable_copy_vars(mutable_state: MutableTestState, copy_func: Callable) def test_duplicate_substate_class(mocker): + # Neuter pytest escape hatch, because we want to test duplicate detection. mocker.patch("reflex.state.is_testing_env", lambda: False) + # Neuter state handling since these _are_ defined inside a function. + mocker.patch("reflex.state.BaseState._handle_local_def", lambda: None) with pytest.raises(ValueError): class TestState(BaseState): From 0889276e24be8e459506e1f591ca19dec3944e8c Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Sat, 12 Oct 2024 02:08:39 +0200 Subject: [PATCH 168/201] Do not auto-determine generic args if already supplied (#4148) * add failing test for figure_out_type * do not auto-determine generic args if already supplied * move has_args to utils.types, add tests for it --- reflex/utils/types.py | 21 +++++++++++++++ reflex/vars/base.py | 9 ++++--- tests/units/utils/test_types.py | 47 ++++++++++++++++++++++++++++++++- tests/units/vars/test_base.py | 28 ++++++++++++++++++++ 4 files changed, 101 insertions(+), 4 deletions(-) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 5e963a7cb..3f3b05258 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -220,6 +220,27 @@ def is_literal(cls: GenericType) -> bool: return get_origin(cls) is Literal +def has_args(cls) -> bool: + """Check if the class has generic parameters. + + Args: + cls: The class to check. + + Returns: + Whether the class has generic + """ + if get_args(cls): + return True + + # Check if the class inherits from a generic class (using __orig_bases__) + if hasattr(cls, "__orig_bases__"): + for base in cls.__orig_bases__: + if get_args(base): + return True + + return False + + def is_optional(cls: GenericType) -> bool: """Check if a class is an Optional. diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 7bc5e4d92..df9a0e122 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -56,7 +56,7 @@ from reflex.utils.imports import ( ParsedImportDict, parse_imports, ) -from reflex.utils.types import GenericType, Self, get_origin +from reflex.utils.types import GenericType, Self, get_origin, has_args if TYPE_CHECKING: from reflex.state import BaseState @@ -1266,6 +1266,11 @@ def figure_out_type(value: Any) -> types.GenericType: Returns: The type of the value. """ + if isinstance(value, Var): + return value._var_type + type_ = type(value) + if has_args(type_): + return type_ if isinstance(value, list): return List[unionize(*(figure_out_type(v) for v in value))] if isinstance(value, set): @@ -1277,8 +1282,6 @@ def figure_out_type(value: Any) -> types.GenericType: unionize(*(figure_out_type(k) for k in value)), unionize(*(figure_out_type(v) for v in value.values())), ] - if isinstance(value, Var): - return value._var_type return type(value) diff --git a/tests/units/utils/test_types.py b/tests/units/utils/test_types.py index fc9261e04..623aacc1f 100644 --- a/tests/units/utils/test_types.py +++ b/tests/units/utils/test_types.py @@ -1,4 +1,4 @@ -from typing import Any, List, Literal, Tuple, Union +from typing import Any, Dict, List, Literal, Tuple, Union import pytest @@ -45,3 +45,48 @@ def test_issubclass( cls: types.GenericType, cls_check: types.GenericType, expected: bool ) -> None: assert types._issubclass(cls, cls_check) == expected + + +class CustomDict(dict[str, str]): + """A custom dict with generic arguments.""" + + pass + + +class ChildCustomDict(CustomDict): + """A child of CustomDict.""" + + pass + + +class GenericDict(dict): + """A generic dict with no generic arguments.""" + + pass + + +class ChildGenericDict(GenericDict): + """A child of GenericDict.""" + + pass + + +@pytest.mark.parametrize( + "cls,expected", + [ + (int, False), + (str, False), + (float, False), + (Tuple[int], True), + (List[int], True), + (Union[int, str], True), + (Union[str, int], True), + (Dict[str, int], True), + (CustomDict, True), + (ChildCustomDict, True), + (GenericDict, False), + (ChildGenericDict, False), + ], +) +def test_has_args(cls, expected: bool) -> None: + assert types.has_args(cls) == expected diff --git a/tests/units/vars/test_base.py b/tests/units/vars/test_base.py index f83d79373..68bc0c38e 100644 --- a/tests/units/vars/test_base.py +++ b/tests/units/vars/test_base.py @@ -5,6 +5,30 @@ import pytest from reflex.vars.base import figure_out_type +class CustomDict(dict[str, str]): + """A custom dict with generic arguments.""" + + pass + + +class ChildCustomDict(CustomDict): + """A child of CustomDict.""" + + pass + + +class GenericDict(dict): + """A generic dict with no generic arguments.""" + + pass + + +class ChildGenericDict(GenericDict): + """A child of GenericDict.""" + + pass + + @pytest.mark.parametrize( ("value", "expected"), [ @@ -15,6 +39,10 @@ from reflex.vars.base import figure_out_type ([1, 2.0, "a"], List[Union[int, float, str]]), ({"a": 1, "b": 2}, Dict[str, int]), ({"a": 1, 2: "b"}, Dict[Union[int, str], Union[str, int]]), + (CustomDict(), CustomDict), + (ChildCustomDict(), ChildCustomDict), + (GenericDict({1: 1}), Dict[int, int]), + (ChildGenericDict({1: 1}), Dict[int, int]), ], ) def test_figure_out_type(value, expected): From b1d449897a14d3c0646f08ed3b0809f314923544 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 11 Oct 2024 17:27:15 -0700 Subject: [PATCH 169/201] unionize base var fields types (#4153) * unionize base var fields types * add tests * fix union types for vars (#4152) * remove 3.11 special casing * special case on version * fix old versions of python --------- Co-authored-by: Masen Furer --- reflex/utils/types.py | 28 +++++++++++++++++++++++----- reflex/vars/base.py | 22 +--------------------- reflex/vars/object.py | 4 +++- tests/units/test_var.py | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 27 deletions(-) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 3f3b05258..d2de4a156 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -182,6 +182,26 @@ def is_generic_alias(cls: GenericType) -> bool: return isinstance(cls, GenericAliasTypes) +def unionize(*args: GenericType) -> Type: + """Unionize the types. + + Args: + args: The types to unionize. + + Returns: + The unionized types. + """ + if not args: + return Any + if len(args) == 1: + return args[0] + # We are bisecting the args list here to avoid hitting the recursion limit + # In Python versions >= 3.11, we can simply do `return Union[*args]` + midpoint = len(args) // 2 + first_half, second_half = args[:midpoint], args[midpoint:] + return Union[unionize(*first_half), unionize(*second_half)] + + def is_none(cls: GenericType) -> bool: """Check if a class is None. @@ -358,11 +378,9 @@ def get_attribute_access_type(cls: GenericType, name: str) -> GenericType | None return type_ elif is_union(cls): # Check in each arg of the annotation. - for arg in get_args(cls): - type_ = get_attribute_access_type(arg, name) - if type_ is not None: - # Return the first attribute type that is accessible. - return type_ + return unionize( + *(get_attribute_access_type(arg, name) for arg in get_args(cls)) + ) elif isinstance(cls, type): # Bare class if sys.version_info >= (3, 10): diff --git a/reflex/vars/base.py b/reflex/vars/base.py index df9a0e122..f62f8513a 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -56,7 +56,7 @@ from reflex.utils.imports import ( ParsedImportDict, parse_imports, ) -from reflex.utils.types import GenericType, Self, get_origin, has_args +from reflex.utils.types import GenericType, Self, get_origin, has_args, unionize if TYPE_CHECKING: from reflex.state import BaseState @@ -1237,26 +1237,6 @@ def var_operation( return wrapper -def unionize(*args: Type) -> Type: - """Unionize the types. - - Args: - args: The types to unionize. - - Returns: - The unionized types. - """ - if not args: - return Any - if len(args) == 1: - return args[0] - # We are bisecting the args list here to avoid hitting the recursion limit - # In Python versions >= 3.11, we can simply do `return Union[*args]` - midpoint = len(args) // 2 - first_half, second_half = args[:midpoint], args[midpoint:] - return Union[unionize(*first_half), unionize(*second_half)] - - def figure_out_type(value: Any) -> types.GenericType: """Figure out the type of the value. diff --git a/reflex/vars/object.py b/reflex/vars/object.py index a9175a703..38add7779 100644 --- a/reflex/vars/object.py +++ b/reflex/vars/object.py @@ -262,7 +262,9 @@ class ObjectVar(Var[OBJECT_TYPE]): var_type = get_args(var_type)[0] fixed_type = var_type if isclass(var_type) else get_origin(var_type) - if isclass(fixed_type) and not issubclass(fixed_type, dict): + if (isclass(fixed_type) and not issubclass(fixed_type, dict)) or ( + fixed_type in types.UnionTypes + ): attribute_type = get_attribute_access_type(var_type, name) if attribute_type is None: raise VarAttributeError( diff --git a/tests/units/test_var.py b/tests/units/test_var.py index c02acefe6..c04e554a9 100644 --- a/tests/units/test_var.py +++ b/tests/units/test_var.py @@ -1,5 +1,6 @@ import json import math +import sys import typing from typing import Dict, List, Optional, Set, Tuple, Union, cast @@ -398,6 +399,44 @@ def test_list_tuple_contains(var, expected): assert str(var.contains(other_var)) == f"{expected}.includes(other)" +class Foo(rx.Base): + """Foo class.""" + + bar: int + baz: str + + +class Bar(rx.Base): + """Bar class.""" + + bar: str + baz: str + foo: int + + +@pytest.mark.parametrize( + ("var", "var_type"), + ( + [ + (Var(_js_expr="", _var_type=Foo | Bar).guess_type(), Foo | Bar), + (Var(_js_expr="", _var_type=Foo | Bar).guess_type().bar, Union[int, str]), + ] + if sys.version_info >= (3, 10) + else [] + ) + + [ + (Var(_js_expr="", _var_type=Union[Foo, Bar]).guess_type(), Union[Foo, Bar]), + (Var(_js_expr="", _var_type=Union[Foo, Bar]).guess_type().baz, str), + ( + Var(_js_expr="", _var_type=Union[Foo, Bar]).guess_type().foo, + Union[int, None], + ), + ], +) +def test_var_types(var, var_type): + assert var._var_type == var_type + + @pytest.mark.parametrize( "var, expected", [ From b2d2719f90d5d71b88ac3f2dd8c8d39b72e49e07 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 14 Oct 2024 08:44:31 -0700 Subject: [PATCH 170/201] add type hinting to events (#4145) * add type hinting to events * fix pyi * make it a list * add on change * dang it darglintz * add future annotations * add try except becuse i hate this * add check for class * aaaa * sometimes you need to make hard decisions * ono * i hate unions * add rx event * move stuff around * maybe * special case osmething * i don't need no test * remove stray print Co-authored-by: Masen Furer * remove another stray print Co-authored-by: Masen Furer * add rx event --------- Co-authored-by: Masen Furer --- reflex/__init__.py | 3 +- reflex/__init__.pyi | 2 +- reflex/components/base/app_wrap.pyi | 54 +- reflex/components/base/body.pyi | 54 +- reflex/components/base/document.pyi | 254 +-- reflex/components/base/error_boundary.pyi | 56 +- reflex/components/base/fragment.pyi | 54 +- reflex/components/base/head.pyi | 104 +- reflex/components/base/link.pyi | 104 +- reflex/components/base/meta.pyi | 204 +-- reflex/components/base/script.pyi | 60 +- reflex/components/core/banner.pyi | 254 +-- .../components/core/client_side_routing.pyi | 104 +- reflex/components/core/clipboard.py | 6 +- reflex/components/core/clipboard.pyi | 56 +- reflex/components/core/debounce.py | 4 +- reflex/components/core/debounce.pyi | 56 +- reflex/components/core/html.pyi | 54 +- reflex/components/core/upload.py | 6 +- reflex/components/core/upload.pyi | 210 +-- reflex/components/datadisplay/code.pyi | 104 +- reflex/components/datadisplay/dataeditor.py | 16 +- reflex/components/datadisplay/dataeditor.pyi | 116 +- reflex/components/el/element.pyi | 54 +- reflex/components/el/elements/base.pyi | 54 +- reflex/components/el/elements/forms.py | 13 +- reflex/components/el/elements/forms.pyi | 726 +++------ reflex/components/el/elements/inline.pyi | 1404 +++++------------ reflex/components/el/elements/media.pyi | 1254 +++++---------- reflex/components/el/elements/metadata.pyi | 304 ++-- reflex/components/el/elements/other.pyi | 354 ++--- reflex/components/el/elements/scripts.pyi | 154 +- reflex/components/el/elements/sectioning.pyi | 754 +++------ reflex/components/el/elements/tables.pyi | 504 ++---- reflex/components/el/elements/typography.pyi | 754 +++------ reflex/components/gridjs/datatable.pyi | 104 +- reflex/components/lucide/icon.pyi | 104 +- reflex/components/markdown/markdown.pyi | 52 +- reflex/components/moment/moment.py | 4 +- reflex/components/moment/moment.pyi | 56 +- reflex/components/next/base.pyi | 54 +- reflex/components/next/image.pyi | 58 +- reflex/components/next/link.pyi | 54 +- reflex/components/next/video.pyi | 54 +- reflex/components/plotly/plotly.pyi | 122 +- .../components/radix/primitives/accordion.py | 16 +- .../components/radix/primitives/accordion.pyi | 360 ++--- reflex/components/radix/primitives/base.pyi | 104 +- reflex/components/radix/primitives/drawer.py | 14 +- reflex/components/radix/primitives/drawer.pyi | 532 ++----- reflex/components/radix/primitives/form.pyi | 522 ++---- .../components/radix/primitives/progress.pyi | 254 +-- reflex/components/radix/primitives/slider.py | 20 +- reflex/components/radix/primitives/slider.pyi | 264 +--- reflex/components/radix/themes/base.pyi | 354 ++--- reflex/components/radix/themes/color_mode.pyi | 165 +- .../radix/themes/components/alert_dialog.py | 10 +- .../radix/themes/components/alert_dialog.pyi | 370 ++--- .../radix/themes/components/aspect_ratio.pyi | 54 +- .../radix/themes/components/avatar.pyi | 54 +- .../radix/themes/components/badge.pyi | 54 +- .../radix/themes/components/button.pyi | 54 +- .../radix/themes/components/callout.pyi | 254 +-- .../radix/themes/components/card.pyi | 54 +- .../radix/themes/components/checkbox.py | 6 +- .../radix/themes/components/checkbox.pyi | 160 +- .../themes/components/checkbox_cards.pyi | 104 +- .../themes/components/checkbox_group.pyi | 104 +- .../radix/themes/components/context_menu.py | 22 +- .../radix/themes/components/context_menu.pyi | 444 ++---- .../radix/themes/components/data_list.pyi | 204 +-- .../radix/themes/components/dialog.py | 14 +- .../radix/themes/components/dialog.pyi | 382 ++--- .../radix/themes/components/dropdown_menu.py | 26 +- .../radix/themes/components/dropdown_menu.pyi | 450 ++---- .../radix/themes/components/hover_card.py | 4 +- .../radix/themes/components/hover_card.pyi | 212 +-- .../radix/themes/components/icon_button.pyi | 54 +- .../radix/themes/components/inset.pyi | 54 +- .../radix/themes/components/popover.py | 16 +- .../radix/themes/components/popover.pyi | 232 +-- .../radix/themes/components/progress.pyi | 54 +- .../radix/themes/components/radio.pyi | 54 +- .../radix/themes/components/radio_cards.py | 4 +- .../radix/themes/components/radio_cards.pyi | 108 +- .../radix/themes/components/radio_group.py | 4 +- .../radix/themes/components/radio_group.pyi | 206 +-- .../radix/themes/components/scroll_area.pyi | 54 +- .../themes/components/segmented_control.py | 16 +- .../themes/components/segmented_control.pyi | 108 +- .../radix/themes/components/select.py | 11 +- .../radix/themes/components/select.pyi | 484 ++---- .../radix/themes/components/separator.pyi | 54 +- .../radix/themes/components/skeleton.pyi | 54 +- .../radix/themes/components/slider.py | 22 +- .../radix/themes/components/slider.pyi | 64 +- .../radix/themes/components/spinner.pyi | 54 +- .../radix/themes/components/switch.py | 4 +- .../radix/themes/components/switch.pyi | 56 +- .../radix/themes/components/table.pyi | 354 ++--- .../radix/themes/components/tabs.py | 4 +- .../radix/themes/components/tabs.pyi | 258 +-- .../radix/themes/components/text_area.pyi | 62 +- .../radix/themes/components/text_field.pyi | 170 +- .../radix/themes/components/tooltip.py | 8 +- .../radix/themes/components/tooltip.pyi | 66 +- .../components/radix/themes/layout/base.pyi | 54 +- reflex/components/radix/themes/layout/box.pyi | 54 +- .../components/radix/themes/layout/center.pyi | 54 +- .../radix/themes/layout/container.pyi | 54 +- .../components/radix/themes/layout/flex.pyi | 54 +- .../components/radix/themes/layout/grid.pyi | 54 +- .../components/radix/themes/layout/list.pyi | 254 +-- .../radix/themes/layout/section.pyi | 54 +- .../components/radix/themes/layout/spacer.pyi | 54 +- .../components/radix/themes/layout/stack.pyi | 154 +- .../radix/themes/typography/blockquote.pyi | 54 +- .../radix/themes/typography/code.pyi | 54 +- .../radix/themes/typography/heading.pyi | 54 +- .../radix/themes/typography/link.pyi | 54 +- .../radix/themes/typography/text.pyi | 354 ++--- reflex/components/react_player/audio.pyi | 102 +- .../components/react_player/react_player.py | 10 +- .../components/react_player/react_player.pyi | 102 +- reflex/components/react_player/video.pyi | 102 +- reflex/components/recharts/cartesian.pyi | 946 ++++------- reflex/components/recharts/charts.pyi | 552 ++----- reflex/components/recharts/general.pyi | 256 +-- reflex/components/recharts/polar.pyi | 194 +-- reflex/components/recharts/recharts.pyi | 104 +- reflex/components/sonner/toast.pyi | 54 +- reflex/components/suneditor/editor.pyi | 78 +- reflex/event.py | 170 +- reflex/experimental/layout.pyi | 258 +-- reflex/utils/pyi_generator.py | 48 +- reflex/utils/types.py | 17 +- reflex/vars/base.py | 113 +- tests/integration/test_background_task.py | 10 + tests/integration/test_call_script.py | 17 + tests/integration/test_client_storage.py | 2 + tests/integration/test_component_state.py | 2 + tests/integration/test_computed_vars.py | 2 + tests/integration/test_connection_banner.py | 1 + tests/integration/test_deploy_url.py | 1 + tests/integration/test_event_actions.py | 1 + tests/integration/test_event_chain.py | 19 + tests/integration/test_login_flow.py | 2 + tests/integration/test_server_side_event.py | 4 + tests/units/components/base/test_script.py | 4 + tests/units/components/core/test_debounce.py | 1 + tests/units/components/core/test_upload.py | 11 +- tests/units/components/test_component.py | 4 +- .../test_component_future_annotations.py | 2 +- tests/units/test_app.py | 1 + 154 files changed, 6957 insertions(+), 14899 deletions(-) diff --git a/reflex/__init__.py b/reflex/__init__.py index 57e7768ea..ad51d2cf4 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -89,6 +89,8 @@ from reflex.utils import ( lazy_loader, ) +from .event import event as event + # import this here explicitly to avoid returning the page module since page attr has the # same name as page module(page.py) from .page import page as page @@ -336,7 +338,6 @@ _MAPPING: dict = { _SUBMODULES: set[str] = { "components", - "event", "app", "style", "admin", diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index 28d768c35..d928778d8 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -11,7 +11,6 @@ from . import base as base from . import compiler as compiler from . import components as components from . import config as config -from . import event as event from . import model as model from . import style as style from . import testing as testing @@ -161,6 +160,7 @@ from .event import clear_local_storage as clear_local_storage from .event import clear_session_storage as clear_session_storage from .event import console_log as console_log from .event import download as download +from .event import event as event from .event import prevent_default as prevent_default from .event import redirect as redirect from .event import remove_cookie as remove_cookie diff --git a/reflex/components/base/app_wrap.pyi b/reflex/components/base/app_wrap.pyi index 29e1e54b1..c4cb45469 100644 --- a/reflex/components/base/app_wrap.pyi +++ b/reflex/components/base/app_wrap.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.base.fragment import Fragment -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -22,41 +22,21 @@ class AppWrap(Fragment): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AppWrap": """Create a new AppWrap component. diff --git a/reflex/components/base/body.pyi b/reflex/components/base/body.pyi index d638a5f3e..74f3333e5 100644 --- a/reflex/components/base/body.pyi +++ b/reflex/components/base/body.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -22,41 +22,21 @@ class Body(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Body": """Create the component. diff --git a/reflex/components/base/document.pyi b/reflex/components/base/document.pyi index d9641a0d1..a4a956369 100644 --- a/reflex/components/base/document.pyi +++ b/reflex/components/base/document.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -22,41 +22,21 @@ class NextDocumentLib(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "NextDocumentLib": """Create the component. @@ -89,41 +69,21 @@ class Html(NextDocumentLib): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Html": """Create the component. @@ -155,41 +115,21 @@ class DocumentHead(NextDocumentLib): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DocumentHead": """Create the component. @@ -221,41 +161,21 @@ class Main(NextDocumentLib): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Main": """Create the component. @@ -287,41 +207,21 @@ class NextScript(NextDocumentLib): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "NextScript": """Create the component. diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index 3497f3141..65109b0fe 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload +from typing import Any, Dict, List, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportVar from reflex.vars.base import Var @@ -27,42 +27,22 @@ class ErrorBoundary(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_error: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ErrorBoundary": """Create the component. diff --git a/reflex/components/base/fragment.pyi b/reflex/components/base/fragment.pyi index 7c7f397db..b49bf4cad 100644 --- a/reflex/components/base/fragment.pyi +++ b/reflex/components/base/fragment.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -22,41 +22,21 @@ class Fragment(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Fragment": """Create the component. diff --git a/reflex/components/base/head.pyi b/reflex/components/base/head.pyi index 64554a57f..148dbe486 100644 --- a/reflex/components/base/head.pyi +++ b/reflex/components/base/head.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -22,41 +22,21 @@ class NextHeadLib(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "NextHeadLib": """Create the component. @@ -88,41 +68,21 @@ class Head(NextHeadLib, MemoizationLeaf): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Head": """Create a new memoization leaf component. diff --git a/reflex/components/base/link.pyi b/reflex/components/base/link.pyi index 6493b012c..61ff66029 100644 --- a/reflex/components/base/link.pyi +++ b/reflex/components/base/link.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -24,41 +24,21 @@ class RawLink(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RawLink": """Create the component. @@ -99,41 +79,21 @@ class ScriptTag(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ScriptTag": """Create the component. diff --git a/reflex/components/base/meta.pyi b/reflex/components/base/meta.pyi index 08b8be65e..e91626cde 100644 --- a/reflex/components/base/meta.pyi +++ b/reflex/components/base/meta.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -23,41 +23,21 @@ class Title(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Title": """Create the component. @@ -94,41 +74,21 @@ class Meta(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Meta": """Create the component. @@ -170,41 +130,21 @@ class Description(Meta): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Description": """Create the component. @@ -246,41 +186,21 @@ class Image(Meta): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Image": """Create the component. diff --git a/reflex/components/base/script.pyi b/reflex/components/base/script.pyi index 2de7b2fcc..2d13180bc 100644 --- a/reflex/components/base/script.pyi +++ b/reflex/components/base/script.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -29,44 +29,24 @@ class Script(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_error: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_load: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_ready: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Script": """Create an inline or user-defined script. diff --git a/reflex/components/core/banner.pyi b/reflex/components/core/banner.pyi index 01c526fac..7c2be272c 100644 --- a/reflex/components/core/banner.pyi +++ b/reflex/components/core/banner.pyi @@ -3,14 +3,14 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import Component from reflex.components.el.elements.typography import Div from reflex.components.lucide.icon import Icon from reflex.components.sonner.toast import Toaster, ToastProps from reflex.constants.compiler import CompileVars -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportVar from reflex.vars import VarData @@ -89,41 +89,21 @@ class ConnectionToaster(Toaster): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ConnectionToaster": """Create a connection toaster component. @@ -169,41 +149,21 @@ class ConnectionBanner(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ConnectionBanner": """Create a connection banner component. @@ -228,41 +188,21 @@ class ConnectionModal(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ConnectionModal": """Create a connection banner component. @@ -288,41 +228,21 @@ class WifiOffPulse(Icon): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "WifiOffPulse": """Create a wifi_off icon with an animated opacity pulse. @@ -381,41 +301,21 @@ class ConnectionPulser(Div): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ConnectionPulser": """Create a connection pulser component. diff --git a/reflex/components/core/client_side_routing.pyi b/reflex/components/core/client_side_routing.pyi index 9f73467b3..1d528daaf 100644 --- a/reflex/components/core/client_side_routing.pyi +++ b/reflex/components/core/client_side_routing.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -26,41 +26,21 @@ class ClientSideRouting(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ClientSideRouting": """Create the component. @@ -95,41 +75,21 @@ class Default404Page(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Default404Page": """Create the component. diff --git a/reflex/components/core/clipboard.py b/reflex/components/core/clipboard.py index 1d7ce7c14..88aa2d145 100644 --- a/reflex/components/core/clipboard.py +++ b/reflex/components/core/clipboard.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Union +from typing import Dict, List, Tuple, Union from reflex.components.base.fragment import Fragment from reflex.components.tags.tag import Tag -from reflex.event import EventChain, EventHandler +from reflex.event import EventChain, EventHandler, identity_event from reflex.utils.format import format_prop, wrap from reflex.utils.imports import ImportVar from reflex.vars import get_unique_variable_name @@ -20,7 +20,7 @@ class Clipboard(Fragment): 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. - on_paste: EventHandler[lambda data: [data]] + on_paste: EventHandler[identity_event(List[Tuple[str, str]])] # Save the original event actions for the on_paste event. on_paste_event_actions: Var[Dict[str, Union[bool, int]]] diff --git a/reflex/components/core/clipboard.pyi b/reflex/components/core/clipboard.pyi index cf02709fc..e2f6afc8d 100644 --- a/reflex/components/core/clipboard.pyi +++ b/reflex/components/core/clipboard.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload +from typing import Any, Dict, List, Optional, Union, overload from reflex.components.base.fragment import Fragment -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportVar from reflex.vars.base import Var @@ -27,42 +27,22 @@ class Clipboard(Fragment): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_paste: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Clipboard": """Create a Clipboard component. diff --git a/reflex/components/core/debounce.py b/reflex/components/core/debounce.py index a8f20f08a..07ad1d69e 100644 --- a/reflex/components/core/debounce.py +++ b/reflex/components/core/debounce.py @@ -6,7 +6,7 @@ from typing import Any, Type, Union from reflex.components.component import Component from reflex.constants import EventTriggers -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event from reflex.vars import VarData from reflex.vars.base import Var @@ -46,7 +46,7 @@ class DebounceInput(Component): element: Var[Type[Component]] # Fired when the input value changes - on_change: EventHandler[lambda e0: [e0.value]] + on_change: EventHandler[empty_event] @classmethod def create(cls, *children: Component, **props: Any) -> Component: diff --git a/reflex/components/core/debounce.pyi b/reflex/components/core/debounce.pyi index dc2b505f5..6d7b76510 100644 --- a/reflex/components/core/debounce.pyi +++ b/reflex/components/core/debounce.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Type, Union, overload +from typing import Any, Dict, Optional, Type, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -31,42 +31,22 @@ class DebounceInput(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DebounceInput": """Create a DebounceInput component. diff --git a/reflex/components/core/html.pyi b/reflex/components/core/html.pyi index 969508a6a..7f3ff603d 100644 --- a/reflex/components/core/html.pyi +++ b/reflex/components/core/html.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.el.elements.typography import Div -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -49,41 +49,21 @@ class Html(Div): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Html": """Create a html component. diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index ac7d5f164..be97b170d 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -4,7 +4,7 @@ from __future__ import annotations import os from pathlib import Path -from typing import Callable, ClassVar, Dict, List, Optional +from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf from reflex.components.el.elements.forms import Input @@ -157,7 +157,7 @@ def get_upload_url(file_path: str) -> Var[str]: return uploaded_files_url_prefix + "/" + file_path -def _on_drop_spec(files: Var): +def _on_drop_spec(files: Var) -> Tuple[Var[Any]]: """Args spec for the on_drop event trigger. Args: @@ -166,7 +166,7 @@ def _on_drop_spec(files: Var): Returns: Signature for on_drop handler including the files to upload. """ - return [files] + return (files,) class UploadFilesProvider(Component): diff --git a/reflex/components/core/upload.pyi b/reflex/components/core/upload.pyi index 22f229098..5bbae892f 100644 --- a/reflex/components/core/upload.pyi +++ b/reflex/components/core/upload.pyi @@ -4,14 +4,14 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from pathlib import Path -from typing import Any, Callable, ClassVar, Dict, List, Optional, Union, overload +from typing import Any, ClassVar, Dict, List, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf from reflex.constants import Dirs from reflex.event import ( CallableEventSpec, - EventHandler, EventSpec, + EventType, ) from reflex.style import Style from reflex.utils.imports import ImportVar @@ -54,41 +54,21 @@ class UploadFilesProvider(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "UploadFilesProvider": """Create the component. @@ -131,42 +111,22 @@ class Upload(MemoizationLeaf): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_drop: Optional[EventType[Any]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Upload": """Create an upload component. @@ -216,42 +176,22 @@ class StyledUpload(Upload): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_drop: Optional[EventType[Any]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "StyledUpload": """Create the styled upload component. @@ -301,42 +241,22 @@ class UploadNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_drop: Optional[EventType[Any]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "StyledUpload": """Create the styled upload component. diff --git a/reflex/components/datadisplay/code.pyi b/reflex/components/datadisplay/code.pyi index 621dce5d0..0bf3dd956 100644 --- a/reflex/components/datadisplay/code.pyi +++ b/reflex/components/datadisplay/code.pyi @@ -4,11 +4,11 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ import dataclasses -from typing import Any, Callable, ClassVar, Dict, Literal, Optional, Union, overload +from typing import Any, ClassVar, Dict, Literal, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.constants.colors import Color -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -939,41 +939,21 @@ class CodeBlock(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CodeBlock": """Create a text component. @@ -1594,41 +1574,21 @@ class CodeblockNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CodeBlock": """Create a text component. diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index ab84ad3f7..01255dd14 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -3,12 +3,12 @@ from __future__ import annotations from enum import Enum -from typing import Any, Dict, List, Literal, Optional, Union +from typing import Any, Dict, List, Literal, Optional, Tuple, Union from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.components.literals import LiteralRowMarker -from reflex.event import EventHandler, empty_event +from reflex.event import EventHandler, empty_event, identity_event from reflex.utils import console, format, types from reflex.utils.imports import ImportDict, ImportVar from reflex.utils.serializers import serializer @@ -223,13 +223,13 @@ class DataEditor(NoSSRComponent): theme: Var[Union[DataEditorTheme, Dict]] # Fired when a cell is activated. - on_cell_activated: EventHandler[lambda pos: [pos]] + on_cell_activated: EventHandler[identity_event(Tuple[int, int])] # Fired when a cell is clicked. - on_cell_clicked: EventHandler[lambda pos: [pos]] + on_cell_clicked: EventHandler[identity_event(Tuple[int, int])] # Fired when a cell is right-clicked. - on_cell_context_menu: EventHandler[lambda pos: [pos]] + on_cell_context_menu: EventHandler[identity_event(Tuple[int, int])] # Fired when a cell is edited. on_cell_edited: EventHandler[on_edit_spec] @@ -244,16 +244,16 @@ class DataEditor(NoSSRComponent): on_group_header_renamed: EventHandler[lambda idx, val: [idx, val]] # Fired when a header is clicked. - on_header_clicked: EventHandler[lambda pos: [pos]] + on_header_clicked: EventHandler[identity_event(Tuple[int, int])] # Fired when a header is right-clicked. - on_header_context_menu: EventHandler[lambda pos: [pos]] + on_header_context_menu: EventHandler[identity_event(Tuple[int, int])] # Fired when a header menu item is clicked. on_header_menu_click: EventHandler[lambda col, pos: [col, pos]] # Fired when an item is hovered. - on_item_hovered: EventHandler[lambda pos: [pos]] + on_item_hovered: EventHandler[identity_event(Tuple[int, int])] # Fired when a selection is deleted. on_delete: EventHandler[lambda selection: [selection]] diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index edfd0521a..b3a9ce2b3 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -4,11 +4,11 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from enum import Enum -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.utils.serializers import serializer @@ -135,87 +135,37 @@ class DataEditor(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_cell_activated: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_cell_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_cell_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_cell_edited: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_column_resize: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_delete: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_finished_editing: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_group_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_group_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_group_header_renamed: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_header_menu_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_item_hovered: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_row_appended: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_selection_cleared: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_cell_activated: Optional[EventType] = None, + on_cell_clicked: Optional[EventType] = None, + on_cell_context_menu: Optional[EventType] = None, + on_cell_edited: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_column_resize: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_delete: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_finished_editing: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_group_header_clicked: Optional[EventType[[]]] = None, + on_group_header_context_menu: Optional[EventType[[]]] = None, + on_group_header_renamed: Optional[EventType[[]]] = None, + on_header_clicked: Optional[EventType] = None, + on_header_context_menu: Optional[EventType] = None, + on_header_menu_click: Optional[EventType[[]]] = None, + on_item_hovered: Optional[EventType] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_row_appended: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_selection_cleared: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DataEditor": """Create the DataEditor component. diff --git a/reflex/components/el/element.pyi b/reflex/components/el/element.pyi index 4ea86f273..f6d76cd02 100644 --- a/reflex/components/el/element.pyi +++ b/reflex/components/el/element.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -22,41 +22,21 @@ class Element(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Element": """Create the component. diff --git a/reflex/components/el/elements/base.pyi b/reflex/components/el/elements/base.pyi index d3f0622da..6e943d0d0 100644 --- a/reflex/components/el/elements/base.pyi +++ b/reflex/components/el/elements/base.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.el.element import Element -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -46,41 +46,21 @@ class BaseHTML(Element): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "BaseHTML": """Create the component. diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index 05168e66c..a343991d5 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -3,7 +3,7 @@ from __future__ import annotations from hashlib import md5 -from typing import Any, Dict, Iterator, Set, Union +from typing import Any, Dict, Iterator, Set, Tuple, Union from jinja2 import Environment @@ -102,6 +102,15 @@ class Fieldset(Element): name: Var[Union[str, int, bool]] +def on_submit_event_spec() -> Tuple[Var[Dict[str, Any]]]: + """Event handler spec for the on_submit event. + + Returns: + The event handler spec. + """ + return (FORM_DATA,) + + class Form(BaseHTML): """Display the form element.""" @@ -141,7 +150,7 @@ class Form(BaseHTML): handle_submit_unique_name: Var[str] # Fired when the form is submitted - on_submit: EventHandler[lambda e0: [FORM_DATA]] + on_submit: EventHandler[on_submit_event_spec] @classmethod def create(cls, *children, **props): diff --git a/reflex/components/el/elements/forms.pyi b/reflex/components/el/elements/forms.pyi index 5677eb741..135291213 100644 --- a/reflex/components/el/elements/forms.pyi +++ b/reflex/components/el/elements/forms.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Tuple, Union, overload from jinja2 import Environment from reflex.components.el.element import Element -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -71,41 +71,21 @@ class Button(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Button": """Create the component. @@ -188,41 +168,21 @@ class Datalist(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Datalist": """Create the component. @@ -273,41 +233,21 @@ class Fieldset(Element): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Fieldset": """Create the component. @@ -330,6 +270,8 @@ class Fieldset(Element): """ ... +def on_submit_event_spec() -> Tuple[Var[Dict[str, Any]]]: ... + class Form(BaseHTML): @overload @classmethod @@ -381,42 +323,22 @@ class Form(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_submit: Optional[EventType[Dict[str, Any]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Form": """Create a form component. @@ -541,46 +463,24 @@ class Input(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[str]] = None, + on_change: Optional[EventType[str]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[str]] = None, + on_key_down: Optional[EventType[str]] = None, + on_key_up: Optional[EventType[str]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Input": """Create the component. @@ -687,41 +587,21 @@ class Label(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Label": """Create the component. @@ -795,41 +675,21 @@ class Legend(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Legend": """Create the component. @@ -908,41 +768,21 @@ class Meter(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Meter": """Create the component. @@ -1023,41 +863,21 @@ class Optgroup(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Optgroup": """Create the component. @@ -1135,41 +955,21 @@ class Option(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Option": """Create the component. @@ -1248,41 +1048,21 @@ class Output(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Output": """Create the component. @@ -1360,41 +1140,21 @@ class Progress(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Progress": """Create the component. @@ -1479,42 +1239,22 @@ class Select(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType[str]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Select": """Create the component. @@ -1616,46 +1356,24 @@ class Textarea(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[str]] = None, + on_change: Optional[EventType[str]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[str]] = None, + on_key_down: Optional[EventType[str]] = None, + on_key_up: Optional[EventType[str]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Textarea": """Create the component. diff --git a/reflex/components/el/elements/inline.pyi b/reflex/components/el/elements/inline.pyi index e53e6da04..336e4d3de 100644 --- a/reflex/components/el/elements/inline.pyi +++ b/reflex/components/el/elements/inline.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -58,41 +58,21 @@ class A(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "A": """Create the component. @@ -173,41 +153,21 @@ class Abbr(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Abbr": """Create the component. @@ -279,41 +239,21 @@ class B(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "B": """Create the component. @@ -385,41 +325,21 @@ class Bdi(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Bdi": """Create the component. @@ -491,41 +411,21 @@ class Bdo(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Bdo": """Create the component. @@ -597,41 +497,21 @@ class Br(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Br": """Create the component. @@ -703,41 +583,21 @@ class Cite(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Cite": """Create the component. @@ -809,41 +669,21 @@ class Code(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Code": """Create the component. @@ -916,41 +756,21 @@ class Data(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Data": """Create the component. @@ -1023,41 +843,21 @@ class Dfn(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Dfn": """Create the component. @@ -1129,41 +929,21 @@ class Em(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Em": """Create the component. @@ -1235,41 +1015,21 @@ class I(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "I": """Create the component. @@ -1341,41 +1101,21 @@ class Kbd(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Kbd": """Create the component. @@ -1447,41 +1187,21 @@ class Mark(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Mark": """Create the component. @@ -1554,41 +1274,21 @@ class Q(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Q": """Create the component. @@ -1661,41 +1361,21 @@ class Rp(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Rp": """Create the component. @@ -1767,41 +1447,21 @@ class Rt(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Rt": """Create the component. @@ -1873,41 +1533,21 @@ class Ruby(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Ruby": """Create the component. @@ -1979,41 +1619,21 @@ class S(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "S": """Create the component. @@ -2085,41 +1705,21 @@ class Samp(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Samp": """Create the component. @@ -2191,41 +1791,21 @@ class Small(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Small": """Create the component. @@ -2297,41 +1877,21 @@ class Span(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Span": """Create the component. @@ -2403,41 +1963,21 @@ class Strong(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Strong": """Create the component. @@ -2509,41 +2049,21 @@ class Sub(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Sub": """Create the component. @@ -2615,41 +2135,21 @@ class Sup(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Sup": """Create the component. @@ -2722,41 +2222,21 @@ class Time(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Time": """Create the component. @@ -2829,41 +2309,21 @@ class U(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "U": """Create the component. @@ -2935,41 +2395,21 @@ class Wbr(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Wbr": """Create the component. diff --git a/reflex/components/el/elements/media.pyi b/reflex/components/el/elements/media.pyi index 336d6fbb9..382f3c79c 100644 --- a/reflex/components/el/elements/media.pyi +++ b/reflex/components/el/elements/media.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex import ComponentNamespace from reflex.constants.colors import Color -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -62,41 +62,21 @@ class Area(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Area": """Create the component. @@ -189,41 +169,21 @@ class Audio(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Audio": """Create the component. @@ -321,41 +281,21 @@ class Img(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Img": """Override create method to apply source attribute to value if user fails to pass in attribute. @@ -441,41 +381,21 @@ class Map(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Map": """Create the component. @@ -553,41 +473,21 @@ class Track(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Track": """Create the component. @@ -678,41 +578,21 @@ class Video(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Video": """Create the component. @@ -796,41 +676,21 @@ class Embed(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Embed": """Create the component. @@ -915,41 +775,21 @@ class Iframe(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Iframe": """Create the component. @@ -1035,41 +875,21 @@ class Object(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Object": """Create the component. @@ -1146,41 +966,21 @@ class Picture(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Picture": """Create the component. @@ -1252,41 +1052,21 @@ class Portal(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Portal": """Create the component. @@ -1363,41 +1143,21 @@ class Source(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Source": """Create the component. @@ -1477,41 +1237,21 @@ class Svg(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Svg": """Create the component. @@ -1593,41 +1333,21 @@ class Text(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Text": """Create the component. @@ -1711,41 +1431,21 @@ class Line(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Line": """Create the component. @@ -1826,41 +1526,21 @@ class Circle(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Circle": """Create the component. @@ -1941,41 +1621,21 @@ class Ellipse(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Ellipse": """Create the component. @@ -2059,41 +1719,21 @@ class Rect(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Rect": """Create the component. @@ -2174,41 +1814,21 @@ class Polygon(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Polygon": """Create the component. @@ -2282,41 +1902,21 @@ class Defs(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Defs": """Create the component. @@ -2395,41 +1995,21 @@ class LinearGradient(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "LinearGradient": """Create the component. @@ -2517,41 +2097,21 @@ class RadialGradient(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadialGradient": """Create the component. @@ -2639,41 +2199,21 @@ class Stop(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Stop": """Create the component. @@ -2749,41 +2289,21 @@ class Path(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Path": """Create the component. @@ -2869,41 +2389,21 @@ class SVG(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Svg": """Create the component. diff --git a/reflex/components/el/elements/metadata.pyi b/reflex/components/el/elements/metadata.pyi index f59ed14fc..498695a80 100644 --- a/reflex/components/el/elements/metadata.pyi +++ b/reflex/components/el/elements/metadata.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.el.element import Element -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -50,41 +50,21 @@ class Base(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Base": """Create the component. @@ -156,41 +136,21 @@ class Head(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Head": """Create the component. @@ -275,41 +235,21 @@ class Link(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Link": """Create the component. @@ -394,41 +334,21 @@ class Meta(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Meta": """Create the component. @@ -480,41 +400,21 @@ class Title(Element): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Title": """Create the component. @@ -547,41 +447,21 @@ class StyleEl(Element): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "StyleEl": """Create the component. diff --git a/reflex/components/el/elements/other.pyi b/reflex/components/el/elements/other.pyi index 9d4cdd7c9..db884a78b 100644 --- a/reflex/components/el/elements/other.pyi +++ b/reflex/components/el/elements/other.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -48,41 +48,21 @@ class Details(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Details": """Create the component. @@ -156,41 +136,21 @@ class Dialog(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Dialog": """Create the component. @@ -263,41 +223,21 @@ class Summary(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Summary": """Create the component. @@ -369,41 +309,21 @@ class Slot(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Slot": """Create the component. @@ -475,41 +395,21 @@ class Template(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Template": """Create the component. @@ -581,41 +481,21 @@ class Math(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Math": """Create the component. @@ -688,41 +568,21 @@ class Html(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Html": """Create the component. diff --git a/reflex/components/el/elements/scripts.pyi b/reflex/components/el/elements/scripts.pyi index a6495720c..774fcfc22 100644 --- a/reflex/components/el/elements/scripts.pyi +++ b/reflex/components/el/elements/scripts.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -47,41 +47,21 @@ class Canvas(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Canvas": """Create the component. @@ -153,41 +133,21 @@ class Noscript(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Noscript": """Create the component. @@ -272,41 +232,21 @@ class Script(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Script": """Create the component. diff --git a/reflex/components/el/elements/sectioning.pyi b/reflex/components/el/elements/sectioning.pyi index 6b5905b13..963d2d651 100644 --- a/reflex/components/el/elements/sectioning.pyi +++ b/reflex/components/el/elements/sectioning.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -47,41 +47,21 @@ class Body(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Body": """Create the component. @@ -153,41 +133,21 @@ class Address(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Address": """Create the component. @@ -259,41 +219,21 @@ class Article(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Article": """Create the component. @@ -365,41 +305,21 @@ class Aside(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Aside": """Create the component. @@ -471,41 +391,21 @@ class Footer(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Footer": """Create the component. @@ -577,41 +477,21 @@ class Header(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Header": """Create the component. @@ -683,41 +563,21 @@ class H1(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "H1": """Create the component. @@ -789,41 +649,21 @@ class H2(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "H2": """Create the component. @@ -895,41 +735,21 @@ class H3(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "H3": """Create the component. @@ -1001,41 +821,21 @@ class H4(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "H4": """Create the component. @@ -1107,41 +907,21 @@ class H5(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "H5": """Create the component. @@ -1213,41 +993,21 @@ class H6(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "H6": """Create the component. @@ -1319,41 +1079,21 @@ class Main(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Main": """Create the component. @@ -1425,41 +1165,21 @@ class Nav(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Nav": """Create the component. @@ -1531,41 +1251,21 @@ class Section(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Section": """Create the component. diff --git a/reflex/components/el/elements/tables.pyi b/reflex/components/el/elements/tables.pyi index 49ab1b407..4d874f460 100644 --- a/reflex/components/el/elements/tables.pyi +++ b/reflex/components/el/elements/tables.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -48,41 +48,21 @@ class Caption(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Caption": """Create the component. @@ -157,41 +137,21 @@ class Col(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Col": """Create the component. @@ -267,41 +227,21 @@ class Colgroup(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Colgroup": """Create the component. @@ -377,41 +317,21 @@ class Table(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Table": """Create the component. @@ -486,41 +406,21 @@ class Tbody(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Tbody": """Create the component. @@ -597,41 +497,21 @@ class Td(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Td": """Create the component. @@ -708,41 +588,21 @@ class Tfoot(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Tfoot": """Create the component. @@ -820,41 +680,21 @@ class Th(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Th": """Create the component. @@ -932,41 +772,21 @@ class Thead(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Thead": """Create the component. @@ -1040,41 +860,21 @@ class Tr(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Tr": """Create the component. diff --git a/reflex/components/el/elements/typography.pyi b/reflex/components/el/elements/typography.pyi index 2e8177090..548371ce6 100644 --- a/reflex/components/el/elements/typography.pyi +++ b/reflex/components/el/elements/typography.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -48,41 +48,21 @@ class Blockquote(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Blockquote": """Create the component. @@ -155,41 +135,21 @@ class Dd(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Dd": """Create the component. @@ -261,41 +221,21 @@ class Div(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Div": """Create the component. @@ -367,41 +307,21 @@ class Dl(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Dl": """Create the component. @@ -473,41 +393,21 @@ class Dt(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Dt": """Create the component. @@ -579,41 +479,21 @@ class Figcaption(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Figcaption": """Create the component. @@ -686,41 +566,21 @@ class Hr(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Hr": """Create the component. @@ -793,41 +653,21 @@ class Li(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Li": """Create the component. @@ -900,41 +740,21 @@ class Menu(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Menu": """Create the component. @@ -1010,41 +830,21 @@ class Ol(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Ol": """Create the component. @@ -1119,41 +919,21 @@ class P(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "P": """Create the component. @@ -1225,41 +1005,21 @@ class Pre(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Pre": """Create the component. @@ -1331,41 +1091,21 @@ class Ul(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Ul": """Create the component. @@ -1439,41 +1179,21 @@ class Ins(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Ins": """Create the component. @@ -1549,41 +1269,21 @@ class Del(BaseHTML): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Del": """Create the component. diff --git a/reflex/components/gridjs/datatable.pyi b/reflex/components/gridjs/datatable.pyi index ae7a8c0d3..ec4a5405a 100644 --- a/reflex/components/gridjs/datatable.pyi +++ b/reflex/components/gridjs/datatable.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload +from typing import Any, Dict, List, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -23,41 +23,21 @@ class Gridjs(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Gridjs": """Create the component. @@ -95,41 +75,21 @@ class DataTable(Gridjs): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DataTable": """Create a datatable component. diff --git a/reflex/components/lucide/icon.pyi b/reflex/components/lucide/icon.pyi index 811576200..661d91dbe 100644 --- a/reflex/components/lucide/icon.pyi +++ b/reflex/components/lucide/icon.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -22,41 +22,21 @@ class LucideIconComponent(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "LucideIconComponent": """Create the component. @@ -89,41 +69,21 @@ class Icon(LucideIconComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Icon": """Initialize the Icon component. diff --git a/reflex/components/markdown/markdown.pyi b/reflex/components/markdown/markdown.pyi index d82756f44..1cad04013 100644 --- a/reflex/components/markdown/markdown.pyi +++ b/reflex/components/markdown/markdown.pyi @@ -7,7 +7,7 @@ from functools import lru_cache from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import LiteralVar, Var @@ -42,41 +42,21 @@ class Markdown(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Markdown": """Create a markdown component. diff --git a/reflex/components/moment/moment.py b/reflex/components/moment/moment.py index da9949235..51b09d55d 100644 --- a/reflex/components/moment/moment.py +++ b/reflex/components/moment/moment.py @@ -4,7 +4,7 @@ import dataclasses from typing import List, Optional from reflex.components.component import Component, NoSSRComponent -from reflex.event import EventHandler +from reflex.event import EventHandler, identity_event from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -93,7 +93,7 @@ class Moment(NoSSRComponent): tz: Var[str] # Fires when the date changes. - on_change: EventHandler[lambda date: [date]] + on_change: EventHandler[identity_event(str)] def add_imports(self) -> ImportDict: """Add the imports for the Moment component. diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index f0d747f77..4f58fda7d 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -4,10 +4,10 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ import dataclasses -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import NoSSRComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -57,42 +57,22 @@ class Moment(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Moment": """Create a Moment component. diff --git a/reflex/components/next/base.pyi b/reflex/components/next/base.pyi index af8064aaf..1d49c5e66 100644 --- a/reflex/components/next/base.pyi +++ b/reflex/components/next/base.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -24,41 +24,21 @@ class NextComponent(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "NextComponent": """Create the component. diff --git a/reflex/components/next/image.pyi b/reflex/components/next/image.pyi index 7786c8a4b..5d72584a9 100644 --- a/reflex/components/next/image.pyi +++ b/reflex/components/next/image.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -37,43 +37,23 @@ class Image(NextComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_error: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_load: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Image": """Create an Image component from next/image. diff --git a/reflex/components/next/link.pyi b/reflex/components/next/link.pyi index 2a3207956..fa9ae530f 100644 --- a/reflex/components/next/link.pyi +++ b/reflex/components/next/link.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -24,41 +24,21 @@ class NextLink(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "NextLink": """Create the component. diff --git a/reflex/components/next/video.pyi b/reflex/components/next/video.pyi index 842e27d22..f8c93b6f1 100644 --- a/reflex/components/next/video.pyi +++ b/reflex/components/next/video.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -26,41 +26,21 @@ class Video(NextComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Video": """Create a Video component. diff --git a/reflex/components/plotly/plotly.pyi b/reflex/components/plotly/plotly.pyi index c8be366c8..29464415d 100644 --- a/reflex/components/plotly/plotly.pyi +++ b/reflex/components/plotly/plotly.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils import console from reflex.vars.base import Var @@ -45,91 +45,39 @@ class Plotly(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_after_plot: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animated: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animating_frame: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_autosize: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_before_hover: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_button_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_deselect: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_hover: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_redraw: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_relayout: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_relayouting: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_restyle: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_selected: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_selecting: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_transition_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_transitioning: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_unhover: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_after_plot: Optional[EventType] = None, + on_animated: Optional[EventType] = None, + on_animating_frame: Optional[EventType] = None, + on_animation_interrupted: Optional[EventType] = None, + on_autosize: Optional[EventType] = None, + on_before_hover: Optional[EventType] = None, + on_blur: Optional[EventType[[]]] = None, + on_button_clicked: Optional[EventType] = None, + on_click: Optional[EventType] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_deselect: Optional[EventType] = None, + on_double_click: Optional[EventType] = None, + on_focus: Optional[EventType[[]]] = None, + on_hover: Optional[EventType] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_redraw: Optional[EventType] = None, + on_relayout: Optional[EventType] = None, + on_relayouting: Optional[EventType] = None, + on_restyle: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_selected: Optional[EventType] = None, + on_selecting: Optional[EventType] = None, + on_transition_interrupted: Optional[EventType] = None, + on_transitioning: Optional[EventType] = None, + on_unhover: Optional[EventType] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Plotly": """Create the Plotly component. diff --git a/reflex/components/radix/primitives/accordion.py b/reflex/components/radix/primitives/accordion.py index 40cbfa2a7..bbcecb1d8 100644 --- a/reflex/components/radix/primitives/accordion.py +++ b/reflex/components/radix/primitives/accordion.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Literal, Optional, Union +from typing import Any, List, Literal, Optional, Tuple, Union from reflex.components.component import Component, ComponentNamespace from reflex.components.core.colors import color @@ -71,6 +71,18 @@ class AccordionComponent(RadixPrimitiveComponent): return ["color_scheme", "variant"] +def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: + """Handle the on_value_change event. + + Args: + value: The value of the event. + + Returns: + The value of the event. + """ + return (value,) + + class AccordionRoot(AccordionComponent): """An accordion component.""" @@ -114,7 +126,7 @@ class AccordionRoot(AccordionComponent): _valid_children: List[str] = ["AccordionItem"] # Fired when the opened the accordions changes. - on_value_change: EventHandler[lambda e0: [e0]] + on_value_change: EventHandler[on_value_change] def _exclude_props(self) -> list[str]: return super()._exclude_props() + [ diff --git a/reflex/components/radix/primitives/accordion.pyi b/reflex/components/radix/primitives/accordion.pyi index 5d86636ad..b975cfebe 100644 --- a/reflex/components/radix/primitives/accordion.pyi +++ b/reflex/components/radix/primitives/accordion.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.radix.primitives.base import RadixPrimitiveComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -101,41 +101,21 @@ class AccordionComponent(RadixPrimitiveComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AccordionComponent": """Create the component. @@ -158,6 +138,8 @@ class AccordionComponent(RadixPrimitiveComponent): """ ... +def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: ... + class AccordionRoot(AccordionComponent): def add_style(self): ... @overload @@ -265,44 +247,22 @@ class AccordionRoot(AccordionComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + on_value_change: Optional[EventType[str | List[str]]] = None, **props, ) -> "AccordionRoot": """Create the component. @@ -421,41 +381,21 @@ class AccordionItem(AccordionComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AccordionItem": """Create an accordion item. @@ -565,41 +505,21 @@ class AccordionHeader(AccordionComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AccordionHeader": """Create the Accordion header component. @@ -705,41 +625,21 @@ class AccordionTrigger(AccordionComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AccordionTrigger": """Create the Accordion trigger component. @@ -777,41 +677,21 @@ class AccordionIcon(Icon): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AccordionIcon": """Create the Accordion icon component. @@ -914,41 +794,21 @@ class AccordionContent(AccordionComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AccordionContent": """Create the Accordion content component. diff --git a/reflex/components/radix/primitives/base.pyi b/reflex/components/radix/primitives/base.pyi index 3f1194424..3eacd3f07 100644 --- a/reflex/components/radix/primitives/base.pyi +++ b/reflex/components/radix/primitives/base.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -23,41 +23,21 @@ class RadixPrimitiveComponent(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadixPrimitiveComponent": """Create the component. @@ -91,41 +71,21 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadixPrimitiveComponentWithClassName": """Create the component. diff --git a/reflex/components/radix/primitives/drawer.py b/reflex/components/radix/primitives/drawer.py index f0efa7e18..6fe4d10dd 100644 --- a/reflex/components/radix/primitives/drawer.py +++ b/reflex/components/radix/primitives/drawer.py @@ -10,7 +10,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import Theme from reflex.components.radix.themes.layout.flex import Flex -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.utils import console from reflex.vars.base import Var @@ -61,7 +61,7 @@ class DrawerRoot(DrawerComponent): preventScrollRestoration: Var[bool] # Fires when the drawer is opened. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class DrawerTrigger(DrawerComponent): @@ -129,19 +129,19 @@ class DrawerContent(DrawerComponent): return {"css": base_style} # Fired when the drawer content is opened. Deprecated. - on_open_auto_focus: EventHandler[lambda e0: []] + on_open_auto_focus: EventHandler[empty_event] # Fired when the drawer content is closed. Deprecated. - on_close_auto_focus: EventHandler[lambda e0: []] + on_close_auto_focus: EventHandler[empty_event] # Fired when the escape key is pressed. Deprecated. - on_escape_key_down: EventHandler[lambda e0: []] + on_escape_key_down: EventHandler[empty_event] # Fired when the pointer is down outside the drawer content. Deprecated. - on_pointer_down_outside: EventHandler[lambda e0: []] + on_pointer_down_outside: EventHandler[empty_event] # Fired when interacting outside the drawer content. Deprecated. - on_interact_outside: EventHandler[lambda e0: []] + on_interact_outside: EventHandler[empty_event] @classmethod def create(cls, *children, **props): diff --git a/reflex/components/radix/primitives/drawer.pyi b/reflex/components/radix/primitives/drawer.pyi index 269d86d47..9c5463e56 100644 --- a/reflex/components/radix/primitives/drawer.pyi +++ b/reflex/components/radix/primitives/drawer.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -24,41 +24,21 @@ class DrawerComponent(RadixPrimitiveComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerComponent": """Create the component. @@ -108,44 +88,22 @@ class DrawerRoot(DrawerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerRoot": """Create the component. @@ -188,41 +146,21 @@ class DrawerTrigger(DrawerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerTrigger": """Create a new DrawerTrigger instance. @@ -249,41 +187,21 @@ class DrawerPortal(DrawerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerPortal": """Create the component. @@ -317,56 +235,26 @@ class DrawerContent(DrawerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_close_auto_focus: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_interact_outside: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_auto_focus: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerContent": """Create a Drawer Content. @@ -404,41 +292,21 @@ class DrawerOverlay(DrawerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerOverlay": """Create the component. @@ -472,41 +340,21 @@ class DrawerClose(DrawerTrigger): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerClose": """Create a new DrawerTrigger instance. @@ -533,41 +381,21 @@ class DrawerTitle(DrawerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerTitle": """Create the component. @@ -601,41 +429,21 @@ class DrawerDescription(DrawerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerDescription": """Create the component. @@ -690,44 +498,22 @@ class Drawer(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerRoot": """Create the component. diff --git a/reflex/components/radix/primitives/form.pyi b/reflex/components/radix/primitives/form.pyi index 75efc1a3f..2139f0c23 100644 --- a/reflex/components/radix/primitives/form.pyi +++ b/reflex/components/radix/primitives/form.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.el.elements.forms import Form as HTMLForm -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -26,41 +26,21 @@ class FormComponent(RadixPrimitiveComponentWithClassName): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormComponent": """Create the component. @@ -134,45 +114,23 @@ class FormRoot(FormComponent, HTMLForm): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_clear_server_errors: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_submit: Optional[EventType[Dict[str, Any]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormRoot": """Create a form component. @@ -236,41 +194,21 @@ class FormField(FormComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormField": """Create the component. @@ -307,41 +245,21 @@ class FormLabel(FormComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormLabel": """Create the component. @@ -375,41 +293,21 @@ class FormControl(FormComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormControl": """Create a Form Control component. @@ -493,41 +391,21 @@ class FormMessage(FormComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormMessage": """Create the component. @@ -564,41 +442,21 @@ class FormValidityState(FormComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormValidityState": """Create the component. @@ -632,41 +490,21 @@ class FormSubmit(FormComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FormSubmit": """Create the component. @@ -741,45 +579,23 @@ class Form(FormRoot): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_clear_server_errors: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_submit: Optional[EventType[Dict[str, Any]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Form": """Create a form component. @@ -885,45 +701,23 @@ class FormNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_clear_server_errors: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_submit: Optional[EventType[Dict[str, Any]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Form": """Create a form component. diff --git a/reflex/components/radix/primitives/progress.pyi b/reflex/components/radix/primitives/progress.pyi index 4e185a903..c760c0a57 100644 --- a/reflex/components/radix/primitives/progress.pyi +++ b/reflex/components/radix/primitives/progress.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -24,41 +24,21 @@ class ProgressComponent(RadixPrimitiveComponentWithClassName): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ProgressComponent": """Create the component. @@ -99,41 +79,21 @@ class ProgressRoot(ProgressComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ProgressRoot": """Create the component. @@ -233,41 +193,21 @@ class ProgressIndicator(ProgressComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ProgressIndicator": """Create the component. @@ -374,41 +314,21 @@ class Progress(ProgressRoot): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Progress": """High-level API for progress bar. @@ -516,41 +436,21 @@ class ProgressNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Progress": """High-level API for progress bar. diff --git a/reflex/components/radix/primitives/slider.py b/reflex/components/radix/primitives/slider.py index dd3108f0e..10a0079a4 100644 --- a/reflex/components/radix/primitives/slider.py +++ b/reflex/components/radix/primitives/slider.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Literal +from typing import Any, List, Literal, Tuple from reflex.components.component import Component, ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName @@ -19,6 +19,20 @@ class SliderComponent(RadixPrimitiveComponentWithClassName): library = "@radix-ui/react-slider@^1.1.2" +def on_value_event_spec( + value: Var[List[int]], +) -> Tuple[Var[List[int]]]: + """Event handler spec for the value event. + + Args: + value: The value of the event. + + Returns: + The event handler spec. + """ + return (value,) # type: ignore + + class SliderRoot(SliderComponent): """The Slider component comtaining all slider parts.""" @@ -48,10 +62,10 @@ class SliderRoot(SliderComponent): min_steps_between_thumbs: Var[int] # Fired when the value of a thumb changes. - on_value_change: EventHandler[lambda e0: [e0]] + on_value_change: EventHandler[on_value_event_spec] # Fired when a thumb is released. - on_value_commit: EventHandler[lambda e0: [e0]] + on_value_commit: EventHandler[on_value_event_spec] def add_style(self) -> dict[str, Any] | None: """Add style to the component. diff --git a/reflex/components/radix/primitives/slider.pyi b/reflex/components/radix/primitives/slider.pyi index 782a83776..3d57fbe5c 100644 --- a/reflex/components/radix/primitives/slider.pyi +++ b/reflex/components/radix/primitives/slider.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -27,41 +27,21 @@ class SliderComponent(RadixPrimitiveComponentWithClassName): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SliderComponent": """Create the component. @@ -82,6 +62,8 @@ class SliderComponent(RadixPrimitiveComponentWithClassName): """ ... +def on_value_event_spec(value: Var[List[int]]) -> Tuple[Var[List[int]]]: ... + class SliderRoot(SliderComponent): def add_style(self) -> dict[str, Any] | None: ... @overload @@ -112,47 +94,23 @@ class SliderRoot(SliderComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + on_value_change: Optional[EventType[List[int]]] = None, + on_value_commit: Optional[EventType[List[int]]] = None, **props, ) -> "SliderRoot": """Create the component. @@ -187,41 +145,21 @@ class SliderTrack(SliderComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SliderTrack": """Create the component. @@ -256,41 +194,21 @@ class SliderRange(SliderComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SliderRange": """Create the component. @@ -325,41 +243,21 @@ class SliderThumb(SliderComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SliderThumb": """Create the component. diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index da3c922e9..0f0de5401 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components import Component -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -103,41 +103,21 @@ class CommonMarginProps(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CommonMarginProps": """Create the component. @@ -177,41 +157,21 @@ class RadixLoadingProp(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadixLoadingProp": """Create the component. @@ -244,41 +204,21 @@ class RadixThemesComponent(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadixThemesComponent": """Create a new component instance. @@ -313,41 +253,21 @@ class RadixThemesTriggerComponent(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadixThemesTriggerComponent": """Create a new RadixThemesTriggerComponent instance. @@ -465,41 +385,21 @@ class Theme(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Theme": """Create a new Radix Theme specification. @@ -544,41 +444,21 @@ class ThemePanel(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ThemePanel": """Create a new component instance. @@ -614,41 +494,21 @@ class RadixThemesColorModeProvider(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadixThemesColorModeProvider": """Create the component. diff --git a/reflex/components/radix/themes/color_mode.pyi b/reflex/components/radix/themes/color_mode.pyi index d41019747..43703dc37 100644 --- a/reflex/components/radix/themes/color_mode.pyi +++ b/reflex/components/radix/themes/color_mode.pyi @@ -3,23 +3,14 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import ( - Any, - Callable, - Dict, - List, - Literal, - Optional, - Union, - overload, -) +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.components.component import BaseComponent from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.cond import Cond from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.switch import Switch -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import ( Style, color_mode, @@ -46,41 +37,21 @@ class ColorModeIcon(Cond): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ColorModeIcon": """Create an icon component based on color_mode. @@ -238,41 +209,21 @@ class ColorModeIconButton(IconButton): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ColorModeIconButton": """Create a icon button component that calls toggle_color_mode on click. @@ -431,42 +382,22 @@ class ColorModeSwitch(Switch): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ColorModeSwitch": """Create a switch component bound to color_mode. diff --git a/reflex/components/radix/themes/components/alert_dialog.py b/reflex/components/radix/themes/components/alert_dialog.py index ca876b4c3..f3c8ec319 100644 --- a/reflex/components/radix/themes/components/alert_dialog.py +++ b/reflex/components/radix/themes/components/alert_dialog.py @@ -5,7 +5,7 @@ from typing import Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.vars.base import Var from ..base import RadixThemesComponent, RadixThemesTriggerComponent @@ -22,7 +22,7 @@ class AlertDialogRoot(RadixThemesComponent): open: Var[bool] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class AlertDialogTrigger(RadixThemesTriggerComponent): @@ -43,13 +43,13 @@ class AlertDialogContent(elements.Div, RadixThemesComponent): force_mount: Var[bool] # Fired when the dialog is opened. - on_open_auto_focus: EventHandler[lambda e0: [e0]] + on_open_auto_focus: EventHandler[empty_event] # Fired when the dialog is closed. - on_close_auto_focus: EventHandler[lambda e0: [e0]] + on_close_auto_focus: EventHandler[empty_event] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0]] + on_escape_key_down: EventHandler[empty_event] class AlertDialogTitle(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/alert_dialog.pyi b/reflex/components/radix/themes/components/alert_dialog.pyi index 019b3f89b..d63fcae53 100644 --- a/reflex/components/radix/themes/components/alert_dialog.pyi +++ b/reflex/components/radix/themes/components/alert_dialog.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -29,44 +29,22 @@ class AlertDialogRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AlertDialogRoot": """Create a new component instance. @@ -102,41 +80,21 @@ class AlertDialogTrigger(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AlertDialogTrigger": """Create a new RadixThemesTriggerComponent instance. @@ -199,50 +157,24 @@ class AlertDialogContent(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_close_auto_focus: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_auto_focus: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AlertDialogContent": """Create a new component instance. @@ -295,41 +227,21 @@ class AlertDialogTitle(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AlertDialogTitle": """Create a new component instance. @@ -364,41 +276,21 @@ class AlertDialogDescription(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AlertDialogDescription": """Create a new component instance. @@ -433,41 +325,21 @@ class AlertDialogAction(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AlertDialogAction": """Create a new RadixThemesTriggerComponent instance. @@ -493,41 +365,21 @@ class AlertDialogCancel(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AlertDialogCancel": """Create a new RadixThemesTriggerComponent instance. diff --git a/reflex/components/radix/themes/components/aspect_ratio.pyi b/reflex/components/radix/themes/components/aspect_ratio.pyi index 024261d91..848d2064a 100644 --- a/reflex/components/radix/themes/components/aspect_ratio.pyi +++ b/reflex/components/radix/themes/components/aspect_ratio.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -24,41 +24,21 @@ class AspectRatio(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AspectRatio": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi index ee6ef6e31..fc42457da 100644 --- a/reflex/components/radix/themes/components/avatar.pyi +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -114,41 +114,21 @@ class Avatar(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Avatar": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi index d5c2f2697..405b7b835 100644 --- a/reflex/components/radix/themes/components/badge.pyi +++ b/reflex/components/radix/themes/components/badge.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -135,41 +135,21 @@ class Badge(elements.Span, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Badge": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi index de9651dd9..f9702d3b5 100644 --- a/reflex/components/radix/themes/components/button.pyi +++ b/reflex/components/radix/themes/components/button.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -158,41 +158,21 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Button": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi index 5caa825d6..18ae5a357 100644 --- a/reflex/components/radix/themes/components/callout.pyi +++ b/reflex/components/radix/themes/components/callout.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -133,41 +133,21 @@ class CalloutRoot(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CalloutRoot": """Create a new component instance. @@ -247,41 +227,21 @@ class CalloutIcon(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CalloutIcon": """Create a new component instance. @@ -356,41 +316,21 @@ class CalloutText(elements.P, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CalloutText": """Create a new component instance. @@ -548,41 +488,21 @@ class Callout(CalloutRoot): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Callout": """Create a callout component. @@ -746,41 +666,21 @@ class CalloutNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Callout": """Create a callout component. diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi index d2bc6f68c..dc45bc226 100644 --- a/reflex/components/radix/themes/components/card.pyi +++ b/reflex/components/radix/themes/components/card.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -68,41 +68,21 @@ class Card(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Card": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/checkbox.py b/reflex/components/radix/themes/components/checkbox.py index 6ba1b04da..2944b1f11 100644 --- a/reflex/components/radix/themes/components/checkbox.py +++ b/reflex/components/radix/themes/components/checkbox.py @@ -6,7 +6,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.radix.themes.layout.flex import Flex from reflex.components.radix.themes.typography.text import Text -from reflex.event import EventHandler +from reflex.event import EventHandler, identity_event from reflex.vars.base import LiteralVar, Var from ..base import ( @@ -61,7 +61,7 @@ class Checkbox(RadixThemesComponent): _rename_props = {"onChange": "onCheckedChange"} # Fired when the checkbox is checked or unchecked. - on_change: EventHandler[lambda e0: [e0]] + on_change: EventHandler[identity_event(bool)] class HighLevelCheckbox(RadixThemesComponent): @@ -112,7 +112,7 @@ class HighLevelCheckbox(RadixThemesComponent): _rename_props = {"onChange": "onCheckedChange"} # Fired when the checkbox is checked or unchecked. - on_change: EventHandler[lambda e0: [e0]] + on_change: EventHandler[identity_event(bool)] @classmethod def create(cls, text: Var[str] = LiteralVar.create(""), **props) -> Component: diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index 978c3e8c2..fad4f5210 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -115,42 +115,22 @@ class Checkbox(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Checkbox": """Create a new component instance. @@ -282,42 +262,22 @@ class HighLevelCheckbox(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HighLevelCheckbox": """Create a checkbox with a label. @@ -446,42 +406,22 @@ class CheckboxNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HighLevelCheckbox": """Create a checkbox with a label. diff --git a/reflex/components/radix/themes/components/checkbox_cards.pyi b/reflex/components/radix/themes/components/checkbox_cards.pyi index 086630a3b..062fc1357 100644 --- a/reflex/components/radix/themes/components/checkbox_cards.pyi +++ b/reflex/components/radix/themes/components/checkbox_cards.pyi @@ -4,10 +4,10 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from types import SimpleNamespace -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -148,41 +148,21 @@ class CheckboxCardsRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CheckboxCardsRoot": """Create a new component instance. @@ -223,41 +203,21 @@ class CheckboxCardsItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CheckboxCardsItem": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/checkbox_group.pyi b/reflex/components/radix/themes/components/checkbox_group.pyi index 21f0ad23a..363be0599 100644 --- a/reflex/components/radix/themes/components/checkbox_group.pyi +++ b/reflex/components/radix/themes/components/checkbox_group.pyi @@ -4,10 +4,10 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from types import SimpleNamespace -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -107,41 +107,21 @@ class CheckboxGroupRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CheckboxGroupRoot": """Create a new component instance. @@ -184,41 +164,21 @@ class CheckboxGroupItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CheckboxGroupItem": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/context_menu.py b/reflex/components/radix/themes/components/context_menu.py index c82f8e714..3eb54a457 100644 --- a/reflex/components/radix/themes/components/context_menu.py +++ b/reflex/components/radix/themes/components/context_menu.py @@ -4,7 +4,7 @@ from typing import List, Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.vars.base import Var from ..base import ( @@ -24,7 +24,7 @@ class ContextMenuRoot(RadixThemesComponent): _invalid_children: List[str] = ["ContextMenuItem"] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class ContextMenuTrigger(RadixThemesComponent): @@ -64,19 +64,19 @@ class ContextMenuContent(RadixThemesComponent): avoid_collisions: Var[bool] # Fired when the context menu is closed. - on_close_auto_focus: EventHandler[lambda e0: [e0]] + on_close_auto_focus: EventHandler[empty_event] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0]] + on_escape_key_down: EventHandler[empty_event] # Fired when a pointer down event happens outside the context menu. - on_pointer_down_outside: EventHandler[lambda e0: [e0]] + on_pointer_down_outside: EventHandler[empty_event] # Fired when focus moves outside the context menu. - on_focus_outside: EventHandler[lambda e0: [e0]] + on_focus_outside: EventHandler[empty_event] # Fired when interacting outside the context menu. - on_interact_outside: EventHandler[lambda e0: [e0]] + on_interact_outside: EventHandler[empty_event] class ContextMenuSub(RadixThemesComponent): @@ -107,16 +107,16 @@ class ContextMenuSubContent(RadixThemesComponent): _valid_parents: List[str] = ["ContextMenuSub"] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0]] + on_escape_key_down: EventHandler[empty_event] # Fired when a pointer down event happens outside the context menu. - on_pointer_down_outside: EventHandler[lambda e0: [e0]] + on_pointer_down_outside: EventHandler[empty_event] # Fired when focus moves outside the context menu. - on_focus_outside: EventHandler[lambda e0: [e0]] + on_focus_outside: EventHandler[empty_event] # Fired when interacting outside the context menu. - on_interact_outside: EventHandler[lambda e0: [e0]] + on_interact_outside: EventHandler[empty_event] class ContextMenuItem(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/context_menu.pyi b/reflex/components/radix/themes/components/context_menu.pyi index 6295ccb49..fbefa88de 100644 --- a/reflex/components/radix/themes/components/context_menu.pyi +++ b/reflex/components/radix/themes/components/context_menu.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -26,44 +26,22 @@ class ContextMenuRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuRoot": """Create a new component instance. @@ -100,41 +78,21 @@ class ContextMenuTrigger(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuTrigger": """Create a new component instance. @@ -245,56 +203,26 @@ class ContextMenuContent(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_close_auto_focus: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_focus_outside: Optional[EventType[[]]] = None, + on_interact_outside: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuContent": """Create a new component instance. @@ -335,41 +263,21 @@ class ContextMenuSub(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuSub": """Create a new component instance. @@ -405,41 +313,21 @@ class ContextMenuSubTrigger(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuSubTrigger": """Create a new component instance. @@ -476,53 +364,25 @@ class ContextMenuSubContent(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_focus_outside: Optional[EventType[[]]] = None, + on_interact_outside: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuSubContent": """Create a new component instance. @@ -621,41 +481,21 @@ class ContextMenuItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuItem": """Create a new component instance. @@ -692,41 +532,21 @@ class ContextMenuSeparator(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ContextMenuSeparator": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/data_list.pyi b/reflex/components/radix/themes/components/data_list.pyi index dafc0fa0b..342fa6e77 100644 --- a/reflex/components/radix/themes/components/data_list.pyi +++ b/reflex/components/radix/themes/components/data_list.pyi @@ -4,10 +4,10 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from types import SimpleNamespace -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -60,41 +60,21 @@ class DataListRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DataListRoot": """Create a new component instance. @@ -149,41 +129,21 @@ class DataListItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DataListItem": """Create a new component instance. @@ -290,41 +250,21 @@ class DataListLabel(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DataListLabel": """Create a new component instance. @@ -363,41 +303,21 @@ class DataListValue(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DataListValue": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/dialog.py b/reflex/components/radix/themes/components/dialog.py index 951e8506d..e8da506ed 100644 --- a/reflex/components/radix/themes/components/dialog.py +++ b/reflex/components/radix/themes/components/dialog.py @@ -5,7 +5,7 @@ from typing import Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.vars.base import Var from ..base import ( @@ -23,7 +23,7 @@ class DialogRoot(RadixThemesComponent): open: Var[bool] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class DialogTrigger(RadixThemesTriggerComponent): @@ -47,19 +47,19 @@ class DialogContent(elements.Div, RadixThemesComponent): size: Var[Responsive[Literal["1", "2", "3", "4"]]] # Fired when the dialog is opened. - on_open_auto_focus: EventHandler[lambda e0: [e0]] + on_open_auto_focus: EventHandler[empty_event] # Fired when the dialog is closed. - on_close_auto_focus: EventHandler[lambda e0: [e0]] + on_close_auto_focus: EventHandler[empty_event] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0]] + on_escape_key_down: EventHandler[empty_event] # Fired when the pointer is down outside the dialog. - on_pointer_down_outside: EventHandler[lambda e0: [e0]] + on_pointer_down_outside: EventHandler[empty_event] # Fired when the pointer interacts outside the dialog. - on_interact_outside: EventHandler[lambda e0: [e0]] + on_interact_outside: EventHandler[empty_event] class DialogDescription(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index 827e50ea7..e3f17d7e8 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -27,44 +27,22 @@ class DialogRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DialogRoot": """Create a new component instance. @@ -100,41 +78,21 @@ class DialogTrigger(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DialogTrigger": """Create a new RadixThemesTriggerComponent instance. @@ -160,41 +118,21 @@ class DialogTitle(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DialogTitle": """Create a new component instance. @@ -265,56 +203,26 @@ class DialogContent(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_close_auto_focus: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_interact_outside: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_auto_focus: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DialogContent": """Create a new component instance. @@ -366,41 +274,21 @@ class DialogDescription(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DialogDescription": """Create a new component instance. @@ -435,41 +323,21 @@ class DialogClose(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DialogClose": """Create a new RadixThemesTriggerComponent instance. @@ -501,44 +369,22 @@ class Dialog(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DialogRoot": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/dropdown_menu.py b/reflex/components/radix/themes/components/dropdown_menu.py index c853619dd..885e8df35 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.py +++ b/reflex/components/radix/themes/components/dropdown_menu.py @@ -4,7 +4,7 @@ from typing import Dict, List, Literal, Union from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.vars.base import Var from ..base import ( @@ -50,7 +50,7 @@ class DropdownMenuRoot(RadixThemesComponent): _invalid_children: List[str] = ["DropdownMenuItem"] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class DropdownMenuTrigger(RadixThemesTriggerComponent): @@ -120,19 +120,19 @@ class DropdownMenuContent(RadixThemesComponent): hide_when_detached: Var[bool] # Fired when the dialog is closed. - on_close_auto_focus: EventHandler[lambda e0: [e0]] + on_close_auto_focus: EventHandler[empty_event] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0]] + on_escape_key_down: EventHandler[empty_event] # Fired when the pointer is down outside the dialog. - on_pointer_down_outside: EventHandler[lambda e0: [e0]] + on_pointer_down_outside: EventHandler[empty_event] # Fired when focus moves outside the dialog. - on_focus_outside: EventHandler[lambda e0: [e0]] + on_focus_outside: EventHandler[empty_event] # Fired when the pointer interacts outside the dialog. - on_interact_outside: EventHandler[lambda e0: [e0]] + on_interact_outside: EventHandler[empty_event] class DropdownMenuSubTrigger(RadixThemesTriggerComponent): @@ -164,7 +164,7 @@ class DropdownMenuSub(RadixThemesComponent): default_open: Var[bool] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class DropdownMenuSubContent(RadixThemesComponent): @@ -205,16 +205,16 @@ class DropdownMenuSubContent(RadixThemesComponent): _valid_parents: List[str] = ["DropdownMenuSub"] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0]] + on_escape_key_down: EventHandler[empty_event] # Fired when the pointer is down outside the dialog. - on_pointer_down_outside: EventHandler[lambda e0: [e0]] + on_pointer_down_outside: EventHandler[empty_event] # Fired when focus moves outside the dialog. - on_focus_outside: EventHandler[lambda e0: [e0]] + on_focus_outside: EventHandler[empty_event] # Fired when the pointer interacts outside the dialog. - on_interact_outside: EventHandler[lambda e0: [e0]] + on_interact_outside: EventHandler[empty_event] class DropdownMenuItem(RadixThemesComponent): @@ -240,7 +240,7 @@ class DropdownMenuItem(RadixThemesComponent): _valid_parents: List[str] = ["DropdownMenuContent", "DropdownMenuSubContent"] # Fired when the item is selected. - on_select: EventHandler[lambda e0: []] + on_select: EventHandler[empty_event] class DropdownMenuSeparator(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/dropdown_menu.pyi b/reflex/components/radix/themes/components/dropdown_menu.pyi index 0995ef2e4..dba619e7d 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.pyi +++ b/reflex/components/radix/themes/components/dropdown_menu.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -36,44 +36,22 @@ class DropdownMenuRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuRoot": """Create a new component instance. @@ -113,41 +91,21 @@ class DropdownMenuTrigger(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuTrigger": """Create a new RadixThemesTriggerComponent instance. @@ -277,56 +235,26 @@ class DropdownMenuContent(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_close_auto_focus: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_focus_outside: Optional[EventType[[]]] = None, + on_interact_outside: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuContent": """Create a new component instance. @@ -380,41 +308,21 @@ class DropdownMenuSubTrigger(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuSubTrigger": """Create a new RadixThemesTriggerComponent instance. @@ -442,44 +350,22 @@ class DropdownMenuSub(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuSub": """Create a new component instance. @@ -535,53 +421,25 @@ class DropdownMenuSubContent(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_focus_outside: Optional[EventType[[]]] = None, + on_interact_outside: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuSubContent": """Create a new component instance. @@ -692,42 +550,22 @@ class DropdownMenuItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_select: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_select: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuItem": """Create a new component instance. @@ -767,41 +605,21 @@ class DropdownMenuSeparator(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DropdownMenuSeparator": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/hover_card.py b/reflex/components/radix/themes/components/hover_card.py index d67a0396a..e76184795 100644 --- a/reflex/components/radix/themes/components/hover_card.py +++ b/reflex/components/radix/themes/components/hover_card.py @@ -5,7 +5,7 @@ from typing import Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.event import EventHandler +from reflex.event import EventHandler, identity_event from reflex.vars.base import Var from ..base import ( @@ -32,7 +32,7 @@ class HoverCardRoot(RadixThemesComponent): close_delay: Var[int] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class HoverCardTrigger(RadixThemesTriggerComponent): diff --git a/reflex/components/radix/themes/components/hover_card.pyi b/reflex/components/radix/themes/components/hover_card.pyi index 966d66276..8924ef1a8 100644 --- a/reflex/components/radix/themes/components/hover_card.pyi +++ b/reflex/components/radix/themes/components/hover_card.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -30,44 +30,22 @@ class HoverCardRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HoverCardRoot": """Create a new component instance. @@ -106,41 +84,21 @@ class HoverCardTrigger(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HoverCardTrigger": """Create a new RadixThemesTriggerComponent instance. @@ -210,41 +168,21 @@ class HoverCardContent(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HoverCardContent": """Create a new component instance. @@ -305,44 +243,22 @@ class HoverCard(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HoverCardRoot": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/icon_button.pyi b/reflex/components/radix/themes/components/icon_button.pyi index fe858aeca..901c8d6ff 100644 --- a/reflex/components/radix/themes/components/icon_button.pyi +++ b/reflex/components/radix/themes/components/icon_button.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -158,41 +158,21 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "IconButton": """Create a IconButton component. diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi index 45e7d6434..d6b0cce04 100644 --- a/reflex/components/radix/themes/components/inset.pyi +++ b/reflex/components/radix/themes/components/inset.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -133,41 +133,21 @@ class Inset(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Inset": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/popover.py b/reflex/components/radix/themes/components/popover.py index 0297b2d99..2535a8a22 100644 --- a/reflex/components/radix/themes/components/popover.py +++ b/reflex/components/radix/themes/components/popover.py @@ -5,7 +5,7 @@ from typing import Literal from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.el import elements -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.vars.base import Var from ..base import ( @@ -26,7 +26,7 @@ class PopoverRoot(RadixThemesComponent): modal: Var[bool] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] class PopoverTrigger(RadixThemesTriggerComponent): @@ -59,22 +59,22 @@ class PopoverContent(elements.Div, RadixThemesComponent): avoid_collisions: Var[bool] # Fired when the dialog is opened. - on_open_auto_focus: EventHandler[lambda e0: [e0]] + on_open_auto_focus: EventHandler[empty_event] # Fired when the dialog is closed. - on_close_auto_focus: EventHandler[lambda e0: [e0]] + on_close_auto_focus: EventHandler[empty_event] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: [e0]] + on_escape_key_down: EventHandler[empty_event] # Fired when the pointer is down outside the dialog. - on_pointer_down_outside: EventHandler[lambda e0: [e0]] + on_pointer_down_outside: EventHandler[empty_event] # Fired when focus moves outside the dialog. - on_focus_outside: EventHandler[lambda e0: [e0]] + on_focus_outside: EventHandler[empty_event] # Fired when the pointer interacts outside the dialog. - on_interact_outside: EventHandler[lambda e0: [e0]] + on_interact_outside: EventHandler[empty_event] class PopoverClose(RadixThemesTriggerComponent): diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index 70349aea3..984a139d0 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -28,44 +28,22 @@ class PopoverRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "PopoverRoot": """Create a new component instance. @@ -102,41 +80,21 @@ class PopoverTrigger(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "PopoverTrigger": """Create a new RadixThemesTriggerComponent instance. @@ -213,59 +171,27 @@ class PopoverContent(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_close_auto_focus: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_focus_outside: Optional[EventType[[]]] = None, + on_interact_outside: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_auto_focus: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "PopoverContent": """Create a new component instance. @@ -322,41 +248,21 @@ class PopoverClose(RadixThemesTriggerComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "PopoverClose": """Create a new RadixThemesTriggerComponent instance. diff --git a/reflex/components/radix/themes/components/progress.pyi b/reflex/components/radix/themes/components/progress.pyi index f2e89526a..6470842f3 100644 --- a/reflex/components/radix/themes/components/progress.pyi +++ b/reflex/components/radix/themes/components/progress.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -114,41 +114,21 @@ class Progress(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Progress": """Create a Progress component. diff --git a/reflex/components/radix/themes/components/radio.pyi b/reflex/components/radix/themes/components/radio.pyi index a35ac33f3..f1a6b131a 100644 --- a/reflex/components/radix/themes/components/radio.pyi +++ b/reflex/components/radix/themes/components/radio.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -104,41 +104,21 @@ class Radio(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Radio": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/radio_cards.py b/reflex/components/radix/themes/components/radio_cards.py index 4c1a92aef..e0aa2a749 100644 --- a/reflex/components/radix/themes/components/radio_cards.py +++ b/reflex/components/radix/themes/components/radio_cards.py @@ -4,7 +4,7 @@ from types import SimpleNamespace from typing import Literal, Union from reflex.components.core.breakpoints import Responsive -from reflex.event import EventHandler +from reflex.event import EventHandler, identity_event from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent @@ -65,7 +65,7 @@ class RadioCardsRoot(RadixThemesComponent): loop: Var[bool] # Event handler called when the value changes. - on_value_change: EventHandler[lambda e0: [e0]] + on_value_change: EventHandler[identity_event(str)] class RadioCardsItem(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/radio_cards.pyi b/reflex/components/radix/themes/components/radio_cards.pyi index f7cc97066..d73447622 100644 --- a/reflex/components/radix/themes/components/radio_cards.pyi +++ b/reflex/components/radix/themes/components/radio_cards.pyi @@ -4,10 +4,10 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from types import SimpleNamespace -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -162,44 +162,22 @@ class RadioCardsRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + on_value_change: Optional[EventType] = None, **props, ) -> "RadioCardsRoot": """Create a new component instance. @@ -252,41 +230,21 @@ class RadioCardsItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadioCardsItem": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index dcc74e040..95d33033b 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -9,7 +9,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.radix.themes.layout.flex import Flex from reflex.components.radix.themes.typography.text import Text -from reflex.event import EventHandler +from reflex.event import EventHandler, identity_event from reflex.utils import types from reflex.vars.base import LiteralVar, Var from reflex.vars.sequence import StringVar @@ -59,7 +59,7 @@ class RadioGroupRoot(RadixThemesComponent): _rename_props = {"onChange": "onValueChange"} # Fired when the value of the radio group changes. - on_change: EventHandler[lambda e0: [e0]] + on_change: EventHandler[identity_event(str)] class RadioGroupItem(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/radio_group.pyi b/reflex/components/radix/themes/components/radio_group.pyi index d255adcb1..c984fa1f2 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -112,42 +112,22 @@ class RadioGroupRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadioGroupRoot": """Create a new component instance. @@ -194,41 +174,21 @@ class RadioGroupItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadioGroupItem": """Create a new component instance. @@ -356,41 +316,21 @@ class HighLevelRadioGroup(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HighLevelRadioGroup": """Create a radio group component. @@ -528,41 +468,21 @@ class RadioGroup(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HighLevelRadioGroup": """Create a radio group component. diff --git a/reflex/components/radix/themes/components/scroll_area.pyi b/reflex/components/radix/themes/components/scroll_area.pyi index 583e97888..8deeb0fe9 100644 --- a/reflex/components/radix/themes/components/scroll_area.pyi +++ b/reflex/components/radix/themes/components/scroll_area.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -36,41 +36,21 @@ class ScrollArea(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ScrollArea": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/segmented_control.py b/reflex/components/radix/themes/components/segmented_control.py index 21b50f03e..22725eaa6 100644 --- a/reflex/components/radix/themes/components/segmented_control.py +++ b/reflex/components/radix/themes/components/segmented_control.py @@ -3,7 +3,7 @@ from __future__ import annotations from types import SimpleNamespace -from typing import List, Literal, Union +from typing import List, Literal, Tuple, Union from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler @@ -12,6 +12,18 @@ from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent +def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: + """Handle the on_value_change event. + + Args: + value: The value of the event. + + Returns: + The value of the event. + """ + return (value,) + + class SegmentedControlRoot(RadixThemesComponent): """Root element for a SegmentedControl component.""" @@ -39,7 +51,7 @@ class SegmentedControlRoot(RadixThemesComponent): value: Var[Union[str, List[str]]] # Handles the `onChange` event for the SegmentedControl component. - on_change: EventHandler[lambda e0: [e0]] + on_change: EventHandler[on_value_change] _rename_props = {"onChange": "onValueChange"} diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index 171fc490a..cb1990a7c 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -4,15 +4,17 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from types import SimpleNamespace -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var from ..base import RadixThemesComponent +def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: ... + class SegmentedControlRoot(RadixThemesComponent): @overload @classmethod @@ -114,42 +116,22 @@ class SegmentedControlRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType[str | List[str]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SegmentedControlRoot": """Create a new component instance. @@ -192,41 +174,21 @@ class SegmentedControlItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SegmentedControlItem": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/select.py b/reflex/components/radix/themes/components/select.py index 9017ab5c7..47a1eaf3f 100644 --- a/reflex/components/radix/themes/components/select.py +++ b/reflex/components/radix/themes/components/select.py @@ -5,6 +5,7 @@ from typing import List, Literal, Union import reflex as rx from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive +from reflex.event import empty_event, identity_event from reflex.vars.base import Var from ..base import ( @@ -47,10 +48,10 @@ class SelectRoot(RadixThemesComponent): _rename_props = {"onChange": "onValueChange"} # Fired when the value of the select changes. - on_change: rx.EventHandler[lambda e0: [e0]] + on_change: rx.EventHandler[identity_event(str)] # Fired when the select is opened or closed. - on_open_change: rx.EventHandler[lambda e0: [e0]] + on_open_change: rx.EventHandler[identity_event(bool)] class SelectTrigger(RadixThemesComponent): @@ -103,13 +104,13 @@ class SelectContent(RadixThemesComponent): align_offset: Var[int] # Fired when the select content is closed. - on_close_auto_focus: rx.EventHandler[lambda e0: [e0]] + on_close_auto_focus: rx.EventHandler[empty_event] # Fired when the escape key is pressed. - on_escape_key_down: rx.EventHandler[lambda e0: [e0]] + on_escape_key_down: rx.EventHandler[empty_event] # Fired when a pointer down event happens outside the select content. - on_pointer_down_outside: rx.EventHandler[lambda e0: [e0]] + on_pointer_down_outside: rx.EventHandler[empty_event] class SelectGroup(RadixThemesComponent): diff --git a/reflex/components/radix/themes/components/select.pyi b/reflex/components/radix/themes/components/select.pyi index b6adac6e7..c43d58ada 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -43,45 +43,23 @@ class SelectRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SelectRoot": """Create a new component instance. @@ -199,41 +177,21 @@ class SelectTrigger(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SelectTrigger": """Create a new component instance. @@ -358,50 +316,24 @@ class SelectContent(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_close_auto_focus: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SelectContent": """Create a new component instance. @@ -444,41 +376,21 @@ class SelectGroup(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SelectGroup": """Create a new component instance. @@ -515,41 +427,21 @@ class SelectItem(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SelectItem": """Create a new component instance. @@ -586,41 +478,21 @@ class SelectLabel(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SelectLabel": """Create a new component instance. @@ -655,41 +527,21 @@ class SelectSeparator(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SelectSeparator": """Create a new component instance. @@ -827,45 +679,23 @@ class HighLevelSelect(SelectRoot): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HighLevelSelect": """Create a select component. @@ -1023,45 +853,23 @@ class Select(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HighLevelSelect": """Create a select component. diff --git a/reflex/components/radix/themes/components/separator.pyi b/reflex/components/radix/themes/components/separator.pyi index cd5f4abce..0f2895403 100644 --- a/reflex/components/radix/themes/components/separator.pyi +++ b/reflex/components/radix/themes/components/separator.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -113,41 +113,21 @@ class Separator(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Separator": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/skeleton.pyi b/reflex/components/radix/themes/components/skeleton.pyi index 46d2697bf..61b57c275 100644 --- a/reflex/components/radix/themes/components/skeleton.pyi +++ b/reflex/components/radix/themes/components/skeleton.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -43,41 +43,21 @@ class Skeleton(RadixLoadingProp, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Skeleton": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/slider.py b/reflex/components/radix/themes/components/slider.py index 3cf2e172d..0d99eda27 100644 --- a/reflex/components/radix/themes/components/slider.py +++ b/reflex/components/radix/themes/components/slider.py @@ -1,6 +1,8 @@ """Interactive components provided by @radix-ui/themes.""" -from typing import List, Literal, Optional, Union +from __future__ import annotations + +from typing import List, Literal, Optional, Tuple, Union from reflex.components.component import Component from reflex.components.core.breakpoints import Responsive @@ -13,6 +15,20 @@ from ..base import ( ) +def on_value_event_spec( + value: Var[List[int | float]], +) -> Tuple[Var[List[int | float]]]: + """Event handler spec for the value event. + + Args: + value: The value of the event. + + Returns: + The event handler spec. + """ + return (value,) # type: ignore + + class Slider(RadixThemesComponent): """Provides user selection from a range of values.""" @@ -64,10 +80,10 @@ class Slider(RadixThemesComponent): _rename_props = {"onChange": "onValueChange"} # Fired when the value of the slider changes. - on_change: EventHandler[lambda e0: [e0]] + on_change: EventHandler[on_value_event_spec] # Fired when a thumb is released after being dragged. - on_value_commit: EventHandler[lambda e0: [e0]] + on_value_commit: EventHandler[on_value_event_spec] @classmethod def create( diff --git a/reflex/components/radix/themes/components/slider.pyi b/reflex/components/radix/themes/components/slider.pyi index 0157aaab0..dec836835 100644 --- a/reflex/components/radix/themes/components/slider.pyi +++ b/reflex/components/radix/themes/components/slider.pyi @@ -3,15 +3,19 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var from ..base import RadixThemesComponent +def on_value_event_spec( + value: Var[List[int | float]], +) -> Tuple[Var[List[int | float]]]: ... + class Slider(RadixThemesComponent): @overload @classmethod @@ -133,45 +137,23 @@ class Slider(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType[List[int | float]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + on_value_commit: Optional[EventType[List[int | float]]] = None, **props, ) -> "Slider": """Create a Slider component. diff --git a/reflex/components/radix/themes/components/spinner.pyi b/reflex/components/radix/themes/components/spinner.pyi index b8f37d636..87033f05c 100644 --- a/reflex/components/radix/themes/components/spinner.pyi +++ b/reflex/components/radix/themes/components/spinner.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -38,41 +38,21 @@ class Spinner(RadixLoadingProp, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Spinner": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/switch.py b/reflex/components/radix/themes/components/switch.py index 56951bc74..13be32d83 100644 --- a/reflex/components/radix/themes/components/switch.py +++ b/reflex/components/radix/themes/components/switch.py @@ -3,7 +3,7 @@ from typing import Literal from reflex.components.core.breakpoints import Responsive -from reflex.event import EventHandler +from reflex.event import EventHandler, identity_event from reflex.vars.base import Var from ..base import ( @@ -59,7 +59,7 @@ class Switch(RadixThemesComponent): _rename_props = {"onChange": "onCheckedChange"} # Fired when the value of the switch changes - on_change: EventHandler[lambda checked: [checked]] + on_change: EventHandler[identity_event(bool)] switch = Switch.create diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index 013501313..ba9c2595e 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -118,42 +118,22 @@ class Switch(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Switch": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index 69f94176b..8b1ef355f 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -66,41 +66,21 @@ class TableRoot(elements.Table, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TableRoot": """Create a new component instance. @@ -180,41 +160,21 @@ class TableHeader(elements.Thead, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TableHeader": """Create a new component instance. @@ -296,41 +256,21 @@ class TableRow(elements.Tr, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TableRow": """Create a new component instance. @@ -417,41 +357,21 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TableColumnHeaderCell": """Create a new component instance. @@ -533,41 +453,21 @@ class TableBody(elements.Tbody, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TableBody": """Create a new component instance. @@ -653,41 +553,21 @@ class TableCell(elements.Td, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TableCell": """Create a new component instance. @@ -778,41 +658,21 @@ class TableRowHeaderCell(elements.Th, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TableRowHeaderCell": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/tabs.py b/reflex/components/radix/themes/components/tabs.py index 5560d44b0..12359b528 100644 --- a/reflex/components/radix/themes/components/tabs.py +++ b/reflex/components/radix/themes/components/tabs.py @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Literal from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive from reflex.components.core.colors import color -from reflex.event import EventHandler +from reflex.event import EventHandler, identity_event from reflex.vars.base import Var from ..base import ( @@ -42,7 +42,7 @@ class TabsRoot(RadixThemesComponent): _rename_props = {"onChange": "onValueChange"} # Fired when the value of the tabs changes. - on_change: EventHandler[lambda e0: [e0]] + on_change: EventHandler[identity_event(str)] def add_style(self) -> Dict[str, Any] | None: """Add style for the component. diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index 8e3c29406..7b67bad6e 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -40,42 +40,22 @@ class TabsRoot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TabsRoot": """Create a new component instance. @@ -124,41 +104,21 @@ class TabsList(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TabsList": """Create a new component instance. @@ -259,41 +219,21 @@ class TabsTrigger(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TabsTrigger": """Create a TabsTrigger component. @@ -333,41 +273,21 @@ class TabsContent(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TabsContent": """Create a new component instance. @@ -419,42 +339,22 @@ class Tabs(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TabsRoot": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/text_area.pyi b/reflex/components/radix/themes/components/text_area.pyi index c39be4b1f..f234d9150 100644 --- a/reflex/components/radix/themes/components/text_area.pyi +++ b/reflex/components/radix/themes/components/text_area.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -168,46 +168,24 @@ class TextArea(RadixThemesComponent, elements.Textarea): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[str]] = None, + on_change: Optional[EventType[str]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[str]] = None, + on_key_down: Optional[EventType[str]] = None, + on_key_up: Optional[EventType[str]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TextArea": """Create an Input component. diff --git a/reflex/components/radix/themes/components/text_field.pyi b/reflex/components/radix/themes/components/text_field.pyi index ff5b79344..7ea0860b5 100644 --- a/reflex/components/radix/themes/components/text_field.pyi +++ b/reflex/components/radix/themes/components/text_field.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -149,46 +149,24 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[str]] = None, + on_change: Optional[EventType[str]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[str]] = None, + on_key_down: Optional[EventType[str]] = None, + on_key_up: Optional[EventType[str]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TextFieldRoot": """Create an Input component. @@ -313,41 +291,21 @@ class TextFieldSlot(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TextFieldSlot": """Create a new component instance. @@ -503,46 +461,24 @@ class TextField(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[str]] = None, + on_change: Optional[EventType[str]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[str]] = None, + on_key_down: Optional[EventType[str]] = None, + on_key_up: Optional[EventType[str]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "TextFieldRoot": """Create an Input component. diff --git a/reflex/components/radix/themes/components/tooltip.py b/reflex/components/radix/themes/components/tooltip.py index 7fd181465..ac35c86d1 100644 --- a/reflex/components/radix/themes/components/tooltip.py +++ b/reflex/components/radix/themes/components/tooltip.py @@ -3,7 +3,7 @@ from typing import Dict, Literal, Union from reflex.components.component import Component -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.utils import format from reflex.vars.base import Var @@ -85,13 +85,13 @@ class Tooltip(RadixThemesComponent): aria_label: Var[str] # Fired when the open state changes. - on_open_change: EventHandler[lambda e0: [e0]] + on_open_change: EventHandler[identity_event(bool)] # Fired when the escape key is pressed. - on_escape_key_down: EventHandler[lambda e0: []] + on_escape_key_down: EventHandler[empty_event] # Fired when the pointer is down outside the tooltip. - on_pointer_down_outside: EventHandler[lambda e0: []] + on_pointer_down_outside: EventHandler[empty_event] @classmethod def create(cls, *children, **props) -> Component: diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index f886dc608..ad7c4402f 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -3,9 +3,9 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -62,50 +62,24 @@ class Tooltip(RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_escape_key_down: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_pointer_down_outside: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Tooltip": """Initialize the Tooltip component. diff --git a/reflex/components/radix/themes/layout/base.pyi b/reflex/components/radix/themes/layout/base.pyi index 4da48975b..df51b07f9 100644 --- a/reflex/components/radix/themes/layout/base.pyi +++ b/reflex/components/radix/themes/layout/base.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -201,41 +201,21 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "LayoutComponent": """Create a new component instance. diff --git a/reflex/components/radix/themes/layout/box.pyi b/reflex/components/radix/themes/layout/box.pyi index ba651b488..895725a35 100644 --- a/reflex/components/radix/themes/layout/box.pyi +++ b/reflex/components/radix/themes/layout/box.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -48,41 +48,21 @@ class Box(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Box": """Create a new component instance. diff --git a/reflex/components/radix/themes/layout/center.pyi b/reflex/components/radix/themes/layout/center.pyi index e6a622c48..eb976892e 100644 --- a/reflex/components/radix/themes/layout/center.pyi +++ b/reflex/components/radix/themes/layout/center.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -125,41 +125,21 @@ class Center(Flex): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Center": """Create a new component instance. diff --git a/reflex/components/radix/themes/layout/container.pyi b/reflex/components/radix/themes/layout/container.pyi index f4c92b085..a5e50b9f3 100644 --- a/reflex/components/radix/themes/layout/container.pyi +++ b/reflex/components/radix/themes/layout/container.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -65,41 +65,21 @@ class Container(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Container": """Create the container component. diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi index be7d1ce55..aba864f4f 100644 --- a/reflex/components/radix/themes/layout/flex.pyi +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -128,41 +128,21 @@ class Flex(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Flex": """Create a new component instance. diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi index 124928198..faf63712e 100644 --- a/reflex/components/radix/themes/layout/grid.pyi +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -157,41 +157,21 @@ class Grid(elements.Div, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Grid": """Create a new component instance. diff --git a/reflex/components/radix/themes/layout/list.pyi b/reflex/components/radix/themes/layout/list.pyi index a3ea33916..b72afbaa7 100644 --- a/reflex/components/radix/themes/layout/list.pyi +++ b/reflex/components/radix/themes/layout/list.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Iterable, Literal, Optional, Union, overload +from typing import Any, Dict, Iterable, Literal, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.components.el.elements.typography import Li, Ol, Ul -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -84,41 +84,21 @@ class BaseList(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "BaseList": """Create a list component. @@ -181,41 +161,21 @@ class UnorderedList(BaseList, Ul): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "UnorderedList": """Create a unordered list component. @@ -295,41 +255,21 @@ class OrderedList(BaseList, Ol): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "OrderedList": """Create an ordered list component. @@ -407,41 +347,21 @@ class ListItem(Li): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ListItem": """Create a list item component. @@ -535,41 +455,21 @@ class List(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "BaseList": """Create a list component. diff --git a/reflex/components/radix/themes/layout/section.pyi b/reflex/components/radix/themes/layout/section.pyi index b949e5e05..9fb790b9f 100644 --- a/reflex/components/radix/themes/layout/section.pyi +++ b/reflex/components/radix/themes/layout/section.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -62,41 +62,21 @@ class Section(elements.Section, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Section": """Create a new component instance. diff --git a/reflex/components/radix/themes/layout/spacer.pyi b/reflex/components/radix/themes/layout/spacer.pyi index 5a3775ef6..f83d7a4c9 100644 --- a/reflex/components/radix/themes/layout/spacer.pyi +++ b/reflex/components/radix/themes/layout/spacer.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -125,41 +125,21 @@ class Spacer(Flex): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Spacer": """Create a new component instance. diff --git a/reflex/components/radix/themes/layout/stack.pyi b/reflex/components/radix/themes/layout/stack.pyi index 0547cbc8f..5eed3db46 100644 --- a/reflex/components/radix/themes/layout/stack.pyi +++ b/reflex/components/radix/themes/layout/stack.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -93,41 +93,21 @@ class Stack(Flex): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Stack": """Create a new instance of the component. @@ -238,41 +218,21 @@ class VStack(Stack): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "VStack": """Create a new instance of the component. @@ -383,41 +343,21 @@ class HStack(Stack): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "HStack": """Create a new instance of the component. diff --git a/reflex/components/radix/themes/typography/blockquote.pyi b/reflex/components/radix/themes/typography/blockquote.pyi index 3abf53fd6..3a9ae5c72 100644 --- a/reflex/components/radix/themes/typography/blockquote.pyi +++ b/reflex/components/radix/themes/typography/blockquote.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -139,41 +139,21 @@ class Blockquote(elements.Blockquote, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Blockquote": """Create a new component instance. diff --git a/reflex/components/radix/themes/typography/code.pyi b/reflex/components/radix/themes/typography/code.pyi index 1da91fc96..2cda39ddf 100644 --- a/reflex/components/radix/themes/typography/code.pyi +++ b/reflex/components/radix/themes/typography/code.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -144,41 +144,21 @@ class Code(elements.Code, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Code": """Create a new component instance. diff --git a/reflex/components/radix/themes/typography/heading.pyi b/reflex/components/radix/themes/typography/heading.pyi index 7b7c45fde..78ef8ba60 100644 --- a/reflex/components/radix/themes/typography/heading.pyi +++ b/reflex/components/radix/themes/typography/heading.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -164,41 +164,21 @@ class Heading(elements.H1, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Heading": """Create a new component instance. diff --git a/reflex/components/radix/themes/typography/link.pyi b/reflex/components/radix/themes/typography/link.pyi index da715f73b..3e3eaf64b 100644 --- a/reflex/components/radix/themes/typography/link.pyi +++ b/reflex/components/radix/themes/typography/link.pyi @@ -3,13 +3,13 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import MemoizationLeaf from reflex.components.core.breakpoints import Breakpoints from reflex.components.el.elements.inline import A from reflex.components.next.link import NextLink -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -176,41 +176,21 @@ class Link(RadixThemesComponent, A, MemoizationLeaf): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Link": """Create a Link component. diff --git a/reflex/components/radix/themes/typography/text.pyi b/reflex/components/radix/themes/typography/text.pyi index 85f7754cc..b4ddc622c 100644 --- a/reflex/components/radix/themes/typography/text.pyi +++ b/reflex/components/radix/themes/typography/text.pyi @@ -3,12 +3,12 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -231,41 +231,21 @@ class Text(elements.Span, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Text": """Create a new component instance. @@ -508,41 +488,21 @@ class Span(Text): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Span": """Create a new component instance. @@ -625,41 +585,21 @@ class Em(elements.Em, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Em": """Create a new component instance. @@ -740,41 +680,21 @@ class Kbd(elements.Kbd, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Kbd": """Create a new component instance. @@ -851,41 +771,21 @@ class Quote(elements.Q, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Quote": """Create a new component instance. @@ -961,41 +861,21 @@ class Strong(elements.Strong, RadixThemesComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Strong": """Create a new component instance. @@ -1234,41 +1114,21 @@ class TextNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Text": """Create a new component instance. diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index af5714148..4b566d898 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -33,73 +33,37 @@ class Audio(ReactPlayer): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_buffer: Optional[EventType[[]]] = None, + on_buffer_end: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_click_preview: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_disable_pip: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_duration: Optional[EventType] = None, + on_enable_pip: Optional[EventType[[]]] = None, + on_ended: Optional[EventType[[]]] = None, + on_error: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pause: Optional[EventType[[]]] = None, + on_play: Optional[EventType[[]]] = None, + on_playback_quality_change: Optional[EventType[[]]] = None, + on_playback_rate_change: Optional[EventType[[]]] = None, + on_progress: Optional[EventType[[]]] = None, + on_ready: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_seek: Optional[EventType] = None, + on_start: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Audio": """Create the component. diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index 9da878b64..7ad45b093 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -3,7 +3,7 @@ from __future__ import annotations from reflex.components.component import NoSSRComponent -from reflex.event import EventHandler, empty_event +from reflex.event import EventHandler, empty_event, identity_event from reflex.vars.base import Var @@ -58,7 +58,7 @@ class ReactPlayer(NoSSRComponent): on_progress: EventHandler[lambda progress: [progress]] # Callback containing duration of the media, in seconds. - on_duration: EventHandler[lambda seconds: [seconds]] + on_duration: EventHandler[identity_event(float)] # Called when media is paused. on_pause: EventHandler[empty_event] @@ -70,13 +70,13 @@ class ReactPlayer(NoSSRComponent): on_buffer_end: EventHandler[empty_event] # Called when media seeks with seconds parameter. - on_seek: EventHandler[lambda seconds: [seconds]] + on_seek: EventHandler[identity_event(float)] # Called when playback rate of the player changed. Only supported by YouTube, Vimeo (if enabled), Wistia, and file paths. - on_playback_rate_change: EventHandler[lambda e0: []] + on_playback_rate_change: EventHandler[empty_event] # Called when playback quality of the player changed. Only supported by YouTube (if enabled). - on_playback_quality_change: EventHandler[lambda e0: []] + on_playback_quality_change: EventHandler[empty_event] # Called when media finishes playing. Does not fire when loop is set to true. on_ended: EventHandler[empty_event] diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 4f466ea2d..1977eaa00 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.component import NoSSRComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -31,73 +31,37 @@ class ReactPlayer(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_buffer: Optional[EventType[[]]] = None, + on_buffer_end: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_click_preview: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_disable_pip: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_duration: Optional[EventType] = None, + on_enable_pip: Optional[EventType[[]]] = None, + on_ended: Optional[EventType[[]]] = None, + on_error: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pause: Optional[EventType[[]]] = None, + on_play: Optional[EventType[[]]] = None, + on_playback_quality_change: Optional[EventType[[]]] = None, + on_playback_rate_change: Optional[EventType[[]]] = None, + on_progress: Optional[EventType[[]]] = None, + on_ready: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_seek: Optional[EventType] = None, + on_start: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ReactPlayer": """Create the component. diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index e60f03920..6e4047d06 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload +from typing import Any, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -33,73 +33,37 @@ class Video(ReactPlayer): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_buffer: Optional[EventType[[]]] = None, + on_buffer_end: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_click_preview: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_disable_pip: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_duration: Optional[EventType] = None, + on_enable_pip: Optional[EventType[[]]] = None, + on_ended: Optional[EventType[[]]] = None, + on_error: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_pause: Optional[EventType[[]]] = None, + on_play: Optional[EventType[[]]] = None, + on_playback_quality_change: Optional[EventType[[]]] = None, + on_playback_rate_change: Optional[EventType[[]]] = None, + on_progress: Optional[EventType[[]]] = None, + on_ready: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_seek: Optional[EventType] = None, + on_start: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Video": """Create the component. diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 3205ee689..9772be792 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -122,41 +122,21 @@ class Axis(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Axis": """Create the component. @@ -316,41 +296,21 @@ class XAxis(Axis): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "XAxis": """Create the component. @@ -513,41 +473,21 @@ class YAxis(Axis): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "YAxis": """Create the component. @@ -652,41 +592,21 @@ class ZAxis(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ZAxis": """Create the component. @@ -737,7 +657,7 @@ class Brush(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_change: Optional[EventType[[]]] = None, **props, ) -> "Brush": """Create the component. @@ -833,47 +753,23 @@ class Cartesian(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Cartesian": """Create the component. @@ -1024,47 +920,23 @@ class Area(Cartesian): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Area": """Create the component. @@ -1180,47 +1052,23 @@ class Bar(Cartesian): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Bar": """Create the component. @@ -1378,47 +1226,23 @@ class Line(Cartesian): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Line": """Create the component. @@ -1539,41 +1363,21 @@ class Scatter(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Scatter": """Create the component. @@ -1666,47 +1470,23 @@ class Funnel(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Funnel": """Create the component. @@ -1753,41 +1533,21 @@ class ErrorBar(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ErrorBar": """Create the component. @@ -1834,41 +1594,21 @@ class Reference(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Reference": """Create the component. @@ -1920,41 +1660,21 @@ class ReferenceLine(Reference): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ReferenceLine": """Create the component. @@ -2011,41 +1731,21 @@ class ReferenceDot(Reference): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ReferenceDot": """Create the component. @@ -2103,41 +1803,21 @@ class ReferenceArea(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ReferenceArea": """Create the component. @@ -2184,41 +1864,21 @@ class Grid(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Grid": """Create the component. @@ -2270,41 +1930,21 @@ class CartesianGrid(Grid): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CartesianGrid": """Create the component. @@ -2372,41 +2012,21 @@ class CartesianAxis(Grid): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CartesianAxis": """Create the component. diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index cda2c0f04..f0b494ff8 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -28,41 +28,21 @@ class ChartBase(RechartsCharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ChartBase": """Create a chart component. @@ -116,41 +96,21 @@ class CategoricalChartBase(ChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "CategoricalChartBase": """Create a chart component. @@ -217,41 +177,21 @@ class AreaChart(CategoricalChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "AreaChart": """Create a chart component. @@ -317,41 +257,21 @@ class BarChart(CategoricalChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "BarChart": """Create a chart component. @@ -416,41 +336,21 @@ class LineChart(CategoricalChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "LineChart": """Create a chart component. @@ -521,41 +421,21 @@ class ComposedChart(CategoricalChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ComposedChart": """Create a chart component. @@ -603,41 +483,21 @@ class PieChart(ChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "PieChart": """Create a chart component. @@ -683,13 +543,9 @@ class RadarChart(ChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_click: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, **props, ) -> "RadarChart": """Create a chart component. @@ -744,41 +600,21 @@ class RadialBarChart(ChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RadialBarChart": """Create a chart component. @@ -827,28 +663,14 @@ class ScatterChart(ChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_click: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, **props, ) -> "ScatterChart": """Create a chart component. @@ -888,41 +710,21 @@ class FunnelChart(ChartBase): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "FunnelChart": """Create a chart component. @@ -974,47 +776,23 @@ class Treemap(RechartsCharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Treemap": """Create a chart component. diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index 9aa88a2d3..4a8f61c5e 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -3,11 +3,11 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -33,42 +33,22 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_resize: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_resize: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ResponsiveContainer": """Create a new memoization leaf component. @@ -163,41 +143,21 @@ class Legend(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Legend": """Create the component. @@ -265,41 +225,21 @@ class GraphingTooltip(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "GraphingTooltip": """Create the component. @@ -396,41 +336,21 @@ class Label(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Label": """Create the component. @@ -516,41 +436,21 @@ class LabelList(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "LabelList": """Create the component. diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index bc12157c9..c02596006 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -84,28 +84,14 @@ class Pie(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, **props, ) -> "Pie": """Create the component. @@ -207,12 +193,8 @@ class Radar(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, **props, ) -> "Radar": """Create the component. @@ -307,28 +289,14 @@ class RadialBar(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_animation_end: Optional[EventType[[]]] = None, + on_animation_start: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, **props, ) -> "RadialBar": """Create the component. @@ -390,41 +358,21 @@ class PolarAngleAxis(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "PolarAngleAxis": """Create the component. @@ -478,41 +426,21 @@ class PolarGrid(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "PolarGrid": """Create the component. @@ -618,22 +546,12 @@ class PolarRadiusAxis(Recharts): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_click: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, **props, ) -> "PolarRadiusAxis": """Create the component. diff --git a/reflex/components/recharts/recharts.pyi b/reflex/components/recharts/recharts.pyi index 71d308ce3..c13519f05 100644 --- a/reflex/components/recharts/recharts.pyi +++ b/reflex/components/recharts/recharts.pyi @@ -3,10 +3,10 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Dict, Literal, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var @@ -23,41 +23,21 @@ class Recharts(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Recharts": """Create the component. @@ -89,41 +69,21 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "RechartsCharts": """Create a new memoization leaf component. diff --git a/reflex/components/sonner/toast.pyi b/reflex/components/sonner/toast.pyi index 67f826164..976f9f310 100644 --- a/reflex/components/sonner/toast.pyi +++ b/reflex/components/sonner/toast.pyi @@ -3,13 +3,13 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, ClassVar, Dict, Literal, Optional, Union, overload +from typing import Any, ClassVar, Dict, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.props import PropsBase -from reflex.event import EventHandler, EventSpec +from reflex.event import EventSpec, EventType from reflex.style import Style from reflex.utils.serializers import serializer from reflex.vars.base import Var @@ -121,41 +121,21 @@ class Toaster(Component): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Toaster": """Create a toaster component. diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index 8fb92b51a..bcc0b64ac 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -4,11 +4,11 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ import enum -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars.base import Var @@ -122,56 +122,30 @@ class Editor(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_copy: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_cut: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_input: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_resize_editor: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - toggle_code_view: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - toggle_full_screen: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_change: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_copy: Optional[EventType[[]]] = None, + on_cut: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_input: Optional[EventType[[]]] = None, + on_load: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_paste: Optional[EventType[[]]] = None, + on_resize_editor: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + toggle_code_view: Optional[EventType[[]]] = None, + toggle_full_screen: Optional[EventType[[]]] = None, **props, ) -> "Editor": """Create an instance of Editor. No children allowed. diff --git a/reflex/event.py b/reflex/event.py index 659532ce2..04879add3 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -8,20 +8,23 @@ import sys import types import urllib.parse from base64 import b64encode +from functools import partial from typing import ( Any, Callable, ClassVar, Dict, + Generic, List, Optional, Tuple, Type, + TypeVar, Union, get_type_hints, ) -from typing_extensions import get_args, get_origin +from typing_extensions import ParamSpec, get_args, get_origin from reflex import constants from reflex.utils import console, format @@ -427,7 +430,7 @@ class JavasciptKeyboardEvent: key: str = "" -def input_event(e: Var[JavascriptInputEvent]) -> Tuple[str]: +def input_event(e: Var[JavascriptInputEvent]) -> Tuple[Var[str]]: """Get the value from an input event. Args: @@ -439,7 +442,7 @@ def input_event(e: Var[JavascriptInputEvent]) -> Tuple[str]: return (e.target.value,) -def key_event(e: Var[JavasciptKeyboardEvent]) -> Tuple[str]: +def key_event(e: Var[JavasciptKeyboardEvent]) -> Tuple[Var[str]]: """Get the key from a keyboard event. Args: @@ -460,6 +463,38 @@ def empty_event() -> Tuple[()]: return tuple() # type: ignore +T = TypeVar("T") + + +def identity_event(event_type: Type[T]) -> Callable[[Var[T]], Tuple[Var[T]]]: + """A helper function that returns the input event as output. + + Args: + event_type: The type of the event. + + Returns: + A function that returns the input event as output. + """ + + def inner(ev: Var[T]) -> Tuple[Var[T]]: + return (ev,) + + inner.__signature__ = inspect.signature(inner).replace( # type: ignore + parameters=[ + inspect.Parameter( + "ev", + kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, + annotation=Var[event_type], + ) + ], + return_annotation=Tuple[Var[event_type]], + ) + inner.__annotations__["ev"] = Var[event_type] + inner.__annotations__["return"] = Tuple[Var[event_type]] + + return inner + + @dataclasses.dataclass( init=True, frozen=True, @@ -1022,13 +1057,15 @@ def parse_args_spec(arg_spec: ArgsSpec): spec = inspect.getfullargspec(arg_spec) annotations = get_type_hints(arg_spec) - return arg_spec( - *[ - Var(f"_{l_arg}").to( - unwrap_var_annotation(resolve_annotation(annotations, l_arg)) - ) - for l_arg in spec.args - ] + return list( + arg_spec( + *[ + Var(f"_{l_arg}").to( + unwrap_var_annotation(resolve_annotation(annotations, l_arg)) + ) + for l_arg in spec.args + ] + ) ) @@ -1390,3 +1427,116 @@ class ToEventChainVarOperation(ToOperation, EventChainVar): _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) _default_var_type: ClassVar[Type] = EventChain + + +G = ParamSpec("G") + +IndividualEventType = Union[EventSpec, EventHandler, Callable[G, Any], Var] + +EventType = Union[IndividualEventType[G], List[IndividualEventType[G]]] + +P = ParamSpec("P") +T = TypeVar("T") + +if sys.version_info >= (3, 10): + from typing import Concatenate + + class EventCallback(Generic[P, T]): + """A descriptor that wraps a function to be used as an event.""" + + def __init__(self, func: Callable[Concatenate[Any, P], T]): + """Initialize the descriptor with the function to be wrapped. + + Args: + func: The function to be wrapped. + """ + self.func = func + + def __get__(self, instance, owner) -> Callable[P, T]: + """Get the function with the instance bound to it. + + Args: + instance: The instance to bind to the function. + owner: The owner of the function. + + Returns: + The function with the instance bound to it + """ + if instance is None: + return self.func # type: ignore + + return partial(self.func, instance) # type: ignore + + def event_handler(func: Callable[Concatenate[Any, P], T]) -> EventCallback[P, T]: + """Wrap a function to be used as an event. + + Args: + func: The function to wrap. + + Returns: + The wrapped function. + """ + return func # type: ignore +else: + + def event_handler(func: Callable[P, T]) -> Callable[P, T]: + """Wrap a function to be used as an event. + + Args: + func: The function to wrap. + + Returns: + The wrapped function. + """ + return func + + +class EventNamespace(types.SimpleNamespace): + """A namespace for event related classes.""" + + Event = Event + EventHandler = EventHandler + EventSpec = EventSpec + CallableEventSpec = CallableEventSpec + EventChain = EventChain + EventVar = EventVar + LiteralEventVar = LiteralEventVar + EventChainVar = EventChainVar + LiteralEventChainVar = LiteralEventChainVar + ToEventVarOperation = ToEventVarOperation + ToEventChainVarOperation = ToEventChainVarOperation + EventType = EventType + + __call__ = staticmethod(event_handler) + get_event = staticmethod(get_event) + get_hydrate_event = staticmethod(get_hydrate_event) + fix_events = staticmethod(fix_events) + call_event_handler = staticmethod(call_event_handler) + call_event_fn = staticmethod(call_event_fn) + get_handler_args = staticmethod(get_handler_args) + check_fn_match_arg_spec = staticmethod(check_fn_match_arg_spec) + resolve_annotation = staticmethod(resolve_annotation) + parse_args_spec = staticmethod(parse_args_spec) + identity_event = staticmethod(identity_event) + input_event = staticmethod(input_event) + key_event = staticmethod(key_event) + empty_event = staticmethod(empty_event) + server_side = staticmethod(server_side) + redirect = staticmethod(redirect) + console_log = staticmethod(console_log) + back = staticmethod(back) + window_alert = staticmethod(window_alert) + set_focus = staticmethod(set_focus) + scroll_to = staticmethod(scroll_to) + set_value = staticmethod(set_value) + remove_cookie = staticmethod(remove_cookie) + clear_local_storage = staticmethod(clear_local_storage) + remove_local_storage = staticmethod(remove_local_storage) + clear_session_storage = staticmethod(clear_session_storage) + remove_session_storage = staticmethod(remove_session_storage) + set_clipboard = staticmethod(set_clipboard) + download = staticmethod(download) + call_script = staticmethod(call_script) + + +event = EventNamespace() diff --git a/reflex/experimental/layout.pyi b/reflex/experimental/layout.pyi index d9b576eeb..e4c82b351 100644 --- a/reflex/experimental/layout.pyi +++ b/reflex/experimental/layout.pyi @@ -3,14 +3,14 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Union, overload from reflex import color from reflex.components.base.fragment import Fragment from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf from reflex.components.radix.primitives.drawer import DrawerRoot from reflex.components.radix.themes.layout.box import Box -from reflex.event import EventHandler, EventSpec +from reflex.event import EventType from reflex.state import ComponentState from reflex.style import Style from reflex.vars.base import Var @@ -51,41 +51,21 @@ class Sidebar(Box, MemoizationLeaf): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Sidebar": """Create the sidebar component. @@ -136,44 +116,22 @@ class DrawerSidebar(DrawerRoot): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_open_change: Optional[EventType] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "DrawerSidebar": """Create the sidebar component. @@ -207,41 +165,21 @@ class SidebarTrigger(Fragment): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "SidebarTrigger": """Create the sidebar trigger component. @@ -292,41 +230,21 @@ class Layout(Box): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Layout": """Create the layout component. @@ -380,41 +298,21 @@ class LayoutNamespace(ComponentNamespace): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, **props, ) -> "Layout": """Create the layout component. diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index 3c00b0427..1df8e6fa0 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -70,7 +70,7 @@ DEFAULT_TYPING_IMPORTS = { DEFAULT_IMPORTS = { "typing": sorted(DEFAULT_TYPING_IMPORTS), "reflex.components.core.breakpoints": ["Breakpoints"], - "reflex.event": ["EventChain", "EventHandler", "EventSpec"], + "reflex.event": ["EventChain", "EventHandler", "EventSpec", "EventType"], "reflex.style": ["Style"], "reflex.vars.base": ["Var"], } @@ -427,18 +427,58 @@ def _generate_component_create_functiondef( all_props = [arg[0].arg for arg in prop_kwargs] kwargs.extend(prop_kwargs) + def figure_out_return_type(annotation: Any): + if inspect.isclass(annotation) and issubclass(annotation, inspect._empty): + return ast.Name(id="Optional[EventType[[]]]") + if isinstance(annotation, str) and annotation.startswith("Tuple["): + inside_of_tuple = annotation.removeprefix("Tuple[").removesuffix("]") + + if inside_of_tuple == "()": + return ast.Name(id="Optional[EventType[[]]]") + + arguments: list[str] = [""] + + bracket_count = 0 + + for char in inside_of_tuple: + if char == "[": + bracket_count += 1 + elif char == "]": + bracket_count -= 1 + + if char == "," and bracket_count == 0: + arguments.append("") + else: + arguments[-1] += char + + arguments = [argument.strip() for argument in arguments] + + arguments_without_var = [ + argument.removeprefix("Var[").removesuffix("]") + if argument.startswith("Var[") + else argument + for argument in arguments + ] + + return ast.Name( + id=f"Optional[EventType[{', '.join(arguments_without_var)}]]" + ) + return ast.Name(id="Optional[EventType]") + + event_triggers = clz().get_event_triggers() + # event handler kwargs kwargs.extend( ( ast.arg( arg=trigger, - annotation=ast.Name( - id="Optional[Union[EventHandler, EventSpec, list, Callable, Var]]" + annotation=figure_out_return_type( + inspect.signature(event_triggers[trigger]).return_annotation ), ), ast.Constant(value=None), ) - for trigger in sorted(clz().get_event_triggers()) + for trigger in sorted(event_triggers) ) logger.debug(f"Generated {clz.__name__}.create method with {len(kwargs)} kwargs") create_args = ast.arguments( diff --git a/reflex/utils/types.py b/reflex/utils/types.py index d2de4a156..0a3aed110 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -18,6 +18,7 @@ from typing import ( List, Literal, Optional, + Sequence, Tuple, Type, Union, @@ -102,14 +103,14 @@ if TYPE_CHECKING: # ArgsSpec = Callable[[Var], list[Var]] ArgsSpec = ( - Callable[[], List[Var]] - | Callable[[Var], List[Var]] - | Callable[[Var, Var], List[Var]] - | Callable[[Var, Var, Var], List[Var]] - | Callable[[Var, Var, Var, Var], List[Var]] - | Callable[[Var, Var, Var, Var, Var], List[Var]] - | Callable[[Var, Var, Var, Var, Var, Var], List[Var]] - | Callable[[Var, Var, Var, Var, Var, Var, Var], List[Var]] + Callable[[], Sequence[Var]] + | Callable[[Var], Sequence[Var]] + | Callable[[Var, Var], Sequence[Var]] + | Callable[[Var, Var, Var], Sequence[Var]] + | Callable[[Var, Var, Var, Var], Sequence[Var]] + | Callable[[Var, Var, Var, Var, Var], Sequence[Var]] + | Callable[[Var, Var, Var, Var, Var, Var], Sequence[Var]] + | Callable[[Var, Var, Var, Var, Var, Var, Var], Sequence[Var]] ) else: ArgsSpec = Callable[..., List[Any]] diff --git a/reflex/vars/base.py b/reflex/vars/base.py index f62f8513a..14e7251bb 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -429,71 +429,75 @@ class Var(Generic[VAR_TYPE]): return self.to(EventVar, output) if fixed_output_type is EventChain: return self.to(EventChainVar, output) - if issubclass(fixed_output_type, Base): - return self.to(ObjectVar, output) + try: + if issubclass(fixed_output_type, Base): + return self.to(ObjectVar, output) + except TypeError: + pass if dataclasses.is_dataclass(fixed_output_type) and not issubclass( fixed_output_type, Var ): return self.to(ObjectVar, output) - if issubclass(output, BooleanVar): - return ToBooleanVarOperation.create(self) + if inspect.isclass(output): + if issubclass(output, BooleanVar): + return ToBooleanVarOperation.create(self) - if issubclass(output, NumberVar): - if fixed_type is not None: - if fixed_type in types.UnionTypes: - inner_types = get_args(base_type) - if not all(issubclass(t, (int, float)) for t in inner_types): + if issubclass(output, NumberVar): + if fixed_type is not None: + if fixed_type in types.UnionTypes: + inner_types = get_args(base_type) + if not all(issubclass(t, (int, float)) for t in inner_types): + raise TypeError( + f"Unsupported type {var_type} for NumberVar. Must be int or float." + ) + + elif not issubclass(fixed_type, (int, float)): raise TypeError( f"Unsupported type {var_type} for NumberVar. Must be int or float." ) + return ToNumberVarOperation.create(self, var_type or float) - elif not issubclass(fixed_type, (int, float)): + if issubclass(output, ArrayVar): + if fixed_type is not None and not issubclass( + fixed_type, (list, tuple, set) + ): raise TypeError( - f"Unsupported type {var_type} for NumberVar. Must be int or float." + f"Unsupported type {var_type} for ArrayVar. Must be list, tuple, or set." ) - return ToNumberVarOperation.create(self, var_type or float) + return ToArrayOperation.create(self, var_type or list) - if issubclass(output, ArrayVar): - if fixed_type is not None and not issubclass( - fixed_type, (list, tuple, set) - ): - raise TypeError( - f"Unsupported type {var_type} for ArrayVar. Must be list, tuple, or set." + if issubclass(output, StringVar): + return ToStringOperation.create(self, var_type or str) + + if issubclass(output, EventVar): + return ToEventVarOperation.create(self, var_type or EventSpec) + + if issubclass(output, EventChainVar): + return ToEventChainVarOperation.create(self, var_type or EventChain) + + if issubclass(output, (ObjectVar, Base)): + return ToObjectOperation.create(self, var_type or dict) + + if issubclass(output, FunctionVar): + # if fixed_type is not None and not issubclass(fixed_type, Callable): + # raise TypeError( + # f"Unsupported type {var_type} for FunctionVar. Must be Callable." + # ) + return ToFunctionOperation.create(self, var_type or Callable) + + if issubclass(output, NoneVar): + return ToNoneOperation.create(self) + + if dataclasses.is_dataclass(output): + return ToObjectOperation.create(self, var_type or dict) + + # If we can't determine the first argument, we just replace the _var_type. + if not issubclass(output, Var) or var_type is None: + return dataclasses.replace( + self, + _var_type=output, ) - return ToArrayOperation.create(self, var_type or list) - - if issubclass(output, StringVar): - return ToStringOperation.create(self, var_type or str) - - if issubclass(output, EventVar): - return ToEventVarOperation.create(self, var_type or EventSpec) - - if issubclass(output, EventChainVar): - return ToEventChainVarOperation.create(self, var_type or EventChain) - - if issubclass(output, (ObjectVar, Base)): - return ToObjectOperation.create(self, var_type or dict) - - if issubclass(output, FunctionVar): - # if fixed_type is not None and not issubclass(fixed_type, Callable): - # raise TypeError( - # f"Unsupported type {var_type} for FunctionVar. Must be Callable." - # ) - return ToFunctionOperation.create(self, var_type or Callable) - - if issubclass(output, NoneVar): - return ToNoneOperation.create(self) - - if dataclasses.is_dataclass(output): - return ToObjectOperation.create(self, var_type or dict) - - # If we can't determine the first argument, we just replace the _var_type. - if not issubclass(output, Var) or var_type is None: - return dataclasses.replace( - self, - _var_type=output, - ) # We couldn't determine the output type to be any other Var type, so we replace the _var_type. if var_type is not None: @@ -568,8 +572,11 @@ class Var(Generic[VAR_TYPE]): return self.to(EventVar, self._var_type) if issubclass(fixed_type, EventChain): return self.to(EventChainVar, self._var_type) - if issubclass(fixed_type, Base): - return self.to(ObjectVar, self._var_type) + try: + if issubclass(fixed_type, Base): + return self.to(ObjectVar, self._var_type) + except TypeError: + pass if dataclasses.is_dataclass(fixed_type): return self.to(ObjectVar, self._var_type) return self diff --git a/tests/integration/test_background_task.py b/tests/integration/test_background_task.py index b97791b0a..a445112f3 100644 --- a/tests/integration/test_background_task.py +++ b/tests/integration/test_background_task.py @@ -23,6 +23,7 @@ def BackgroundTask(): iterations: int = 10 @rx.background + @rx.event async def handle_event(self): async with self: self._task_id += 1 @@ -32,6 +33,7 @@ def BackgroundTask(): await asyncio.sleep(0.005) @rx.background + @rx.event async def handle_event_yield_only(self): async with self: self._task_id += 1 @@ -42,6 +44,7 @@ def BackgroundTask(): yield State.increment() # type: ignore await asyncio.sleep(0.005) + @rx.event def increment(self): self.counter += 1 @@ -50,13 +53,16 @@ def BackgroundTask(): async with self: self.counter += int(amount) + @rx.event def reset_counter(self): self.counter = 0 + @rx.event async def blocking_pause(self): await asyncio.sleep(0.02) @rx.background + @rx.event async def non_blocking_pause(self): await asyncio.sleep(0.02) @@ -69,12 +75,14 @@ def BackgroundTask(): await asyncio.sleep(0.005) @rx.background + @rx.event async def handle_racy_event(self): await asyncio.gather( self.racy_task(), self.racy_task(), self.racy_task(), self.racy_task() ) @rx.background + @rx.event async def nested_async_with_self(self): async with self: self.counter += 1 @@ -87,6 +95,7 @@ def BackgroundTask(): await third_state._triple_count() @rx.background + @rx.event async def yield_in_async_with_self(self): async with self: self.counter += 1 @@ -95,6 +104,7 @@ def BackgroundTask(): class OtherState(rx.State): @rx.background + @rx.event async def get_other_state(self): async with self: state = await self.get_state(State) diff --git a/tests/integration/test_call_script.py b/tests/integration/test_call_script.py index 744d83d16..a949dc451 100644 --- a/tests/integration/test_call_script.py +++ b/tests/integration/test_call_script.py @@ -54,15 +54,18 @@ def CallScript(): def call_script_callback_other_arg(self, result, other_arg): self.results.append([other_arg, result]) + @rx.event def call_scripts_inline_yield(self): yield rx.call_script("inline1()") yield rx.call_script("inline2()") yield rx.call_script("inline3()") yield rx.call_script("inline4()") + @rx.event def call_script_inline_return(self): return rx.call_script("inline2()") + @rx.event def call_scripts_inline_yield_callback(self): yield rx.call_script( "inline1()", callback=CallScriptState.call_script_callback @@ -77,11 +80,13 @@ def CallScript(): "inline4()", callback=CallScriptState.call_script_callback ) + @rx.event def call_script_inline_return_callback(self): return rx.call_script( "inline3()", callback=CallScriptState.call_script_callback ) + @rx.event def call_script_inline_return_lambda(self): return rx.call_script( "inline2()", @@ -90,21 +95,25 @@ def CallScript(): ), ) + @rx.event def get_inline_counter(self): return rx.call_script( "inline_counter", callback=CallScriptState.set_inline_counter, # type: ignore ) + @rx.event def call_scripts_external_yield(self): yield rx.call_script("external1()") yield rx.call_script("external2()") yield rx.call_script("external3()") yield rx.call_script("external4()") + @rx.event def call_script_external_return(self): return rx.call_script("external2()") + @rx.event def call_scripts_external_yield_callback(self): yield rx.call_script( "external1()", callback=CallScriptState.call_script_callback @@ -119,11 +128,13 @@ def CallScript(): "external4()", callback=CallScriptState.call_script_callback ) + @rx.event def call_script_external_return_callback(self): return rx.call_script( "external3()", callback=CallScriptState.call_script_callback ) + @rx.event def call_script_external_return_lambda(self): return rx.call_script( "external2()", @@ -132,30 +143,35 @@ def CallScript(): ), ) + @rx.event def get_external_counter(self): return rx.call_script( "external_counter", callback=CallScriptState.set_external_counter, # type: ignore ) + @rx.event def call_with_var_f_string(self): return rx.call_script( f"{rx.Var('inline_counter')} + {rx.Var('external_counter')}", callback=CallScriptState.set_last_result, # type: ignore ) + @rx.event def call_with_var_str_cast(self): return rx.call_script( f"{str(rx.Var('inline_counter'))} + {str(rx.Var('external_counter'))}", callback=CallScriptState.set_last_result, # type: ignore ) + @rx.event def call_with_var_f_string_wrapped(self): return rx.call_script( rx.Var(f"{rx.Var('inline_counter')} + {rx.Var('external_counter')}"), callback=CallScriptState.set_last_result, # type: ignore ) + @rx.event def call_with_var_str_cast_wrapped(self): return rx.call_script( rx.Var( @@ -164,6 +180,7 @@ def CallScript(): callback=CallScriptState.set_last_result, # type: ignore ) + @rx.event def reset_(self): yield rx.call_script("inline_counter = 0; external_counter = 0") self.reset() diff --git a/tests/integration/test_client_storage.py b/tests/integration/test_client_storage.py index e4a38a15b..ae66087e2 100644 --- a/tests/integration/test_client_storage.py +++ b/tests/integration/test_client_storage.py @@ -55,6 +55,7 @@ def ClientSide(): def set_l6(self, my_param: str): self.l6 = my_param + @rx.event def set_var(self): setattr(self, self.state_var, self.input_value) self.state_var = self.input_value = "" @@ -64,6 +65,7 @@ def ClientSide(): l1s: str = rx.LocalStorage() s1s: str = rx.SessionStorage() + @rx.event def set_var(self): setattr(self, self.state_var, self.input_value) self.state_var = self.input_value = "" diff --git a/tests/integration/test_component_state.py b/tests/integration/test_component_state.py index 1555577d1..f4a295d07 100644 --- a/tests/integration/test_component_state.py +++ b/tests/integration/test_component_state.py @@ -27,6 +27,7 @@ def ComponentStateApp(): _be_int: int _be_str: str = "42" + @rx.event def increment(self): self.count += 1 self._be = self.count # type: ignore @@ -57,6 +58,7 @@ def ComponentStateApp(): class _Counter(rx.State): count: int = 0 + @rx.event def increment(self): self.count += 1 diff --git a/tests/integration/test_computed_vars.py b/tests/integration/test_computed_vars.py index 28f774de5..1f585cd8b 100644 --- a/tests/integration/test_computed_vars.py +++ b/tests/integration/test_computed_vars.py @@ -58,9 +58,11 @@ def ComputedVars(): def depends_on_count3(self) -> int: return self.count + @rx.event def increment(self): self.count += 1 + @rx.event def mark_dirty(self): self._mark_dirty() diff --git a/tests/integration/test_connection_banner.py b/tests/integration/test_connection_banner.py index b83a493ce..6921444b0 100644 --- a/tests/integration/test_connection_banner.py +++ b/tests/integration/test_connection_banner.py @@ -20,6 +20,7 @@ def ConnectionBanner(): class State(rx.State): foo: int = 0 + @rx.event async def delay(self): await asyncio.sleep(5) diff --git a/tests/integration/test_deploy_url.py b/tests/integration/test_deploy_url.py index b0421cfb7..f93e9db27 100644 --- a/tests/integration/test_deploy_url.py +++ b/tests/integration/test_deploy_url.py @@ -17,6 +17,7 @@ def DeployUrlSample() -> None: import reflex as rx class State(rx.State): + @rx.event def goto_self(self): return rx.redirect(rx.config.get_config().deploy_url) # type: ignore diff --git a/tests/integration/test_event_actions.py b/tests/integration/test_event_actions.py index 499478a1c..5d278835e 100644 --- a/tests/integration/test_event_actions.py +++ b/tests/integration/test_event_actions.py @@ -24,6 +24,7 @@ def TestEventAction(): def on_click(self, ev): self.order.append(f"on_click:{ev}") + @rx.event def on_click2(self): self.order.append("on_click2") diff --git a/tests/integration/test_event_chain.py b/tests/integration/test_event_chain.py index 740fc71a3..ea2d2191c 100644 --- a/tests/integration/test_event_chain.py +++ b/tests/integration/test_event_chain.py @@ -27,45 +27,55 @@ def EventChain(): event_order: List[str] = [] interim_value: str = "" + @rx.event def event_no_args(self): self.event_order.append("event_no_args") + @rx.event def event_arg(self, arg): self.event_order.append(f"event_arg:{arg}") + @rx.event def event_arg_repr_type(self, arg): self.event_order.append(f"event_arg_repr:{arg!r}_{type(arg).__name__}") + @rx.event def event_nested_1(self): self.event_order.append("event_nested_1") yield State.event_nested_2 yield State.event_arg("nested_1") # type: ignore + @rx.event def event_nested_2(self): self.event_order.append("event_nested_2") yield State.event_nested_3 yield rx.console_log("event_nested_2") yield State.event_arg("nested_2") # type: ignore + @rx.event def event_nested_3(self): self.event_order.append("event_nested_3") yield State.event_no_args yield State.event_arg("nested_3") # type: ignore + @rx.event def on_load_return_chain(self): self.event_order.append("on_load_return_chain") return [State.event_arg(1), State.event_arg(2), State.event_arg(3)] # type: ignore + @rx.event def on_load_yield_chain(self): self.event_order.append("on_load_yield_chain") yield State.event_arg(4) # type: ignore yield State.event_arg(5) # type: ignore yield State.event_arg(6) # type: ignore + @rx.event def click_return_event(self): self.event_order.append("click_return_event") return State.event_no_args + @rx.event def click_return_events(self): self.event_order.append("click_return_events") return [ @@ -75,6 +85,7 @@ def EventChain(): State.event_arg(9), # type: ignore ] + @rx.event def click_yield_chain(self): self.event_order.append("click_yield_chain:0") yield State.event_arg(10) # type: ignore @@ -85,6 +96,7 @@ def EventChain(): yield State.event_arg(12) # type: ignore self.event_order.append("click_yield_chain:3") + @rx.event def click_yield_many_events(self): self.event_order.append("click_yield_many_events") for ix in range(MANY_EVENTS): @@ -92,33 +104,40 @@ def EventChain(): yield rx.console_log(f"many_events_{ix}") self.event_order.append("click_yield_many_events_done") + @rx.event def click_yield_nested(self): self.event_order.append("click_yield_nested") yield State.event_nested_1 yield State.event_arg("yield_nested") # type: ignore + @rx.event def redirect_return_chain(self): self.event_order.append("redirect_return_chain") yield rx.redirect("/on-load-return-chain") + @rx.event def redirect_yield_chain(self): self.event_order.append("redirect_yield_chain") yield rx.redirect("/on-load-yield-chain") + @rx.event def click_return_int_type(self): self.event_order.append("click_return_int_type") return State.event_arg_repr_type(1) # type: ignore + @rx.event def click_return_dict_type(self): self.event_order.append("click_return_dict_type") return State.event_arg_repr_type({"a": 1}) # type: ignore + @rx.event async def click_yield_interim_value_async(self): self.interim_value = "interim" yield await asyncio.sleep(0.5) self.interim_value = "final" + @rx.event def click_yield_interim_value(self): self.interim_value = "interim" yield diff --git a/tests/integration/test_login_flow.py b/tests/integration/test_login_flow.py index 7d583e433..ecaade9cf 100644 --- a/tests/integration/test_login_flow.py +++ b/tests/integration/test_login_flow.py @@ -21,9 +21,11 @@ def LoginSample(): class State(rx.State): auth_token: str = rx.LocalStorage("") + @rx.event def logout(self): self.set_auth_token("") + @rx.event def login(self): self.set_auth_token("12345") yield rx.redirect("/") diff --git a/tests/integration/test_server_side_event.py b/tests/integration/test_server_side_event.py index ee5e8dbc0..cacf6e1c5 100644 --- a/tests/integration/test_server_side_event.py +++ b/tests/integration/test_server_side_event.py @@ -14,16 +14,19 @@ def ServerSideEvent(): import reflex as rx class SSState(rx.State): + @rx.event def set_value_yield(self): yield rx.set_value("a", "") yield rx.set_value("b", "") yield rx.set_value("c", "") + @rx.event def set_value_yield_return(self): yield rx.set_value("a", "") yield rx.set_value("b", "") return rx.set_value("c", "") + @rx.event def set_value_return(self): return [ rx.set_value("a", ""), @@ -31,6 +34,7 @@ def ServerSideEvent(): rx.set_value("c", ""), ] + @rx.event def set_value_return_c(self): return rx.set_value("c", "") diff --git a/tests/units/components/base/test_script.py b/tests/units/components/base/test_script.py index be62276f2..b909b6c61 100644 --- a/tests/units/components/base/test_script.py +++ b/tests/units/components/base/test_script.py @@ -2,6 +2,7 @@ import pytest +import reflex as rx from reflex.components.base.script import Script from reflex.state import BaseState @@ -35,14 +36,17 @@ def test_script_neither(): class EvState(BaseState): """State for testing event handlers.""" + @rx.event def on_ready(self): """Empty event handler.""" pass + @rx.event def on_load(self): """Empty event handler.""" pass + @rx.event def on_error(self): """Empty event handler.""" pass diff --git a/tests/units/components/core/test_debounce.py b/tests/units/components/core/test_debounce.py index 656f26c1f..7856ee090 100644 --- a/tests/units/components/core/test_debounce.py +++ b/tests/units/components/core/test_debounce.py @@ -37,6 +37,7 @@ class S(BaseState): value: str = "" + @rx.event def on_change(self, v: str): """Dummy on_change handler. diff --git a/tests/units/components/core/test_upload.py b/tests/units/components/core/test_upload.py index 1379956e2..710baa161 100644 --- a/tests/units/components/core/test_upload.py +++ b/tests/units/components/core/test_upload.py @@ -1,3 +1,6 @@ +from typing import Any + +from reflex import event from reflex.components.core.upload import ( StyledUpload, Upload, @@ -14,7 +17,8 @@ from reflex.vars.base import LiteralVar, Var class UploadStateTest(State): """Test upload state.""" - def drop_handler(self, files): + @event + def drop_handler(self, files: Any): """Handle the drop event. Args: @@ -22,7 +26,8 @@ class UploadStateTest(State): """ pass - def not_drop_handler(self, not_files): + @event + def not_drop_handler(self, not_files: Any): """Handle the drop event without defining the files argument. Args: @@ -42,7 +47,7 @@ def test_get_upload_url(): def test__on_drop_spec(): - assert isinstance(_on_drop_spec(LiteralVar.create([])), list) + assert isinstance(_on_drop_spec(LiteralVar.create([])), tuple) def test_upload_create(): diff --git a/tests/units/components/test_component.py b/tests/units/components/test_component.py index b54ce1bbe..eda628df7 100644 --- a/tests/units/components/test_component.py +++ b/tests/units/components/test_component.py @@ -1230,6 +1230,7 @@ class EventState(rx.State): v: int = 42 + @rx.event def handler(self): """A handler that does nothing.""" @@ -1794,7 +1795,7 @@ def test_custom_component_declare_event_handlers_in_fields(): class TestComponent(Component): on_a: EventHandler[lambda e0: [e0]] on_b: EventHandler[input_event] - on_c: EventHandler[lambda e0: []] + on_c: EventHandler[empty_event] on_d: EventHandler[empty_event] on_e: EventHandler on_f: EventHandler[lambda a, b, c: [c, b, a]] @@ -2147,6 +2148,7 @@ def test_add_style_foreach(): class TriggerState(rx.State): """Test state with event handlers.""" + @rx.event def do_something(self): """Sample event handler.""" pass diff --git a/tests/units/components/test_component_future_annotations.py b/tests/units/components/test_component_future_annotations.py index 791fef7c9..44ec52c16 100644 --- a/tests/units/components/test_component_future_annotations.py +++ b/tests/units/components/test_component_future_annotations.py @@ -26,7 +26,7 @@ def test_custom_component_declare_event_handlers_in_fields(): class TestComponent(Component): on_a: EventHandler[lambda e0: [e0]] on_b: EventHandler[input_event] - on_c: EventHandler[lambda e0: []] + on_c: EventHandler[empty_event] on_d: EventHandler[empty_event] custom_component = ReferenceComponent.create() diff --git a/tests/units/test_app.py b/tests/units/test_app.py index 31acd53f5..a4ecfc5f7 100644 --- a/tests/units/test_app.py +++ b/tests/units/test_app.py @@ -900,6 +900,7 @@ class DynamicState(BaseState): """Event handler for page on_load, should trigger for all navigation events.""" self.loaded = self.loaded + 1 + @rx.event def on_counter(self): """Increment the counter var.""" self.counter = self.counter + 1 From 1d268f8b135b3d5acce8c64cd7833d3796975b16 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 14 Oct 2024 08:45:25 -0700 Subject: [PATCH 171/201] Support aria and data props (#4149) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support aria and data props * Fix busted docstring * Ignore special_attributes logic for defined props * simplify special attribute checking logic avoid special cases in the special case handling code 🙄 --- reflex/components/component.py | 14 ++++++- reflex/constants/compiler.py | 25 +++++++++++ tests/units/components/test_component.py | 53 ++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 2 deletions(-) diff --git a/reflex/components/component.py b/reflex/components/component.py index 26ea2fd3f..364353b9d 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -36,6 +36,7 @@ from reflex.constants import ( MemoizationMode, PageNames, ) +from reflex.constants.compiler import SpecialAttributes from reflex.event import ( EventChain, EventChainVar, @@ -474,6 +475,17 @@ class Component(BaseComponent, ABC): for key in kwargs["event_triggers"]: del kwargs[key] + # Place data_ and aria_ attributes into custom_attrs + special_attributes = tuple( + key + for key in kwargs + if key not in fields and SpecialAttributes.is_special(key) + ) + if special_attributes: + custom_attrs = kwargs.setdefault("custom_attrs", {}) + for key in special_attributes: + custom_attrs[format.to_kebab_case(key)] = kwargs.pop(key) + # Add style props to the component. style = kwargs.get("style", {}) if isinstance(style, List): @@ -493,8 +505,6 @@ class Component(BaseComponent, ABC): **{attr: value for attr, value in kwargs.items() if attr not in fields}, } ) - if "custom_attrs" not in kwargs: - kwargs["custom_attrs"] = {} # Convert class_name to str if it's list class_name = kwargs.get("class_name", "") diff --git a/reflex/constants/compiler.py b/reflex/constants/compiler.py index 1de3fc263..557a92092 100644 --- a/reflex/constants/compiler.py +++ b/reflex/constants/compiler.py @@ -160,3 +160,28 @@ class MemoizationMode(Base): # Whether children of this component should be memoized first. recursive: bool = True + + +class SpecialAttributes(enum.Enum): + """Special attributes for components. + + These are placed in custom_attrs and rendered as-is rather than converting + to a style prop. + """ + + DATA_UNDERSCORE = "data_" + DATA_DASH = "data-" + ARIA_UNDERSCORE = "aria_" + ARIA_DASH = "aria-" + + @classmethod + def is_special(cls, attr: str) -> bool: + """Check if the attribute is special. + + Args: + attr: the attribute to check + + Returns: + True if the attribute is special. + """ + return any(attr.startswith(value.value) for value in cls) diff --git a/tests/units/components/test_component.py b/tests/units/components/test_component.py index eda628df7..b7b721a92 100644 --- a/tests/units/components/test_component.py +++ b/tests/units/components/test_component.py @@ -2217,3 +2217,56 @@ class TriggerState(rx.State): ) def test_has_state_event_triggers(component, output): assert component._has_stateful_event_triggers() == output + + +class SpecialComponent(Box): + """A special component with custom attributes.""" + + data_prop: Var[str] + aria_prop: Var[str] + + +@pytest.mark.parametrize( + ("component_kwargs", "exp_custom_attrs", "exp_style"), + [ + ( + {"data_test": "test", "aria_test": "test"}, + {"data-test": "test", "aria-test": "test"}, + {}, + ), + ( + {"data-test": "test", "aria-test": "test"}, + {"data-test": "test", "aria-test": "test"}, + {}, + ), + ( + {"custom_attrs": {"data-existing": "test"}, "data_new": "test"}, + {"data-existing": "test", "data-new": "test"}, + {}, + ), + ( + {"data_test": "test", "data_prop": "prop"}, + {"data-test": "test"}, + {}, + ), + ( + {"aria_test": "test", "aria_prop": "prop"}, + {"aria-test": "test"}, + {}, + ), + ], +) +def test_special_props(component_kwargs, exp_custom_attrs, exp_style): + """Test that data_ and aria_ special props are correctly added to the component. + + Args: + component_kwargs: The component kwargs. + exp_custom_attrs: The expected custom attributes. + exp_style: The expected style. + """ + component = SpecialComponent.create(**component_kwargs) + assert component.custom_attrs == exp_custom_attrs + assert component.style == exp_style + for prop in SpecialComponent.get_props(): + if prop in component_kwargs: + assert getattr(component, prop)._var_value == component_kwargs[prop] From d6797a1f1d764a74bc9283f753a9b0d5702cd9b9 Mon Sep 17 00:00:00 2001 From: Manoj Bhat <99398172+Manojvbhat@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:17:38 +0530 Subject: [PATCH 172/201] Change the defalut direction of radio group (#4070). (#4146) - The default direction of radio groups is column. - Since most use cases are horizontal, change the default direction from column to row. --- reflex/components/radix/themes/components/radio_group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index 95d33033b..a55ca3a41 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -84,7 +84,7 @@ class HighLevelRadioGroup(RadixThemesComponent): items: Var[List[str]] # The direction of the radio group. - direction: Var[LiteralFlexDirection] = LiteralVar.create("column") + direction: Var[LiteralFlexDirection] = LiteralVar.create("row") # The gap between the items of the radio group. spacing: Var[LiteralSpacing] = LiteralVar.create("2") @@ -137,7 +137,7 @@ class HighLevelRadioGroup(RadixThemesComponent): Raises: TypeError: If the type of items is invalid. """ - direction = props.pop("direction", "column") + direction = props.pop("direction", "row") spacing = props.pop("spacing", "2") size = props.pop("size", "2") variant = props.pop("variant", "classic") From 3a140259991a5721dbbdc9852d568e4c0e3c1f64 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 14 Oct 2024 15:36:30 -0700 Subject: [PATCH 173/201] pin AppHarness tests to ubuntu-22.04 runner (#4173) --- .github/workflows/check_node_latest.yml | 2 +- .github/workflows/integration_app_harness.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_node_latest.yml b/.github/workflows/check_node_latest.yml index 749b94efa..5910fa9ed 100644 --- a/.github/workflows/check_node_latest.yml +++ b/.github/workflows/check_node_latest.yml @@ -14,7 +14,7 @@ env: jobs: check_latest_node: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: python-version: ['3.12'] diff --git a/.github/workflows/integration_app_harness.yml b/.github/workflows/integration_app_harness.yml index c11e6e01c..9644e0a19 100644 --- a/.github/workflows/integration_app_harness.yml +++ b/.github/workflows/integration_app_harness.yml @@ -24,7 +24,7 @@ jobs: matrix: state_manager: ['redis', 'memory'] python-version: ['3.11.5', '3.12.0'] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 services: # Label used to access the service container redis: From 5b802c2c9e4827e7fa0a7957f4569634ad9a479c Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 15 Oct 2024 10:54:14 -0700 Subject: [PATCH 174/201] bump version to 0.6.4dev1 for further development (#4178) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 17ee4d132..ae636a1c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "reflex" -version = "0.6.3dev1" +version = "0.6.4dev1" description = "Web apps in pure Python." license = "Apache-2.0" authors = [ From 2018be8e085fe59863bcb7ffa397cedb6f531689 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 15 Oct 2024 12:21:03 -0700 Subject: [PATCH 175/201] only treat dict object vars as key value mapping (#4177) --- reflex/style.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reflex/style.py b/reflex/style.py index 4ebd42ac3..8e24e9b6b 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -10,6 +10,7 @@ from reflex.event import EventChain, EventHandler from reflex.utils import format from reflex.utils.exceptions import ReflexError from reflex.utils.imports import ImportVar +from reflex.utils.types import get_origin from reflex.vars import VarData from reflex.vars.base import CallableVar, LiteralVar, Var from reflex.vars.function import FunctionVar @@ -196,6 +197,10 @@ def convert( isinstance(value, Breakpoints) and all(not isinstance(v, dict) for v in value.values()) ) + or ( + isinstance(value, ObjectVar) + and not issubclass(get_origin(value._var_type) or value._var_type, dict) + ) else (key,) ) From 7565ae15efa83ebe204eaacdad13a613ceebc36f Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 16 Oct 2024 11:31:05 -0700 Subject: [PATCH 176/201] disk is memory is disk (#4185) --- reflex/state.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 7b338b4d6..0d6eed0ed 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -2566,9 +2566,9 @@ class StateManager(Base, ABC): The state manager (either disk, memory or redis). """ config = get_config() - if config.state_manager_mode == constants.StateManagerMode.DISK: - return StateManagerMemory(state=state) if config.state_manager_mode == constants.StateManagerMode.MEMORY: + return StateManagerMemory(state=state) + if config.state_manager_mode == constants.StateManagerMode.DISK: return StateManagerDisk(state=state) if config.state_manager_mode == constants.StateManagerMode.REDIS: redis = prerequisites.get_redis() From 4422515f4baca8d1a6ef1822f889792cd5cf2f85 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Wed, 16 Oct 2024 11:35:09 -0700 Subject: [PATCH 177/201] LiteralEventChainVar becomes an ArgsFunctionOperation (#4174) * LiteralEventChainVar becomes an ArgsFunctionOperation Instead of using the ArgsFunctionOperation to create the string representation of the _js_expr, make the identity of the var an ArgsFunctionOperation so the _args_names and _return_expr remain accessible. Rely on the default behavior of ArgsFunctionOperation to create the _cached_var_name / _js_expr value. This allows the compat shim in `format_event_chain` to remain functional, as it does special handling for ArgsFunctionOperation to retain the previous behavior of that function (this was a regression introduced in 0.6.2). * _var_type is EventChain; fix parent class order * Re-fix LiteralEventChainVar inheritence list w/ comment * [ENG-3942] LiteralEventVar becomes VarCallOperation instead of using `.call` when constructing the `_js_expr`, have the identity of a LiteralEventVar as a VarCallOperation to take advantage of the _var_data carrying. * add event overlords * EventCallback descriptor always returns EventSpec from class Relax actual `__get__` definition to support the multitude of overloads * test case for event related vars carrying _var_data --------- Co-authored-by: Khaleel Al-Adhami --- reflex/event.py | 173 +++++++++++++++++++++++--------------- tests/units/test_event.py | 38 ++++++++- 2 files changed, 138 insertions(+), 73 deletions(-) diff --git a/reflex/event.py b/reflex/event.py index 04879add3..4b0bf96e2 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -22,6 +22,7 @@ from typing import ( TypeVar, Union, get_type_hints, + overload, ) from typing_extensions import ParamSpec, get_args, get_origin @@ -32,14 +33,17 @@ from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.types import ArgsSpec, GenericType from reflex.vars import VarData from reflex.vars.base import ( - CachedVarOperation, LiteralNoneVar, LiteralVar, ToOperation, Var, - cached_property_no_lock, ) -from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar, FunctionVar +from reflex.vars.function import ( + ArgsFunctionOperation, + FunctionStringVar, + FunctionVar, + VarOperationCall, +) from reflex.vars.object import ObjectVar try: @@ -1258,7 +1262,7 @@ class EventVar(ObjectVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class LiteralEventVar(CachedVarOperation, LiteralVar, EventVar): +class LiteralEventVar(VarOperationCall, LiteralVar, EventVar): """A literal event var.""" _var_value: EventSpec = dataclasses.field(default=None) # type: ignore @@ -1271,35 +1275,6 @@ class LiteralEventVar(CachedVarOperation, LiteralVar, EventVar): """ return hash((self.__class__.__name__, self._js_expr)) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str( - FunctionStringVar("Event").call( - # event handler name - ".".join( - filter( - None, - format.get_event_handler_parts(self._var_value.handler), - ) - ), - # event handler args - {str(name): value for name, value in self._var_value.args}, - # event actions - self._var_value.event_actions, - # client handler name - *( - [self._var_value.client_handler_name] - if self._var_value.client_handler_name - else [] - ), - ) - ) - @classmethod def create( cls, @@ -1320,6 +1295,22 @@ class LiteralEventVar(CachedVarOperation, LiteralVar, EventVar): _var_type=EventSpec, _var_data=_var_data, _var_value=value, + _func=FunctionStringVar("Event"), + _args=( + # event handler name + ".".join( + filter( + None, + format.get_event_handler_parts(value.handler), + ) + ), + # event handler args + {str(name): value for name, value in value.args}, + # event actions + value.event_actions, + # client handler name + *([value.client_handler_name] if value.client_handler_name else []), + ), ) @@ -1332,7 +1323,10 @@ class EventChainVar(FunctionVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class LiteralEventChainVar(CachedVarOperation, LiteralVar, EventChainVar): +# Note: LiteralVar is second in the inheritance list allowing it act like a +# CachedVarOperation (ArgsFunctionOperation) and get the _js_expr from the +# _cached_var_name property. +class LiteralEventChainVar(ArgsFunctionOperation, LiteralVar, EventChainVar): """A literal event chain var.""" _var_value: EventChain = dataclasses.field(default=None) # type: ignore @@ -1345,41 +1339,6 @@ class LiteralEventChainVar(CachedVarOperation, LiteralVar, EventChainVar): """ return hash((self.__class__.__name__, self._js_expr)) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - sig = inspect.signature(self._var_value.args_spec) # type: ignore - if sig.parameters: - arg_def = tuple((f"_{p}" for p in sig.parameters)) - arg_def_expr = LiteralVar.create([Var(_js_expr=arg) for arg in arg_def]) - else: - # add a default argument for addEvents if none were specified in value.args_spec - # used to trigger the preventDefault() on the event. - arg_def = ("...args",) - arg_def_expr = Var(_js_expr="args") - - if self._var_value.invocation is None: - invocation = FunctionStringVar.create("addEvents") - else: - invocation = self._var_value.invocation - - return str( - ArgsFunctionOperation.create( - arg_def, - invocation.call( - LiteralVar.create( - [LiteralVar.create(event) for event in self._var_value.events] - ), - arg_def_expr, - self._var_value.event_actions, - ), - ) - ) - @classmethod def create( cls, @@ -1395,10 +1354,31 @@ class LiteralEventChainVar(CachedVarOperation, LiteralVar, EventChainVar): Returns: The created LiteralEventChainVar instance. """ + sig = inspect.signature(value.args_spec) # type: ignore + if sig.parameters: + arg_def = tuple((f"_{p}" for p in sig.parameters)) + arg_def_expr = LiteralVar.create([Var(_js_expr=arg) for arg in arg_def]) + else: + # add a default argument for addEvents if none were specified in value.args_spec + # used to trigger the preventDefault() on the event. + arg_def = ("...args",) + arg_def_expr = Var(_js_expr="args") + + if value.invocation is None: + invocation = FunctionStringVar.create("addEvents") + else: + invocation = value.invocation + return cls( _js_expr="", _var_type=EventChain, _var_data=_var_data, + _args_names=arg_def, + _return_expr=invocation.call( + LiteralVar.create([LiteralVar.create(event) for event in value.events]), + arg_def_expr, + value.event_actions, + ), _var_value=value, ) @@ -1437,6 +1417,11 @@ EventType = Union[IndividualEventType[G], List[IndividualEventType[G]]] P = ParamSpec("P") T = TypeVar("T") +V = TypeVar("V") +V2 = TypeVar("V2") +V3 = TypeVar("V3") +V4 = TypeVar("V4") +V5 = TypeVar("V5") if sys.version_info >= (3, 10): from typing import Concatenate @@ -1452,7 +1437,55 @@ if sys.version_info >= (3, 10): """ self.func = func - def __get__(self, instance, owner) -> Callable[P, T]: + @overload + def __get__( + self: EventCallback[[V], T], instance: None, owner + ) -> Callable[[Union[Var[V], V]], EventSpec]: ... + + @overload + def __get__( + self: EventCallback[[V, V2], T], instance: None, owner + ) -> Callable[[Union[Var[V], V], Union[Var[V2], V2]], EventSpec]: ... + + @overload + def __get__( + self: EventCallback[[V, V2, V3], T], instance: None, owner + ) -> Callable[ + [Union[Var[V], V], Union[Var[V2], V2], Union[Var[V3], V3]], + EventSpec, + ]: ... + + @overload + def __get__( + self: EventCallback[[V, V2, V3, V4], T], instance: None, owner + ) -> Callable[ + [ + Union[Var[V], V], + Union[Var[V2], V2], + Union[Var[V3], V3], + Union[Var[V4], V4], + ], + EventSpec, + ]: ... + + @overload + def __get__( + self: EventCallback[[V, V2, V3, V4, V5], T], instance: None, owner + ) -> Callable[ + [ + Union[Var[V], V], + Union[Var[V2], V2], + Union[Var[V3], V3], + Union[Var[V4], V4], + Union[Var[V5], V5], + ], + EventSpec, + ]: ... + + @overload + def __get__(self, instance, owner) -> Callable[P, T]: ... + + def __get__(self, instance, owner) -> Callable: """Get the function with the instance bound to it. Args: diff --git a/tests/units/test_event.py b/tests/units/test_event.py index 3996a6101..d7b7cf7a2 100644 --- a/tests/units/test_event.py +++ b/tests/units/test_event.py @@ -2,11 +2,18 @@ from typing import List import pytest -from reflex import event -from reflex.event import Event, EventHandler, EventSpec, call_event_handler, fix_events +from reflex.event import ( + Event, + EventChain, + EventHandler, + EventSpec, + call_event_handler, + event, + fix_events, +) from reflex.state import BaseState from reflex.utils import format -from reflex.vars.base import LiteralVar, Var +from reflex.vars.base import Field, LiteralVar, Var, field def make_var(value) -> Var: @@ -388,3 +395,28 @@ def test_event_actions_on_state(): assert sp_handler.event_actions == {"stopPropagation": True} # should NOT affect other references to the handler assert not handler.event_actions + + +def test_event_var_data(): + class S(BaseState): + x: Field[int] = field(0) + + @event + def s(self, value: int): + pass + + # Handler doesn't have any _var_data because it's just a str + handler_var = Var.create(S.s) + assert handler_var._get_all_var_data() is None + + # Ensure spec carries _var_data + spec_var = Var.create(S.s(S.x)) + assert spec_var._get_all_var_data() == S.x._get_all_var_data() + + # Needed to instantiate the EventChain + def _args_spec(value: Var[int]) -> tuple[Var[int]]: + return (value,) + + # Ensure chain carries _var_data + chain_var = Var.create(EventChain(events=[S.s(S.x)], args_spec=_args_spec)) + assert chain_var._get_all_var_data() == S.x._get_all_var_data() From da9d7eabddfeda76291f0a1e425b62250e2528e5 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Wed, 16 Oct 2024 11:35:27 -0700 Subject: [PATCH 178/201] Arbitrary arg access two levels deep for untyped handler (#4180) * Arbitrary arg access two levels deep for untyped handler Provide drop-in compatibility with existing component wrapping code that was accessing attributes on the default handler arg type. * py3.9 compat --- reflex/event.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reflex/event.py b/reflex/event.py index 4b0bf96e2..58053408d 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1045,7 +1045,8 @@ def resolve_annotation(annotations: dict[str, Any], arg_name: str): deprecation_version="0.6.3", removal_version="0.7.0", ) - return JavascriptInputEvent + # Allow arbitrary attribute access two levels deep until removed. + return Dict[str, dict] return annotation From 13c909434386f00a3db4669b496da3980b0d4b48 Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Wed, 16 Oct 2024 11:35:56 -0700 Subject: [PATCH 179/201] Remove demo command (#4176) * Remove demo command * Format --------- Co-authored-by: Alek Petuskey --- reflex/reflex.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/reflex/reflex.py b/reflex/reflex.py index 4608ed171..bd6904d06 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -4,7 +4,6 @@ from __future__ import annotations import atexit import os -import webbrowser from pathlib import Path from typing import List, Optional @@ -586,18 +585,6 @@ def deploy( ) -@cli.command() -def demo( - frontend_port: str = typer.Option( - "3001", help="Specify a different frontend port." - ), - backend_port: str = typer.Option("8001", help="Specify a different backend port."), -): - """Run the demo app.""" - # Open the demo app in a terminal. - webbrowser.open("https://demo.reflex.run") - - cli.add_typer(db_cli, name="db", help="Subcommands for managing the database schema.") cli.add_typer(script_cli, name="script", help="Subcommands running helper scripts.") cli.add_typer( From d8ea2fc79543d4abaeec09839f83a3e4219415ac Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 16 Oct 2024 13:39:49 -0700 Subject: [PATCH 180/201] fix pyi for untyped event handlers (#4186) * fix pyi for untyped event handlers * no more empty lambdas --- reflex/components/base/error_boundary.pyi | 2 +- reflex/components/component.py | 35 +++++++------- reflex/components/datadisplay/dataeditor.pyi | 16 +++---- reflex/components/react_player/audio.pyi | 2 +- .../components/react_player/react_player.pyi | 2 +- reflex/components/react_player/video.pyi | 2 +- reflex/components/recharts/cartesian.py | 6 +-- reflex/components/recharts/charts.py | 22 ++++----- reflex/components/recharts/polar.py | 48 +++++++++---------- reflex/components/suneditor/editor.pyi | 20 ++++---- reflex/event.py | 10 ++-- reflex/utils/pyi_generator.py | 2 +- 12 files changed, 84 insertions(+), 83 deletions(-) diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index 65109b0fe..aaf5584e4 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -31,7 +31,7 @@ class ErrorBoundary(Component): on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, - on_error: Optional[EventType[[]]] = None, + on_error: Optional[EventType] = None, on_focus: Optional[EventType[[]]] = None, on_mount: Optional[EventType[[]]] = None, on_mouse_down: Optional[EventType[[]]] = None, diff --git a/reflex/components/component.py b/reflex/components/component.py index 364353b9d..a0d9c93b0 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -45,6 +45,7 @@ from reflex.event import ( EventVar, call_event_fn, call_event_handler, + empty_event, get_handler_args, ) from reflex.style import Style, format_as_emotion @@ -623,21 +624,21 @@ class Component(BaseComponent, ABC): """ default_triggers = { - EventTriggers.ON_FOCUS: lambda: [], - EventTriggers.ON_BLUR: lambda: [], - EventTriggers.ON_CLICK: lambda: [], - EventTriggers.ON_CONTEXT_MENU: lambda: [], - EventTriggers.ON_DOUBLE_CLICK: lambda: [], - EventTriggers.ON_MOUSE_DOWN: lambda: [], - EventTriggers.ON_MOUSE_ENTER: lambda: [], - EventTriggers.ON_MOUSE_LEAVE: lambda: [], - EventTriggers.ON_MOUSE_MOVE: lambda: [], - EventTriggers.ON_MOUSE_OUT: lambda: [], - EventTriggers.ON_MOUSE_OVER: lambda: [], - EventTriggers.ON_MOUSE_UP: lambda: [], - EventTriggers.ON_SCROLL: lambda: [], - EventTriggers.ON_MOUNT: lambda: [], - EventTriggers.ON_UNMOUNT: lambda: [], + EventTriggers.ON_FOCUS: empty_event, + EventTriggers.ON_BLUR: empty_event, + EventTriggers.ON_CLICK: empty_event, + EventTriggers.ON_CONTEXT_MENU: empty_event, + EventTriggers.ON_DOUBLE_CLICK: empty_event, + EventTriggers.ON_MOUSE_DOWN: empty_event, + EventTriggers.ON_MOUSE_ENTER: empty_event, + EventTriggers.ON_MOUSE_LEAVE: empty_event, + EventTriggers.ON_MOUSE_MOVE: empty_event, + EventTriggers.ON_MOUSE_OUT: empty_event, + EventTriggers.ON_MOUSE_OVER: empty_event, + EventTriggers.ON_MOUSE_UP: empty_event, + EventTriggers.ON_SCROLL: empty_event, + EventTriggers.ON_MOUNT: empty_event, + EventTriggers.ON_UNMOUNT: empty_event, } # Look for component specific triggers, @@ -648,7 +649,7 @@ class Component(BaseComponent, ABC): annotation = field.annotation if (metadata := getattr(annotation, "__metadata__", None)) is not None: args_spec = metadata[0] - default_triggers[field.name] = args_spec or (lambda: []) + default_triggers[field.name] = args_spec or (empty_event) # type: ignore return default_triggers def __repr__(self) -> str: @@ -1705,7 +1706,7 @@ class CustomComponent(Component): value = self._create_event_chain( value=value, args_spec=event_triggers_in_component_declaration.get( - key, lambda: [] + key, empty_event ), ) self.props[format.to_camel_case(key)] = value diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index b3a9ce2b3..1b8fed287 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -139,20 +139,20 @@ class DataEditor(NoSSRComponent): on_cell_activated: Optional[EventType] = None, on_cell_clicked: Optional[EventType] = None, on_cell_context_menu: Optional[EventType] = None, - on_cell_edited: Optional[EventType[[]]] = None, + on_cell_edited: Optional[EventType] = None, on_click: Optional[EventType[[]]] = None, - on_column_resize: Optional[EventType[[]]] = None, + on_column_resize: Optional[EventType] = None, on_context_menu: Optional[EventType[[]]] = None, - on_delete: Optional[EventType[[]]] = None, + on_delete: Optional[EventType] = None, on_double_click: Optional[EventType[[]]] = None, - on_finished_editing: Optional[EventType[[]]] = None, + on_finished_editing: Optional[EventType] = None, on_focus: Optional[EventType[[]]] = None, - on_group_header_clicked: Optional[EventType[[]]] = None, - on_group_header_context_menu: Optional[EventType[[]]] = None, - on_group_header_renamed: Optional[EventType[[]]] = None, + on_group_header_clicked: Optional[EventType] = None, + on_group_header_context_menu: Optional[EventType] = None, + on_group_header_renamed: Optional[EventType] = None, on_header_clicked: Optional[EventType] = None, on_header_context_menu: Optional[EventType] = None, - on_header_menu_click: Optional[EventType[[]]] = None, + on_header_menu_click: Optional[EventType] = None, on_item_hovered: Optional[EventType] = None, on_mount: Optional[EventType[[]]] = None, on_mouse_down: Optional[EventType[[]]] = None, diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index 4b566d898..d1f29f508 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -58,7 +58,7 @@ class Audio(ReactPlayer): on_play: Optional[EventType[[]]] = None, on_playback_quality_change: Optional[EventType[[]]] = None, on_playback_rate_change: Optional[EventType[[]]] = None, - on_progress: Optional[EventType[[]]] = None, + on_progress: Optional[EventType] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_seek: Optional[EventType] = None, diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 1977eaa00..940b09e51 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -56,7 +56,7 @@ class ReactPlayer(NoSSRComponent): on_play: Optional[EventType[[]]] = None, on_playback_quality_change: Optional[EventType[[]]] = None, on_playback_rate_change: Optional[EventType[[]]] = None, - on_progress: Optional[EventType[[]]] = None, + on_progress: Optional[EventType] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_seek: Optional[EventType] = None, diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index 6e4047d06..a50ccf71f 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -58,7 +58,7 @@ class Video(ReactPlayer): on_play: Optional[EventType[[]]] = None, on_playback_quality_change: Optional[EventType[[]]] = None, on_playback_rate_change: Optional[EventType[[]]] = None, - on_progress: Optional[EventType[[]]] = None, + on_progress: Optional[EventType] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_seek: Optional[EventType] = None, diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 153d3fb2a..865b50a32 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -252,7 +252,7 @@ class Brush(Recharts): A dict mapping the event trigger to the var that is passed to the handler. """ return { - EventTriggers.ON_CHANGE: lambda: [], + EventTriggers.ON_CHANGE: empty_event, } @@ -293,10 +293,10 @@ class Cartesian(Recharts): name: Var[Union[str, int]] # The customized event handler of animation start - on_animation_start: EventHandler[lambda: []] + on_animation_start: EventHandler[empty_event] # The customized event handler of animation end - on_animation_end: EventHandler[lambda: []] + on_animation_end: EventHandler[empty_event] # The customized event handler of click on the component in this group on_click: EventHandler[empty_event] diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index d4785f6c4..d7e07b2d8 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -330,9 +330,9 @@ class RadarChart(ChartBase): A dict mapping the event trigger to the var that is passed to the handler. """ return { - EventTriggers.ON_CLICK: lambda: [], - EventTriggers.ON_MOUSE_ENTER: lambda: [], - EventTriggers.ON_MOUSE_LEAVE: lambda: [], + EventTriggers.ON_CLICK: empty_event, + EventTriggers.ON_MOUSE_ENTER: empty_event, + EventTriggers.ON_MOUSE_LEAVE: empty_event, } @@ -419,14 +419,14 @@ class ScatterChart(ChartBase): A dict mapping the event trigger to the var that is passed to the handler. """ return { - EventTriggers.ON_CLICK: lambda: [], - EventTriggers.ON_MOUSE_DOWN: lambda: [], - EventTriggers.ON_MOUSE_UP: lambda: [], - EventTriggers.ON_MOUSE_MOVE: lambda: [], - EventTriggers.ON_MOUSE_OVER: lambda: [], - EventTriggers.ON_MOUSE_OUT: lambda: [], - EventTriggers.ON_MOUSE_ENTER: lambda: [], - EventTriggers.ON_MOUSE_LEAVE: lambda: [], + EventTriggers.ON_CLICK: empty_event, + EventTriggers.ON_MOUSE_DOWN: empty_event, + EventTriggers.ON_MOUSE_UP: empty_event, + EventTriggers.ON_MOUSE_MOVE: empty_event, + EventTriggers.ON_MOUSE_OVER: empty_event, + EventTriggers.ON_MOUSE_OUT: empty_event, + EventTriggers.ON_MOUSE_ENTER: empty_event, + EventTriggers.ON_MOUSE_LEAVE: empty_event, } diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index bcbd5abd3..ccb96f180 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -103,14 +103,14 @@ class Pie(Recharts): A dict mapping the event trigger to the var that is passed to the handler. """ return { - EventTriggers.ON_ANIMATION_START: lambda: [], - EventTriggers.ON_ANIMATION_END: lambda: [], - EventTriggers.ON_CLICK: lambda: [], - EventTriggers.ON_MOUSE_MOVE: lambda: [], - EventTriggers.ON_MOUSE_OVER: lambda: [], - EventTriggers.ON_MOUSE_OUT: lambda: [], - EventTriggers.ON_MOUSE_ENTER: lambda: [], - EventTriggers.ON_MOUSE_LEAVE: lambda: [], + EventTriggers.ON_ANIMATION_START: empty_event, + EventTriggers.ON_ANIMATION_END: empty_event, + EventTriggers.ON_CLICK: empty_event, + EventTriggers.ON_MOUSE_MOVE: empty_event, + EventTriggers.ON_MOUSE_OVER: empty_event, + EventTriggers.ON_MOUSE_OUT: empty_event, + EventTriggers.ON_MOUSE_ENTER: empty_event, + EventTriggers.ON_MOUSE_LEAVE: empty_event, } @@ -167,8 +167,8 @@ class Radar(Recharts): A dict mapping the event trigger to the var that is passed to the handler. """ return { - EventTriggers.ON_ANIMATION_START: lambda: [], - EventTriggers.ON_ANIMATION_END: lambda: [], + EventTriggers.ON_ANIMATION_START: empty_event, + EventTriggers.ON_ANIMATION_END: empty_event, } @@ -219,14 +219,14 @@ class RadialBar(Recharts): A dict mapping the event trigger to the var that is passed to the handler. """ return { - EventTriggers.ON_CLICK: lambda: [], - EventTriggers.ON_MOUSE_MOVE: lambda: [], - EventTriggers.ON_MOUSE_OVER: lambda: [], - EventTriggers.ON_MOUSE_OUT: lambda: [], - EventTriggers.ON_MOUSE_ENTER: lambda: [], - EventTriggers.ON_MOUSE_LEAVE: lambda: [], - EventTriggers.ON_ANIMATION_START: lambda: [], - EventTriggers.ON_ANIMATION_END: lambda: [], + EventTriggers.ON_CLICK: empty_event, + EventTriggers.ON_MOUSE_MOVE: empty_event, + EventTriggers.ON_MOUSE_OVER: empty_event, + EventTriggers.ON_MOUSE_OUT: empty_event, + EventTriggers.ON_MOUSE_ENTER: empty_event, + EventTriggers.ON_MOUSE_LEAVE: empty_event, + EventTriggers.ON_ANIMATION_START: empty_event, + EventTriggers.ON_ANIMATION_END: empty_event, } @@ -392,12 +392,12 @@ class PolarRadiusAxis(Recharts): A dict mapping the event trigger to the var that is passed to the handler. """ return { - EventTriggers.ON_CLICK: lambda: [], - EventTriggers.ON_MOUSE_MOVE: lambda: [], - EventTriggers.ON_MOUSE_OVER: lambda: [], - EventTriggers.ON_MOUSE_OUT: lambda: [], - EventTriggers.ON_MOUSE_ENTER: lambda: [], - EventTriggers.ON_MOUSE_LEAVE: lambda: [], + EventTriggers.ON_CLICK: empty_event, + EventTriggers.ON_MOUSE_MOVE: empty_event, + EventTriggers.ON_MOUSE_OVER: empty_event, + EventTriggers.ON_MOUSE_OUT: empty_event, + EventTriggers.ON_MOUSE_ENTER: empty_event, + EventTriggers.ON_MOUSE_LEAVE: empty_event, } diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index bcc0b64ac..f7149a02c 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -122,16 +122,16 @@ class Editor(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType[[]]] = None, + on_blur: Optional[EventType] = None, + on_change: Optional[EventType] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, - on_copy: Optional[EventType[[]]] = None, - on_cut: Optional[EventType[[]]] = None, + on_copy: Optional[EventType] = None, + on_cut: Optional[EventType] = None, on_double_click: Optional[EventType[[]]] = None, on_focus: Optional[EventType[[]]] = None, - on_input: Optional[EventType[[]]] = None, - on_load: Optional[EventType[[]]] = None, + on_input: Optional[EventType] = None, + on_load: Optional[EventType] = None, on_mount: Optional[EventType[[]]] = None, on_mouse_down: Optional[EventType[[]]] = None, on_mouse_enter: Optional[EventType[[]]] = None, @@ -140,12 +140,12 @@ class Editor(NoSSRComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_paste: Optional[EventType[[]]] = None, - on_resize_editor: Optional[EventType[[]]] = None, + on_paste: Optional[EventType] = None, + on_resize_editor: Optional[EventType] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, - toggle_code_view: Optional[EventType[[]]] = None, - toggle_full_screen: Optional[EventType[[]]] = None, + toggle_code_view: Optional[EventType] = None, + toggle_full_screen: Optional[EventType] = None, **props, ) -> "Editor": """Create an instance of Editor. No children allowed. diff --git a/reflex/event.py b/reflex/event.py index 58053408d..f93bc63d2 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -399,11 +399,6 @@ class EventChain(EventActionsMixin): invocation: Optional[Var] = dataclasses.field(default=None) -# These chains can be used for their side effects when no other events are desired. -stop_propagation = EventChain(events=[], args_spec=lambda: []).stop_propagation -prevent_default = EventChain(events=[], args_spec=lambda: []).prevent_default - - @dataclasses.dataclass( init=True, frozen=True, @@ -467,6 +462,11 @@ def empty_event() -> Tuple[()]: return tuple() # type: ignore +# These chains can be used for their side effects when no other events are desired. +stop_propagation = EventChain(events=[], args_spec=empty_event).stop_propagation +prevent_default = EventChain(events=[], args_spec=empty_event).prevent_default + + T = TypeVar("T") diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index 1df8e6fa0..fd76576b9 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -429,7 +429,7 @@ def _generate_component_create_functiondef( def figure_out_return_type(annotation: Any): if inspect.isclass(annotation) and issubclass(annotation, inspect._empty): - return ast.Name(id="Optional[EventType[[]]]") + return ast.Name(id="Optional[EventType]") if isinstance(annotation, str) and annotation.startswith("Tuple["): inside_of_tuple = annotation.removeprefix("Tuple[").removesuffix("]") From 35810fe1bd3935e4df1f8246b98163a6517acbd2 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 16 Oct 2024 15:20:51 -0700 Subject: [PATCH 181/201] use larger or equal for node version check (#4189) --- reflex/utils/prerequisites.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 34ed5f53f..44d1f6acc 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -146,14 +146,9 @@ def check_node_version() -> bool: Whether the version of Node.js is valid. """ current_version = get_node_version() - if current_version: - # Compare the version numbers - return ( - current_version >= version.parse(constants.Node.MIN_VERSION) - if constants.IS_WINDOWS or path_ops.use_system_node() - else current_version == version.parse(constants.Node.VERSION) - ) - return False + return current_version is not None and current_version >= version.parse( + constants.Node.MIN_VERSION + ) def get_node_version() -> version.Version | None: From 101fb1b5405e2aa20e91efa21ecb77068e7e3fd4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 16 Oct 2024 15:21:47 -0700 Subject: [PATCH 182/201] check for none before returning which (#4187) --- reflex/utils/path_ops.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index f597e0075..f795e1aa4 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -185,7 +185,8 @@ def get_node_path() -> str | None: """ node_path = Path(constants.Node.PATH) if use_system_node() or not node_path.exists(): - return str(which("node")) + system_node_path = which("node") + return str(system_node_path) if system_node_path else None return str(node_path) @@ -197,7 +198,8 @@ def get_npm_path() -> str | None: """ npm_path = Path(constants.Node.NPM_PATH) if use_system_node() or not npm_path.exists(): - return str(which("npm")) + system_npm_path = which("npm") + return str(system_npm_path) if system_npm_path else None return str(npm_path) From e14c79d57d8f96b62a1da122f706d6a601a3fd62 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 17 Oct 2024 16:16:24 -0700 Subject: [PATCH 183/201] [ENG-3954] Treat ArrayVar.foreach index as int (#4193) * [ENG-3954] Treat ArrayVar.foreach index as int * foreach: convert return value to a Var When the value returned from the foreach is not hashable (mutable type), then it will raise an exception if it is not first converted to a LiteralVar. --- reflex/vars/sequence.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 9b65507b7..e3b422f35 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -1155,7 +1155,7 @@ class ArrayVar(Var[ARRAY_VAR_TYPE]): function_var = ArgsFunctionOperation.create(tuple(), return_value) else: # generic number var - number_var = Var("").to(NumberVar) + number_var = Var("").to(NumberVar, int) first_arg_type = self[number_var]._var_type @@ -1167,7 +1167,10 @@ class ArrayVar(Var[ARRAY_VAR_TYPE]): _var_type=first_arg_type, ).guess_type() - function_var = ArgsFunctionOperation.create((arg_name,), fn(first_arg)) + function_var = ArgsFunctionOperation.create( + (arg_name,), + Var.create(fn(first_arg)), + ) return map_array_operation(self, function_var) From 330c280c7857a2cf5ac09fa8520f5510514dfa13 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 17 Oct 2024 16:54:36 -0700 Subject: [PATCH 184/201] When REDIS_URL is set, use redis, regardless of config preference. (#4196) We might change this down the road, but we don't want to introduce a breaking change at this time. --- reflex/state.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reflex/state.py b/reflex/state.py index 0d6eed0ed..9740bddaa 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -2566,6 +2566,8 @@ class StateManager(Base, ABC): The state manager (either disk, memory or redis). """ config = get_config() + if prerequisites.parse_redis_url() is not None: + config.state_manager_mode = constants.StateManagerMode.REDIS if config.state_manager_mode == constants.StateManagerMode.MEMORY: return StateManagerMemory(state=state) if config.state_manager_mode == constants.StateManagerMode.DISK: From 6cb87a812f5dbac7745ec2f1dae4373980206743 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 17 Oct 2024 19:21:43 -0700 Subject: [PATCH 185/201] Fix runtime error on python 3.11.0 (#4197) All generic types present in a Union must be parametrized on 3.11.0 if any other generic types in the union are parametrized. This appears to be a bug in 3.11.0, as the behavior is not observed in 3.11.1 or 3.10; fixing here as this is technically more correct anyway and avoids a crash. --- reflex/event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/event.py b/reflex/event.py index f93bc63d2..8291e3465 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1412,7 +1412,7 @@ class ToEventChainVarOperation(ToOperation, EventChainVar): G = ParamSpec("G") -IndividualEventType = Union[EventSpec, EventHandler, Callable[G, Any], Var] +IndividualEventType = Union[EventSpec, EventHandler, Callable[G, Any], Var[Any]] EventType = Union[IndividualEventType[G], List[IndividualEventType[G]]] From fcc97b04029fdf4063fc648a00f5673d22c4b326 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 21 Oct 2024 12:11:00 -0700 Subject: [PATCH 186/201] upgrade node to latest lts (#4191) --- reflex/constants/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index b12d56c78..9acc109ac 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -80,7 +80,7 @@ class Node(SimpleNamespace): """Node/ NPM constants.""" # The Node version. - VERSION = "20.18.0" + VERSION = "22.10.0" # The minimum required node version. MIN_VERSION = "18.17.0" From 7560bf6429487ef4b0f64096b341ae8b1a27ab76 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:26:09 +0200 Subject: [PATCH 187/201] allow setting run mode via env, add helpers to determine it (#4168) --- reflex/constants/__init__.py | 2 ++ reflex/constants/base.py | 3 +++ reflex/reflex.py | 18 ++++++++++++++++-- reflex/utils/exec.py | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/reflex/constants/__init__.py b/reflex/constants/__init__.py index 8e61a3717..a540805b5 100644 --- a/reflex/constants/__init__.py +++ b/reflex/constants/__init__.py @@ -2,6 +2,8 @@ from .base import ( COOKIES, + ENV_BACKEND_ONLY_ENV_VAR, + ENV_FRONTEND_ONLY_ENV_VAR, ENV_MODE_ENV_VAR, IS_WINDOWS, LOCAL_STORAGE, diff --git a/reflex/constants/base.py b/reflex/constants/base.py index b86f083cc..070ff7724 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -226,6 +226,9 @@ SKIP_COMPILE_ENV_VAR = "__REFLEX_SKIP_COMPILE" # This env var stores the execution mode of the app ENV_MODE_ENV_VAR = "REFLEX_ENV_MODE" +ENV_BACKEND_ONLY_ENV_VAR = "REFLEX_BACKEND_ONLY" +ENV_FRONTEND_ONLY_ENV_VAR = "REFLEX_FRONTEND_ONLY" + # Testing variables. # Testing os env set by pytest when running a test case. PYTEST_CURRENT_TEST = "PYTEST_CURRENT_TEST" diff --git a/reflex/reflex.py b/reflex/reflex.py index bd6904d06..99850a9d2 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -274,9 +274,17 @@ def run( constants.Env.DEV, help="The environment to run the app in." ), frontend: bool = typer.Option( - False, "--frontend-only", help="Execute only frontend." + False, + "--frontend-only", + help="Execute only frontend.", + envvar=constants.ENV_FRONTEND_ONLY_ENV_VAR, + ), + backend: bool = typer.Option( + False, + "--backend-only", + help="Execute only backend.", + envvar=constants.ENV_BACKEND_ONLY_ENV_VAR, ), - backend: bool = typer.Option(False, "--backend-only", help="Execute only backend."), frontend_port: str = typer.Option( config.frontend_port, help="Specify a different frontend port." ), @@ -291,6 +299,12 @@ def run( ), ): """Run the app in the current directory.""" + if frontend and backend: + console.error("Cannot use both --frontend-only and --backend-only options.") + raise typer.Exit(1) + os.environ[constants.ENV_BACKEND_ONLY_ENV_VAR] = str(backend).lower() + os.environ[constants.ENV_FRONTEND_ONLY_ENV_VAR] = str(frontend).lower() + _run(env, frontend, backend, frontend_port, backend_port, backend_host, loglevel) diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index acb69ee19..6fa67a96f 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -496,6 +496,24 @@ def is_prod_mode() -> bool: return current_mode == constants.Env.PROD.value +def is_frontend_only() -> bool: + """Check if the app is running in frontend-only mode. + + Returns: + True if the app is running in frontend-only mode. + """ + return os.environ.get(constants.ENV_FRONTEND_ONLY_ENV_VAR, "").lower() == "true" + + +def is_backend_only() -> bool: + """Check if the app is running in backend-only mode. + + Returns: + True if the app is running in backend-only mode. + """ + return os.environ.get(constants.ENV_BACKEND_ONLY_ENV_VAR, "").lower() == "true" + + def should_skip_compile() -> bool: """Whether the app should skip compile. From 7168b42babc2954d9a6d22bc53e26542f3e70134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 21 Oct 2024 12:56:36 -0700 Subject: [PATCH 188/201] versions bump before 0.6.4 (#4208) --- .../workflows/check_outdated_dependencies.yml | 2 +- poetry.lock | 1062 +++++++++-------- pyproject.toml | 2 +- reflex/components/core/upload.py | 2 +- reflex/components/datadisplay/code.py | 2 +- reflex/components/recharts/recharts.py | 4 +- reflex/constants/installer.py | 6 +- reflex/constants/style.py | 2 +- 8 files changed, 554 insertions(+), 528 deletions(-) diff --git a/.github/workflows/check_outdated_dependencies.yml b/.github/workflows/check_outdated_dependencies.yml index fb28bb318..fe8c42608 100644 --- a/.github/workflows/check_outdated_dependencies.yml +++ b/.github/workflows/check_outdated_dependencies.yml @@ -74,7 +74,7 @@ jobs: echo "$outdated" # Ignore 3rd party dependencies that are not updated. - filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion|react-markdown|remark-math|remark-gfm|rehype-katex|rehype-raw' || true) + filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion|react-markdown|remark-math|remark-gfm|rehype-katex|rehype-raw|remark-unwrap-images' || true) no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true) diff --git a/poetry.lock b/poetry.lock index 144547342..2f77234d4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -32,13 +32,13 @@ files = [ [[package]] name = "anyio" -version = "4.6.0" +version = "4.6.2.post1" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.9" files = [ - {file = "anyio-4.6.0-py3-none-any.whl", hash = "sha256:c7d2e9d63e31599eeb636c8c5c03a7e108d73b345f064f1c19fdc87b79036a9a"}, - {file = "anyio-4.6.0.tar.gz", hash = "sha256:137b4559cbb034c477165047febb6ff83f390fc3b20bf181c1fc0a728cb8beeb"}, + {file = "anyio-4.6.2.post1-py3-none-any.whl", hash = "sha256:6d170c36fba3bdd840c73d3868c1e777e33676a69c3a72cf0a0d5d6d8009b61d"}, + {file = "anyio-4.6.2.post1.tar.gz", hash = "sha256:4c8bc31ccdb51c7f7bd251f51c609e038d63e34219b44aa86e47576389880b4c"}, ] [package.dependencies] @@ -49,7 +49,7 @@ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.21.0b1)"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] trio = ["trio (>=0.26.1)"] [[package]] @@ -247,101 +247,116 @@ files = [ [[package]] name = "charset-normalizer" -version = "3.3.2" +version = "3.4.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7.0" files = [ - {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, - {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"}, + {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"}, + {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"}, ] [[package]] @@ -371,83 +386,73 @@ files = [ [[package]] name = "coverage" -version = "7.6.1" +version = "7.6.4" description = "Code coverage measurement for Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "coverage-7.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16"}, - {file = "coverage-7.6.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36"}, - {file = "coverage-7.6.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61c0abb4c85b095a784ef23fdd4aede7a2628478e7baba7c5e3deba61070a02"}, - {file = "coverage-7.6.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd21f6ae3f08b41004dfb433fa895d858f3f5979e7762d052b12aef444e29afc"}, - {file = "coverage-7.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f59d57baca39b32db42b83b2a7ba6f47ad9c394ec2076b084c3f029b7afca23"}, - {file = "coverage-7.6.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a1ac0ae2b8bd743b88ed0502544847c3053d7171a3cff9228af618a068ed9c34"}, - {file = "coverage-7.6.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e6a08c0be454c3b3beb105c0596ebdc2371fab6bb90c0c0297f4e58fd7e1012c"}, - {file = "coverage-7.6.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f5796e664fe802da4f57a168c85359a8fbf3eab5e55cd4e4569fbacecc903959"}, - {file = "coverage-7.6.1-cp310-cp310-win32.whl", hash = "sha256:7bb65125fcbef8d989fa1dd0e8a060999497629ca5b0efbca209588a73356232"}, - {file = "coverage-7.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:3115a95daa9bdba70aea750db7b96b37259a81a709223c8448fa97727d546fe0"}, - {file = "coverage-7.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7dea0889685db8550f839fa202744652e87c60015029ce3f60e006f8c4462c93"}, - {file = "coverage-7.6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ed37bd3c3b063412f7620464a9ac1314d33100329f39799255fb8d3027da50d3"}, - {file = "coverage-7.6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d85f5e9a5f8b73e2350097c3756ef7e785f55bd71205defa0bfdaf96c31616ff"}, - {file = "coverage-7.6.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bc572be474cafb617672c43fe989d6e48d3c83af02ce8de73fff1c6bb3c198d"}, - {file = "coverage-7.6.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0c0420b573964c760df9e9e86d1a9a622d0d27f417e1a949a8a66dd7bcee7bc6"}, - {file = "coverage-7.6.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1f4aa8219db826ce6be7099d559f8ec311549bfc4046f7f9fe9b5cea5c581c56"}, - {file = "coverage-7.6.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:fc5a77d0c516700ebad189b587de289a20a78324bc54baee03dd486f0855d234"}, - {file = "coverage-7.6.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b48f312cca9621272ae49008c7f613337c53fadca647d6384cc129d2996d1133"}, - {file = "coverage-7.6.1-cp311-cp311-win32.whl", hash = "sha256:1125ca0e5fd475cbbba3bb67ae20bd2c23a98fac4e32412883f9bcbaa81c314c"}, - {file = "coverage-7.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:8ae539519c4c040c5ffd0632784e21b2f03fc1340752af711f33e5be83a9d6c6"}, - {file = "coverage-7.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:95cae0efeb032af8458fc27d191f85d1717b1d4e49f7cb226cf526ff28179778"}, - {file = "coverage-7.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5621a9175cf9d0b0c84c2ef2b12e9f5f5071357c4d2ea6ca1cf01814f45d2391"}, - {file = "coverage-7.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:260933720fdcd75340e7dbe9060655aff3af1f0c5d20f46b57f262ab6c86a5e8"}, - {file = "coverage-7.6.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07e2ca0ad381b91350c0ed49d52699b625aab2b44b65e1b4e02fa9df0e92ad2d"}, - {file = "coverage-7.6.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c44fee9975f04b33331cb8eb272827111efc8930cfd582e0320613263ca849ca"}, - {file = "coverage-7.6.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:877abb17e6339d96bf08e7a622d05095e72b71f8afd8a9fefc82cf30ed944163"}, - {file = "coverage-7.6.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3e0cadcf6733c09154b461f1ca72d5416635e5e4ec4e536192180d34ec160f8a"}, - {file = "coverage-7.6.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c3c02d12f837d9683e5ab2f3d9844dc57655b92c74e286c262e0fc54213c216d"}, - {file = "coverage-7.6.1-cp312-cp312-win32.whl", hash = "sha256:e05882b70b87a18d937ca6768ff33cc3f72847cbc4de4491c8e73880766718e5"}, - {file = "coverage-7.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:b5d7b556859dd85f3a541db6a4e0167b86e7273e1cdc973e5b175166bb634fdb"}, - {file = "coverage-7.6.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a4acd025ecc06185ba2b801f2de85546e0b8ac787cf9d3b06e7e2a69f925b106"}, - {file = "coverage-7.6.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a6d3adcf24b624a7b778533480e32434a39ad8fa30c315208f6d3e5542aeb6e9"}, - {file = "coverage-7.6.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0c212c49b6c10e6951362f7c6df3329f04c2b1c28499563d4035d964ab8e08c"}, - {file = "coverage-7.6.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6e81d7a3e58882450ec4186ca59a3f20a5d4440f25b1cff6f0902ad890e6748a"}, - {file = "coverage-7.6.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78b260de9790fd81e69401c2dc8b17da47c8038176a79092a89cb2b7d945d060"}, - {file = "coverage-7.6.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a78d169acd38300060b28d600344a803628c3fd585c912cacc9ea8790fe96862"}, - {file = "coverage-7.6.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2c09f4ce52cb99dd7505cd0fc8e0e37c77b87f46bc9c1eb03fe3bc9991085388"}, - {file = "coverage-7.6.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6878ef48d4227aace338d88c48738a4258213cd7b74fd9a3d4d7582bb1d8a155"}, - {file = "coverage-7.6.1-cp313-cp313-win32.whl", hash = "sha256:44df346d5215a8c0e360307d46ffaabe0f5d3502c8a1cefd700b34baf31d411a"}, - {file = "coverage-7.6.1-cp313-cp313-win_amd64.whl", hash = "sha256:8284cf8c0dd272a247bc154eb6c95548722dce90d098c17a883ed36e67cdb129"}, - {file = "coverage-7.6.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:d3296782ca4eab572a1a4eca686d8bfb00226300dcefdf43faa25b5242ab8a3e"}, - {file = "coverage-7.6.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:502753043567491d3ff6d08629270127e0c31d4184c4c8d98f92c26f65019962"}, - {file = "coverage-7.6.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a89ecca80709d4076b95f89f308544ec8f7b4727e8a547913a35f16717856cb"}, - {file = "coverage-7.6.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a318d68e92e80af8b00fa99609796fdbcdfef3629c77c6283566c6f02c6d6704"}, - {file = "coverage-7.6.1-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13b0a73a0896988f053e4fbb7de6d93388e6dd292b0d87ee51d106f2c11b465b"}, - {file = "coverage-7.6.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:4421712dbfc5562150f7554f13dde997a2e932a6b5f352edcce948a815efee6f"}, - {file = "coverage-7.6.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:166811d20dfea725e2e4baa71fffd6c968a958577848d2131f39b60043400223"}, - {file = "coverage-7.6.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:225667980479a17db1048cb2bf8bfb39b8e5be8f164b8f6628b64f78a72cf9d3"}, - {file = "coverage-7.6.1-cp313-cp313t-win32.whl", hash = "sha256:170d444ab405852903b7d04ea9ae9b98f98ab6d7e63e1115e82620807519797f"}, - {file = "coverage-7.6.1-cp313-cp313t-win_amd64.whl", hash = "sha256:b9f222de8cded79c49bf184bdbc06630d4c58eec9459b939b4a690c82ed05657"}, - {file = "coverage-7.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6db04803b6c7291985a761004e9060b2bca08da6d04f26a7f2294b8623a0c1a0"}, - {file = "coverage-7.6.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f1adfc8ac319e1a348af294106bc6a8458a0f1633cc62a1446aebc30c5fa186a"}, - {file = "coverage-7.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a95324a9de9650a729239daea117df21f4b9868ce32e63f8b650ebe6cef5595b"}, - {file = "coverage-7.6.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b43c03669dc4618ec25270b06ecd3ee4fa94c7f9b3c14bae6571ca00ef98b0d3"}, - {file = "coverage-7.6.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8929543a7192c13d177b770008bc4e8119f2e1f881d563fc6b6305d2d0ebe9de"}, - {file = "coverage-7.6.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:a09ece4a69cf399510c8ab25e0950d9cf2b42f7b3cb0374f95d2e2ff594478a6"}, - {file = "coverage-7.6.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9054a0754de38d9dbd01a46621636689124d666bad1936d76c0341f7d71bf569"}, - {file = "coverage-7.6.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0dbde0f4aa9a16fa4d754356a8f2e36296ff4d83994b2c9d8398aa32f222f989"}, - {file = "coverage-7.6.1-cp38-cp38-win32.whl", hash = "sha256:da511e6ad4f7323ee5702e6633085fb76c2f893aaf8ce4c51a0ba4fc07580ea7"}, - {file = "coverage-7.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:3f1156e3e8f2872197af3840d8ad307a9dd18e615dc64d9ee41696f287c57ad8"}, - {file = "coverage-7.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:abd5fd0db5f4dc9289408aaf34908072f805ff7792632250dcb36dc591d24255"}, - {file = "coverage-7.6.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:547f45fa1a93154bd82050a7f3cddbc1a7a4dd2a9bf5cb7d06f4ae29fe94eaf8"}, - {file = "coverage-7.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:645786266c8f18a931b65bfcefdbf6952dd0dea98feee39bd188607a9d307ed2"}, - {file = "coverage-7.6.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9e0b2df163b8ed01d515807af24f63de04bebcecbd6c3bfeff88385789fdf75a"}, - {file = "coverage-7.6.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:609b06f178fe8e9f89ef676532760ec0b4deea15e9969bf754b37f7c40326dbc"}, - {file = "coverage-7.6.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:702855feff378050ae4f741045e19a32d57d19f3e0676d589df0575008ea5004"}, - {file = "coverage-7.6.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:2bdb062ea438f22d99cba0d7829c2ef0af1d768d1e4a4f528087224c90b132cb"}, - {file = "coverage-7.6.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9c56863d44bd1c4fe2abb8a4d6f5371d197f1ac0ebdee542f07f35895fc07f36"}, - {file = "coverage-7.6.1-cp39-cp39-win32.whl", hash = "sha256:6e2cd258d7d927d09493c8df1ce9174ad01b381d4729a9d8d4e38670ca24774c"}, - {file = "coverage-7.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:06a737c882bd26d0d6ee7269b20b12f14a8704807a01056c80bb881a4b2ce6ca"}, - {file = "coverage-7.6.1-pp38.pp39.pp310-none-any.whl", hash = "sha256:e9a6e0eb86070e8ccaedfbd9d38fec54864f3125ab95419970575b42af7541df"}, - {file = "coverage-7.6.1.tar.gz", hash = "sha256:953510dfb7b12ab69d20135a0662397f077c59b1e6379a768e97c59d852ee51d"}, + {file = "coverage-7.6.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5f8ae553cba74085db385d489c7a792ad66f7f9ba2ee85bfa508aeb84cf0ba07"}, + {file = "coverage-7.6.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8165b796df0bd42e10527a3f493c592ba494f16ef3c8b531288e3d0d72c1f6f0"}, + {file = "coverage-7.6.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7c8b95bf47db6d19096a5e052ffca0a05f335bc63cef281a6e8fe864d450a72"}, + {file = "coverage-7.6.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ed9281d1b52628e81393f5eaee24a45cbd64965f41857559c2b7ff19385df51"}, + {file = "coverage-7.6.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0809082ee480bb8f7416507538243c8863ac74fd8a5d2485c46f0f7499f2b491"}, + {file = "coverage-7.6.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d541423cdd416b78626b55f123412fcf979d22a2c39fce251b350de38c15c15b"}, + {file = "coverage-7.6.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58809e238a8a12a625c70450b48e8767cff9eb67c62e6154a642b21ddf79baea"}, + {file = "coverage-7.6.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c9b8e184898ed014884ca84c70562b4a82cbc63b044d366fedc68bc2b2f3394a"}, + {file = "coverage-7.6.4-cp310-cp310-win32.whl", hash = "sha256:6bd818b7ea14bc6e1f06e241e8234508b21edf1b242d49831831a9450e2f35fa"}, + {file = "coverage-7.6.4-cp310-cp310-win_amd64.whl", hash = "sha256:06babbb8f4e74b063dbaeb74ad68dfce9186c595a15f11f5d5683f748fa1d172"}, + {file = "coverage-7.6.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:73d2b73584446e66ee633eaad1a56aad577c077f46c35ca3283cd687b7715b0b"}, + {file = "coverage-7.6.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:51b44306032045b383a7a8a2c13878de375117946d68dcb54308111f39775a25"}, + {file = "coverage-7.6.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3fb02fe73bed561fa12d279a417b432e5b50fe03e8d663d61b3d5990f29546"}, + {file = "coverage-7.6.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed8fe9189d2beb6edc14d3ad19800626e1d9f2d975e436f84e19efb7fa19469b"}, + {file = "coverage-7.6.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b369ead6527d025a0fe7bd3864e46dbee3aa8f652d48df6174f8d0bac9e26e0e"}, + {file = "coverage-7.6.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ade3ca1e5f0ff46b678b66201f7ff477e8fa11fb537f3b55c3f0568fbfe6e718"}, + {file = "coverage-7.6.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:27fb4a050aaf18772db513091c9c13f6cb94ed40eacdef8dad8411d92d9992db"}, + {file = "coverage-7.6.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4f704f0998911abf728a7783799444fcbbe8261c4a6c166f667937ae6a8aa522"}, + {file = "coverage-7.6.4-cp311-cp311-win32.whl", hash = "sha256:29155cd511ee058e260db648b6182c419422a0d2e9a4fa44501898cf918866cf"}, + {file = "coverage-7.6.4-cp311-cp311-win_amd64.whl", hash = "sha256:8902dd6a30173d4ef09954bfcb24b5d7b5190cf14a43170e386979651e09ba19"}, + {file = "coverage-7.6.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:12394842a3a8affa3ba62b0d4ab7e9e210c5e366fbac3e8b2a68636fb19892c2"}, + {file = "coverage-7.6.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2b6b4c83d8e8ea79f27ab80778c19bc037759aea298da4b56621f4474ffeb117"}, + {file = "coverage-7.6.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d5b8007f81b88696d06f7df0cb9af0d3b835fe0c8dbf489bad70b45f0e45613"}, + {file = "coverage-7.6.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b57b768feb866f44eeed9f46975f3d6406380275c5ddfe22f531a2bf187eda27"}, + {file = "coverage-7.6.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5915fcdec0e54ee229926868e9b08586376cae1f5faa9bbaf8faf3561b393d52"}, + {file = "coverage-7.6.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0b58c672d14f16ed92a48db984612f5ce3836ae7d72cdd161001cc54512571f2"}, + {file = "coverage-7.6.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:2fdef0d83a2d08d69b1f2210a93c416d54e14d9eb398f6ab2f0a209433db19e1"}, + {file = "coverage-7.6.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8cf717ee42012be8c0cb205dbbf18ffa9003c4cbf4ad078db47b95e10748eec5"}, + {file = "coverage-7.6.4-cp312-cp312-win32.whl", hash = "sha256:7bb92c539a624cf86296dd0c68cd5cc286c9eef2d0c3b8b192b604ce9de20a17"}, + {file = "coverage-7.6.4-cp312-cp312-win_amd64.whl", hash = "sha256:1032e178b76a4e2b5b32e19d0fd0abbce4b58e77a1ca695820d10e491fa32b08"}, + {file = "coverage-7.6.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:023bf8ee3ec6d35af9c1c6ccc1d18fa69afa1cb29eaac57cb064dbb262a517f9"}, + {file = "coverage-7.6.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:b0ac3d42cb51c4b12df9c5f0dd2f13a4f24f01943627120ec4d293c9181219ba"}, + {file = "coverage-7.6.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f8fe4984b431f8621ca53d9380901f62bfb54ff759a1348cd140490ada7b693c"}, + {file = "coverage-7.6.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5fbd612f8a091954a0c8dd4c0b571b973487277d26476f8480bfa4b2a65b5d06"}, + {file = "coverage-7.6.4-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dacbc52de979f2823a819571f2e3a350a7e36b8cb7484cdb1e289bceaf35305f"}, + {file = "coverage-7.6.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:dab4d16dfef34b185032580e2f2f89253d302facba093d5fa9dbe04f569c4f4b"}, + {file = "coverage-7.6.4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:862264b12ebb65ad8d863d51f17758b1684560b66ab02770d4f0baf2ff75da21"}, + {file = "coverage-7.6.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5beb1ee382ad32afe424097de57134175fea3faf847b9af002cc7895be4e2a5a"}, + {file = "coverage-7.6.4-cp313-cp313-win32.whl", hash = "sha256:bf20494da9653f6410213424f5f8ad0ed885e01f7e8e59811f572bdb20b8972e"}, + {file = "coverage-7.6.4-cp313-cp313-win_amd64.whl", hash = "sha256:182e6cd5c040cec0a1c8d415a87b67ed01193ed9ad458ee427741c7d8513d963"}, + {file = "coverage-7.6.4-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:a181e99301a0ae128493a24cfe5cfb5b488c4e0bf2f8702091473d033494d04f"}, + {file = "coverage-7.6.4-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:df57bdbeffe694e7842092c5e2e0bc80fff7f43379d465f932ef36f027179806"}, + {file = "coverage-7.6.4-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0bcd1069e710600e8e4cf27f65c90c7843fa8edfb4520fb0ccb88894cad08b11"}, + {file = "coverage-7.6.4-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:99b41d18e6b2a48ba949418db48159d7a2e81c5cc290fc934b7d2380515bd0e3"}, + {file = "coverage-7.6.4-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6b1e54712ba3474f34b7ef7a41e65bd9037ad47916ccb1cc78769bae324c01a"}, + {file = "coverage-7.6.4-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:53d202fd109416ce011578f321460795abfe10bb901b883cafd9b3ef851bacfc"}, + {file = "coverage-7.6.4-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:c48167910a8f644671de9f2083a23630fbf7a1cb70ce939440cd3328e0919f70"}, + {file = "coverage-7.6.4-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:cc8ff50b50ce532de2fa7a7daae9dd12f0a699bfcd47f20945364e5c31799fef"}, + {file = "coverage-7.6.4-cp313-cp313t-win32.whl", hash = "sha256:b8d3a03d9bfcaf5b0141d07a88456bb6a4c3ce55c080712fec8418ef3610230e"}, + {file = "coverage-7.6.4-cp313-cp313t-win_amd64.whl", hash = "sha256:f3ddf056d3ebcf6ce47bdaf56142af51bb7fad09e4af310241e9db7a3a8022e1"}, + {file = "coverage-7.6.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9cb7fa111d21a6b55cbf633039f7bc2749e74932e3aa7cb7333f675a58a58bf3"}, + {file = "coverage-7.6.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:11a223a14e91a4693d2d0755c7a043db43d96a7450b4f356d506c2562c48642c"}, + {file = "coverage-7.6.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a413a096c4cbac202433c850ee43fa326d2e871b24554da8327b01632673a076"}, + {file = "coverage-7.6.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00a1d69c112ff5149cabe60d2e2ee948752c975d95f1e1096742e6077affd376"}, + {file = "coverage-7.6.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f76846299ba5c54d12c91d776d9605ae33f8ae2b9d1d3c3703cf2db1a67f2c0"}, + {file = "coverage-7.6.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:fe439416eb6380de434886b00c859304338f8b19f6f54811984f3420a2e03858"}, + {file = "coverage-7.6.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:0294ca37f1ba500667b1aef631e48d875ced93ad5e06fa665a3295bdd1d95111"}, + {file = "coverage-7.6.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:6f01ba56b1c0e9d149f9ac85a2f999724895229eb36bd997b61e62999e9b0901"}, + {file = "coverage-7.6.4-cp39-cp39-win32.whl", hash = "sha256:bc66f0bf1d7730a17430a50163bb264ba9ded56739112368ba985ddaa9c3bd09"}, + {file = "coverage-7.6.4-cp39-cp39-win_amd64.whl", hash = "sha256:c481b47f6b5845064c65a7bc78bc0860e635a9b055af0df46fdf1c58cebf8e8f"}, + {file = "coverage-7.6.4-pp39.pp310-none-any.whl", hash = "sha256:3c65d37f3a9ebb703e710befdc489a38683a5b152242664b973a7b7b22348a4e"}, + {file = "coverage-7.6.4.tar.gz", hash = "sha256:29fc0f17b1d3fea332f8001d4558f8214af7f1d87a345f3a133c901d60347c73"}, ] [package.dependencies] @@ -458,38 +463,38 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "43.0.1" +version = "43.0.3" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-43.0.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:8385d98f6a3bf8bb2d65a73e17ed87a3ba84f6991c155691c51112075f9ffc5d"}, - {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27e613d7077ac613e399270253259d9d53872aaf657471473ebfc9a52935c062"}, - {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:68aaecc4178e90719e95298515979814bda0cbada1256a4485414860bd7ab962"}, - {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:de41fd81a41e53267cb020bb3a7212861da53a7d39f863585d13ea11049cf277"}, - {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f98bf604c82c416bc829e490c700ca1553eafdf2912a91e23a79d97d9801372a"}, - {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:61ec41068b7b74268fa86e3e9e12b9f0c21fcf65434571dbb13d954bceb08042"}, - {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:014f58110f53237ace6a408b5beb6c427b64e084eb451ef25a28308270086494"}, - {file = "cryptography-43.0.1-cp37-abi3-win32.whl", hash = "sha256:2bd51274dcd59f09dd952afb696bf9c61a7a49dfc764c04dd33ef7a6b502a1e2"}, - {file = "cryptography-43.0.1-cp37-abi3-win_amd64.whl", hash = "sha256:666ae11966643886c2987b3b721899d250855718d6d9ce41b521252a17985f4d"}, - {file = "cryptography-43.0.1-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:ac119bb76b9faa00f48128b7f5679e1d8d437365c5d26f1c2c3f0da4ce1b553d"}, - {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bbcce1a551e262dfbafb6e6252f1ae36a248e615ca44ba302df077a846a8806"}, - {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58d4e9129985185a06d849aa6df265bdd5a74ca6e1b736a77959b498e0505b85"}, - {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d03a475165f3134f773d1388aeb19c2d25ba88b6a9733c5c590b9ff7bbfa2e0c"}, - {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:511f4273808ab590912a93ddb4e3914dfd8a388fed883361b02dea3791f292e1"}, - {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:80eda8b3e173f0f247f711eef62be51b599b5d425c429b5d4ca6a05e9e856baa"}, - {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:38926c50cff6f533f8a2dae3d7f19541432610d114a70808f0926d5aaa7121e4"}, - {file = "cryptography-43.0.1-cp39-abi3-win32.whl", hash = "sha256:a575913fb06e05e6b4b814d7f7468c2c660e8bb16d8d5a1faf9b33ccc569dd47"}, - {file = "cryptography-43.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:d75601ad10b059ec832e78823b348bfa1a59f6b8d545db3a24fd44362a1564cb"}, - {file = "cryptography-43.0.1-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ea25acb556320250756e53f9e20a4177515f012c9eaea17eb7587a8c4d8ae034"}, - {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c1332724be35d23a854994ff0b66530119500b6053d0bd3363265f7e5e77288d"}, - {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fba1007b3ef89946dbbb515aeeb41e30203b004f0b4b00e5e16078b518563289"}, - {file = "cryptography-43.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5b43d1ea6b378b54a1dc99dd8a2b5be47658fe9a7ce0a58ff0b55f4b43ef2b84"}, - {file = "cryptography-43.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:88cce104c36870d70c49c7c8fd22885875d950d9ee6ab54df2745f83ba0dc365"}, - {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:9d3cdb25fa98afdd3d0892d132b8d7139e2c087da1712041f6b762e4f807cc96"}, - {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e710bf40870f4db63c3d7d929aa9e09e4e7ee219e703f949ec4073b4294f6172"}, - {file = "cryptography-43.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7c05650fe8023c5ed0d46793d4b7d7e6cd9c04e68eabe5b0aeea836e37bdcec2"}, - {file = "cryptography-43.0.1.tar.gz", hash = "sha256:203e92a75716d8cfb491dc47c79e17d0d9207ccffcbcb35f598fbe463ae3444d"}, + {file = "cryptography-43.0.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:bf7a1932ac4176486eab36a19ed4c0492da5d97123f1406cf15e41b05e787d2e"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63efa177ff54aec6e1c0aefaa1a241232dcd37413835a9b674b6e3f0ae2bfd3e"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e1ce50266f4f70bf41a2c6dc4358afadae90e2a1e5342d3c08883df1675374f"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:443c4a81bb10daed9a8f334365fe52542771f25aedaf889fd323a853ce7377d6"}, + {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:74f57f24754fe349223792466a709f8e0c093205ff0dca557af51072ff47ab18"}, + {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9762ea51a8fc2a88b70cf2995e5675b38d93bf36bd67d91721c309df184f49bd"}, + {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:81ef806b1fef6b06dcebad789f988d3b37ccaee225695cf3e07648eee0fc6b73"}, + {file = "cryptography-43.0.3-cp37-abi3-win32.whl", hash = "sha256:cbeb489927bd7af4aa98d4b261af9a5bc025bd87f0e3547e11584be9e9427be2"}, + {file = "cryptography-43.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:f46304d6f0c6ab8e52770addfa2fc41e6629495548862279641972b6215451cd"}, + {file = "cryptography-43.0.3-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:8ac43ae87929a5982f5948ceda07001ee5e83227fd69cf55b109144938d96984"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7"}, + {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405"}, + {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16"}, + {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73"}, + {file = "cryptography-43.0.3-cp39-abi3-win32.whl", hash = "sha256:d56e96520b1020449bbace2b78b603442e7e378a9b3bd68de65c782db1507995"}, + {file = "cryptography-43.0.3-cp39-abi3-win_amd64.whl", hash = "sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d03b5621a135bffecad2c73e9f4deb1a0f977b9a8ffe6f8e002bf6c9d07b918c"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:a2a431ee15799d6db9fe80c82b055bae5a752bef645bba795e8e52687c69efe3"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:281c945d0e28c92ca5e5930664c1cefd85efe80e5c0d2bc58dd63383fda29f83"}, + {file = "cryptography-43.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f18c716be16bc1fea8e95def49edf46b82fccaa88587a45f8dc0ff6ab5d8e0a7"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4a02ded6cd4f0a5562a8887df8b3bd14e822a90f97ac5e544c162899bc467664"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:53a583b6637ab4c4e3591a15bc9db855b8d9dee9a669b550f311480acab6eb08"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1ec0bcf7e17c0c5669d881b1cd38c4972fade441b27bda1051665faaa89bdcaa"}, + {file = "cryptography-43.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2ce6fae5bdad59577b44e4dfed356944fbf1d925269114c28be377692643b4ff"}, + {file = "cryptography-43.0.3.tar.gz", hash = "sha256:315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805"}, ] [package.dependencies] @@ -502,7 +507,7 @@ nox = ["nox"] pep8test = ["check-sdist", "click", "mypy", "ruff"] sdist = ["build"] ssh = ["bcrypt (>=3.1.5)"] -test = ["certifi", "cryptography-vectors (==43.0.1)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test = ["certifi", "cryptography-vectors (==43.0.3)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] [[package]] @@ -518,13 +523,13 @@ files = [ [[package]] name = "distlib" -version = "0.3.8" +version = "0.3.9" description = "Distribution utilities" optional = false python-versions = "*" files = [ - {file = "distlib-0.3.8-py2.py3-none-any.whl", hash = "sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784"}, - {file = "distlib-0.3.8.tar.gz", hash = "sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64"}, + {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, + {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, ] [[package]] @@ -565,18 +570,18 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.115.0" +version = "0.115.2" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.115.0-py3-none-any.whl", hash = "sha256:17ea427674467486e997206a5ab25760f6b09e069f099b96f5b55a32fb6f1631"}, - {file = "fastapi-0.115.0.tar.gz", hash = "sha256:f93b4ca3529a8ebc6fc3fcf710e5efa8de3df9b41570958abf1d97d843138004"}, + {file = "fastapi-0.115.2-py3-none-any.whl", hash = "sha256:61704c71286579cc5a598763905928f24ee98bfcc07aabe84cfefb98812bbc86"}, + {file = "fastapi-0.115.2.tar.gz", hash = "sha256:3995739e0b09fa12f984bce8fa9ae197b35d433750d3d312422d846e283697ee"}, ] [package.dependencies] pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" -starlette = ">=0.37.2,<0.39.0" +starlette = ">=0.37.2,<0.41.0" typing-extensions = ">=4.8.0" [package.extras] @@ -601,69 +606,84 @@ typing = ["typing-extensions (>=4.12.2)"] [[package]] name = "greenlet" -version = "3.0.3" +version = "3.1.1" description = "Lightweight in-process concurrent programming" optional = false python-versions = ">=3.7" files = [ - {file = "greenlet-3.0.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:9da2bd29ed9e4f15955dd1595ad7bc9320308a3b766ef7f837e23ad4b4aac31a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d353cadd6083fdb056bb46ed07e4340b0869c305c8ca54ef9da3421acbdf6881"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dca1e2f3ca00b84a396bc1bce13dd21f680f035314d2379c4160c98153b2059b"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ed7fb269f15dc662787f4119ec300ad0702fa1b19d2135a37c2c4de6fadfd4a"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd4f49ae60e10adbc94b45c0b5e6a179acc1736cf7a90160b404076ee283cf83"}, - {file = "greenlet-3.0.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:73a411ef564e0e097dbe7e866bb2dda0f027e072b04da387282b02c308807405"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7f362975f2d179f9e26928c5b517524e89dd48530a0202570d55ad6ca5d8a56f"}, - {file = "greenlet-3.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:649dde7de1a5eceb258f9cb00bdf50e978c9db1b996964cd80703614c86495eb"}, - {file = "greenlet-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:68834da854554926fbedd38c76e60c4a2e3198c6fbed520b106a8986445caaf9"}, - {file = "greenlet-3.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379"}, - {file = "greenlet-3.0.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3"}, - {file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d"}, - {file = "greenlet-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728"}, - {file = "greenlet-3.0.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:70fb482fdf2c707765ab5f0b6655e9cfcf3780d8d87355a063547b41177599be"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4d1ac74f5c0c0524e4a24335350edad7e5f03b9532da7ea4d3c54d527784f2e"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:149e94a2dd82d19838fe4b2259f1b6b9957d5ba1b25640d2380bea9c5df37676"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15d79dd26056573940fcb8c7413d84118086f2ec1a8acdfa854631084393efcc"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b7db1ebff4ba09aaaeae6aa491daeb226c8150fc20e836ad00041bcb11230"}, - {file = "greenlet-3.0.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fcd2469d6a2cf298f198f0487e0a5b1a47a42ca0fa4dfd1b6862c999f018ebbf"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1f672519db1796ca0d8753f9e78ec02355e862d0998193038c7073045899f305"}, - {file = "greenlet-3.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2516a9957eed41dd8f1ec0c604f1cdc86758b587d964668b5b196a9db5bfcde6"}, - {file = "greenlet-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:bba5387a6975598857d86de9eac14210a49d554a77eb8261cc68b7d082f78ce2"}, - {file = "greenlet-3.0.3-cp37-cp37m-macosx_11_0_universal2.whl", hash = "sha256:5b51e85cb5ceda94e79d019ed36b35386e8c37d22f07d6a751cb659b180d5274"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:daf3cb43b7cf2ba96d614252ce1684c1bccee6b2183a01328c98d36fcd7d5cb0"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99bf650dc5d69546e076f413a87481ee1d2d09aaaaaca058c9251b6d8c14783f"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dd6e660effd852586b6a8478a1d244b8dc90ab5b1321751d2ea15deb49ed414"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3391d1e16e2a5a1507d83e4a8b100f4ee626e8eca43cf2cadb543de69827c4c"}, - {file = "greenlet-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e1f145462f1fa6e4a4ae3c0f782e580ce44d57c8f2c7aae1b6fa88c0b2efdb41"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1a7191e42732df52cb5f39d3527217e7ab73cae2cb3694d241e18f53d84ea9a7"}, - {file = "greenlet-3.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6"}, - {file = "greenlet-3.0.3-cp37-cp37m-win32.whl", hash = "sha256:b542be2440edc2d48547b5923c408cbe0fc94afb9f18741faa6ae970dbcb9b6d"}, - {file = "greenlet-3.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67"}, - {file = "greenlet-3.0.3-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1996cb9306c8595335bb157d133daf5cf9f693ef413e7673cb07e3e5871379ca"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ddc0f794e6ad661e321caa8d2f0a55ce01213c74722587256fb6566049a8b04"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9db1c18f0eaad2f804728c67d6c610778456e3e1cc4ab4bbd5eeb8e6053c6fc"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7170375bcc99f1a2fbd9c306f5be8764eaf3ac6b5cb968862cad4c7057756506"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b66c9c1e7ccabad3a7d037b2bcb740122a7b17a53734b7d72a344ce39882a1b"}, - {file = "greenlet-3.0.3-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:098d86f528c855ead3479afe84b49242e174ed262456c342d70fc7f972bc13c4"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:81bb9c6d52e8321f09c3d165b2a78c680506d9af285bfccbad9fb7ad5a5da3e5"}, - {file = "greenlet-3.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da"}, - {file = "greenlet-3.0.3-cp38-cp38-win32.whl", hash = "sha256:d46677c85c5ba00a9cb6f7a00b2bfa6f812192d2c9f7d9c4f6a55b60216712f3"}, - {file = "greenlet-3.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:419b386f84949bf0e7c73e6032e3457b82a787c1ab4a0e43732898a761cc9dbf"}, - {file = "greenlet-3.0.3-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:da70d4d51c8b306bb7a031d5cff6cc25ad253affe89b70352af5f1cb68e74b53"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:086152f8fbc5955df88382e8a75984e2bb1c892ad2e3c80a2508954e52295257"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d73a9fe764d77f87f8ec26a0c85144d6a951a6c438dfe50487df5595c6373eac"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7dcbe92cc99f08c8dd11f930de4d99ef756c3591a5377d1d9cd7dd5e896da71"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1551a8195c0d4a68fac7a4325efac0d541b48def35feb49d803674ac32582f61"}, - {file = "greenlet-3.0.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:64d7675ad83578e3fc149b617a444fab8efdafc9385471f868eb5ff83e446b8b"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b37eef18ea55f2ffd8f00ff8fe7c8d3818abd3e25fb73fae2ca3b672e333a7a6"}, - {file = "greenlet-3.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:77457465d89b8263bca14759d7c1684df840b6811b2499838cc5b040a8b5b113"}, - {file = "greenlet-3.0.3-cp39-cp39-win32.whl", hash = "sha256:57e8974f23e47dac22b83436bdcf23080ade568ce77df33159e019d161ce1d1e"}, - {file = "greenlet-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:c5ee858cfe08f34712f548c3c363e807e7186f03ad7a5039ebadb29e8c6be067"}, - {file = "greenlet-3.0.3.tar.gz", hash = "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491"}, + {file = "greenlet-3.1.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:0bbae94a29c9e5c7e4a2b7f0aae5c17e8e90acbfd3bf6270eeba60c39fce3563"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fde093fb93f35ca72a556cf72c92ea3ebfda3d79fc35bb19fbe685853869a83"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:36b89d13c49216cadb828db8dfa6ce86bbbc476a82d3a6c397f0efae0525bdd0"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94b6150a85e1b33b40b1464a3f9988dcc5251d6ed06842abff82e42632fac120"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93147c513fac16385d1036b7e5b102c7fbbdb163d556b791f0f11eada7ba65dc"}, + {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da7a9bff22ce038e19bf62c4dd1ec8391062878710ded0a845bcf47cc0200617"}, + {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b2795058c23988728eec1f36a4e5e4ebad22f8320c85f3587b539b9ac84128d7"}, + {file = "greenlet-3.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ed10eac5830befbdd0c32f83e8aa6288361597550ba669b04c48f0f9a2c843c6"}, + {file = "greenlet-3.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:77c386de38a60d1dfb8e55b8c1101d68c79dfdd25c7095d51fec2dd800892b80"}, + {file = "greenlet-3.1.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e4d333e558953648ca09d64f13e6d8f0523fa705f51cae3f03b5983489958c70"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fc016b73c94e98e29af67ab7b9a879c307c6731a2c9da0db5a7d9b7edd1159"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5e975ca70269d66d17dd995dafc06f1b06e8cb1ec1e9ed54c1d1e4a7c4cf26e"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b2813dc3de8c1ee3f924e4d4227999285fd335d1bcc0d2be6dc3f1f6a318ec1"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e347b3bfcf985a05e8c0b7d462ba6f15b1ee1c909e2dcad795e49e91b152c383"}, + {file = "greenlet-3.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e8f8c9cb53cdac7ba9793c276acd90168f416b9ce36799b9b885790f8ad6c0a"}, + {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62ee94988d6b4722ce0028644418d93a52429e977d742ca2ccbe1c4f4a792511"}, + {file = "greenlet-3.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1776fd7f989fc6b8d8c8cb8da1f6b82c5814957264d1f6cf818d475ec2bf6395"}, + {file = "greenlet-3.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:48ca08c771c268a768087b408658e216133aecd835c0ded47ce955381105ba39"}, + {file = "greenlet-3.1.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:4afe7ea89de619adc868e087b4d2359282058479d7cfb94970adf4b55284574d"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f406b22b7c9a9b4f8aa9d2ab13d6ae0ac3e85c9a809bd590ad53fed2bf70dc79"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c3a701fe5a9695b238503ce5bbe8218e03c3bcccf7e204e455e7462d770268aa"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2846930c65b47d70b9d178e89c7e1a69c95c1f68ea5aa0a58646b7a96df12441"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99cfaa2110534e2cf3ba31a7abcac9d328d1d9f1b95beede58294a60348fba36"}, + {file = "greenlet-3.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9"}, + {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b7cede291382a78f7bb5f04a529cb18e068dd29e0fb27376074b6d0317bf4dd0"}, + {file = "greenlet-3.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:23f20bb60ae298d7d8656c6ec6db134bca379ecefadb0b19ce6f19d1f232a942"}, + {file = "greenlet-3.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:7124e16b4c55d417577c2077be379514321916d5790fa287c9ed6f23bd2ffd01"}, + {file = "greenlet-3.1.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:05175c27cb459dcfc05d026c4232f9de8913ed006d42713cb8a5137bd49375f1"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:935e943ec47c4afab8965954bf49bfa639c05d4ccf9ef6e924188f762145c0ff"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:667a9706c970cb552ede35aee17339a18e8f2a87a51fba2ed39ceeeb1004798a"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8a678974d1f3aa55f6cc34dc480169d58f2e6d8958895d68845fa4ab566509e"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efc0f674aa41b92da8c49e0346318c6075d734994c3c4e4430b1c3f853e498e4"}, + {file = "greenlet-3.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0153404a4bb921f0ff1abeb5ce8a5131da56b953eda6e14b88dc6bbc04d2049e"}, + {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:275f72decf9932639c1c6dd1013a1bc266438eb32710016a1c742df5da6e60a1"}, + {file = "greenlet-3.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c4aab7f6381f38a4b42f269057aee279ab0fc7bf2e929e3d4abfae97b682a12c"}, + {file = "greenlet-3.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:b42703b1cf69f2aa1df7d1030b9d77d3e584a70755674d60e710f0af570f3761"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1695e76146579f8c06c1509c7ce4dfe0706f49c6831a817ac04eebb2fd02011"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7876452af029456b3f3549b696bb36a06db7c90747740c5302f74a9e9fa14b13"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ead44c85f8ab905852d3de8d86f6f8baf77109f9da589cb4fa142bd3b57b475"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8320f64b777d00dd7ccdade271eaf0cad6636343293a25074cc5566160e4de7b"}, + {file = "greenlet-3.1.1-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6510bf84a6b643dabba74d3049ead221257603a253d0a9873f55f6a59a65f822"}, + {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:04b013dc07c96f83134b1e99888e7a79979f1a247e2a9f59697fa14b5862ed01"}, + {file = "greenlet-3.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47da355d8687fd65240c364c90a31569a133b7b60de111c255ef5b606f2ae291"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:98884ecf2ffb7d7fe6bd517e8eb99d31ff7855a840fa6d0d63cd07c037f6a981"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1d4aeb8891338e60d1ab6127af1fe45def5259def8094b9c7e34690c8858803"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db32b5348615a04b82240cc67983cb315309e88d444a288934ee6ceaebcad6cc"}, + {file = "greenlet-3.1.1-cp37-cp37m-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dcc62f31eae24de7f8dce72134c8651c58000d3b1868e01392baea7c32c247de"}, + {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1d3755bcb2e02de341c55b4fca7a745a24a9e7212ac953f6b3a48d117d7257aa"}, + {file = "greenlet-3.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b8da394b34370874b4572676f36acabac172602abf054cbc4ac910219f3340af"}, + {file = "greenlet-3.1.1-cp37-cp37m-win32.whl", hash = "sha256:a0dfc6c143b519113354e780a50381508139b07d2177cb6ad6a08278ec655798"}, + {file = "greenlet-3.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:54558ea205654b50c438029505def3834e80f0869a70fb15b871c29b4575ddef"}, + {file = "greenlet-3.1.1-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:346bed03fe47414091be4ad44786d1bd8bef0c3fcad6ed3dee074a032ab408a9"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfc59d69fc48664bc693842bd57acfdd490acafda1ab52c7836e3fc75c90a111"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21e10da6ec19b457b82636209cbe2331ff4306b54d06fa04b7c138ba18c8a81"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37b9de5a96111fc15418819ab4c4432e4f3c2ede61e660b1e33971eba26ef9ba"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ef9ea3f137e5711f0dbe5f9263e8c009b7069d8a1acea822bd5e9dae0ae49c8"}, + {file = "greenlet-3.1.1-cp38-cp38-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:85f3ff71e2e60bd4b4932a043fbbe0f499e263c628390b285cb599154a3b03b1"}, + {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:95ffcf719966dd7c453f908e208e14cde192e09fde6c7186c8f1896ef778d8cd"}, + {file = "greenlet-3.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:03a088b9de532cbfe2ba2034b2b85e82df37874681e8c470d6fb2f8c04d7e4b7"}, + {file = "greenlet-3.1.1-cp38-cp38-win32.whl", hash = "sha256:8b8b36671f10ba80e159378df9c4f15c14098c4fd73a36b9ad715f057272fbef"}, + {file = "greenlet-3.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:7017b2be767b9d43cc31416aba48aab0d2309ee31b4dbf10a1d38fb7972bdf9d"}, + {file = "greenlet-3.1.1-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:396979749bd95f018296af156201d6211240e7a23090f50a8d5d18c370084dc3"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca9d0ff5ad43e785350894d97e13633a66e2b50000e8a183a50a88d834752d42"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f6ff3b14f2df4c41660a7dec01045a045653998784bf8cfcb5a525bdffffbc8f"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94ebba31df2aa506d7b14866fed00ac141a867e63143fe5bca82a8e503b36437"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73aaad12ac0ff500f62cebed98d8789198ea0e6f233421059fa68a5aa7220145"}, + {file = "greenlet-3.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63e4844797b975b9af3a3fb8f7866ff08775f5426925e1e0bbcfe7932059a12c"}, + {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7939aa3ca7d2a1593596e7ac6d59391ff30281ef280d8632fa03d81f7c5f955e"}, + {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d0028e725ee18175c6e422797c407874da24381ce0690d6b9396c204c7f7276e"}, + {file = "greenlet-3.1.1-cp39-cp39-win32.whl", hash = "sha256:5e06afd14cbaf9e00899fae69b24a32f2196c19de08fcb9f4779dd4f004e5e7c"}, + {file = "greenlet-3.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:3319aa75e0e0639bc15ff54ca327e8dc7a6fe404003496e3c6925cd3142e0e22"}, + {file = "greenlet-3.1.1.tar.gz", hash = "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467"}, ] [package.extras] @@ -993,71 +1013,72 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] [[package]] name = "markupsafe" -version = "2.1.5" +version = "3.0.2" description = "Safely add untrusted strings to HTML/XML markup." optional = false -python-versions = ">=3.7" +python-versions = ">=3.9" files = [ - {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"}, - {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-win32.whl", hash = "sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50"}, + {file = "MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-win32.whl", hash = "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d"}, + {file = "MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-win32.whl", hash = "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30"}, + {file = "MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1"}, + {file = "MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6"}, + {file = "MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-win32.whl", hash = "sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f"}, + {file = "MarkupSafe-3.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a"}, + {file = "markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0"}, ] [[package]] @@ -1347,95 +1368,90 @@ xml = ["lxml (>=4.9.2)"] [[package]] name = "pillow" -version = "10.4.0" +version = "11.0.0" description = "Python Imaging Library (Fork)" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "pillow-10.4.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:4d9667937cfa347525b319ae34375c37b9ee6b525440f3ef48542fcf66f2731e"}, - {file = "pillow-10.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:543f3dc61c18dafb755773efc89aae60d06b6596a63914107f75459cf984164d"}, - {file = "pillow-10.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7928ecbf1ece13956b95d9cbcfc77137652b02763ba384d9ab508099a2eca856"}, - {file = "pillow-10.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4d49b85c4348ea0b31ea63bc75a9f3857869174e2bf17e7aba02945cd218e6f"}, - {file = "pillow-10.4.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:6c762a5b0997f5659a5ef2266abc1d8851ad7749ad9a6a5506eb23d314e4f46b"}, - {file = "pillow-10.4.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:a985e028fc183bf12a77a8bbf36318db4238a3ded7fa9df1b9a133f1cb79f8fc"}, - {file = "pillow-10.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:812f7342b0eee081eaec84d91423d1b4650bb9828eb53d8511bcef8ce5aecf1e"}, - {file = "pillow-10.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ac1452d2fbe4978c2eec89fb5a23b8387aba707ac72810d9490118817d9c0b46"}, - {file = "pillow-10.4.0-cp310-cp310-win32.whl", hash = "sha256:bcd5e41a859bf2e84fdc42f4edb7d9aba0a13d29a2abadccafad99de3feff984"}, - {file = "pillow-10.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:ecd85a8d3e79cd7158dec1c9e5808e821feea088e2f69a974db5edf84dc53141"}, - {file = "pillow-10.4.0-cp310-cp310-win_arm64.whl", hash = "sha256:ff337c552345e95702c5fde3158acb0625111017d0e5f24bf3acdb9cc16b90d1"}, - {file = "pillow-10.4.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:0a9ec697746f268507404647e531e92889890a087e03681a3606d9b920fbee3c"}, - {file = "pillow-10.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dfe91cb65544a1321e631e696759491ae04a2ea11d36715eca01ce07284738be"}, - {file = "pillow-10.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5dc6761a6efc781e6a1544206f22c80c3af4c8cf461206d46a1e6006e4429ff3"}, - {file = "pillow-10.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e84b6cc6a4a3d76c153a6b19270b3526a5a8ed6b09501d3af891daa2a9de7d6"}, - {file = "pillow-10.4.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:bbc527b519bd3aa9d7f429d152fea69f9ad37c95f0b02aebddff592688998abe"}, - {file = "pillow-10.4.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:76a911dfe51a36041f2e756b00f96ed84677cdeb75d25c767f296c1c1eda1319"}, - {file = "pillow-10.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:59291fb29317122398786c2d44427bbd1a6d7ff54017075b22be9d21aa59bd8d"}, - {file = "pillow-10.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:416d3a5d0e8cfe4f27f574362435bc9bae57f679a7158e0096ad2beb427b8696"}, - {file = "pillow-10.4.0-cp311-cp311-win32.whl", hash = "sha256:7086cc1d5eebb91ad24ded9f58bec6c688e9f0ed7eb3dbbf1e4800280a896496"}, - {file = "pillow-10.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cbed61494057c0f83b83eb3a310f0bf774b09513307c434d4366ed64f4128a91"}, - {file = "pillow-10.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:f5f0c3e969c8f12dd2bb7e0b15d5c468b51e5017e01e2e867335c81903046a22"}, - {file = "pillow-10.4.0-cp312-cp312-macosx_10_10_x86_64.whl", hash = "sha256:673655af3eadf4df6b5457033f086e90299fdd7a47983a13827acf7459c15d94"}, - {file = "pillow-10.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:866b6942a92f56300012f5fbac71f2d610312ee65e22f1aa2609e491284e5597"}, - {file = "pillow-10.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29dbdc4207642ea6aad70fbde1a9338753d33fb23ed6956e706936706f52dd80"}, - {file = "pillow-10.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf2342ac639c4cf38799a44950bbc2dfcb685f052b9e262f446482afaf4bffca"}, - {file = "pillow-10.4.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:f5b92f4d70791b4a67157321c4e8225d60b119c5cc9aee8ecf153aace4aad4ef"}, - {file = "pillow-10.4.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:86dcb5a1eb778d8b25659d5e4341269e8590ad6b4e8b44d9f4b07f8d136c414a"}, - {file = "pillow-10.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:780c072c2e11c9b2c7ca37f9a2ee8ba66f44367ac3e5c7832afcfe5104fd6d1b"}, - {file = "pillow-10.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:37fb69d905be665f68f28a8bba3c6d3223c8efe1edf14cc4cfa06c241f8c81d9"}, - {file = "pillow-10.4.0-cp312-cp312-win32.whl", hash = "sha256:7dfecdbad5c301d7b5bde160150b4db4c659cee2b69589705b6f8a0c509d9f42"}, - {file = "pillow-10.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:1d846aea995ad352d4bdcc847535bd56e0fd88d36829d2c90be880ef1ee4668a"}, - {file = "pillow-10.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:e553cad5179a66ba15bb18b353a19020e73a7921296a7979c4a2b7f6a5cd57f9"}, - {file = "pillow-10.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8bc1a764ed8c957a2e9cacf97c8b2b053b70307cf2996aafd70e91a082e70df3"}, - {file = "pillow-10.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:6209bb41dc692ddfee4942517c19ee81b86c864b626dbfca272ec0f7cff5d9fb"}, - {file = "pillow-10.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bee197b30783295d2eb680b311af15a20a8b24024a19c3a26431ff83eb8d1f70"}, - {file = "pillow-10.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ef61f5dd14c300786318482456481463b9d6b91ebe5ef12f405afbba77ed0be"}, - {file = "pillow-10.4.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:297e388da6e248c98bc4a02e018966af0c5f92dfacf5a5ca22fa01cb3179bca0"}, - {file = "pillow-10.4.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:e4db64794ccdf6cb83a59d73405f63adbe2a1887012e308828596100a0b2f6cc"}, - {file = "pillow-10.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bd2880a07482090a3bcb01f4265f1936a903d70bc740bfcb1fd4e8a2ffe5cf5a"}, - {file = "pillow-10.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4b35b21b819ac1dbd1233317adeecd63495f6babf21b7b2512d244ff6c6ce309"}, - {file = "pillow-10.4.0-cp313-cp313-win32.whl", hash = "sha256:551d3fd6e9dc15e4c1eb6fc4ba2b39c0c7933fa113b220057a34f4bb3268a060"}, - {file = "pillow-10.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:030abdbe43ee02e0de642aee345efa443740aa4d828bfe8e2eb11922ea6a21ea"}, - {file = "pillow-10.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:5b001114dd152cfd6b23befeb28d7aee43553e2402c9f159807bf55f33af8a8d"}, - {file = "pillow-10.4.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:8d4d5063501b6dd4024b8ac2f04962d661222d120381272deea52e3fc52d3736"}, - {file = "pillow-10.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7c1ee6f42250df403c5f103cbd2768a28fe1a0ea1f0f03fe151c8741e1469c8b"}, - {file = "pillow-10.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b15e02e9bb4c21e39876698abf233c8c579127986f8207200bc8a8f6bb27acf2"}, - {file = "pillow-10.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a8d4bade9952ea9a77d0c3e49cbd8b2890a399422258a77f357b9cc9be8d680"}, - {file = "pillow-10.4.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:43efea75eb06b95d1631cb784aa40156177bf9dd5b4b03ff38979e048258bc6b"}, - {file = "pillow-10.4.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:950be4d8ba92aca4b2bb0741285a46bfae3ca699ef913ec8416c1b78eadd64cd"}, - {file = "pillow-10.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d7480af14364494365e89d6fddc510a13e5a2c3584cb19ef65415ca57252fb84"}, - {file = "pillow-10.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:73664fe514b34c8f02452ffb73b7a92c6774e39a647087f83d67f010eb9a0cf0"}, - {file = "pillow-10.4.0-cp38-cp38-win32.whl", hash = "sha256:e88d5e6ad0d026fba7bdab8c3f225a69f063f116462c49892b0149e21b6c0a0e"}, - {file = "pillow-10.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:5161eef006d335e46895297f642341111945e2c1c899eb406882a6c61a4357ab"}, - {file = "pillow-10.4.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:0ae24a547e8b711ccaaf99c9ae3cd975470e1a30caa80a6aaee9a2f19c05701d"}, - {file = "pillow-10.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:298478fe4f77a4408895605f3482b6cc6222c018b2ce565c2b6b9c354ac3229b"}, - {file = "pillow-10.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:134ace6dc392116566980ee7436477d844520a26a4b1bd4053f6f47d096997fd"}, - {file = "pillow-10.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:930044bb7679ab003b14023138b50181899da3f25de50e9dbee23b61b4de2126"}, - {file = "pillow-10.4.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:c76e5786951e72ed3686e122d14c5d7012f16c8303a674d18cdcd6d89557fc5b"}, - {file = "pillow-10.4.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:b2724fdb354a868ddf9a880cb84d102da914e99119211ef7ecbdc613b8c96b3c"}, - {file = "pillow-10.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:dbc6ae66518ab3c5847659e9988c3b60dc94ffb48ef9168656e0019a93dbf8a1"}, - {file = "pillow-10.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:06b2f7898047ae93fad74467ec3d28fe84f7831370e3c258afa533f81ef7f3df"}, - {file = "pillow-10.4.0-cp39-cp39-win32.whl", hash = "sha256:7970285ab628a3779aecc35823296a7869f889b8329c16ad5a71e4901a3dc4ef"}, - {file = "pillow-10.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:961a7293b2457b405967af9c77dcaa43cc1a8cd50d23c532e62d48ab6cdd56f5"}, - {file = "pillow-10.4.0-cp39-cp39-win_arm64.whl", hash = "sha256:32cda9e3d601a52baccb2856b8ea1fc213c90b340c542dcef77140dfa3278a9e"}, - {file = "pillow-10.4.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:5b4815f2e65b30f5fbae9dfffa8636d992d49705723fe86a3661806e069352d4"}, - {file = "pillow-10.4.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:8f0aef4ef59694b12cadee839e2ba6afeab89c0f39a3adc02ed51d109117b8da"}, - {file = "pillow-10.4.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f4727572e2918acaa9077c919cbbeb73bd2b3ebcfe033b72f858fc9fbef0026"}, - {file = "pillow-10.4.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff25afb18123cea58a591ea0244b92eb1e61a1fd497bf6d6384f09bc3262ec3e"}, - {file = "pillow-10.4.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:dc3e2db6ba09ffd7d02ae9141cfa0ae23393ee7687248d46a7507b75d610f4f5"}, - {file = "pillow-10.4.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:02a2be69f9c9b8c1e97cf2713e789d4e398c751ecfd9967c18d0ce304efbf885"}, - {file = "pillow-10.4.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:0755ffd4a0c6f267cccbae2e9903d95477ca2f77c4fcf3a3a09570001856c8a5"}, - {file = "pillow-10.4.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:a02364621fe369e06200d4a16558e056fe2805d3468350df3aef21e00d26214b"}, - {file = "pillow-10.4.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:1b5dea9831a90e9d0721ec417a80d4cbd7022093ac38a568db2dd78363b00908"}, - {file = "pillow-10.4.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9b885f89040bb8c4a1573566bbb2f44f5c505ef6e74cec7ab9068c900047f04b"}, - {file = "pillow-10.4.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87dd88ded2e6d74d31e1e0a99a726a6765cda32d00ba72dc37f0651f306daaa8"}, - {file = "pillow-10.4.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:2db98790afc70118bd0255c2eeb465e9767ecf1f3c25f9a1abb8ffc8cfd1fe0a"}, - {file = "pillow-10.4.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:f7baece4ce06bade126fb84b8af1c33439a76d8a6fd818970215e0560ca28c27"}, - {file = "pillow-10.4.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:cfdd747216947628af7b259d274771d84db2268ca062dd5faf373639d00113a3"}, - {file = "pillow-10.4.0.tar.gz", hash = "sha256:166c1cd4d24309b30d61f79f4a9114b7b2313d7450912277855ff5dfd7cd4a06"}, + {file = "pillow-11.0.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:6619654954dc4936fcff82db8eb6401d3159ec6be81e33c6000dfd76ae189947"}, + {file = "pillow-11.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b3c5ac4bed7519088103d9450a1107f76308ecf91d6dabc8a33a2fcfb18d0fba"}, + {file = "pillow-11.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a65149d8ada1055029fcb665452b2814fe7d7082fcb0c5bed6db851cb69b2086"}, + {file = "pillow-11.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88a58d8ac0cc0e7f3a014509f0455248a76629ca9b604eca7dc5927cc593c5e9"}, + {file = "pillow-11.0.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:c26845094b1af3c91852745ae78e3ea47abf3dbcd1cf962f16b9a5fbe3ee8488"}, + {file = "pillow-11.0.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:1a61b54f87ab5786b8479f81c4b11f4d61702830354520837f8cc791ebba0f5f"}, + {file = "pillow-11.0.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:674629ff60030d144b7bca2b8330225a9b11c482ed408813924619c6f302fdbb"}, + {file = "pillow-11.0.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:598b4e238f13276e0008299bd2482003f48158e2b11826862b1eb2ad7c768b97"}, + {file = "pillow-11.0.0-cp310-cp310-win32.whl", hash = "sha256:9a0f748eaa434a41fccf8e1ee7a3eed68af1b690e75328fd7a60af123c193b50"}, + {file = "pillow-11.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:a5629742881bcbc1f42e840af185fd4d83a5edeb96475a575f4da50d6ede337c"}, + {file = "pillow-11.0.0-cp310-cp310-win_arm64.whl", hash = "sha256:ee217c198f2e41f184f3869f3e485557296d505b5195c513b2bfe0062dc537f1"}, + {file = "pillow-11.0.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:1c1d72714f429a521d8d2d018badc42414c3077eb187a59579f28e4270b4b0fc"}, + {file = "pillow-11.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:499c3a1b0d6fc8213519e193796eb1a86a1be4b1877d678b30f83fd979811d1a"}, + {file = "pillow-11.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c8b2351c85d855293a299038e1f89db92a2f35e8d2f783489c6f0b2b5f3fe8a3"}, + {file = "pillow-11.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f4dba50cfa56f910241eb7f883c20f1e7b1d8f7d91c750cd0b318bad443f4d5"}, + {file = "pillow-11.0.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:5ddbfd761ee00c12ee1be86c9c0683ecf5bb14c9772ddbd782085779a63dd55b"}, + {file = "pillow-11.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:45c566eb10b8967d71bf1ab8e4a525e5a93519e29ea071459ce517f6b903d7fa"}, + {file = "pillow-11.0.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b4fd7bd29610a83a8c9b564d457cf5bd92b4e11e79a4ee4716a63c959699b306"}, + {file = "pillow-11.0.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:cb929ca942d0ec4fac404cbf520ee6cac37bf35be479b970c4ffadf2b6a1cad9"}, + {file = "pillow-11.0.0-cp311-cp311-win32.whl", hash = "sha256:006bcdd307cc47ba43e924099a038cbf9591062e6c50e570819743f5607404f5"}, + {file = "pillow-11.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:52a2d8323a465f84faaba5236567d212c3668f2ab53e1c74c15583cf507a0291"}, + {file = "pillow-11.0.0-cp311-cp311-win_arm64.whl", hash = "sha256:16095692a253047fe3ec028e951fa4221a1f3ed3d80c397e83541a3037ff67c9"}, + {file = "pillow-11.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d2c0a187a92a1cb5ef2c8ed5412dd8d4334272617f532d4ad4de31e0495bd923"}, + {file = "pillow-11.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:084a07ef0821cfe4858fe86652fffac8e187b6ae677e9906e192aafcc1b69903"}, + {file = "pillow-11.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8069c5179902dcdce0be9bfc8235347fdbac249d23bd90514b7a47a72d9fecf4"}, + {file = "pillow-11.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f02541ef64077f22bf4924f225c0fd1248c168f86e4b7abdedd87d6ebaceab0f"}, + {file = "pillow-11.0.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:fcb4621042ac4b7865c179bb972ed0da0218a076dc1820ffc48b1d74c1e37fe9"}, + {file = "pillow-11.0.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:00177a63030d612148e659b55ba99527803288cea7c75fb05766ab7981a8c1b7"}, + {file = "pillow-11.0.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8853a3bf12afddfdf15f57c4b02d7ded92c7a75a5d7331d19f4f9572a89c17e6"}, + {file = "pillow-11.0.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3107c66e43bda25359d5ef446f59c497de2b5ed4c7fdba0894f8d6cf3822dafc"}, + {file = "pillow-11.0.0-cp312-cp312-win32.whl", hash = "sha256:86510e3f5eca0ab87429dd77fafc04693195eec7fd6a137c389c3eeb4cfb77c6"}, + {file = "pillow-11.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:8ec4a89295cd6cd4d1058a5e6aec6bf51e0eaaf9714774e1bfac7cfc9051db47"}, + {file = "pillow-11.0.0-cp312-cp312-win_arm64.whl", hash = "sha256:27a7860107500d813fcd203b4ea19b04babe79448268403172782754870dac25"}, + {file = "pillow-11.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:bcd1fb5bb7b07f64c15618c89efcc2cfa3e95f0e3bcdbaf4642509de1942a699"}, + {file = "pillow-11.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0e038b0745997c7dcaae350d35859c9715c71e92ffb7e0f4a8e8a16732150f38"}, + {file = "pillow-11.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ae08bd8ffc41aebf578c2af2f9d8749d91f448b3bfd41d7d9ff573d74f2a6b2"}, + {file = "pillow-11.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d69bfd8ec3219ae71bcde1f942b728903cad25fafe3100ba2258b973bd2bc1b2"}, + {file = "pillow-11.0.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:61b887f9ddba63ddf62fd02a3ba7add935d053b6dd7d58998c630e6dbade8527"}, + {file = "pillow-11.0.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:c6a660307ca9d4867caa8d9ca2c2658ab685de83792d1876274991adec7b93fa"}, + {file = "pillow-11.0.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:73e3a0200cdda995c7e43dd47436c1548f87a30bb27fb871f352a22ab8dcf45f"}, + {file = "pillow-11.0.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fba162b8872d30fea8c52b258a542c5dfd7b235fb5cb352240c8d63b414013eb"}, + {file = "pillow-11.0.0-cp313-cp313-win32.whl", hash = "sha256:f1b82c27e89fffc6da125d5eb0ca6e68017faf5efc078128cfaa42cf5cb38798"}, + {file = "pillow-11.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:8ba470552b48e5835f1d23ecb936bb7f71d206f9dfeee64245f30c3270b994de"}, + {file = "pillow-11.0.0-cp313-cp313-win_arm64.whl", hash = "sha256:846e193e103b41e984ac921b335df59195356ce3f71dcfd155aa79c603873b84"}, + {file = "pillow-11.0.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:4ad70c4214f67d7466bea6a08061eba35c01b1b89eaa098040a35272a8efb22b"}, + {file = "pillow-11.0.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:6ec0d5af64f2e3d64a165f490d96368bb5dea8b8f9ad04487f9ab60dc4bb6003"}, + {file = "pillow-11.0.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c809a70e43c7977c4a42aefd62f0131823ebf7dd73556fa5d5950f5b354087e2"}, + {file = "pillow-11.0.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:4b60c9520f7207aaf2e1d94de026682fc227806c6e1f55bba7606d1c94dd623a"}, + {file = "pillow-11.0.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:1e2688958a840c822279fda0086fec1fdab2f95bf2b717b66871c4ad9859d7e8"}, + {file = "pillow-11.0.0-cp313-cp313t-win32.whl", hash = "sha256:607bbe123c74e272e381a8d1957083a9463401f7bd01287f50521ecb05a313f8"}, + {file = "pillow-11.0.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5c39ed17edea3bc69c743a8dd3e9853b7509625c2462532e62baa0732163a904"}, + {file = "pillow-11.0.0-cp313-cp313t-win_arm64.whl", hash = "sha256:75acbbeb05b86bc53cbe7b7e6fe00fbcf82ad7c684b3ad82e3d711da9ba287d3"}, + {file = "pillow-11.0.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:2e46773dc9f35a1dd28bd6981332fd7f27bec001a918a72a79b4133cf5291dba"}, + {file = "pillow-11.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2679d2258b7f1192b378e2893a8a0a0ca472234d4c2c0e6bdd3380e8dfa21b6a"}, + {file = "pillow-11.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eda2616eb2313cbb3eebbe51f19362eb434b18e3bb599466a1ffa76a033fb916"}, + {file = "pillow-11.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20ec184af98a121fb2da42642dea8a29ec80fc3efbaefb86d8fdd2606619045d"}, + {file = "pillow-11.0.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:8594f42df584e5b4bb9281799698403f7af489fba84c34d53d1c4bfb71b7c4e7"}, + {file = "pillow-11.0.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:c12b5ae868897c7338519c03049a806af85b9b8c237b7d675b8c5e089e4a618e"}, + {file = "pillow-11.0.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:70fbbdacd1d271b77b7721fe3cdd2d537bbbd75d29e6300c672ec6bb38d9672f"}, + {file = "pillow-11.0.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5178952973e588b3f1360868847334e9e3bf49d19e169bbbdfaf8398002419ae"}, + {file = "pillow-11.0.0-cp39-cp39-win32.whl", hash = "sha256:8c676b587da5673d3c75bd67dd2a8cdfeb282ca38a30f37950511766b26858c4"}, + {file = "pillow-11.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:94f3e1780abb45062287b4614a5bc0874519c86a777d4a7ad34978e86428b8dd"}, + {file = "pillow-11.0.0-cp39-cp39-win_arm64.whl", hash = "sha256:290f2cc809f9da7d6d622550bbf4c1e57518212da51b6a30fe8e0a270a5b78bd"}, + {file = "pillow-11.0.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:1187739620f2b365de756ce086fdb3604573337cc28a0d3ac4a01ab6b2d2a6d2"}, + {file = "pillow-11.0.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fbbcb7b57dc9c794843e3d1258c0fbf0f48656d46ffe9e09b63bbd6e8cd5d0a2"}, + {file = "pillow-11.0.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d203af30149ae339ad1b4f710d9844ed8796e97fda23ffbc4cc472968a47d0b"}, + {file = "pillow-11.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21a0d3b115009ebb8ac3d2ebec5c2982cc693da935f4ab7bb5c8ebe2f47d36f2"}, + {file = "pillow-11.0.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:73853108f56df97baf2bb8b522f3578221e56f646ba345a372c78326710d3830"}, + {file = "pillow-11.0.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e58876c91f97b0952eb766123bfef372792ab3f4e3e1f1a2267834c2ab131734"}, + {file = "pillow-11.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:224aaa38177597bb179f3ec87eeefcce8e4f85e608025e9cfac60de237ba6316"}, + {file = "pillow-11.0.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:5bd2d3bdb846d757055910f0a59792d33b555800813c3b39ada1829c372ccb06"}, + {file = "pillow-11.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:375b8dd15a1f5d2feafff536d47e22f69625c1aa92f12b339ec0b2ca40263273"}, + {file = "pillow-11.0.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:daffdf51ee5db69a82dd127eabecce20729e21f7a3680cf7cbb23f0829189790"}, + {file = "pillow-11.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7326a1787e3c7b0429659e0a944725e1b03eeaa10edd945a86dead1913383944"}, + {file = "pillow-11.0.0.tar.gz", hash = "sha256:72bacbaf24ac003fea9bff9837d1eedb6088758d41e100c1552930151f677739"}, ] [package.extras] -docs = ["furo", "olefile", "sphinx (>=7.3)", "sphinx-copybutton", "sphinx-inline-tabs", "sphinxext-opengraph"] +docs = ["furo", "olefile", "sphinx (>=8.1)", "sphinx-copybutton", "sphinx-inline-tabs", "sphinxext-opengraph"] fpx = ["olefile"] mic = ["olefile"] tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "packaging", "pyroma", "pytest", "pytest-cov", "pytest-timeout"] @@ -1503,22 +1519,22 @@ type = ["mypy (>=1.11.2)"] [[package]] name = "playwright" -version = "1.47.0" +version = "1.48.0" description = "A high-level API to automate web browsers" optional = false python-versions = ">=3.8" files = [ - {file = "playwright-1.47.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:f205df24edb925db1a4ab62f1ab0da06f14bb69e382efecfb0deedc4c7f4b8cd"}, - {file = "playwright-1.47.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7fc820faf6885f69a52ba4ec94124e575d3c4a4003bf29200029b4a4f2b2d0ab"}, - {file = "playwright-1.47.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:8e212dc472ff19c7d46ed7e900191c7a786ce697556ac3f1615986ec3aa00341"}, - {file = "playwright-1.47.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:a1935672531963e4b2a321de5aa59b982fb92463ee6e1032dd7326378e462955"}, - {file = "playwright-1.47.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0a1b61473d6f7f39c5d77d4800b3cbefecb03344c90b98f3fbcae63294ad249"}, - {file = "playwright-1.47.0-py3-none-win32.whl", hash = "sha256:1b977ed81f6bba5582617684a21adab9bad5676d90a357ebf892db7bdf4a9974"}, - {file = "playwright-1.47.0-py3-none-win_amd64.whl", hash = "sha256:0ec1056042d2e86088795a503347407570bffa32cbe20748e5d4c93dba085280"}, + {file = "playwright-1.48.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:082bce2739f1078acc7d0734da8cc0e23eb91b7fae553f3316d733276f09a6b1"}, + {file = "playwright-1.48.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7da2eb51a19c7f3b523e9faa9d98e7af92e52eb983a099979ea79c9668e3cbf7"}, + {file = "playwright-1.48.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:115b988d1da322358b77bc3bf2d3cc90f8c881e691461538e7df91614c4833c9"}, + {file = "playwright-1.48.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:8dabb80e62f667fe2640a8b694e26a7b884c0b4803f7514a3954fc849126227b"}, + {file = "playwright-1.48.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ff8303409ebed76bed4c3d655340320b768817d900ba208b394fdd7d7939a5c"}, + {file = "playwright-1.48.0-py3-none-win32.whl", hash = "sha256:85598c360c590076d4f435525be991246d74a905b654ac19d26eab7ed9b98b2d"}, + {file = "playwright-1.48.0-py3-none-win_amd64.whl", hash = "sha256:e0e87b0c4dc8fce83c725dd851aec37bc4e882bb225ec8a96bd83cf32d4f1623"}, ] [package.dependencies] -greenlet = "3.0.3" +greenlet = "3.1.1" pyee = "12.0.0" [[package]] @@ -1553,13 +1569,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "4.0.0" +version = "4.0.1" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false python-versions = ">=3.9" files = [ - {file = "pre_commit-4.0.0-py2.py3-none-any.whl", hash = "sha256:0ca2341cf94ac1865350970951e54b1a50521e57b7b500403307aed4315a1234"}, - {file = "pre_commit-4.0.0.tar.gz", hash = "sha256:5d9807162cc5537940f94f266cbe2d716a75cfad0d78a317a92cac16287cfed6"}, + {file = "pre_commit-4.0.1-py2.py3-none-any.whl", hash = "sha256:efde913840816312445dc98787724647c65473daefe420785f885e8ed9a06878"}, + {file = "pre_commit-4.0.1.tar.gz", hash = "sha256:80905ac375958c0444c65e9cebebd948b3cdb518f335a091a670a89d652139d2"}, ] [package.dependencies] @@ -1571,32 +1587,33 @@ virtualenv = ">=20.10.0" [[package]] name = "psutil" -version = "6.0.0" +version = "6.1.0" description = "Cross-platform lib for process and system monitoring in Python." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "psutil-6.0.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a021da3e881cd935e64a3d0a20983bda0bb4cf80e4f74fa9bfcb1bc5785360c6"}, - {file = "psutil-6.0.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:1287c2b95f1c0a364d23bc6f2ea2365a8d4d9b726a3be7294296ff7ba97c17f0"}, - {file = "psutil-6.0.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:a9a3dbfb4de4f18174528d87cc352d1f788b7496991cca33c6996f40c9e3c92c"}, - {file = "psutil-6.0.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:6ec7588fb3ddaec7344a825afe298db83fe01bfaaab39155fa84cf1c0d6b13c3"}, - {file = "psutil-6.0.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:1e7c870afcb7d91fdea2b37c24aeb08f98b6d67257a5cb0a8bc3ac68d0f1a68c"}, - {file = "psutil-6.0.0-cp27-none-win32.whl", hash = "sha256:02b69001f44cc73c1c5279d02b30a817e339ceb258ad75997325e0e6169d8b35"}, - {file = "psutil-6.0.0-cp27-none-win_amd64.whl", hash = "sha256:21f1fb635deccd510f69f485b87433460a603919b45e2a324ad65b0cc74f8fb1"}, - {file = "psutil-6.0.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c588a7e9b1173b6e866756dde596fd4cad94f9399daf99ad8c3258b3cb2b47a0"}, - {file = "psutil-6.0.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ed2440ada7ef7d0d608f20ad89a04ec47d2d3ab7190896cd62ca5fc4fe08bf0"}, - {file = "psutil-6.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fd9a97c8e94059b0ef54a7d4baf13b405011176c3b6ff257c247cae0d560ecd"}, - {file = "psutil-6.0.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2e8d0054fc88153ca0544f5c4d554d42e33df2e009c4ff42284ac9ebdef4132"}, - {file = "psutil-6.0.0-cp36-cp36m-win32.whl", hash = "sha256:fc8c9510cde0146432bbdb433322861ee8c3efbf8589865c8bf8d21cb30c4d14"}, - {file = "psutil-6.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:34859b8d8f423b86e4385ff3665d3f4d94be3cdf48221fbe476e883514fdb71c"}, - {file = "psutil-6.0.0-cp37-abi3-win32.whl", hash = "sha256:a495580d6bae27291324fe60cea0b5a7c23fa36a7cd35035a16d93bdcf076b9d"}, - {file = "psutil-6.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:33ea5e1c975250a720b3a6609c490db40dae5d83a4eb315170c4fe0d8b1f34b3"}, - {file = "psutil-6.0.0-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:ffe7fc9b6b36beadc8c322f84e1caff51e8703b88eee1da46d1e3a6ae11b4fd0"}, - {file = "psutil-6.0.0.tar.gz", hash = "sha256:8faae4f310b6d969fa26ca0545338b21f73c6b15db7c4a8d934a5482faa818f2"}, + {file = "psutil-6.1.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ff34df86226c0227c52f38b919213157588a678d049688eded74c76c8ba4a5d0"}, + {file = "psutil-6.1.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:c0e0c00aa18ca2d3b2b991643b799a15fc8f0563d2ebb6040f64ce8dc027b942"}, + {file = "psutil-6.1.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:000d1d1ebd634b4efb383f4034437384e44a6d455260aaee2eca1e9c1b55f047"}, + {file = "psutil-6.1.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:5cd2bcdc75b452ba2e10f0e8ecc0b57b827dd5d7aaffbc6821b2a9a242823a76"}, + {file = "psutil-6.1.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:045f00a43c737f960d273a83973b2511430d61f283a44c96bf13a6e829ba8fdc"}, + {file = "psutil-6.1.0-cp27-none-win32.whl", hash = "sha256:9118f27452b70bb1d9ab3198c1f626c2499384935aaf55388211ad982611407e"}, + {file = "psutil-6.1.0-cp27-none-win_amd64.whl", hash = "sha256:a8506f6119cff7015678e2bce904a4da21025cc70ad283a53b099e7620061d85"}, + {file = "psutil-6.1.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:6e2dcd475ce8b80522e51d923d10c7871e45f20918e027ab682f94f1c6351688"}, + {file = "psutil-6.1.0-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:0895b8414afafc526712c498bd9de2b063deaac4021a3b3c34566283464aff8e"}, + {file = "psutil-6.1.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9dcbfce5d89f1d1f2546a2090f4fcf87c7f669d1d90aacb7d7582addece9fb38"}, + {file = "psutil-6.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:498c6979f9c6637ebc3a73b3f87f9eb1ec24e1ce53a7c5173b8508981614a90b"}, + {file = "psutil-6.1.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d905186d647b16755a800e7263d43df08b790d709d575105d419f8b6ef65423a"}, + {file = "psutil-6.1.0-cp36-cp36m-win32.whl", hash = "sha256:6d3fbbc8d23fcdcb500d2c9f94e07b1342df8ed71b948a2649b5cb060a7c94ca"}, + {file = "psutil-6.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:1209036fbd0421afde505a4879dee3b2fd7b1e14fee81c0069807adcbbcca747"}, + {file = "psutil-6.1.0-cp37-abi3-win32.whl", hash = "sha256:1ad45a1f5d0b608253b11508f80940985d1d0c8f6111b5cb637533a0e6ddc13e"}, + {file = "psutil-6.1.0-cp37-abi3-win_amd64.whl", hash = "sha256:a8fb3752b491d246034fa4d279ff076501588ce8cbcdbb62c32fd7a377d996be"}, + {file = "psutil-6.1.0.tar.gz", hash = "sha256:353815f59a7f64cdaca1c0307ee13558a0512f6db064e92fe833784f08539c7a"}, ] [package.extras] -test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] +dev = ["black", "check-manifest", "coverage", "packaging", "pylint", "pyperf", "pypinfo", "pytest-cov", "requests", "rstcheck", "ruff", "sphinx", "sphinx_rtd_theme", "toml-sort", "twine", "virtualenv", "wheel"] +test = ["pytest", "pytest-xdist", "setuptools"] [[package]] name = "py-cpuinfo" @@ -1962,13 +1979,13 @@ six = ">=1.5" [[package]] name = "python-engineio" -version = "4.9.1" +version = "4.10.1" description = "Engine.IO server and client for Python" optional = false python-versions = ">=3.6" files = [ - {file = "python_engineio-4.9.1-py3-none-any.whl", hash = "sha256:f995e702b21f6b9ebde4e2000cd2ad0112ba0e5116ec8d22fe3515e76ba9dddd"}, - {file = "python_engineio-4.9.1.tar.gz", hash = "sha256:7631cf5563086076611e494c643b3fa93dd3a854634b5488be0bba0ef9b99709"}, + {file = "python_engineio-4.10.1-py3-none-any.whl", hash = "sha256:445a94004ec8034960ab99e7ce4209ec619c6e6b6a12aedcb05abeab924025c0"}, + {file = "python_engineio-4.10.1.tar.gz", hash = "sha256:166cea8dd7429638c5c4e3a4895beae95196e860bc6f29ed0b9fe753d1ef2072"}, ] [package.dependencies] @@ -2150,13 +2167,13 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==23.2.1)", "requests (>=2.31.0)" [[package]] name = "reflex-chakra" -version = "0.6.1" +version = "0.6.2" description = "reflex using chakra components" optional = false -python-versions = "<4.0,>=3.8" +python-versions = "<4.0,>=3.9" files = [ - {file = "reflex_chakra-0.6.1-py3-none-any.whl", hash = "sha256:824d461264b6d2c836ba4a2a430e677a890b82e83da149672accfc58786442fa"}, - {file = "reflex_chakra-0.6.1.tar.gz", hash = "sha256:4b9b3c8bada19cbb4d1b8d8bc4ab0460ec008a91f380010c34d416d5b613dc07"}, + {file = "reflex_chakra-0.6.2-py3-none-any.whl", hash = "sha256:b8aa19f39a02601c560b97f4b17f171c0b5980e13a58069e3a5dd0999e362e4f"}, + {file = "reflex_chakra-0.6.2.tar.gz", hash = "sha256:81ddb7f182cc454922cc817312755b799d4e1a49a46ef2e81305052dc76ef86d"}, ] [package.dependencies] @@ -2316,13 +2333,13 @@ websocket-client = ">=1.8,<2.0" [[package]] name = "setuptools" -version = "75.1.0" +version = "75.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-75.1.0-py3-none-any.whl", hash = "sha256:35ab7fd3bcd95e6b7fd704e4a1539513edad446c097797f2985e0e4b960772f2"}, - {file = "setuptools-75.1.0.tar.gz", hash = "sha256:d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"}, + {file = "setuptools-75.2.0-py3-none-any.whl", hash = "sha256:a7fcb66f68b4d9e8e66b42f9876150a3371558f98fa32222ffaa5bced76406f8"}, + {file = "setuptools-75.2.0.tar.gz", hash = "sha256:753bb6ebf1f465a1912e19ed1d41f403a79173a9acf66a42e7e6aec45c3c16ec"}, ] [package.extras] @@ -2347,19 +2364,20 @@ files = [ [[package]] name = "simple-websocket" -version = "1.0.0" +version = "1.1.0" description = "Simple WebSocket server and client for Python" optional = false python-versions = ">=3.6" files = [ - {file = "simple-websocket-1.0.0.tar.gz", hash = "sha256:17d2c72f4a2bd85174a97e3e4c88b01c40c3f81b7b648b0cc3ce1305968928c8"}, - {file = "simple_websocket-1.0.0-py3-none-any.whl", hash = "sha256:1d5bf585e415eaa2083e2bcf02a3ecf91f9712e7b3e6b9fa0b461ad04e0837bc"}, + {file = "simple_websocket-1.1.0-py3-none-any.whl", hash = "sha256:4af6069630a38ed6c561010f0e11a5bc0d4ca569b36306eb257cd9a192497c8c"}, + {file = "simple_websocket-1.1.0.tar.gz", hash = "sha256:7939234e7aa067c534abdab3a9ed933ec9ce4691b0713c78acb195560aa52ae4"}, ] [package.dependencies] wsproto = "*" [package.extras] +dev = ["flake8", "pytest", "pytest-cov", "tox"] docs = ["sphinx"] [[package]] @@ -2397,60 +2415,68 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.35" +version = "2.0.36" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:67219632be22f14750f0d1c70e62f204ba69d28f62fd6432ba05ab295853de9b"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4668bd8faf7e5b71c0319407b608f278f279668f358857dbfd10ef1954ac9f90"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb8bea573863762bbf45d1e13f87c2d2fd32cee2dbd50d050f83f87429c9e1ea"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f552023710d4b93d8fb29a91fadf97de89c5926c6bd758897875435f2a939f33"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:016b2e665f778f13d3c438651dd4de244214b527a275e0acf1d44c05bc6026a9"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7befc148de64b6060937231cbff8d01ccf0bfd75aa26383ffdf8d82b12ec04ff"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-win32.whl", hash = "sha256:22b83aed390e3099584b839b93f80a0f4a95ee7f48270c97c90acd40ee646f0b"}, - {file = "SQLAlchemy-2.0.35-cp310-cp310-win_amd64.whl", hash = "sha256:a29762cd3d116585278ffb2e5b8cc311fb095ea278b96feef28d0b423154858e"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e21f66748ab725ade40fa7af8ec8b5019c68ab00b929f6643e1b1af461eddb60"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8a6219108a15fc6d24de499d0d515c7235c617b2540d97116b663dade1a54d62"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:042622a5306c23b972192283f4e22372da3b8ddf5f7aac1cc5d9c9b222ab3ff6"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:627dee0c280eea91aed87b20a1f849e9ae2fe719d52cbf847c0e0ea34464b3f7"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4fdcd72a789c1c31ed242fd8c1bcd9ea186a98ee8e5408a50e610edfef980d71"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:89b64cd8898a3a6f642db4eb7b26d1b28a497d4022eccd7717ca066823e9fb01"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-win32.whl", hash = "sha256:6a93c5a0dfe8d34951e8a6f499a9479ffb9258123551fa007fc708ae2ac2bc5e"}, - {file = "SQLAlchemy-2.0.35-cp311-cp311-win_amd64.whl", hash = "sha256:c68fe3fcde03920c46697585620135b4ecfdfc1ed23e75cc2c2ae9f8502c10b8"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:eb60b026d8ad0c97917cb81d3662d0b39b8ff1335e3fabb24984c6acd0c900a2"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6921ee01caf375363be5e9ae70d08ce7ca9d7e0e8983183080211a062d299468"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8cdf1a0dbe5ced887a9b127da4ffd7354e9c1a3b9bb330dce84df6b70ccb3a8d"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93a71c8601e823236ac0e5d087e4f397874a421017b3318fd92c0b14acf2b6db"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e04b622bb8a88f10e439084486f2f6349bf4d50605ac3e445869c7ea5cf0fa8c"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1b56961e2d31389aaadf4906d453859f35302b4eb818d34a26fab72596076bb8"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-win32.whl", hash = "sha256:0f9f3f9a3763b9c4deb8c5d09c4cc52ffe49f9876af41cc1b2ad0138878453cf"}, - {file = "SQLAlchemy-2.0.35-cp312-cp312-win_amd64.whl", hash = "sha256:25b0f63e7fcc2a6290cb5f7f5b4fc4047843504983a28856ce9b35d8f7de03cc"}, - {file = "SQLAlchemy-2.0.35-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:f021d334f2ca692523aaf7bbf7592ceff70c8594fad853416a81d66b35e3abf9"}, - {file = "SQLAlchemy-2.0.35-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:05c3f58cf91683102f2f0265c0db3bd3892e9eedabe059720492dbaa4f922da1"}, - {file = "SQLAlchemy-2.0.35-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:032d979ce77a6c2432653322ba4cbeabf5a6837f704d16fa38b5a05d8e21fa00"}, - {file = "SQLAlchemy-2.0.35-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:2e795c2f7d7249b75bb5f479b432a51b59041580d20599d4e112b5f2046437a3"}, - {file = "SQLAlchemy-2.0.35-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:cc32b2990fc34380ec2f6195f33a76b6cdaa9eecf09f0c9404b74fc120aef36f"}, - {file = "SQLAlchemy-2.0.35-cp37-cp37m-win32.whl", hash = "sha256:9509c4123491d0e63fb5e16199e09f8e262066e58903e84615c301dde8fa2e87"}, - {file = "SQLAlchemy-2.0.35-cp37-cp37m-win_amd64.whl", hash = "sha256:3655af10ebcc0f1e4e06c5900bb33e080d6a1fa4228f502121f28a3b1753cde5"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:4c31943b61ed8fdd63dfd12ccc919f2bf95eefca133767db6fbbd15da62078ec"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a62dd5d7cc8626a3634208df458c5fe4f21200d96a74d122c83bc2015b333bc1"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0630774b0977804fba4b6bbea6852ab56c14965a2b0c7fc7282c5f7d90a1ae72"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d625eddf7efeba2abfd9c014a22c0f6b3796e0ffb48f5d5ab106568ef01ff5a"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ada603db10bb865bbe591939de854faf2c60f43c9b763e90f653224138f910d9"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c41411e192f8d3ea39ea70e0fae48762cd11a2244e03751a98bd3c0ca9a4e936"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-win32.whl", hash = "sha256:d299797d75cd747e7797b1b41817111406b8b10a4f88b6e8fe5b5e59598b43b0"}, - {file = "SQLAlchemy-2.0.35-cp38-cp38-win_amd64.whl", hash = "sha256:0375a141e1c0878103eb3d719eb6d5aa444b490c96f3fedab8471c7f6ffe70ee"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ccae5de2a0140d8be6838c331604f91d6fafd0735dbdcee1ac78fc8fbaba76b4"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2a275a806f73e849e1c309ac11108ea1a14cd7058577aba962cd7190e27c9e3c"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:732e026240cdd1c1b2e3ac515c7a23820430ed94292ce33806a95869c46bd139"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:890da8cd1941fa3dab28c5bac3b9da8502e7e366f895b3b8e500896f12f94d11"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c0d8326269dbf944b9201911b0d9f3dc524d64779a07518199a58384c3d37a44"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b76d63495b0508ab9fc23f8152bac63205d2a704cd009a2b0722f4c8e0cba8e0"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-win32.whl", hash = "sha256:69683e02e8a9de37f17985905a5eca18ad651bf592314b4d3d799029797d0eb3"}, - {file = "SQLAlchemy-2.0.35-cp39-cp39-win_amd64.whl", hash = "sha256:aee110e4ef3c528f3abbc3c2018c121e708938adeeff9006428dd7c8555e9b3f"}, - {file = "SQLAlchemy-2.0.35-py3-none-any.whl", hash = "sha256:2ab3f0336c0387662ce6221ad30ab3a5e6499aab01b9790879b6578fd9b8faa1"}, - {file = "sqlalchemy-2.0.35.tar.gz", hash = "sha256:e11d7ea4d24f0a262bccf9a7cd6284c976c5369dac21db237cff59586045ab9f"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:59b8f3adb3971929a3e660337f5dacc5942c2cdb760afcabb2614ffbda9f9f72"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:37350015056a553e442ff672c2d20e6f4b6d0b2495691fa239d8aa18bb3bc908"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8318f4776c85abc3f40ab185e388bee7a6ea99e7fa3a30686580b209eaa35c08"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c245b1fbade9c35e5bd3b64270ab49ce990369018289ecfde3f9c318411aaa07"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:69f93723edbca7342624d09f6704e7126b152eaed3cdbb634cb657a54332a3c5"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f9511d8dd4a6e9271d07d150fb2f81874a3c8c95e11ff9af3a2dfc35fe42ee44"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-win32.whl", hash = "sha256:c3f3631693003d8e585d4200730616b78fafd5a01ef8b698f6967da5c605b3fa"}, + {file = "SQLAlchemy-2.0.36-cp310-cp310-win_amd64.whl", hash = "sha256:a86bfab2ef46d63300c0f06936bd6e6c0105faa11d509083ba8f2f9d237fb5b5"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fd3a55deef00f689ce931d4d1b23fa9f04c880a48ee97af488fd215cf24e2a6c"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4f5e9cd989b45b73bd359f693b935364f7e1f79486e29015813c338450aa5a71"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0ddd9db6e59c44875211bc4c7953a9f6638b937b0a88ae6d09eb46cced54eff"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2519f3a5d0517fc159afab1015e54bb81b4406c278749779be57a569d8d1bb0d"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:59b1ee96617135f6e1d6f275bbe988f419c5178016f3d41d3c0abb0c819f75bb"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:39769a115f730d683b0eb7b694db9789267bcd027326cccc3125e862eb03bfd8"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-win32.whl", hash = "sha256:66bffbad8d6271bb1cc2f9a4ea4f86f80fe5e2e3e501a5ae2a3dc6a76e604e6f"}, + {file = "SQLAlchemy-2.0.36-cp311-cp311-win_amd64.whl", hash = "sha256:23623166bfefe1487d81b698c423f8678e80df8b54614c2bf4b4cfcd7c711959"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f7b64e6ec3f02c35647be6b4851008b26cff592a95ecb13b6788a54ef80bbdd4"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:46331b00096a6db1fdc052d55b101dbbfc99155a548e20a0e4a8e5e4d1362855"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fdf3386a801ea5aba17c6410dd1dc8d39cf454ca2565541b5ac42a84e1e28f53"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac9dfa18ff2a67b09b372d5db8743c27966abf0e5344c555d86cc7199f7ad83a"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:90812a8933df713fdf748b355527e3af257a11e415b613dd794512461eb8a686"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1bc330d9d29c7f06f003ab10e1eaced295e87940405afe1b110f2eb93a233588"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-win32.whl", hash = "sha256:79d2e78abc26d871875b419e1fd3c0bca31a1cb0043277d0d850014599626c2e"}, + {file = "SQLAlchemy-2.0.36-cp312-cp312-win_amd64.whl", hash = "sha256:b544ad1935a8541d177cb402948b94e871067656b3a0b9e91dbec136b06a2ff5"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b5cc79df7f4bc3d11e4b542596c03826063092611e481fcf1c9dfee3c94355ef"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3c01117dd36800f2ecaa238c65365b7b16497adc1522bf84906e5710ee9ba0e8"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bc633f4ee4b4c46e7adcb3a9b5ec083bf1d9a97c1d3854b92749d935de40b9b"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e46ed38affdfc95d2c958de328d037d87801cfcbea6d421000859e9789e61c2"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b2985c0b06e989c043f1dc09d4fe89e1616aadd35392aea2844f0458a989eacf"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4a121d62ebe7d26fec9155f83f8be5189ef1405f5973ea4874a26fab9f1e262c"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-win32.whl", hash = "sha256:0572f4bd6f94752167adfd7c1bed84f4b240ee6203a95e05d1e208d488d0d436"}, + {file = "SQLAlchemy-2.0.36-cp313-cp313-win_amd64.whl", hash = "sha256:8c78ac40bde930c60e0f78b3cd184c580f89456dd87fc08f9e3ee3ce8765ce88"}, + {file = "SQLAlchemy-2.0.36-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:be9812b766cad94a25bc63bec11f88c4ad3629a0cec1cd5d4ba48dc23860486b"}, + {file = "SQLAlchemy-2.0.36-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50aae840ebbd6cdd41af1c14590e5741665e5272d2fee999306673a1bb1fdb4d"}, + {file = "SQLAlchemy-2.0.36-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4557e1f11c5f653ebfdd924f3f9d5ebfc718283b0b9beebaa5dd6b77ec290971"}, + {file = "SQLAlchemy-2.0.36-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:07b441f7d03b9a66299ce7ccf3ef2900abc81c0db434f42a5694a37bd73870f2"}, + {file = "SQLAlchemy-2.0.36-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:28120ef39c92c2dd60f2721af9328479516844c6b550b077ca450c7d7dc68575"}, + {file = "SQLAlchemy-2.0.36-cp37-cp37m-win32.whl", hash = "sha256:b81ee3d84803fd42d0b154cb6892ae57ea6b7c55d8359a02379965706c7efe6c"}, + {file = "SQLAlchemy-2.0.36-cp37-cp37m-win_amd64.whl", hash = "sha256:f942a799516184c855e1a32fbc7b29d7e571b52612647866d4ec1c3242578fcb"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3d6718667da04294d7df1670d70eeddd414f313738d20a6f1d1f379e3139a545"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:72c28b84b174ce8af8504ca28ae9347d317f9dba3999e5981a3cd441f3712e24"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b11d0cfdd2b095e7b0686cf5fabeb9c67fae5b06d265d8180715b8cfa86522e3"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e32092c47011d113dc01ab3e1d3ce9f006a47223b18422c5c0d150af13a00687"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6a440293d802d3011028e14e4226da1434b373cbaf4a4bbb63f845761a708346"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c54a1e53a0c308a8e8a7dffb59097bff7facda27c70c286f005327f21b2bd6b1"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-win32.whl", hash = "sha256:1e0d612a17581b6616ff03c8e3d5eff7452f34655c901f75d62bd86449d9750e"}, + {file = "SQLAlchemy-2.0.36-cp38-cp38-win_amd64.whl", hash = "sha256:8958b10490125124463095bbdadda5aa22ec799f91958e410438ad6c97a7b793"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dc022184d3e5cacc9579e41805a681187650e170eb2fd70e28b86192a479dcaa"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b817d41d692bf286abc181f8af476c4fbef3fd05e798777492618378448ee689"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a4e46a888b54be23d03a89be510f24a7652fe6ff660787b96cd0e57a4ebcb46d"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4ae3005ed83f5967f961fd091f2f8c5329161f69ce8480aa8168b2d7fe37f06"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:03e08af7a5f9386a43919eda9de33ffda16b44eb11f3b313e6822243770e9763"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:3dbb986bad3ed5ceaf090200eba750b5245150bd97d3e67343a3cfed06feecf7"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-win32.whl", hash = "sha256:9fe53b404f24789b5ea9003fc25b9a3988feddebd7e7b369c8fac27ad6f52f28"}, + {file = "SQLAlchemy-2.0.36-cp39-cp39-win_amd64.whl", hash = "sha256:af148a33ff0349f53512a049c6406923e4e02bf2f26c5fb285f143faf4f0e46a"}, + {file = "SQLAlchemy-2.0.36-py3-none-any.whl", hash = "sha256:fddbe92b4760c6f5d48162aef14824add991aeda8ddadb3c31d56eb15ca69f8e"}, + {file = "sqlalchemy-2.0.36.tar.gz", hash = "sha256:7f2767680b6d2398aea7082e45a774b2b0767b5c8d8ffb9c8b683088ea9b29c5"}, ] [package.dependencies] @@ -2463,7 +2489,7 @@ aioodbc = ["aioodbc", "greenlet (!=0.4.17)"] aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing_extensions (!=3.10.0.1)"] asyncio = ["greenlet (!=0.4.17)"] asyncmy = ["asyncmy (>=0.2.3,!=0.2.4,!=0.2.6)", "greenlet (!=0.4.17)"] -mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2,!=1.1.5)"] +mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2,!=1.1.5,!=1.1.10)"] mssql = ["pyodbc"] mssql-pymssql = ["pymssql"] mssql-pyodbc = ["pyodbc"] @@ -2499,13 +2525,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.38.6" +version = "0.40.0" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.38.6-py3-none-any.whl", hash = "sha256:4517a1409e2e73ee4951214ba012052b9e16f60e90d73cfb06192c19203bbb05"}, - {file = "starlette-0.38.6.tar.gz", hash = "sha256:863a1588f5574e70a821dadefb41e4881ea451a47a3cd1b4df359d4ffefe5ead"}, + {file = "starlette-0.40.0-py3-none-any.whl", hash = "sha256:c494a22fae73805376ea6bf88439783ecfba9aac88a43911b48c653437e784c4"}, + {file = "starlette-0.40.0.tar.gz", hash = "sha256:1a3139688fb298ce5e2d661d37046a66ad996ce94be4d4983be019a23a04ea35"}, ] [package.dependencies] @@ -2613,13 +2639,13 @@ files = [ [[package]] name = "trio" -version = "0.26.2" +version = "0.27.0" description = "A friendly Python library for async concurrency and I/O" optional = false python-versions = ">=3.8" files = [ - {file = "trio-0.26.2-py3-none-any.whl", hash = "sha256:c5237e8133eb0a1d72f09a971a55c28ebe69e351c783fc64bc37db8db8bbe1d0"}, - {file = "trio-0.26.2.tar.gz", hash = "sha256:0346c3852c15e5c7d40ea15972c4805689ef2cb8b5206f794c9c19450119f3a4"}, + {file = "trio-0.27.0-py3-none-any.whl", hash = "sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884"}, + {file = "trio-0.27.0.tar.gz", hash = "sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831"}, ] [package.dependencies] @@ -2730,13 +2756,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "uvicorn" -version = "0.31.0" +version = "0.32.0" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" files = [ - {file = "uvicorn-0.31.0-py3-none-any.whl", hash = "sha256:cac7be4dd4d891c363cd942160a7b02e69150dcbc7a36be04d5f4af4b17c8ced"}, - {file = "uvicorn-0.31.0.tar.gz", hash = "sha256:13bc21373d103859f68fe739608e2eb054a816dea79189bc3ca08ea89a275906"}, + {file = "uvicorn-0.32.0-py3-none-any.whl", hash = "sha256:60b8f3a5ac027dcd31448f411ced12b5ef452c646f76f02f8cc3f25d8d26fd82"}, + {file = "uvicorn-0.32.0.tar.gz", hash = "sha256:f78b36b143c16f54ccdb8190d0a26b5f1901fe5a3c777e1ab29f26391af8551e"}, ] [package.dependencies] @@ -2749,13 +2775,13 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [[package]] name = "virtualenv" -version = "20.26.6" +version = "20.27.0" description = "Virtual Python Environment builder" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "virtualenv-20.26.6-py3-none-any.whl", hash = "sha256:7345cc5b25405607a624d8418154577459c3e0277f5466dd79c49d5e492995f2"}, - {file = "virtualenv-20.26.6.tar.gz", hash = "sha256:280aede09a2a5c317e409a00102e7077c6432c5a38f0ef938e643805a7ad2c48"}, + {file = "virtualenv-20.27.0-py3-none-any.whl", hash = "sha256:44a72c29cceb0ee08f300b314848c86e57bf8d1f13107a5e671fb9274138d655"}, + {file = "virtualenv-20.27.0.tar.gz", hash = "sha256:2ca56a68ed615b8fe4326d11a0dca5dfbe8fd68510fb6c6349163bed3c15f2b2"}, ] [package.dependencies] @@ -3007,4 +3033,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "796ddba36f031ad2b47cae43ce6c49102e2cb98f92823b265d9779e6684333f6" +content-hash = "edb7145394dd61f5a665b5519cc0c091c8c1628200ea1170857cff1a6bdb829e" diff --git a/pyproject.toml b/pyproject.toml index ae636a1c4..d4f583189 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ pytest-asyncio = ">=0.24.0" pytest-cov = ">=4.0.0,<6.0" ruff = "^0.6.9" pandas = ">=2.1.1,<3.0" -pillow = ">=10.0.0,<11.0" +pillow = ">=10.0.0,<12.0" plotly = ">=5.13.0,<6.0" asynctest = ">=0.13.0,<1.0" pre-commit = ">=3.2.1" diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index be97b170d..bc8826fe9 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -179,7 +179,7 @@ class UploadFilesProvider(Component): class Upload(MemoizationLeaf): """A file upload component.""" - library = "react-dropzone@14.2.9" + library = "react-dropzone@14.2.10" tag = "ReactDropzone" diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index c18e44885..3b4fa39d1 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -381,7 +381,7 @@ for theme_name in dir(Theme): class CodeBlock(Component): """A code block.""" - library = "react-syntax-highlighter@15.5.0" + library = "react-syntax-highlighter@15.6.1" tag = "PrismAsyncLight" diff --git a/reflex/components/recharts/recharts.py b/reflex/components/recharts/recharts.py index 9068cb396..a0d683f72 100644 --- a/reflex/components/recharts/recharts.py +++ b/reflex/components/recharts/recharts.py @@ -9,7 +9,7 @@ from reflex.utils import console class Recharts(Component): """A component that wraps a recharts lib.""" - library = "recharts@2.12.7" + library = "recharts@2.13.0" def render(self) -> Dict: """Render the tag. @@ -29,7 +29,7 @@ class Recharts(Component): class RechartsCharts(NoSSRComponent, MemoizationLeaf): """A component that wraps a recharts lib.""" - library = "recharts@2.12.7" + library = "recharts@2.13.0" LiteralAnimationEasing = Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"] diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 9acc109ac..02e184032 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -117,18 +117,18 @@ class PackageJson(SimpleNamespace): PATH = "package.json" DEPENDENCIES = { - "@babel/standalone": "7.25.7", + "@babel/standalone": "7.25.8", "@emotion/react": "11.13.3", "axios": "1.7.7", "json5": "2.2.3", - "next": "14.2.14", + "next": "14.2.15", "next-sitemap": "4.2.3", "next-themes": "0.3.0", "react": "18.3.1", "react-dom": "18.3.1", "react-focus-lock": "2.13.2", "socket.io-client": "4.8.0", - "universal-cookie": "7.2.0", + "universal-cookie": "7.2.1", } DEV_DEPENDENCIES = { "autoprefixer": "10.4.20", diff --git a/reflex/constants/style.py b/reflex/constants/style.py index 9cd51da79..403acd4ba 100644 --- a/reflex/constants/style.py +++ b/reflex/constants/style.py @@ -7,7 +7,7 @@ class Tailwind(SimpleNamespace): """Tailwind constants.""" # The Tailwindcss version - VERSION = "tailwindcss@3.4.13" + VERSION = "tailwindcss@3.4.14" # The Tailwind config. CONFIG = "tailwind.config.js" # Default Tailwind content paths From c05da488f95eb651cc5f100f3d32313bde08374d Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 21 Oct 2024 12:56:56 -0700 Subject: [PATCH 189/201] Raise TypeError when `ComputedVar.__init__` gets bad kwargs (#4199) It's easy to mis-spell `rx.var(cached=True)` instead of `rx.var(cache=True)`, and in 0.6.3, this doesn't actual raise an error... the bad value is silently discarded and the var is NOT marked as being cached. --- reflex/vars/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index 14e7251bb..cf02863c3 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -1557,8 +1557,8 @@ class ComputedVar(Var[RETURN_TYPE]): "return", Any ) - kwargs["_js_expr"] = kwargs.pop("_js_expr", fget.__name__) - kwargs["_var_type"] = kwargs.pop("_var_type", hint) + kwargs.setdefault("_js_expr", fget.__name__) + kwargs.setdefault("_var_type", hint) Var.__init__( self, @@ -1567,6 +1567,9 @@ class ComputedVar(Var[RETURN_TYPE]): _var_data=kwargs.pop("_var_data", None), ) + if kwargs: + raise TypeError(f"Unexpected keyword arguments: {tuple(kwargs)}") + if backend is None: backend = fget.__name__.startswith("_") From f39e8c96674a5e8bad5f42575a321c2af47c34ec Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 21 Oct 2024 13:28:55 -0700 Subject: [PATCH 190/201] move all environment variables to the same place (#4192) * move all environment variables to the same place * reorder things around * move more variables to environment * remove cyclical imports * forgot default value for field * for some reason type hints aren't being interpreted * put the field type *before* not after * make it get * move a bit more * add more fields * move reflex dir * add return * put things somewhere else * add custom error --- reflex/app.py | 9 +- reflex/compiler/compiler.py | 5 +- reflex/components/core/upload.py | 6 +- reflex/config.py | 198 +++++++++++++++++- reflex/constants/base.py | 79 ++++--- reflex/constants/config.py | 3 +- reflex/constants/installer.py | 106 +++++++--- reflex/constants/utils.py | 32 +++ reflex/custom_components/custom_components.py | 6 +- reflex/model.py | 19 +- reflex/reflex.py | 4 +- reflex/state.py | 8 +- reflex/utils/build.py | 12 -- reflex/utils/exceptions.py | 4 + reflex/utils/exec.py | 4 +- reflex/utils/net.py | 6 +- reflex/utils/path_ops.py | 22 +- reflex/utils/prerequisites.py | 17 +- reflex/utils/registry.py | 8 +- reflex/utils/types.py | 14 ++ tests/units/test_config.py | 3 +- 21 files changed, 421 insertions(+), 144 deletions(-) create mode 100644 reflex/constants/utils.py diff --git a/reflex/app.py b/reflex/app.py index 584b8a321..abf0b5d41 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -64,7 +64,7 @@ from reflex.components.core.client_side_routing import ( ) from reflex.components.core.upload import Upload, get_upload_dir from reflex.components.radix import themes -from reflex.config import get_config +from reflex.config import environment, get_config from reflex.event import Event, EventHandler, EventSpec, window_alert from reflex.model import Model, get_db_status from reflex.page import ( @@ -957,15 +957,16 @@ class App(MiddlewareMixin, LifespanMixin, Base): executor = None if ( platform.system() in ("Linux", "Darwin") - and os.environ.get("REFLEX_COMPILE_PROCESSES") is not None + and (number_of_processes := environment.REFLEX_COMPILE_PROCESSES) + is not None ): executor = concurrent.futures.ProcessPoolExecutor( - max_workers=int(os.environ.get("REFLEX_COMPILE_PROCESSES", 0)) or None, + max_workers=number_of_processes, mp_context=multiprocessing.get_context("fork"), ) else: executor = concurrent.futures.ThreadPoolExecutor( - max_workers=int(os.environ.get("REFLEX_COMPILE_THREADS", 0)) or None, + max_workers=environment.REFLEX_COMPILE_THREADS ) with executor: diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index 0c29f941d..909299635 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -2,7 +2,6 @@ from __future__ import annotations -import os from datetime import datetime from pathlib import Path from typing import Dict, Iterable, Optional, Type, Union @@ -16,7 +15,7 @@ from reflex.components.component import ( CustomComponent, StatefulComponent, ) -from reflex.config import get_config +from reflex.config import environment, get_config from reflex.state import BaseState from reflex.style import SYSTEM_COLOR_MODE from reflex.utils.exec import is_prod_mode @@ -527,7 +526,7 @@ def remove_tailwind_from_postcss() -> tuple[str, str]: def purge_web_pages_dir(): """Empty out .web/pages directory.""" - if not is_prod_mode() and os.environ.get("REFLEX_PERSIST_WEB_DIR"): + if not is_prod_mode() and environment.REFLEX_PERSIST_WEB_DIR: # Skip purging the web directory in dev mode if REFLEX_PERSIST_WEB_DIR is set. return diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index bc8826fe9..89665bb31 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -2,13 +2,13 @@ from __future__ import annotations -import os from pathlib import Path from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf from reflex.components.el.elements.forms import Input from reflex.components.radix.themes.layout.box import Box +from reflex.config import environment from reflex.constants import Dirs from reflex.event import ( CallableEventSpec, @@ -125,9 +125,7 @@ def get_upload_dir() -> Path: """ Upload.is_used = True - uploaded_files_dir = Path( - os.environ.get("REFLEX_UPLOADED_FILES_DIR", "./uploaded_files") - ) + uploaded_files_dir = environment.REFLEX_UPLOADED_FILES_DIR uploaded_files_dir.mkdir(parents=True, exist_ok=True) return uploaded_files_dir diff --git a/reflex/config.py b/reflex/config.py index 719d5c21f..2e16e2eb0 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -2,6 +2,7 @@ from __future__ import annotations +import dataclasses import importlib import os import sys @@ -9,7 +10,10 @@ import urllib.parse from pathlib import Path from typing import Any, Dict, List, Optional, Set, Union -from reflex.utils.exceptions import ConfigError +from typing_extensions import get_type_hints + +from reflex.utils.exceptions import ConfigError, EnvironmentVarValueError +from reflex.utils.types import value_inside_optional try: import pydantic.v1 as pydantic @@ -131,6 +135,198 @@ class DBConfig(Base): return f"{self.engine}://{path}/{self.database}" +def get_default_value_for_field(field: dataclasses.Field) -> Any: + """Get the default value for a field. + + Args: + field: The field. + + Returns: + The default value. + + Raises: + ValueError: If no default value is found. + """ + if field.default != dataclasses.MISSING: + return field.default + elif field.default_factory != dataclasses.MISSING: + return field.default_factory() + else: + raise ValueError( + f"Missing value for environment variable {field.name} and no default value found" + ) + + +def interpret_boolean_env(value: str) -> bool: + """Interpret a boolean environment variable value. + + Args: + value: The environment variable value. + + Returns: + The interpreted value. + + Raises: + EnvironmentVarValueError: If the value is invalid. + """ + true_values = ["true", "1", "yes", "y"] + false_values = ["false", "0", "no", "n"] + + if value.lower() in true_values: + return True + elif value.lower() in false_values: + return False + raise EnvironmentVarValueError(f"Invalid boolean value: {value}") + + +def interpret_int_env(value: str) -> int: + """Interpret an integer environment variable value. + + Args: + value: The environment variable value. + + Returns: + The interpreted value. + + Raises: + EnvironmentVarValueError: If the value is invalid. + """ + try: + return int(value) + except ValueError as ve: + raise EnvironmentVarValueError(f"Invalid integer value: {value}") from ve + + +def interpret_path_env(value: str) -> Path: + """Interpret a path environment variable value. + + Args: + value: The environment variable value. + + Returns: + The interpreted value. + + Raises: + EnvironmentVarValueError: If the path does not exist. + """ + path = Path(value) + if not path.exists(): + raise EnvironmentVarValueError(f"Path does not exist: {path}") + return path + + +def interpret_env_var_value(value: str, field: dataclasses.Field) -> Any: + """Interpret an environment variable value based on the field type. + + Args: + value: The environment variable value. + field: The field. + + Returns: + The interpreted value. + + Raises: + ValueError: If the value is invalid. + """ + field_type = value_inside_optional(field.type) + + if field_type is bool: + return interpret_boolean_env(value) + elif field_type is str: + return value + elif field_type is int: + return interpret_int_env(value) + elif field_type is Path: + return interpret_path_env(value) + + else: + raise ValueError( + f"Invalid type for environment variable {field.name}: {field_type}. This is probably an issue in Reflex." + ) + + +@dataclasses.dataclass(init=False) +class EnvironmentVariables: + """Environment variables class to instantiate environment variables.""" + + # Whether to use npm over bun to install frontend packages. + REFLEX_USE_NPM: bool = False + + # The npm registry to use. + NPM_CONFIG_REGISTRY: Optional[str] = None + + # Whether to use Granian for the backend. Otherwise, use Uvicorn. + REFLEX_USE_GRANIAN: bool = False + + # The username to use for authentication on python package repository. Username and password must both be provided. + TWINE_USERNAME: Optional[str] = None + + # The password to use for authentication on python package repository. Username and password must both be provided. + TWINE_PASSWORD: Optional[str] = None + + # Whether to use the system installed bun. If set to false, bun will be bundled with the app. + REFLEX_USE_SYSTEM_BUN: bool = False + + # Whether to use the system installed node and npm. If set to false, node and npm will be bundled with the app. + REFLEX_USE_SYSTEM_NODE: bool = False + + # The working directory for the next.js commands. + REFLEX_WEB_WORKDIR: Path = Path(constants.Dirs.WEB) + + # Path to the alembic config file + ALEMBIC_CONFIG: Path = Path(constants.ALEMBIC_CONFIG) + + # Disable SSL verification for HTTPX requests. + SSL_NO_VERIFY: bool = False + + # The directory to store uploaded files. + REFLEX_UPLOADED_FILES_DIR: Path = Path(constants.Dirs.UPLOADED_FILES) + + # Whether to use seperate processes to compile the frontend and how many. If not set, defaults to thread executor. + REFLEX_COMPILE_PROCESSES: Optional[int] = None + + # Whether to use seperate threads to compile the frontend and how many. Defaults to `min(32, os.cpu_count() + 4)`. + REFLEX_COMPILE_THREADS: Optional[int] = None + + # The directory to store reflex dependencies. + REFLEX_DIR: Path = Path(constants.Reflex.DIR) + + # Whether to print the SQL queries if the log level is INFO or lower. + SQLALCHEMY_ECHO: bool = False + + # Whether to ignore the redis config error. Some redis servers only allow out-of-band configuration. + REFLEX_IGNORE_REDIS_CONFIG_ERROR: bool = False + + # Whether to skip purging the web directory in dev mode. + REFLEX_PERSIST_WEB_DIR: bool = False + + # The reflex.build frontend host. + REFLEX_BUILD_FRONTEND: str = constants.Templates.REFLEX_BUILD_FRONTEND + + # The reflex.build backend host. + REFLEX_BUILD_BACKEND: str = constants.Templates.REFLEX_BUILD_BACKEND + + def __init__(self): + """Initialize the environment variables.""" + type_hints = get_type_hints(type(self)) + + for field in dataclasses.fields(self): + raw_value = os.getenv(field.name, None) + + field.type = type_hints.get(field.name) or field.type + + value = ( + interpret_env_var_value(raw_value, field) + if raw_value is not None + else get_default_value_for_field(field) + ) + + setattr(self, field.name, value) + + +environment = EnvironmentVariables() + + class Config(Base): """The config defines runtime settings for the app. diff --git a/reflex/constants/base.py b/reflex/constants/base.py index 070ff7724..bba53d625 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -2,7 +2,6 @@ from __future__ import annotations -import os import platform from enum import Enum from importlib import metadata @@ -11,6 +10,8 @@ from types import SimpleNamespace from platformdirs import PlatformDirs +from .utils import classproperty + IS_WINDOWS = platform.system() == "Windows" @@ -20,6 +21,8 @@ class Dirs(SimpleNamespace): # The frontend directories in a project. # The web folder where the NextJS app is compiled to. WEB = ".web" + # The directory where uploaded files are stored. + UPLOADED_FILES = "uploaded_files" # The name of the assets directory. APP_ASSETS = "assets" # The name of the assets directory for external ressource (a subfolder of APP_ASSETS). @@ -64,21 +67,13 @@ class Reflex(SimpleNamespace): # Files and directories used to init a new project. # The directory to store reflex dependencies. - # Get directory value from enviroment variables if it exists. - _dir = os.environ.get("REFLEX_DIR", "") + # on windows, we use C:/Users//AppData/Local/reflex. + # on macOS, we use ~/Library/Application Support/reflex. + # on linux, we use ~/.local/share/reflex. + # If user sets REFLEX_DIR envroment variable use that instead. + DIR = PlatformDirs(MODULE_NAME, False).user_data_path - DIR = Path( - _dir - or ( - # on windows, we use C:/Users//AppData/Local/reflex. - # on macOS, we use ~/Library/Application Support/reflex. - # on linux, we use ~/.local/share/reflex. - # If user sets REFLEX_DIR envroment variable use that instead. - PlatformDirs(MODULE_NAME, False).user_data_dir - ) - ) # The root directory of the reflex library. - ROOT_DIR = Path(__file__).parents[2] RELEASES_URL = f"https://api.github.com/repos/reflex-dev/templates/releases" @@ -101,27 +96,51 @@ class Templates(SimpleNamespace): DEFAULT = "blank" # The reflex.build frontend host - REFLEX_BUILD_FRONTEND = os.environ.get( - "REFLEX_BUILD_FRONTEND", "https://flexgen.reflex.run" - ) + REFLEX_BUILD_FRONTEND = "https://flexgen.reflex.run" # The reflex.build backend host - REFLEX_BUILD_BACKEND = os.environ.get( - "REFLEX_BUILD_BACKEND", "https://flexgen-prod-flexgen.fly.dev" - ) + REFLEX_BUILD_BACKEND = "https://flexgen-prod-flexgen.fly.dev" - # The URL to redirect to reflex.build - REFLEX_BUILD_URL = ( - REFLEX_BUILD_FRONTEND + "/gen?reflex_init_token={reflex_init_token}" - ) + @classproperty + @classmethod + def REFLEX_BUILD_URL(cls): + """The URL to redirect to reflex.build. - # The URL to poll waiting for the user to select a generation. - REFLEX_BUILD_POLL_URL = REFLEX_BUILD_BACKEND + "/api/init/{reflex_init_token}" + Returns: + The URL to redirect to reflex.build. + """ + from reflex.config import environment - # The URL to fetch the generation's reflex code - REFLEX_BUILD_CODE_URL = ( - REFLEX_BUILD_BACKEND + "/api/gen/{generation_hash}/refactored" - ) + return ( + environment.REFLEX_BUILD_FRONTEND + + "/gen?reflex_init_token={reflex_init_token}" + ) + + @classproperty + @classmethod + def REFLEX_BUILD_POLL_URL(cls): + """The URL to poll waiting for the user to select a generation. + + Returns: + The URL to poll waiting for the user to select a generation. + """ + from reflex.config import environment + + return environment.REFLEX_BUILD_BACKEND + "/api/init/{reflex_init_token}" + + @classproperty + @classmethod + def REFLEX_BUILD_CODE_URL(cls): + """The URL to fetch the generation's reflex code. + + Returns: + The URL to fetch the generation's reflex code. + """ + from reflex.config import environment + + return ( + environment.REFLEX_BUILD_BACKEND + "/api/gen/{generation_hash}/refactored" + ) class Dirs(SimpleNamespace): """Folders used by the template system of Reflex.""" diff --git a/reflex/constants/config.py b/reflex/constants/config.py index 3ff7aade5..970e67844 100644 --- a/reflex/constants/config.py +++ b/reflex/constants/config.py @@ -1,6 +1,5 @@ """Config constants.""" -import os from pathlib import Path from types import SimpleNamespace @@ -9,7 +8,7 @@ from reflex.constants.base import Dirs, Reflex from .compiler import Ext # Alembic migrations -ALEMBIC_CONFIG = os.environ.get("ALEMBIC_CONFIG", "alembic.ini") +ALEMBIC_CONFIG = "alembic.ini" class Config(SimpleNamespace): diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 02e184032..766dcf5be 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -3,9 +3,11 @@ from __future__ import annotations import platform +from pathlib import Path from types import SimpleNamespace -from .base import IS_WINDOWS, Reflex +from .base import IS_WINDOWS +from .utils import classproperty def get_fnm_name() -> str | None: @@ -36,12 +38,9 @@ class Bun(SimpleNamespace): # The Bun version. VERSION = "1.1.29" + # Min Bun Version MIN_VERSION = "0.7.0" - # The directory to store the bun. - ROOT_PATH = Reflex.DIR / "bun" - # Default bun path. - DEFAULT_PATH = ROOT_PATH / "bin" / ("bun" if not IS_WINDOWS else "bun.exe") # URL to bun install script. INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/bun_install.sh" @@ -50,11 +49,31 @@ class Bun(SimpleNamespace): WINDOWS_INSTALL_URL = ( "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/install.ps1" ) + # Path of the bunfig file CONFIG_PATH = "bunfig.toml" - # The environment variable to use the system installed bun. - USE_SYSTEM_VAR = "REFLEX_USE_SYSTEM_BUN" + @classproperty + @classmethod + def ROOT_PATH(cls): + """The directory to store the bun. + + Returns: + The directory to store the bun. + """ + from reflex.config import environment + + return environment.REFLEX_DIR / "bun" + + @classproperty + @classmethod + def DEFAULT_PATH(cls): + """Default bun path. + + Returns: + The default bun path. + """ + return cls.ROOT_PATH / "bin" / ("bun" if not IS_WINDOWS else "bun.exe") # FNM config. @@ -63,17 +82,36 @@ class Fnm(SimpleNamespace): # The FNM version. VERSION = "1.35.1" - # The directory to store fnm. - DIR = Reflex.DIR / "fnm" + FILENAME = get_fnm_name() - # The fnm executable binary. - EXE = DIR / ("fnm.exe" if IS_WINDOWS else "fnm") # The URL to the fnm release binary INSTALL_URL = ( f"https://github.com/Schniz/fnm/releases/download/v{VERSION}/{FILENAME}.zip" ) + @classproperty + @classmethod + def DIR(cls) -> Path: + """The directory to store fnm. + + Returns: + The directory to store fnm. + """ + from reflex.config import environment + + return environment.REFLEX_DIR / "fnm" + + @classproperty + @classmethod + def EXE(cls): + """The fnm executable binary. + + Returns: + The fnm executable binary. + """ + return cls.DIR / ("fnm.exe" if IS_WINDOWS else "fnm") + # Node / NPM config class Node(SimpleNamespace): @@ -84,23 +122,41 @@ class Node(SimpleNamespace): # The minimum required node version. MIN_VERSION = "18.17.0" - # The node bin path. - BIN_PATH = ( - Fnm.DIR - / "node-versions" - / f"v{VERSION}" - / "installation" - / ("bin" if not IS_WINDOWS else "") - ) + @classproperty + @classmethod + def BIN_PATH(cls): + """The node bin path. - # The default path where node is installed. - PATH = BIN_PATH / ("node.exe" if IS_WINDOWS else "node") + Returns: + The node bin path. + """ + return ( + Fnm.DIR + / "node-versions" + / f"v{cls.VERSION}" + / "installation" + / ("bin" if not IS_WINDOWS else "") + ) - # The default path where npm is installed. - NPM_PATH = BIN_PATH / "npm" + @classproperty + @classmethod + def PATH(cls): + """The default path where node is installed. - # The environment variable to use the system installed node. - USE_SYSTEM_VAR = "REFLEX_USE_SYSTEM_NODE" + Returns: + The default path where node is installed. + """ + return cls.BIN_PATH / ("node.exe" if IS_WINDOWS else "node") + + @classproperty + @classmethod + def NPM_PATH(cls): + """The default path where npm is installed. + + Returns: + The default path where npm is installed. + """ + return cls.BIN_PATH / "npm" class PackageJson(SimpleNamespace): diff --git a/reflex/constants/utils.py b/reflex/constants/utils.py new file mode 100644 index 000000000..48797afbf --- /dev/null +++ b/reflex/constants/utils.py @@ -0,0 +1,32 @@ +"""Utility functions for constants.""" + +from typing import Any, Callable, Generic, Type + +from typing_extensions import TypeVar + +T = TypeVar("T") +V = TypeVar("V") + + +class classproperty(Generic[T, V]): + """A class property decorator.""" + + def __init__(self, getter: Callable[[Type[T]], V]) -> None: + """Initialize the class property. + + Args: + getter: The getter function. + """ + self.getter = getattr(getter, "__func__", getter) + + def __get__(self, instance: Any, owner: Type[T]) -> V: + """Get the value of the class property. + + Args: + instance: The instance of the class. + owner: The class itself. + + Returns: + The value of the class property. + """ + return self.getter(owner) diff --git a/reflex/custom_components/custom_components.py b/reflex/custom_components/custom_components.py index ee24a7cd0..ddda3de56 100644 --- a/reflex/custom_components/custom_components.py +++ b/reflex/custom_components/custom_components.py @@ -17,7 +17,7 @@ import typer from tomlkit.exceptions import TOMLKitError from reflex import constants -from reflex.config import get_config +from reflex.config import environment, get_config from reflex.constants import CustomComponents from reflex.utils import console @@ -609,14 +609,14 @@ def publish( help="The API token to use for authentication on python package repository. If token is provided, no username/password should be provided at the same time", ), username: Optional[str] = typer.Option( - os.getenv("TWINE_USERNAME"), + environment.TWINE_USERNAME, "-u", "--username", show_default="TWINE_USERNAME environment variable value if set", help="The username to use for authentication on python package repository. Username and password must both be provided.", ), password: Optional[str] = typer.Option( - os.getenv("TWINE_PASSWORD"), + environment.TWINE_PASSWORD, "-p", "--password", show_default="TWINE_PASSWORD environment variable value if set", diff --git a/reflex/model.py b/reflex/model.py index 0e8d62e90..b269044c5 100644 --- a/reflex/model.py +++ b/reflex/model.py @@ -2,9 +2,7 @@ from __future__ import annotations -import os from collections import defaultdict -from pathlib import Path from typing import Any, ClassVar, Optional, Type, Union import alembic.autogenerate @@ -18,9 +16,8 @@ import sqlalchemy import sqlalchemy.exc import sqlalchemy.orm -from reflex import constants from reflex.base import Base -from reflex.config import get_config +from reflex.config import environment, get_config from reflex.utils import console from reflex.utils.compat import sqlmodel, sqlmodel_field_has_primary_key @@ -41,12 +38,12 @@ def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine: url = url or conf.db_url if url is None: raise ValueError("No database url configured") - if not Path(constants.ALEMBIC_CONFIG).exists(): + if environment.ALEMBIC_CONFIG.exists(): console.warn( "Database is not initialized, run [bold]reflex db init[/bold] first." ) # Print the SQL queries if the log level is INFO or lower. - echo_db_query = os.environ.get("SQLALCHEMY_ECHO") == "True" + echo_db_query = environment.SQLALCHEMY_ECHO # Needed for the admin dash on sqlite. connect_args = {"check_same_thread": False} if url.startswith("sqlite") else {} return sqlmodel.create_engine(url, echo=echo_db_query, connect_args=connect_args) @@ -234,7 +231,7 @@ class Model(Base, sqlmodel.SQLModel): # pyright: ignore [reportGeneralTypeIssue Returns: tuple of (config, script_directory) """ - config = alembic.config.Config(constants.ALEMBIC_CONFIG) + config = alembic.config.Config(environment.ALEMBIC_CONFIG) return config, alembic.script.ScriptDirectory( config.get_main_option("script_location", default="version"), ) @@ -269,8 +266,8 @@ class Model(Base, sqlmodel.SQLModel): # pyright: ignore [reportGeneralTypeIssue def alembic_init(cls): """Initialize alembic for the project.""" alembic.command.init( - config=alembic.config.Config(constants.ALEMBIC_CONFIG), - directory=str(Path(constants.ALEMBIC_CONFIG).parent / "alembic"), + config=alembic.config.Config(environment.ALEMBIC_CONFIG), + directory=str(environment.ALEMBIC_CONFIG.parent / "alembic"), ) @classmethod @@ -290,7 +287,7 @@ class Model(Base, sqlmodel.SQLModel): # pyright: ignore [reportGeneralTypeIssue Returns: True when changes have been detected. """ - if not Path(constants.ALEMBIC_CONFIG).exists(): + if not environment.ALEMBIC_CONFIG.exists(): return False config, script_directory = cls._alembic_config() @@ -391,7 +388,7 @@ class Model(Base, sqlmodel.SQLModel): # pyright: ignore [reportGeneralTypeIssue True - indicating the process was successful. None - indicating the process was skipped. """ - if not Path(constants.ALEMBIC_CONFIG).exists(): + if not environment.ALEMBIC_CONFIG.exists(): return with cls.get_db_engine().connect() as connection: diff --git a/reflex/reflex.py b/reflex/reflex.py index 99850a9d2..7bef8b7e5 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -13,7 +13,7 @@ from reflex_cli.deployments import deployments_cli from reflex_cli.utils import dependency from reflex import constants -from reflex.config import get_config +from reflex.config import environment, get_config from reflex.custom_components.custom_components import custom_components_cli from reflex.state import reset_disk_state_manager from reflex.utils import console, redir, telemetry @@ -420,7 +420,7 @@ def db_init(): return # Check the alembic config. - if Path(constants.ALEMBIC_CONFIG).exists(): + if environment.ALEMBIC_CONFIG.exists(): console.error( "Database is already initialized. Use " "[bold]reflex db makemigrations[/bold] to create schema change " diff --git a/reflex/state.py b/reflex/state.py index 9740bddaa..0634ad5b7 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -8,7 +8,6 @@ import copy import dataclasses import functools import inspect -import os import pickle import sys import uuid @@ -64,6 +63,7 @@ from redis.exceptions import ResponseError import reflex.istate.dynamic from reflex import constants from reflex.base import Base +from reflex.config import environment from reflex.event import ( BACKGROUND_TASK_MARKER, Event, @@ -3274,11 +3274,7 @@ class StateManagerRedis(StateManager): ) except ResponseError: # Some redis servers only allow out-of-band configuration, so ignore errors here. - ignore_config_error = os.environ.get( - "REFLEX_IGNORE_REDIS_CONFIG_ERROR", - None, - ) - if not ignore_config_error: + if not environment.REFLEX_IGNORE_REDIS_CONFIG_ERROR: raise async with self.redis.pubsub() as pubsub: await pubsub.psubscribe(lock_key_channel) diff --git a/reflex/utils/build.py b/reflex/utils/build.py index 770809015..14709d99c 100644 --- a/reflex/utils/build.py +++ b/reflex/utils/build.py @@ -23,18 +23,6 @@ def set_env_json(): ) -def set_os_env(**kwargs): - """Set os environment variables. - - Args: - kwargs: env key word args. - """ - for key, value in kwargs.items(): - if not value: - continue - os.environ[key.upper()] = value - - def generate_sitemap_config(deploy_url: str, export=False): """Generate the sitemap config file. diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 35f59a0e1..cd3d108b4 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -135,3 +135,7 @@ class SetUndefinedStateVarError(ReflexError, AttributeError): class StateSchemaMismatchError(ReflexError, TypeError): """Raised when the serialized schema of a state class does not match the current schema.""" + + +class EnvironmentVarValueError(ReflexError, ValueError): + """Raised when an environment variable is set to an invalid value.""" diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 6fa67a96f..f5521c91f 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -15,7 +15,7 @@ from urllib.parse import urljoin import psutil from reflex import constants -from reflex.config import get_config +from reflex.config import environment, get_config from reflex.constants.base import LogLevel from reflex.utils import console, path_ops from reflex.utils.prerequisites import get_web_dir @@ -184,7 +184,7 @@ def should_use_granian(): Returns: True if Granian should be used. """ - return os.getenv("REFLEX_USE_GRANIAN", "0") == "1" + return environment.REFLEX_USE_GRANIAN def get_app_module(): diff --git a/reflex/utils/net.py b/reflex/utils/net.py index 83e25559c..2c6f22764 100644 --- a/reflex/utils/net.py +++ b/reflex/utils/net.py @@ -1,9 +1,8 @@ """Helpers for downloading files from the network.""" -import os - import httpx +from ..config import environment from . import console @@ -13,8 +12,7 @@ def _httpx_verify_kwarg() -> bool: Returns: True if SSL verification is enabled, False otherwise """ - ssl_no_verify = os.environ.get("SSL_NO_VERIFY", "").lower() in ["true", "1", "yes"] - return not ssl_no_verify + return not environment.SSL_NO_VERIFY def get(url: str, **kwargs) -> httpx.Response: diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index f795e1aa4..ee93b24cf 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -9,6 +9,7 @@ import shutil from pathlib import Path from reflex import constants +from reflex.config import environment # Shorthand for join. join = os.linesep.join @@ -129,30 +130,13 @@ def which(program: str | Path) -> str | Path | None: return shutil.which(str(program)) -def use_system_install(var_name: str) -> bool: - """Check if the system install should be used. - - Args: - var_name: The name of the environment variable. - - Raises: - ValueError: If the variable name is invalid. - - Returns: - Whether the associated env var should use the system install. - """ - if not var_name.startswith("REFLEX_USE_SYSTEM_"): - raise ValueError("Invalid system install variable name.") - return os.getenv(var_name, "").lower() in ["true", "1", "yes"] - - def use_system_node() -> bool: """Check if the system node should be used. Returns: Whether the system node should be used. """ - return use_system_install(constants.Node.USE_SYSTEM_VAR) + return environment.REFLEX_USE_SYSTEM_NODE def use_system_bun() -> bool: @@ -161,7 +145,7 @@ def use_system_bun() -> bool: Returns: Whether the system bun should be used. """ - return use_system_install(constants.Bun.USE_SYSTEM_VAR) + return environment.REFLEX_USE_SYSTEM_BUN def get_node_bin_path() -> Path | None: diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 44d1f6acc..33165af0e 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -33,7 +33,7 @@ from redis.asyncio import Redis from reflex import constants, model from reflex.compiler import templates -from reflex.config import Config, get_config +from reflex.config import Config, environment, get_config from reflex.utils import console, net, path_ops, processes from reflex.utils.exceptions import GeneratedCodeHasNoFunctionDefs from reflex.utils.format import format_library_name @@ -69,8 +69,7 @@ def get_web_dir() -> Path: Returns: The working directory. """ - workdir = Path(os.getenv("REFLEX_WEB_WORKDIR", constants.Dirs.WEB)) - return workdir + return environment.REFLEX_WEB_WORKDIR def _python_version_check(): @@ -250,7 +249,7 @@ def windows_npm_escape_hatch() -> bool: Returns: If the user has set REFLEX_USE_NPM. """ - return os.environ.get("REFLEX_USE_NPM", "").lower() in ["true", "1", "yes"] + return environment.REFLEX_USE_NPM def get_app(reload: bool = False) -> ModuleType: @@ -992,7 +991,7 @@ def needs_reinit(frontend: bool = True) -> bool: return False # Make sure the .reflex directory exists. - if not constants.Reflex.DIR.exists(): + if not environment.REFLEX_DIR.exists(): return True # Make sure the .web directory exists in frontend mode. @@ -1097,7 +1096,7 @@ def ensure_reflex_installation_id() -> Optional[int]: """ try: initialize_reflex_user_directory() - installation_id_file = constants.Reflex.DIR / "installation_id" + installation_id_file = environment.REFLEX_DIR / "installation_id" installation_id = None if installation_id_file.exists(): @@ -1122,7 +1121,7 @@ def ensure_reflex_installation_id() -> Optional[int]: def initialize_reflex_user_directory(): """Initialize the reflex user directory.""" # Create the reflex directory. - path_ops.mkdir(constants.Reflex.DIR) + path_ops.mkdir(environment.REFLEX_DIR) def initialize_frontend_dependencies(): @@ -1145,7 +1144,7 @@ def check_db_initialized() -> bool: Returns: True if alembic is initialized (or if database is not used). """ - if get_config().db_url is not None and not Path(constants.ALEMBIC_CONFIG).exists(): + if get_config().db_url is not None and not environment.ALEMBIC_CONFIG.exists(): console.error( "Database is not initialized. Run [bold]reflex db init[/bold] first." ) @@ -1155,7 +1154,7 @@ def check_db_initialized() -> bool: def check_schema_up_to_date(): """Check if the sqlmodel metadata matches the current database schema.""" - if get_config().db_url is None or not Path(constants.ALEMBIC_CONFIG).exists(): + if get_config().db_url is None or not environment.ALEMBIC_CONFIG.exists(): return with model.Model.get_db_engine().connect() as connection: try: diff --git a/reflex/utils/registry.py b/reflex/utils/registry.py index 6b87c163d..77c3d31cd 100644 --- a/reflex/utils/registry.py +++ b/reflex/utils/registry.py @@ -1,9 +1,8 @@ """Utilities for working with registries.""" -import os - import httpx +from reflex.config import environment from reflex.utils import console, net @@ -56,7 +55,4 @@ def _get_npm_registry() -> str: Returns: str: """ - if npm_registry := os.environ.get("NPM_CONFIG_REGISTRY", ""): - return npm_registry - else: - return get_best_registry() + return environment.NPM_CONFIG_REGISTRY or get_best_registry() diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 0a3aed110..3d7992011 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -274,6 +274,20 @@ def is_optional(cls: GenericType) -> bool: return is_union(cls) and type(None) in get_args(cls) +def value_inside_optional(cls: GenericType) -> GenericType: + """Get the value inside an Optional type or the original type. + + Args: + cls: The class to check. + + Returns: + The value inside the Optional type or the original type. + """ + if is_union(cls) and len(args := get_args(cls)) >= 2 and type(None) in args: + return unionize(*[arg for arg in args if arg is not type(None)]) + return cls + + def get_property_hint(attr: Any | None) -> GenericType | None: """Check if an attribute is a property and return its type hint. diff --git a/tests/units/test_config.py b/tests/units/test_config.py index a6c6fe697..c4a143bc5 100644 --- a/tests/units/test_config.py +++ b/tests/units/test_config.py @@ -5,6 +5,7 @@ import pytest import reflex as rx import reflex.config +from reflex.config import environment from reflex.constants import Endpoint @@ -178,7 +179,7 @@ def test_replace_defaults( def reflex_dir_constant(): - return rx.constants.Reflex.DIR + return environment.REFLEX_DIR def test_reflex_dir_env_var(monkeypatch, tmp_path): From 54ad9f0f4b4e7832c4720ecc5245f9e214bd5ec9 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 21 Oct 2024 17:05:13 -0700 Subject: [PATCH 191/201] make var system expandable (#4175) * make var system expandable * use old syntax * remove newer features * that's a weird error * remove unnecessary error message * remove hacky getattr as it's no longer necessary * improve color handling * get it right pyright * dang it darglint * fix prototype to string * don't try twice * adjust test case * add test for var alpha * change place of type ignore * fix json * add name to custom var operation * don't delete that you silly * change logic * remove extra word --- reflex/event.py | 35 +- reflex/vars/base.py | 866 +++++++++++---------- reflex/vars/function.py | 21 +- reflex/vars/number.py | 139 ++-- reflex/vars/object.py | 32 +- reflex/vars/sequence.py | 204 +++-- tests/units/components/core/test_colors.py | 12 +- tests/units/test_var.py | 4 +- 8 files changed, 682 insertions(+), 631 deletions(-) diff --git a/reflex/event.py b/reflex/event.py index 8291e3465..76a465739 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -12,7 +12,6 @@ from functools import partial from typing import ( Any, Callable, - ClassVar, Dict, Generic, List, @@ -33,9 +32,7 @@ from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.types import ArgsSpec, GenericType from reflex.vars import VarData from reflex.vars.base import ( - LiteralNoneVar, LiteralVar, - ToOperation, Var, ) from reflex.vars.function import ( @@ -1254,7 +1251,7 @@ def get_fn_signature(fn: Callable) -> inspect.Signature: return signature.replace(parameters=(new_param, *signature.parameters.values())) -class EventVar(ObjectVar): +class EventVar(ObjectVar, python_types=EventSpec): """Base class for event vars.""" @@ -1315,7 +1312,7 @@ class LiteralEventVar(VarOperationCall, LiteralVar, EventVar): ) -class EventChainVar(FunctionVar): +class EventChainVar(FunctionVar, python_types=EventChain): """Base class for event chain vars.""" @@ -1384,32 +1381,6 @@ class LiteralEventChainVar(ArgsFunctionOperation, LiteralVar, EventChainVar): ) -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToEventVarOperation(ToOperation, EventVar): - """Result of a cast to an event var.""" - - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - - _default_var_type: ClassVar[Type] = EventSpec - - -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToEventChainVarOperation(ToOperation, EventChainVar): - """Result of a cast to an event chain var.""" - - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - - _default_var_type: ClassVar[Type] = EventChain - - G = ParamSpec("G") IndividualEventType = Union[EventSpec, EventHandler, Callable[G, Any], Var[Any]] @@ -1537,8 +1508,6 @@ class EventNamespace(types.SimpleNamespace): LiteralEventVar = LiteralEventVar EventChainVar = EventChainVar LiteralEventChainVar = LiteralEventChainVar - ToEventVarOperation = ToEventVarOperation - ToEventChainVarOperation = ToEventChainVarOperation EventType = EventType __call__ = staticmethod(event_handler) diff --git a/reflex/vars/base.py b/reflex/vars/base.py index cf02863c3..6df8eec6f 100644 --- a/reflex/vars/base.py +++ b/reflex/vars/base.py @@ -19,6 +19,7 @@ from typing import ( TYPE_CHECKING, Any, Callable, + ClassVar, Dict, FrozenSet, Generic, @@ -37,7 +38,13 @@ from typing import ( overload, ) -from typing_extensions import ParamSpec, TypeGuard, deprecated, get_type_hints, override +from typing_extensions import ( + ParamSpec, + TypeGuard, + deprecated, + get_type_hints, + override, +) from reflex import constants from reflex.base import Base @@ -61,15 +68,13 @@ from reflex.utils.types import GenericType, Self, get_origin, has_args, unionize if TYPE_CHECKING: from reflex.state import BaseState - from .function import FunctionVar, ToFunctionOperation + from .function import FunctionVar from .number import ( BooleanVar, NumberVar, - ToBooleanVarOperation, - ToNumberVarOperation, ) - from .object import ObjectVar, ToObjectOperation - from .sequence import ArrayVar, StringVar, ToArrayOperation, ToStringOperation + from .object import ObjectVar + from .sequence import ArrayVar, StringVar VAR_TYPE = TypeVar("VAR_TYPE", covariant=True) @@ -78,6 +83,184 @@ OTHER_VAR_TYPE = TypeVar("OTHER_VAR_TYPE") warnings.filterwarnings("ignore", message="fields may not start with an underscore") +@dataclasses.dataclass( + eq=False, + frozen=True, +) +class VarSubclassEntry: + """Entry for a Var subclass.""" + + var_subclass: Type[Var] + to_var_subclass: Type[ToOperation] + python_types: Tuple[GenericType, ...] + + +_var_subclasses: List[VarSubclassEntry] = [] +_var_literal_subclasses: List[Tuple[Type[LiteralVar], VarSubclassEntry]] = [] + + +@dataclasses.dataclass( + eq=True, + frozen=True, +) +class VarData: + """Metadata associated with a x.""" + + # The name of the enclosing state. + state: str = dataclasses.field(default="") + + # The name of the field in the state. + field_name: str = dataclasses.field(default="") + + # Imports needed to render this var + imports: ImmutableParsedImportDict = dataclasses.field(default_factory=tuple) + + # Hooks that need to be present in the component to render this var + hooks: Tuple[str, ...] = dataclasses.field(default_factory=tuple) + + def __init__( + self, + state: str = "", + field_name: str = "", + imports: ImportDict | ParsedImportDict | None = None, + hooks: dict[str, None] | None = None, + ): + """Initialize the var data. + + Args: + state: The name of the enclosing state. + field_name: The name of the field in the state. + imports: Imports needed to render this var. + hooks: Hooks that need to be present in the component to render this var. + """ + immutable_imports: ImmutableParsedImportDict = tuple( + sorted( + ((k, tuple(sorted(v))) for k, v in parse_imports(imports or {}).items()) + ) + ) + object.__setattr__(self, "state", state) + object.__setattr__(self, "field_name", field_name) + object.__setattr__(self, "imports", immutable_imports) + object.__setattr__(self, "hooks", tuple(hooks or {})) + + def old_school_imports(self) -> ImportDict: + """Return the imports as a mutable dict. + + Returns: + The imports as a mutable dict. + """ + return dict((k, list(v)) for k, v in self.imports) + + @classmethod + def merge(cls, *others: VarData | None) -> VarData | None: + """Merge multiple var data objects. + + Args: + *others: The var data objects to merge. + + Returns: + The merged var data object. + """ + state = "" + field_name = "" + _imports = {} + hooks = {} + for var_data in others: + if var_data is None: + continue + state = state or var_data.state + field_name = field_name or var_data.field_name + _imports = imports.merge_imports(_imports, var_data.imports) + hooks.update( + var_data.hooks + if isinstance(var_data.hooks, dict) + else {k: None for k in var_data.hooks} + ) + + if state or _imports or hooks or field_name: + return VarData( + state=state, + field_name=field_name, + imports=_imports, + hooks=hooks, + ) + return None + + def __bool__(self) -> bool: + """Check if the var data is non-empty. + + Returns: + True if any field is set to a non-default value. + """ + return bool(self.state or self.imports or self.hooks or self.field_name) + + @classmethod + def from_state(cls, state: Type[BaseState] | str, field_name: str = "") -> VarData: + """Set the state of the var. + + Args: + state: The state to set or the full name of the state. + field_name: The name of the field in the state. Optional. + + Returns: + The var with the set state. + """ + from reflex.utils import format + + state_name = state if isinstance(state, str) else state.get_full_name() + return VarData( + state=state_name, + field_name=field_name, + hooks={ + "const {0} = useContext(StateContexts.{0})".format( + format.format_state_name(state_name) + ): None + }, + imports={ + f"/{constants.Dirs.CONTEXTS_PATH}": [ImportVar(tag="StateContexts")], + "react": [ImportVar(tag="useContext")], + }, + ) + + +def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: + """Decode the state name from a formatted var. + + Args: + value: The value to extract the state name from. + + Returns: + The extracted state name and the value without the state name. + """ + var_datas = [] + if isinstance(value, str): + # fast path if there is no encoded VarData + if constants.REFLEX_VAR_OPENING_TAG not in value: + return None, value + + offset = 0 + + # Find all tags. + while m := _decode_var_pattern.search(value): + start, end = m.span() + value = value[:start] + value[end:] + + serialized_data = m.group(1) + + if serialized_data.isnumeric() or ( + serialized_data[0] == "-" and serialized_data[1:].isnumeric() + ): + # This is a global immutable var. + var = _global_vars[int(serialized_data)] + var_data = var._get_all_var_data() + + if var_data is not None: + var_datas.append(var_data) + offset += end - start + + return VarData.merge(*var_datas) if var_datas else None, value + + @dataclasses.dataclass( eq=False, frozen=True, @@ -151,6 +334,40 @@ class Var(Generic[VAR_TYPE]): """ return False + def __init_subclass__( + cls, python_types: Tuple[GenericType, ...] | GenericType = types.Unset, **kwargs + ): + """Initialize the subclass. + + Args: + python_types: The python types that the var represents. + **kwargs: Additional keyword arguments. + """ + super().__init_subclass__(**kwargs) + + if python_types is not types.Unset: + python_types = ( + python_types if isinstance(python_types, tuple) else (python_types,) + ) + + @dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, + ) + class ToVarOperation(ToOperation, cls): + """Base class of converting a var to another var type.""" + + _original: Var = dataclasses.field( + default=Var(_js_expr="null", _var_type=None), + ) + + _default_var_type: ClassVar[GenericType] = python_types[0] + + ToVarOperation.__name__ = f'To{cls.__name__.removesuffix("Var")}Operation' + + _var_subclasses.append(VarSubclassEntry(cls, ToVarOperation, python_types)) + def __post_init__(self): """Post-initialize the var.""" # Decode any inline Var markup and apply it to the instance @@ -331,35 +548,35 @@ class Var(Generic[VAR_TYPE]): return f"{constants.REFLEX_VAR_OPENING_TAG}{hashed_var}{constants.REFLEX_VAR_CLOSING_TAG}{self._js_expr}" @overload - def to(self, output: Type[StringVar]) -> ToStringOperation: ... + def to(self, output: Type[StringVar]) -> StringVar: ... @overload - def to(self, output: Type[str]) -> ToStringOperation: ... + def to(self, output: Type[str]) -> StringVar: ... @overload - def to(self, output: Type[BooleanVar]) -> ToBooleanVarOperation: ... + def to(self, output: Type[BooleanVar]) -> BooleanVar: ... @overload def to( self, output: Type[NumberVar], var_type: type[int] | type[float] = float - ) -> ToNumberVarOperation: ... + ) -> NumberVar: ... @overload def to( self, output: Type[ArrayVar], var_type: type[list] | type[tuple] | type[set] = list, - ) -> ToArrayOperation: ... + ) -> ArrayVar: ... @overload def to( self, output: Type[ObjectVar], var_type: types.GenericType = dict - ) -> ToObjectOperation: ... + ) -> ObjectVar: ... @overload def to( self, output: Type[FunctionVar], var_type: Type[Callable] = Callable - ) -> ToFunctionOperation: ... + ) -> FunctionVar: ... @overload def to( @@ -379,56 +596,26 @@ class Var(Generic[VAR_TYPE]): output: The output type. var_type: The type of the var. - Raises: - TypeError: If the var_type is not a supported type for the output. - Returns: The converted var. """ - from reflex.event import ( - EventChain, - EventChainVar, - EventSpec, - EventVar, - ToEventChainVarOperation, - ToEventVarOperation, - ) - - from .function import FunctionVar, ToFunctionOperation - from .number import ( - BooleanVar, - NumberVar, - ToBooleanVarOperation, - ToNumberVarOperation, - ) - from .object import ObjectVar, ToObjectOperation - from .sequence import ArrayVar, StringVar, ToArrayOperation, ToStringOperation + from .object import ObjectVar base_type = var_type if types.is_optional(base_type): base_type = types.get_args(base_type)[0] - fixed_type = get_origin(base_type) or base_type - fixed_output_type = get_origin(output) or output # If the first argument is a python type, we map it to the corresponding Var type. - if fixed_output_type is dict: - return self.to(ObjectVar, output) - if fixed_output_type in (list, tuple, set): - return self.to(ArrayVar, output) - if fixed_output_type in (int, float): - return self.to(NumberVar, output) - if fixed_output_type is str: - return self.to(StringVar, output) - if fixed_output_type is bool: - return self.to(BooleanVar, output) + for var_subclass in _var_subclasses[::-1]: + if fixed_output_type in var_subclass.python_types: + return self.to(var_subclass.var_subclass, output) + if fixed_output_type is None: - return ToNoneOperation.create(self) - if fixed_output_type is EventSpec: - return self.to(EventVar, output) - if fixed_output_type is EventChain: - return self.to(EventChainVar, output) + return get_to_operation(NoneVar).create(self) # type: ignore + + # Handle fixed_output_type being Base or a dataclass. try: if issubclass(fixed_output_type, Base): return self.to(ObjectVar, output) @@ -440,57 +627,12 @@ class Var(Generic[VAR_TYPE]): return self.to(ObjectVar, output) if inspect.isclass(output): - if issubclass(output, BooleanVar): - return ToBooleanVarOperation.create(self) - - if issubclass(output, NumberVar): - if fixed_type is not None: - if fixed_type in types.UnionTypes: - inner_types = get_args(base_type) - if not all(issubclass(t, (int, float)) for t in inner_types): - raise TypeError( - f"Unsupported type {var_type} for NumberVar. Must be int or float." - ) - - elif not issubclass(fixed_type, (int, float)): - raise TypeError( - f"Unsupported type {var_type} for NumberVar. Must be int or float." - ) - return ToNumberVarOperation.create(self, var_type or float) - - if issubclass(output, ArrayVar): - if fixed_type is not None and not issubclass( - fixed_type, (list, tuple, set) - ): - raise TypeError( - f"Unsupported type {var_type} for ArrayVar. Must be list, tuple, or set." + for var_subclass in _var_subclasses[::-1]: + if issubclass(output, var_subclass.var_subclass): + to_operation_return = var_subclass.to_var_subclass.create( + value=self, _var_type=var_type ) - return ToArrayOperation.create(self, var_type or list) - - if issubclass(output, StringVar): - return ToStringOperation.create(self, var_type or str) - - if issubclass(output, EventVar): - return ToEventVarOperation.create(self, var_type or EventSpec) - - if issubclass(output, EventChainVar): - return ToEventChainVarOperation.create(self, var_type or EventChain) - - if issubclass(output, (ObjectVar, Base)): - return ToObjectOperation.create(self, var_type or dict) - - if issubclass(output, FunctionVar): - # if fixed_type is not None and not issubclass(fixed_type, Callable): - # raise TypeError( - # f"Unsupported type {var_type} for FunctionVar. Must be Callable." - # ) - return ToFunctionOperation.create(self, var_type or Callable) - - if issubclass(output, NoneVar): - return ToNoneOperation.create(self) - - if dataclasses.is_dataclass(output): - return ToObjectOperation.create(self, var_type or dict) + return to_operation_return # type: ignore # If we can't determine the first argument, we just replace the _var_type. if not issubclass(output, Var) or var_type is None: @@ -508,6 +650,18 @@ class Var(Generic[VAR_TYPE]): return self + @overload + def guess_type(self: Var[str]) -> StringVar: ... + + @overload + def guess_type(self: Var[bool]) -> BooleanVar: ... + + @overload + def guess_type(self: Var[int] | Var[float] | Var[int | float]) -> NumberVar: ... + + @overload + def guess_type(self) -> Self: ... + def guess_type(self) -> Var: """Guesses the type of the variable based on its `_var_type` attribute. @@ -517,11 +671,8 @@ class Var(Generic[VAR_TYPE]): Raises: TypeError: If the type is not supported for guessing. """ - from reflex.event import EventChain, EventChainVar, EventSpec, EventVar - - from .number import BooleanVar, NumberVar + from .number import NumberVar from .object import ObjectVar - from .sequence import ArrayVar, StringVar var_type = self._var_type if var_type is None: @@ -558,20 +709,13 @@ class Var(Generic[VAR_TYPE]): if not inspect.isclass(fixed_type): raise TypeError(f"Unsupported type {var_type} for guess_type.") - if issubclass(fixed_type, bool): - return self.to(BooleanVar, self._var_type) - if issubclass(fixed_type, (int, float)): - return self.to(NumberVar, self._var_type) - if issubclass(fixed_type, dict): - return self.to(ObjectVar, self._var_type) - if issubclass(fixed_type, (list, tuple, set)): - return self.to(ArrayVar, self._var_type) - if issubclass(fixed_type, str): - return self.to(StringVar, self._var_type) - if issubclass(fixed_type, EventSpec): - return self.to(EventVar, self._var_type) - if issubclass(fixed_type, EventChain): - return self.to(EventChainVar, self._var_type) + if fixed_type is None: + return self.to(None) + + for var_subclass in _var_subclasses[::-1]: + if issubclass(fixed_type, var_subclass.python_types): + return self.to(var_subclass.var_subclass, self._var_type) + try: if issubclass(fixed_type, Base): return self.to(ObjectVar, self._var_type) @@ -782,16 +926,23 @@ class Var(Generic[VAR_TYPE]): """ return ~self.bool() - def to_string(self): + def to_string(self, use_json: bool = True) -> StringVar: """Convert the var to a string. + Args: + use_json: Whether to use JSON stringify. If False, uses Object.prototype.toString. + Returns: The string var. """ - from .function import JSON_STRINGIFY + from .function import JSON_STRINGIFY, PROTOTYPE_TO_STRING from .sequence import StringVar - return JSON_STRINGIFY.call(self).to(StringVar) + return ( + JSON_STRINGIFY.call(self).to(StringVar) + if use_json + else PROTOTYPE_TO_STRING.call(self).to(StringVar) + ) def as_ref(self) -> Var: """Get a reference to the var. @@ -1017,9 +1168,129 @@ class Var(Generic[VAR_TYPE]): OUTPUT = TypeVar("OUTPUT", bound=Var) +class ToOperation: + """A var operation that converts a var to another type.""" + + def __getattr__(self, name: str) -> Any: + """Get an attribute of the var. + + Args: + name: The name of the attribute. + + Returns: + The attribute of the var. + """ + from .object import ObjectVar + + if isinstance(self, ObjectVar) and name != "_js_expr": + return ObjectVar.__getattr__(self, name) + return getattr(self._original, name) + + def __post_init__(self): + """Post initialization.""" + object.__delattr__(self, "_js_expr") + + def __hash__(self) -> int: + """Calculate the hash value of the object. + + Returns: + int: The hash value of the object. + """ + return hash(self._original) + + def _get_all_var_data(self) -> VarData | None: + """Get all the var data. + + Returns: + The var data. + """ + return VarData.merge( + self._original._get_all_var_data(), + self._var_data, # type: ignore + ) + + @classmethod + def create( + cls, + value: Var, + _var_type: GenericType | None = None, + _var_data: VarData | None = None, + ): + """Create a ToOperation. + + Args: + value: The value of the var. + _var_type: The type of the Var. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The ToOperation. + """ + return cls( + _js_expr="", # type: ignore + _var_data=_var_data, # type: ignore + _var_type=_var_type or cls._default_var_type, # type: ignore + _original=value, # type: ignore + ) + + class LiteralVar(Var): """Base class for immutable literal vars.""" + def __init_subclass__(cls, **kwargs): + """Initialize the subclass. + + Args: + **kwargs: Additional keyword arguments. + + Raises: + TypeError: If the LiteralVar subclass does not have a corresponding Var subclass. + """ + super().__init_subclass__(**kwargs) + + bases = cls.__bases__ + + bases_normalized = [ + base if inspect.isclass(base) else get_origin(base) for base in bases + ] + + possible_bases = [ + base + for base in bases_normalized + if issubclass(base, Var) and base != LiteralVar + ] + + if not possible_bases: + raise TypeError( + f"LiteralVar subclass {cls} must have a base class that is a subclass of Var and not LiteralVar." + ) + + var_subclasses = [ + var_subclass + for var_subclass in _var_subclasses + if var_subclass.var_subclass in possible_bases + ] + + if not var_subclasses: + raise TypeError( + f"LiteralVar {cls} must have a base class annotated with `python_types`." + ) + + if len(var_subclasses) != 1: + raise TypeError( + f"LiteralVar {cls} must have exactly one base class annotated with `python_types`." + ) + + var_subclass = var_subclasses[0] + + # Remove the old subclass, happens because __init_subclass__ is called twice + # for each subclass. This is because of __slots__ in dataclasses. + for var_literal_subclass in list(_var_literal_subclasses): + if var_literal_subclass[1] is var_subclass: + _var_literal_subclasses.remove(var_literal_subclass) + + _var_literal_subclasses.append((cls, var_subclass)) + @classmethod def create( cls, @@ -1038,50 +1309,21 @@ class LiteralVar(Var): Raises: TypeError: If the value is not a supported type for LiteralVar. """ - from .number import LiteralBooleanVar, LiteralNumberVar from .object import LiteralObjectVar - from .sequence import LiteralArrayVar, LiteralStringVar + from .sequence import LiteralStringVar if isinstance(value, Var): if _var_data is None: return value return value._replace(merge_var_data=_var_data) - if isinstance(value, str): - return LiteralStringVar.create(value, _var_data=_var_data) + for literal_subclass, var_subclass in _var_literal_subclasses[::-1]: + if isinstance(value, var_subclass.python_types): + return literal_subclass.create(value, _var_data=_var_data) - if isinstance(value, bool): - return LiteralBooleanVar.create(value, _var_data=_var_data) - - if isinstance(value, (int, float)): - return LiteralNumberVar.create(value, _var_data=_var_data) - - if isinstance(value, dict): - return LiteralObjectVar.create(value, _var_data=_var_data) - - if isinstance(value, (list, tuple, set)): - return LiteralArrayVar.create(value, _var_data=_var_data) - - if value is None: - return LiteralNoneVar.create(_var_data=_var_data) - - from reflex.event import ( - EventChain, - EventHandler, - EventSpec, - LiteralEventChainVar, - LiteralEventVar, - ) + from reflex.event import EventHandler from reflex.utils.format import get_event_handler_parts - from .object import LiteralObjectVar - - if isinstance(value, EventSpec): - return LiteralEventVar.create(value, _var_data=_var_data) - - if isinstance(value, EventChain): - return LiteralEventChainVar.create(value, _var_data=_var_data) - if isinstance(value, EventHandler): return Var(_js_expr=".".join(filter(None, get_event_handler_parts(value)))) @@ -1155,6 +1397,22 @@ def serialize_literal(value: LiteralVar): return value._var_value +def get_python_literal(value: Union[LiteralVar, Any]) -> Any | None: + """Get the Python literal value. + + Args: + value: The value to get the Python literal value of. + + Returns: + The Python literal value. + """ + if isinstance(value, LiteralVar): + return value._var_value + if isinstance(value, Var): + return None + return value + + P = ParamSpec("P") T = TypeVar("T") @@ -1205,6 +1463,12 @@ def var_operation( ) -> Callable[P, ObjectVar[OBJECT_TYPE]]: ... +@overload +def var_operation( + func: Callable[P, CustomVarOperationReturn[T]], +) -> Callable[P, Var[T]]: ... + + def var_operation( func: Callable[P, CustomVarOperationReturn[T]], ) -> Callable[P, Var[T]]: @@ -1237,6 +1501,7 @@ def var_operation( } return CustomVarOperation.create( + name=func.__name__, args=tuple(list(args_vars.items()) + list(kwargs_vars.items())), return_var=func(*args_vars.values(), **kwargs_vars), # type: ignore ).guess_type() @@ -2062,6 +2327,8 @@ def var_operation_return( class CustomVarOperation(CachedVarOperation, Var[T]): """Base class for custom var operations.""" + _name: str = dataclasses.field(default="") + _args: Tuple[Tuple[str, Var], ...] = dataclasses.field(default_factory=tuple) _return: CustomVarOperationReturn[T] = dataclasses.field( @@ -2096,6 +2363,7 @@ class CustomVarOperation(CachedVarOperation, Var[T]): @classmethod def create( cls, + name: str, args: Tuple[Tuple[str, Var], ...], return_var: CustomVarOperationReturn[T], _var_data: VarData | None = None, @@ -2103,6 +2371,7 @@ class CustomVarOperation(CachedVarOperation, Var[T]): """Create a CustomVarOperation. Args: + name: The name of the operation. args: The arguments to the operation. return_var: The return var. _var_data: Additional hooks and imports associated with the Var. @@ -2114,12 +2383,13 @@ class CustomVarOperation(CachedVarOperation, Var[T]): _js_expr="", _var_type=return_var._var_type, _var_data=_var_data, + _name=name, _args=args, _return=return_var, ) -class NoneVar(Var[None]): +class NoneVar(Var[None], python_types=type(None)): """A var representing None.""" @@ -2144,11 +2414,13 @@ class LiteralNoneVar(LiteralVar, NoneVar): @classmethod def create( cls, + value: None = None, _var_data: VarData | None = None, ) -> LiteralNoneVar: """Create a var from a value. Args: + value: The value of the var. Must be None. Existed for compatibility with LiteralVar. _var_data: Additional hooks and imports associated with the Var. Returns: @@ -2161,48 +2433,26 @@ class LiteralNoneVar(LiteralVar, NoneVar): ) -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToNoneOperation(CachedVarOperation, NoneVar): - """A var operation that converts a var to None.""" +def get_to_operation(var_subclass: Type[Var]) -> Type[ToOperation]: + """Get the ToOperation class for a given Var subclass. - _original_var: Var = dataclasses.field( - default_factory=lambda: LiteralNoneVar.create() - ) + Args: + var_subclass: The Var subclass. - @cached_property_no_lock - def _cached_var_name(self) -> str: - """Get the cached var name. + Returns: + The ToOperation class. - Returns: - The cached var name. - """ - return str(self._original_var) - - @classmethod - def create( - cls, - var: Var, - _var_data: VarData | None = None, - ) -> ToNoneOperation: - """Create a ToNoneOperation. - - Args: - var: The var to convert to None. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The ToNoneOperation. - """ - return ToNoneOperation( - _js_expr="", - _var_type=None, - _var_data=_var_data, - _original_var=var, - ) + Raises: + ValueError: If the ToOperation class cannot be found. + """ + possible_classes = [ + saved_var_subclass.to_var_subclass + for saved_var_subclass in _var_subclasses + if saved_var_subclass.var_subclass is var_subclass + ] + if not possible_classes: + raise ValueError(f"Could not find ToOperation for {var_subclass}.") + return possible_classes[0] @dataclasses.dataclass( @@ -2265,68 +2515,6 @@ class StateOperation(CachedVarOperation, Var): ) -class ToOperation: - """A var operation that converts a var to another type.""" - - def __getattr__(self, name: str) -> Any: - """Get an attribute of the var. - - Args: - name: The name of the attribute. - - Returns: - The attribute of the var. - """ - return getattr(object.__getattribute__(self, "_original"), name) - - def __post_init__(self): - """Post initialization.""" - object.__delattr__(self, "_js_expr") - - def __hash__(self) -> int: - """Calculate the hash value of the object. - - Returns: - int: The hash value of the object. - """ - return hash(object.__getattribute__(self, "_original")) - - def _get_all_var_data(self) -> VarData | None: - """Get all the var data. - - Returns: - The var data. - """ - return VarData.merge( - object.__getattribute__(self, "_original")._get_all_var_data(), - self._var_data, # type: ignore - ) - - @classmethod - def create( - cls, - value: Var, - _var_type: GenericType | None = None, - _var_data: VarData | None = None, - ): - """Create a ToOperation. - - Args: - value: The value of the var. - _var_type: The type of the Var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The ToOperation. - """ - return cls( - _js_expr="", # type: ignore - _var_data=_var_data, # type: ignore - _var_type=_var_type or cls._default_var_type, # type: ignore - _original=value, # type: ignore - ) - - def get_uuid_string_var() -> Var: """Return a Var that generates a single memoized UUID via .web/utils/state.js. @@ -2372,168 +2560,6 @@ def get_unique_variable_name() -> str: return get_unique_variable_name() -@dataclasses.dataclass( - eq=True, - frozen=True, -) -class VarData: - """Metadata associated with a x.""" - - # The name of the enclosing state. - state: str = dataclasses.field(default="") - - # The name of the field in the state. - field_name: str = dataclasses.field(default="") - - # Imports needed to render this var - imports: ImmutableParsedImportDict = dataclasses.field(default_factory=tuple) - - # Hooks that need to be present in the component to render this var - hooks: Tuple[str, ...] = dataclasses.field(default_factory=tuple) - - def __init__( - self, - state: str = "", - field_name: str = "", - imports: ImportDict | ParsedImportDict | None = None, - hooks: dict[str, None] | None = None, - ): - """Initialize the var data. - - Args: - state: The name of the enclosing state. - field_name: The name of the field in the state. - imports: Imports needed to render this var. - hooks: Hooks that need to be present in the component to render this var. - """ - immutable_imports: ImmutableParsedImportDict = tuple( - sorted( - ((k, tuple(sorted(v))) for k, v in parse_imports(imports or {}).items()) - ) - ) - object.__setattr__(self, "state", state) - object.__setattr__(self, "field_name", field_name) - object.__setattr__(self, "imports", immutable_imports) - object.__setattr__(self, "hooks", tuple(hooks or {})) - - def old_school_imports(self) -> ImportDict: - """Return the imports as a mutable dict. - - Returns: - The imports as a mutable dict. - """ - return dict((k, list(v)) for k, v in self.imports) - - @classmethod - def merge(cls, *others: VarData | None) -> VarData | None: - """Merge multiple var data objects. - - Args: - *others: The var data objects to merge. - - Returns: - The merged var data object. - """ - state = "" - field_name = "" - _imports = {} - hooks = {} - for var_data in others: - if var_data is None: - continue - state = state or var_data.state - field_name = field_name or var_data.field_name - _imports = imports.merge_imports(_imports, var_data.imports) - hooks.update( - var_data.hooks - if isinstance(var_data.hooks, dict) - else {k: None for k in var_data.hooks} - ) - - if state or _imports or hooks or field_name: - return VarData( - state=state, - field_name=field_name, - imports=_imports, - hooks=hooks, - ) - return None - - def __bool__(self) -> bool: - """Check if the var data is non-empty. - - Returns: - True if any field is set to a non-default value. - """ - return bool(self.state or self.imports or self.hooks or self.field_name) - - @classmethod - def from_state(cls, state: Type[BaseState] | str, field_name: str = "") -> VarData: - """Set the state of the var. - - Args: - state: The state to set or the full name of the state. - field_name: The name of the field in the state. Optional. - - Returns: - The var with the set state. - """ - from reflex.utils import format - - state_name = state if isinstance(state, str) else state.get_full_name() - return VarData( - state=state_name, - field_name=field_name, - hooks={ - "const {0} = useContext(StateContexts.{0})".format( - format.format_state_name(state_name) - ): None - }, - imports={ - f"/{constants.Dirs.CONTEXTS_PATH}": [ImportVar(tag="StateContexts")], - "react": [ImportVar(tag="useContext")], - }, - ) - - -def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: - """Decode the state name from a formatted var. - - Args: - value: The value to extract the state name from. - - Returns: - The extracted state name and the value without the state name. - """ - var_datas = [] - if isinstance(value, str): - # fast path if there is no encoded VarData - if constants.REFLEX_VAR_OPENING_TAG not in value: - return None, value - - offset = 0 - - # Find all tags. - while m := _decode_var_pattern.search(value): - start, end = m.span() - value = value[:start] + value[end:] - - serialized_data = m.group(1) - - if serialized_data.isnumeric() or ( - serialized_data[0] == "-" and serialized_data[1:].isnumeric() - ): - # This is a global immutable var. - var = _global_vars[int(serialized_data)] - var_data = var._get_all_var_data() - - if var_data is not None: - var_datas.append(var_data) - offset += end - start - - return VarData.merge(*var_datas) if var_datas else None, value - - # Compile regex for finding reflex var tags. _decode_var_pattern_re = ( rf"{constants.REFLEX_VAR_OPENING_TAG}(.*?){constants.REFLEX_VAR_CLOSING_TAG}" diff --git a/reflex/vars/function.py b/reflex/vars/function.py index a512432b9..a1f7fb7bd 100644 --- a/reflex/vars/function.py +++ b/reflex/vars/function.py @@ -4,21 +4,20 @@ from __future__ import annotations import dataclasses import sys -from typing import Any, Callable, ClassVar, Optional, Tuple, Type, Union +from typing import Any, Callable, Optional, Tuple, Type, Union from reflex.utils.types import GenericType from .base import ( CachedVarOperation, LiteralVar, - ToOperation, Var, VarData, cached_property_no_lock, ) -class FunctionVar(Var[Callable]): +class FunctionVar(Var[Callable], python_types=Callable): """Base class for immutable function vars.""" def __call__(self, *args: Var | Any) -> ArgsFunctionOperation: @@ -180,17 +179,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): ) -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToFunctionOperation(ToOperation, FunctionVar): - """Base class of converting a var to a function.""" - - _original: Var = dataclasses.field(default_factory=lambda: LiteralVar.create(None)) - - _default_var_type: ClassVar[GenericType] = Callable - - JSON_STRINGIFY = FunctionStringVar.create("JSON.stringify") +PROTOTYPE_TO_STRING = FunctionStringVar.create( + "((__to_string) => __to_string.toString())" +) diff --git a/reflex/vars/number.py b/reflex/vars/number.py index 0aaa7a068..77c728d13 100644 --- a/reflex/vars/number.py +++ b/reflex/vars/number.py @@ -10,7 +10,6 @@ from typing import ( TYPE_CHECKING, Any, Callable, - ClassVar, NoReturn, Type, TypeVar, @@ -25,9 +24,7 @@ from reflex.utils.types import is_optional from .base import ( CustomVarOperationReturn, - LiteralNoneVar, LiteralVar, - ToOperation, Var, VarData, unionize, @@ -58,7 +55,7 @@ def raise_unsupported_operand_types( ) -class NumberVar(Var[NUMBER_T]): +class NumberVar(Var[NUMBER_T], python_types=(int, float)): """Base class for immutable number vars.""" @overload @@ -760,7 +757,7 @@ def number_trunc_operation(value: NumberVar): return var_operation_return(js_expression=f"Math.trunc({value})", var_type=int) -class BooleanVar(NumberVar[bool]): +class BooleanVar(NumberVar[bool], python_types=bool): """Base class for immutable boolean vars.""" def __invert__(self): @@ -984,51 +981,6 @@ def boolean_not_operation(value: BooleanVar): return var_operation_return(js_expression=f"!({value})", var_type=bool) -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class LiteralBooleanVar(LiteralVar, BooleanVar): - """Base class for immutable literal boolean vars.""" - - _var_value: bool = dataclasses.field(default=False) - - def json(self) -> str: - """Get the JSON representation of the var. - - Returns: - The JSON representation of the var. - """ - return "true" if self._var_value else "false" - - def __hash__(self) -> int: - """Calculate the hash value of the object. - - Returns: - int: The hash value of the object. - """ - return hash((self.__class__.__name__, self._var_value)) - - @classmethod - def create(cls, value: bool, _var_data: VarData | None = None): - """Create the boolean var. - - Args: - value: The value of the var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The boolean var. - """ - return cls( - _js_expr="true" if value else "false", - _var_type=bool, - _var_data=_var_data, - _var_value=value, - ) - - @dataclasses.dataclass( eq=False, frozen=True, @@ -1088,36 +1040,55 @@ class LiteralNumberVar(LiteralVar, NumberVar): ) +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class LiteralBooleanVar(LiteralVar, BooleanVar): + """Base class for immutable literal boolean vars.""" + + _var_value: bool = dataclasses.field(default=False) + + def json(self) -> str: + """Get the JSON representation of the var. + + Returns: + The JSON representation of the var. + """ + return "true" if self._var_value else "false" + + def __hash__(self) -> int: + """Calculate the hash value of the object. + + Returns: + int: The hash value of the object. + """ + return hash((self.__class__.__name__, self._var_value)) + + @classmethod + def create(cls, value: bool, _var_data: VarData | None = None): + """Create the boolean var. + + Args: + value: The value of the var. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The boolean var. + """ + return cls( + _js_expr="true" if value else "false", + _var_type=bool, + _var_data=_var_data, + _var_value=value, + ) + + number_types = Union[NumberVar, int, float] boolean_types = Union[BooleanVar, bool] -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToNumberVarOperation(ToOperation, NumberVar): - """Base class for immutable number vars that are the result of a number operation.""" - - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - - _default_var_type: ClassVar[Type] = float - - -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToBooleanVarOperation(ToOperation, BooleanVar): - """Base class for immutable boolean vars that are the result of a boolean operation.""" - - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - - _default_var_type: ClassVar[Type] = bool - - _IS_TRUE_IMPORT: ImportDict = { f"/{Dirs.STATE_PATH}": [ImportVar(tag="isTrue")], } @@ -1140,8 +1111,12 @@ def boolify(value: Var): ) +T = TypeVar("T") +U = TypeVar("U") + + @var_operation -def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): +def ternary_operation(condition: BooleanVar, if_true: Var[T], if_false: Var[U]): """Create a ternary operation. Args: @@ -1152,10 +1127,14 @@ def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): Returns: The ternary operation. """ - return var_operation_return( - js_expression=f"({condition} ? {if_true} : {if_false})", - var_type=unionize(if_true._var_type, if_false._var_type), + type_value: Union[Type[T], Type[U]] = unionize( + if_true._var_type, if_false._var_type ) + value: CustomVarOperationReturn[Union[T, U]] = var_operation_return( + js_expression=f"({condition} ? {if_true} : {if_false})", + var_type=type_value, + ) + return value NUMBER_TYPES = (int, float, NumberVar) diff --git a/reflex/vars/object.py b/reflex/vars/object.py index 38add7779..56f3535d8 100644 --- a/reflex/vars/object.py +++ b/reflex/vars/object.py @@ -8,7 +8,6 @@ import typing from inspect import isclass from typing import ( Any, - ClassVar, Dict, List, NoReturn, @@ -27,7 +26,6 @@ from reflex.utils.types import GenericType, get_attribute_access_type, get_origi from .base import ( CachedVarOperation, LiteralVar, - ToOperation, Var, VarData, cached_property_no_lock, @@ -48,7 +46,7 @@ ARRAY_INNER_TYPE = TypeVar("ARRAY_INNER_TYPE") OTHER_KEY_TYPE = TypeVar("OTHER_KEY_TYPE") -class ObjectVar(Var[OBJECT_TYPE]): +class ObjectVar(Var[OBJECT_TYPE], python_types=dict): """Base class for immutable object vars.""" def _key_type(self) -> Type: @@ -521,34 +519,6 @@ class ObjectItemOperation(CachedVarOperation, Var): ) -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToObjectOperation(ToOperation, ObjectVar): - """Operation to convert a var to an object.""" - - _original: Var = dataclasses.field( - default_factory=lambda: LiteralObjectVar.create({}) - ) - - _default_var_type: ClassVar[GenericType] = dict - - def __getattr__(self, name: str) -> Any: - """Get an attribute of the var. - - Args: - name: The name of the attribute. - - Returns: - The attribute of the var. - """ - if name == "_js_expr": - return self._original._js_expr - return ObjectVar.__getattr__(self, name) - - @var_operation def object_has_own_property_operation(object: ObjectVar, key: Var): """Check if an object has a key. diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index e3b422f35..149300028 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -11,7 +11,6 @@ import typing from typing import ( TYPE_CHECKING, Any, - ClassVar, Dict, List, Literal, @@ -19,27 +18,28 @@ from typing import ( Set, Tuple, Type, - TypeVar, Union, overload, ) +from typing_extensions import TypeVar + from reflex import constants from reflex.constants.base import REFLEX_VAR_OPENING_TAG +from reflex.constants.colors import Color from reflex.utils.exceptions import VarTypeError from reflex.utils.types import GenericType, get_origin from .base import ( CachedVarOperation, CustomVarOperationReturn, - LiteralNoneVar, LiteralVar, - ToOperation, Var, VarData, _global_vars, cached_property_no_lock, figure_out_type, + get_python_literal, get_unique_variable_name, unionize, var_operation, @@ -50,13 +50,16 @@ from .number import ( LiteralNumberVar, NumberVar, raise_unsupported_operand_types, + ternary_operation, ) if TYPE_CHECKING: from .object import ObjectVar +STRING_TYPE = TypeVar("STRING_TYPE", default=str) -class StringVar(Var[str]): + +class StringVar(Var[STRING_TYPE], python_types=str): """Base class for immutable string vars.""" @overload @@ -350,7 +353,7 @@ class StringVar(Var[str]): @var_operation -def string_lt_operation(lhs: StringVar | str, rhs: StringVar | str): +def string_lt_operation(lhs: StringVar[Any] | str, rhs: StringVar[Any] | str): """Check if a string is less than another string. Args: @@ -364,7 +367,7 @@ def string_lt_operation(lhs: StringVar | str, rhs: StringVar | str): @var_operation -def string_gt_operation(lhs: StringVar | str, rhs: StringVar | str): +def string_gt_operation(lhs: StringVar[Any] | str, rhs: StringVar[Any] | str): """Check if a string is greater than another string. Args: @@ -378,7 +381,7 @@ def string_gt_operation(lhs: StringVar | str, rhs: StringVar | str): @var_operation -def string_le_operation(lhs: StringVar | str, rhs: StringVar | str): +def string_le_operation(lhs: StringVar[Any] | str, rhs: StringVar[Any] | str): """Check if a string is less than or equal to another string. Args: @@ -392,7 +395,7 @@ def string_le_operation(lhs: StringVar | str, rhs: StringVar | str): @var_operation -def string_ge_operation(lhs: StringVar | str, rhs: StringVar | str): +def string_ge_operation(lhs: StringVar[Any] | str, rhs: StringVar[Any] | str): """Check if a string is greater than or equal to another string. Args: @@ -406,7 +409,7 @@ def string_ge_operation(lhs: StringVar | str, rhs: StringVar | str): @var_operation -def string_lower_operation(string: StringVar): +def string_lower_operation(string: StringVar[Any]): """Convert a string to lowercase. Args: @@ -419,7 +422,7 @@ def string_lower_operation(string: StringVar): @var_operation -def string_upper_operation(string: StringVar): +def string_upper_operation(string: StringVar[Any]): """Convert a string to uppercase. Args: @@ -432,7 +435,7 @@ def string_upper_operation(string: StringVar): @var_operation -def string_strip_operation(string: StringVar): +def string_strip_operation(string: StringVar[Any]): """Strip a string. Args: @@ -446,7 +449,7 @@ def string_strip_operation(string: StringVar): @var_operation def string_contains_field_operation( - haystack: StringVar, needle: StringVar | str, field: StringVar | str + haystack: StringVar[Any], needle: StringVar[Any] | str, field: StringVar[Any] | str ): """Check if a string contains another string. @@ -465,7 +468,7 @@ def string_contains_field_operation( @var_operation -def string_contains_operation(haystack: StringVar, needle: StringVar | str): +def string_contains_operation(haystack: StringVar[Any], needle: StringVar[Any] | str): """Check if a string contains another string. Args: @@ -481,7 +484,9 @@ def string_contains_operation(haystack: StringVar, needle: StringVar | str): @var_operation -def string_starts_with_operation(full_string: StringVar, prefix: StringVar | str): +def string_starts_with_operation( + full_string: StringVar[Any], prefix: StringVar[Any] | str +): """Check if a string starts with a prefix. Args: @@ -497,7 +502,7 @@ def string_starts_with_operation(full_string: StringVar, prefix: StringVar | str @var_operation -def string_item_operation(string: StringVar, index: NumberVar | int): +def string_item_operation(string: StringVar[Any], index: NumberVar | int): """Get an item from a string. Args: @@ -511,7 +516,7 @@ def string_item_operation(string: StringVar, index: NumberVar | int): @var_operation -def array_join_operation(array: ArrayVar, sep: StringVar | str = ""): +def array_join_operation(array: ArrayVar, sep: StringVar[Any] | str = ""): """Join the elements of an array. Args: @@ -536,7 +541,7 @@ _decode_var_pattern = re.compile(_decode_var_pattern_re, flags=re.DOTALL) frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class LiteralStringVar(LiteralVar, StringVar): +class LiteralStringVar(LiteralVar, StringVar[str]): """Base class for immutable literal string vars.""" _var_value: str = dataclasses.field(default="") @@ -658,7 +663,7 @@ class LiteralStringVar(LiteralVar, StringVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ConcatVarOperation(CachedVarOperation, StringVar): +class ConcatVarOperation(CachedVarOperation, StringVar[str]): """Representing a concatenation of literal string vars.""" _var_value: Tuple[Var, ...] = dataclasses.field(default_factory=tuple) @@ -742,7 +747,7 @@ KEY_TYPE = TypeVar("KEY_TYPE") VALUE_TYPE = TypeVar("VALUE_TYPE") -class ArrayVar(Var[ARRAY_VAR_TYPE]): +class ArrayVar(Var[ARRAY_VAR_TYPE], python_types=(list, tuple, set)): """Base class for immutable array vars.""" @overload @@ -1275,7 +1280,7 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): @var_operation -def string_split_operation(string: StringVar, sep: StringVar | str = ""): +def string_split_operation(string: StringVar[Any], sep: StringVar | str = ""): """Split a string. Args: @@ -1572,32 +1577,6 @@ def array_contains_operation(haystack: ArrayVar, needle: Any | Var): ) -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToStringOperation(ToOperation, StringVar): - """Base class for immutable string vars that are the result of a to string operation.""" - - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - - _default_var_type: ClassVar[Type] = str - - -@dataclasses.dataclass( - eq=False, - frozen=True, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class ToArrayOperation(ToOperation, ArrayVar): - """Base class for immutable array vars that are the result of a to array operation.""" - - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - - _default_var_type: ClassVar[Type] = List[Any] - - @var_operation def repeat_array_operation( array: ArrayVar[ARRAY_VAR_TYPE], count: NumberVar | int @@ -1657,3 +1636,134 @@ def array_concat_operation( js_expression=f"[...{lhs}, ...{rhs}]", var_type=Union[lhs._var_type, rhs._var_type], ) + + +class ColorVar(StringVar[Color], python_types=Color): + """Base class for immutable color vars.""" + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class LiteralColorVar(CachedVarOperation, LiteralVar, ColorVar): + """Base class for immutable literal color vars.""" + + _var_value: Color = dataclasses.field(default_factory=lambda: Color(color="black")) + + @classmethod + def create( + cls, + value: Color, + _var_type: Type[Color] | None = None, + _var_data: VarData | None = None, + ) -> ColorVar: + """Create a var from a string value. + + Args: + value: The value to create the var from. + _var_type: The type of the var. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The var. + """ + return cls( + _js_expr="", + _var_type=_var_type or Color, + _var_data=_var_data, + _var_value=value, + ) + + def __hash__(self) -> int: + """Get the hash of the var. + + Returns: + The hash of the var. + """ + return hash( + ( + self.__class__.__name__, + self._var_value.color, + self._var_value.alpha, + self._var_value.shade, + ) + ) + + @cached_property_no_lock + def _cached_var_name(self) -> str: + """The name of the var. + + Returns: + The name of the var. + """ + alpha = self._var_value.alpha + alpha = ( + ternary_operation( + alpha, + LiteralStringVar.create("a"), + LiteralStringVar.create(""), + ) + if isinstance(alpha, Var) + else LiteralStringVar.create("a" if alpha else "") + ) + + shade = self._var_value.shade + shade = ( + shade.to_string(use_json=False) + if isinstance(shade, Var) + else LiteralStringVar.create(str(shade)) + ) + return str( + ConcatVarOperation.create( + LiteralStringVar.create("var(--"), + self._var_value.color, + LiteralStringVar.create("-"), + alpha, + shade, + LiteralStringVar.create(")"), + ) + ) + + @cached_property_no_lock + def _cached_get_all_var_data(self) -> VarData | None: + """Get all the var data. + + Returns: + The var data. + """ + return VarData.merge( + *[ + LiteralVar.create(var)._get_all_var_data() + for var in ( + self._var_value.color, + self._var_value.alpha, + self._var_value.shade, + ) + ], + self._var_data, + ) + + def json(self) -> str: + """Get the JSON representation of the var. + + Returns: + The JSON representation of the var. + + Raises: + TypeError: If the color is not a valid color. + """ + color, alpha, shade = map( + get_python_literal, + (self._var_value.color, self._var_value.alpha, self._var_value.shade), + ) + if color is None or alpha is None or shade is None: + raise TypeError("Cannot serialize color that contains non-literal vars.") + if ( + not isinstance(color, str) + or not isinstance(alpha, bool) + or not isinstance(shade, int) + ): + raise TypeError("Color is not a valid color.") + return f"var(--{color}-{'a' if alpha else ''}{shade})" diff --git a/tests/units/components/core/test_colors.py b/tests/units/components/core/test_colors.py index a6175d56a..74fbeb20f 100644 --- a/tests/units/components/core/test_colors.py +++ b/tests/units/components/core/test_colors.py @@ -14,6 +14,7 @@ class ColorState(rx.State): color: str = "mint" color_part: str = "tom" shade: int = 4 + alpha: bool = False color_state_name = ColorState.get_full_name().replace(".", "__") @@ -31,7 +32,14 @@ def create_color_var(color): (create_color_var(rx.color("mint", 3, True)), '"var(--mint-a3)"', Color), ( create_color_var(rx.color(ColorState.color, ColorState.shade)), # type: ignore - f'("var(--"+{str(color_state_name)}.color+"-"+{str(color_state_name)}.shade+")")', + f'("var(--"+{str(color_state_name)}.color+"-"+(((__to_string) => __to_string.toString())({str(color_state_name)}.shade))+")")', + Color, + ), + ( + create_color_var( + rx.color(ColorState.color, ColorState.shade, ColorState.alpha) # type: ignore + ), + f'("var(--"+{str(color_state_name)}.color+"-"+({str(color_state_name)}.alpha ? "a" : "")+(((__to_string) => __to_string.toString())({str(color_state_name)}.shade))+")")', Color, ), ( @@ -43,7 +51,7 @@ def create_color_var(color): create_color_var( rx.color(f"{ColorState.color_part}ato", f"{ColorState.shade}") # type: ignore ), - f'("var(--"+{str(color_state_name)}.color_part+"ato-"+{str(color_state_name)}.shade+")")', + f'("var(--"+({str(color_state_name)}.color_part+"ato")+"-"+{str(color_state_name)}.shade+")")', Color, ), ( diff --git a/tests/units/test_var.py b/tests/units/test_var.py index c04e554a9..a8b4b759d 100644 --- a/tests/units/test_var.py +++ b/tests/units/test_var.py @@ -519,8 +519,8 @@ def test_var_indexing_types(var, type_): type_ : The type on indexed object. """ - assert var[2]._var_type == type_[0] - assert var[3]._var_type == type_[1] + assert var[0]._var_type == type_[0] + assert var[1]._var_type == type_[1] def test_var_indexing_str(): From 45959881ac2490f629fc6bd60f5d577f1f9dc656 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 21 Oct 2024 18:17:06 -0700 Subject: [PATCH 192/201] add type hinting to error boundary (#4182) * add type hinting to error boundary * remove logFrontendError * fix other calls to handle_frontend_exception --- reflex/.templates/web/utils/state.js | 2 + reflex/components/base/error_boundary.py | 59 ++++++++++++++--------- reflex/components/base/error_boundary.pyi | 15 +++--- reflex/constants/compiler.py | 10 ---- reflex/state.py | 5 +- 5 files changed, 49 insertions(+), 42 deletions(-) diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 0fe0db8c1..24092f235 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -743,6 +743,7 @@ export const useEventLoop = ( addEvents([ Event(`${exception_state_name}.handle_frontend_exception`, { stack: error.stack, + component_stack: "", }), ]); return false; @@ -754,6 +755,7 @@ export const useEventLoop = ( addEvents([ Event(`${exception_state_name}.handle_frontend_exception`, { stack: event.reason.stack, + component_stack: "", }), ]); return false; diff --git a/reflex/components/base/error_boundary.py b/reflex/components/base/error_boundary.py index 66a9c43c8..b35c69a60 100644 --- a/reflex/components/base/error_boundary.py +++ b/reflex/components/base/error_boundary.py @@ -2,16 +2,30 @@ from __future__ import annotations -from typing import List +from typing import Dict, List, Tuple from reflex.compiler.compiler import _compile_component from reflex.components.component import Component from reflex.components.el import div, p -from reflex.constants import Hooks, Imports -from reflex.event import EventChain, EventHandler -from reflex.utils.imports import ImportVar +from reflex.event import EventHandler +from reflex.state import FrontendEventExceptionState from reflex.vars.base import Var -from reflex.vars.function import FunctionVar + + +def on_error_spec(error: Var, info: Var[Dict[str, str]]) -> Tuple[Var[str], Var[str]]: + """The spec for the on_error event handler. + + Args: + error: The error message. + info: Additional information about the error. + + Returns: + The arguments for the event handler. + """ + return ( + error.stack, + info.componentStack, + ) class ErrorBoundary(Component): @@ -21,31 +35,13 @@ class ErrorBoundary(Component): tag = "ErrorBoundary" # Fired when the boundary catches an error. - on_error: EventHandler[lambda error, info: [error, info]] = Var( # type: ignore - "logFrontendError" - ).to(FunctionVar, EventChain) + on_error: EventHandler[on_error_spec] # Rendered instead of the children when an error is caught. Fallback_component: Var[Component] = Var(_js_expr="Fallback")._replace( _var_type=Component ) - def add_imports(self) -> dict[str, list[ImportVar]]: - """Add imports for the component. - - Returns: - The imports to add. - """ - return Imports.EVENTS - - def add_hooks(self) -> List[str | Var]: - """Add hooks for the component. - - Returns: - The hooks to add. - """ - return [Hooks.EVENTS, Hooks.FRONTEND_ERRORS] - def add_custom_code(self) -> List[str]: """Add custom Javascript code into the page that contains this component. @@ -75,5 +71,20 @@ class ErrorBoundary(Component): """ ] + @classmethod + def create(cls, *children, **props): + """Create an ErrorBoundary component. + + Args: + *children: The children of the component. + **props: The props of the component. + + Returns: + The ErrorBoundary component. + """ + if "on_error" not in props: + props["on_error"] = FrontendEventExceptionState.handle_frontend_exception + return super().create(*children, **props) + error_boundary = ErrorBoundary.create diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index aaf5584e4..94b129bdc 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -3,17 +3,18 @@ # ------------------- DO NOT EDIT ---------------------- # 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, Tuple, Union, overload from reflex.components.component import Component from reflex.event import EventType from reflex.style import Style -from reflex.utils.imports import ImportVar from reflex.vars.base import Var +def on_error_spec( + error: Var, info: Var[Dict[str, str]] +) -> Tuple[Var[str], Var[str]]: ... + class ErrorBoundary(Component): - def add_imports(self) -> dict[str, list[ImportVar]]: ... - def add_hooks(self) -> List[str | Var]: ... def add_custom_code(self) -> List[str]: ... @overload @classmethod @@ -31,7 +32,7 @@ class ErrorBoundary(Component): on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, - on_error: Optional[EventType] = None, + on_error: Optional[EventType[str, str]] = None, on_focus: Optional[EventType[[]]] = None, on_mount: Optional[EventType[[]]] = None, on_mouse_down: Optional[EventType[[]]] = None, @@ -45,7 +46,7 @@ class ErrorBoundary(Component): on_unmount: Optional[EventType[[]]] = None, **props, ) -> "ErrorBoundary": - """Create the component. + """Create an ErrorBoundary component. Args: *children: The children of the component. @@ -59,7 +60,7 @@ class ErrorBoundary(Component): **props: The props of the component. Returns: - The component. + The ErrorBoundary component. """ ... diff --git a/reflex/constants/compiler.py b/reflex/constants/compiler.py index 557a92092..318a93783 100644 --- a/reflex/constants/compiler.py +++ b/reflex/constants/compiler.py @@ -132,16 +132,6 @@ class Hooks(SimpleNamespace): } })""" - FRONTEND_ERRORS = f""" - const logFrontendError = (error, info) => {{ - if (process.env.NODE_ENV === "production") {{ - addEvents([Event("{CompileVars.FRONTEND_EXCEPTION_STATE_FULL}.handle_frontend_exception", {{ - stack: error.stack, - }})]) - }} - }} - """ - class MemoizationDisposition(enum.Enum): """The conditions under which a component should be memoized.""" diff --git a/reflex/state.py b/reflex/state.py index 0634ad5b7..3422d1ba7 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -39,6 +39,7 @@ from typing import ( from sqlalchemy.orm import DeclarativeBase from typing_extensions import Self +from reflex import event from reflex.config import get_config from reflex.istate.data import RouterData from reflex.vars.base import ( @@ -2094,7 +2095,8 @@ class State(BaseState): class FrontendEventExceptionState(State): """Substate for handling frontend exceptions.""" - def handle_frontend_exception(self, stack: str) -> None: + @event + def handle_frontend_exception(self, stack: str, component_stack: str) -> None: """Handle frontend exceptions. If a frontend exception handler is provided, it will be called. @@ -2102,6 +2104,7 @@ class FrontendEventExceptionState(State): Args: stack: The stack trace of the exception. + component_stack: The stack trace of the component where the exception occurred. """ app_instance = getattr(prerequisites.get_app(), constants.CompileVars.APP) From 3ab750fecd3cebd2d13c40730d639a48e07eadc4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 21 Oct 2024 18:17:27 -0700 Subject: [PATCH 193/201] add event types to suneditor (#4209) --- reflex/components/suneditor/editor.py | 56 ++++++++++++++++++-------- reflex/components/suneditor/editor.pyi | 18 +++++---- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/reflex/components/suneditor/editor.py b/reflex/components/suneditor/editor.py index 6f5b6e4b4..3bca8a3f6 100644 --- a/reflex/components/suneditor/editor.py +++ b/reflex/components/suneditor/editor.py @@ -3,11 +3,11 @@ from __future__ import annotations import enum -from typing import Dict, List, Literal, Optional, Union +from typing import Dict, List, Literal, Optional, Tuple, Union from reflex.base import Base from reflex.components.component import Component, NoSSRComponent -from reflex.event import EventHandler +from reflex.event import EventHandler, empty_event, identity_event from reflex.utils.format import to_camel_case from reflex.utils.imports import ImportDict, ImportVar from reflex.vars.base import Var @@ -68,6 +68,35 @@ class EditorOptions(Base): button_list: Optional[List[Union[List[str], str]]] +def on_blur_spec(e: Var, content: Var[str]) -> Tuple[Var[str]]: + """A helper function to specify the on_blur event handler. + + Args: + e: The event. + content: The content of the editor. + + Returns: + A tuple containing the content of the editor. + """ + return (content,) + + +def on_paste_spec( + e: Var, clean_data: Var[str], max_char_count: Var[bool] +) -> Tuple[Var[str], Var[bool]]: + """A helper function to specify the on_paste event handler. + + Args: + e: The event. + clean_data: The clean data. + max_char_count: The maximum character count. + + Returns: + A tuple containing the clean data and the maximum character count. + """ + return (clean_data, max_char_count) + + class Editor(NoSSRComponent): """A Rich Text Editor component based on SunEditor. Not every JS prop is listed here (some are not easily usable from python), @@ -178,36 +207,31 @@ class Editor(NoSSRComponent): disable_toolbar: Var[bool] # Fired when the editor content changes. - on_change: EventHandler[lambda content: [content]] + on_change: EventHandler[identity_event(str)] # Fired when the something is inputted in the editor. - on_input: EventHandler[lambda e: [e]] + on_input: EventHandler[empty_event] # Fired when the editor loses focus. - on_blur: EventHandler[lambda e, content: [content]] + on_blur: EventHandler[on_blur_spec] # Fired when the editor is loaded. - on_load: EventHandler[lambda reload: [reload]] - - # Fired when the editor is resized. - on_resize_editor: EventHandler[lambda height, prev_height: [height, prev_height]] + on_load: EventHandler[identity_event(bool)] # Fired when the editor content is copied. - on_copy: EventHandler[lambda e, clipboard_data: [clipboard_data]] + on_copy: EventHandler[empty_event] # Fired when the editor content is cut. - on_cut: EventHandler[lambda e, clipboard_data: [clipboard_data]] + on_cut: EventHandler[empty_event] # Fired when the editor content is pasted. - on_paste: EventHandler[ - lambda e, clean_data, max_char_count: [clean_data, max_char_count] - ] + on_paste: EventHandler[on_paste_spec] # Fired when the code view is toggled. - toggle_code_view: EventHandler[lambda is_code_view: [is_code_view]] + toggle_code_view: EventHandler[identity_event(bool)] # Fired when the full screen mode is toggled. - toggle_full_screen: EventHandler[lambda is_full_screen: [is_full_screen]] + toggle_full_screen: EventHandler[identity_event(bool)] def add_imports(self) -> ImportDict: """Add imports for the Editor component. diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index f7149a02c..5cc45dc98 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -4,7 +4,7 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ import enum -from typing import Any, Dict, List, Literal, Optional, Union, overload +from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent @@ -44,6 +44,11 @@ class EditorOptions(Base): rtl: Optional[bool] button_list: Optional[List[Union[List[str], str]]] +def on_blur_spec(e: Var, content: Var[str]) -> Tuple[Var[str]]: ... +def on_paste_spec( + e: Var, clean_data: Var[str], max_char_count: Var[bool] +) -> Tuple[Var[str], Var[bool]]: ... + class Editor(NoSSRComponent): def add_imports(self) -> ImportDict: ... @overload @@ -122,15 +127,15 @@ class Editor(NoSSRComponent): class_name: Optional[Any] = None, autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[EventType] = None, + on_blur: Optional[EventType[str]] = None, on_change: Optional[EventType] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, - on_copy: Optional[EventType] = None, - on_cut: Optional[EventType] = None, + on_copy: Optional[EventType[[]]] = None, + on_cut: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, on_focus: Optional[EventType[[]]] = None, - on_input: Optional[EventType] = None, + on_input: Optional[EventType[[]]] = None, on_load: Optional[EventType] = None, on_mount: Optional[EventType[[]]] = None, on_mouse_down: Optional[EventType[[]]] = None, @@ -140,8 +145,7 @@ class Editor(NoSSRComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_paste: Optional[EventType] = None, - on_resize_editor: Optional[EventType] = None, + on_paste: Optional[EventType[str, bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, toggle_code_view: Optional[EventType] = None, From c103ab5e2872ca9496978360802d84c930e50b4e Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 21 Oct 2024 18:53:51 -0700 Subject: [PATCH 194/201] Add type hinting to dataeditor events (#4210) --- reflex/components/base/error_boundary.py | 4 +- reflex/components/base/error_boundary.pyi | 2 +- reflex/components/core/clipboard.pyi | 2 +- reflex/components/datadisplay/dataeditor.py | 88 +++++++++++++++++-- reflex/components/datadisplay/dataeditor.pyi | 78 +++++++++++++--- reflex/components/moment/moment.pyi | 2 +- reflex/components/radix/primitives/drawer.pyi | 4 +- reflex/components/radix/themes/color_mode.pyi | 2 +- .../radix/themes/components/alert_dialog.pyi | 2 +- .../radix/themes/components/checkbox.pyi | 6 +- .../radix/themes/components/context_menu.pyi | 2 +- .../radix/themes/components/dialog.pyi | 4 +- .../radix/themes/components/dropdown_menu.pyi | 4 +- .../radix/themes/components/hover_card.pyi | 4 +- .../radix/themes/components/popover.pyi | 2 +- .../radix/themes/components/radio_cards.pyi | 2 +- .../radix/themes/components/radio_group.pyi | 2 +- .../radix/themes/components/select.pyi | 12 +-- .../radix/themes/components/switch.pyi | 2 +- .../radix/themes/components/tabs.pyi | 4 +- .../radix/themes/components/tooltip.pyi | 2 +- reflex/components/react_player/audio.pyi | 4 +- .../components/react_player/react_player.pyi | 4 +- reflex/components/react_player/video.pyi | 4 +- reflex/components/suneditor/editor.pyi | 8 +- reflex/event.py | 82 +++++++++++++++-- reflex/experimental/layout.pyi | 2 +- reflex/utils/pyi_generator.py | 78 +++++++++++++++- tests/integration/test_lifespan.py | 1 + 29 files changed, 342 insertions(+), 71 deletions(-) diff --git a/reflex/components/base/error_boundary.py b/reflex/components/base/error_boundary.py index b35c69a60..83becc034 100644 --- a/reflex/components/base/error_boundary.py +++ b/reflex/components/base/error_boundary.py @@ -12,7 +12,9 @@ from reflex.state import FrontendEventExceptionState from reflex.vars.base import Var -def on_error_spec(error: Var, info: Var[Dict[str, str]]) -> Tuple[Var[str], Var[str]]: +def on_error_spec( + error: Var[Dict[str, str]], info: Var[Dict[str, str]] +) -> Tuple[Var[str], Var[str]]: """The spec for the on_error event handler. Args: diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index 94b129bdc..c84742851 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -11,7 +11,7 @@ from reflex.style import Style from reflex.vars.base import Var def on_error_spec( - error: Var, info: Var[Dict[str, str]] + error: Var[Dict[str, str]], info: Var[Dict[str, str]] ) -> Tuple[Var[str], Var[str]]: ... class ErrorBoundary(Component): diff --git a/reflex/components/core/clipboard.pyi b/reflex/components/core/clipboard.pyi index e2f6afc8d..489a9bcc5 100644 --- a/reflex/components/core/clipboard.pyi +++ b/reflex/components/core/clipboard.pyi @@ -40,7 +40,7 @@ class Clipboard(Fragment): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_paste: Optional[EventType] = None, + on_paste: Optional[EventType[list[tuple[str, str]]]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index 01255dd14..a192c7a45 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -5,6 +5,8 @@ from __future__ import annotations from enum import Enum from typing import Any, Dict, List, Literal, Optional, Tuple, Union +from typing_extensions import TypedDict + from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.components.literals import LiteralRowMarker @@ -120,6 +122,78 @@ def on_edit_spec(pos, data: dict[str, Any]): return [pos, data] +class Bounds(TypedDict): + """The bounds of the group header.""" + + x: int + y: int + width: int + height: int + + +class CompatSelection(TypedDict): + """The selection.""" + + items: list + + +class Rectangle(TypedDict): + """The bounds of the group header.""" + + x: int + y: int + width: int + height: int + + +class GridSelectionCurrent(TypedDict): + """The current selection.""" + + cell: list[int] + range: Rectangle + rangeStack: list[Rectangle] + + +class GridSelection(TypedDict): + """The grid selection.""" + + current: Optional[GridSelectionCurrent] + columns: CompatSelection + rows: CompatSelection + + +class GroupHeaderClickedEventArgs(TypedDict): + """The arguments for the group header clicked event.""" + + kind: str + group: str + location: list[int] + bounds: Bounds + isEdge: bool + shiftKey: bool + ctrlKey: bool + metaKey: bool + isTouch: bool + localEventX: int + localEventY: int + button: int + buttons: int + scrollEdge: list[int] + + +class GridCell(TypedDict): + """The grid cell.""" + + span: Optional[List[int]] + + +class GridColumn(TypedDict): + """The grid column.""" + + title: str + group: Optional[str] + + class DataEditor(NoSSRComponent): """The DataEditor Component.""" @@ -238,10 +312,12 @@ class DataEditor(NoSSRComponent): on_group_header_clicked: EventHandler[on_edit_spec] # Fired when a group header is right-clicked. - on_group_header_context_menu: EventHandler[lambda grp_idx, data: [grp_idx, data]] + on_group_header_context_menu: EventHandler[ + identity_event(int, GroupHeaderClickedEventArgs) + ] # Fired when a group header is renamed. - on_group_header_renamed: EventHandler[lambda idx, val: [idx, val]] + on_group_header_renamed: EventHandler[identity_event(str, str)] # Fired when a header is clicked. on_header_clicked: EventHandler[identity_event(Tuple[int, int])] @@ -250,16 +326,16 @@ class DataEditor(NoSSRComponent): on_header_context_menu: EventHandler[identity_event(Tuple[int, int])] # Fired when a header menu item is clicked. - on_header_menu_click: EventHandler[lambda col, pos: [col, pos]] + on_header_menu_click: EventHandler[identity_event(int, Rectangle)] # Fired when an item is hovered. on_item_hovered: EventHandler[identity_event(Tuple[int, int])] # Fired when a selection is deleted. - on_delete: EventHandler[lambda selection: [selection]] + on_delete: EventHandler[identity_event(GridSelection)] # Fired when editing is finished. - on_finished_editing: EventHandler[lambda new_value, movement: [new_value, movement]] + on_finished_editing: EventHandler[identity_event(Union[GridCell, None], list[int])] # Fired when a row is appended. on_row_appended: EventHandler[empty_event] @@ -268,7 +344,7 @@ class DataEditor(NoSSRComponent): on_selection_cleared: EventHandler[empty_event] # Fired when a column is resized. - on_column_resize: EventHandler[lambda col, width: [col, width]] + on_column_resize: EventHandler[identity_event(GridColumn, int)] def add_imports(self) -> ImportDict: """Add imports for the component. diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index 1b8fed287..aadd9666e 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -6,6 +6,8 @@ from enum import Enum from typing import Any, Dict, List, Literal, Optional, Union, overload +from typing_extensions import TypedDict + from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventType @@ -78,6 +80,54 @@ class DataEditorTheme(Base): def on_edit_spec(pos, data: dict[str, Any]): ... +class Bounds(TypedDict): + x: int + y: int + width: int + height: int + +class CompatSelection(TypedDict): + items: list + +class Rectangle(TypedDict): + x: int + y: int + width: int + height: int + +class GridSelectionCurrent(TypedDict): + cell: list[int] + range: Rectangle + rangeStack: list[Rectangle] + +class GridSelection(TypedDict): + current: Optional[GridSelectionCurrent] + columns: CompatSelection + rows: CompatSelection + +class GroupHeaderClickedEventArgs(TypedDict): + kind: str + group: str + location: list[int] + bounds: Bounds + isEdge: bool + shiftKey: bool + ctrlKey: bool + metaKey: bool + isTouch: bool + localEventX: int + localEventY: int + button: int + buttons: int + scrollEdge: list[int] + +class GridCell(TypedDict): + span: Optional[List[int]] + +class GridColumn(TypedDict): + title: str + group: Optional[str] + class DataEditor(NoSSRComponent): def add_imports(self) -> ImportDict: ... def add_hooks(self) -> list[str]: ... @@ -136,24 +186,28 @@ class DataEditor(NoSSRComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_cell_activated: Optional[EventType] = None, - on_cell_clicked: Optional[EventType] = None, - on_cell_context_menu: Optional[EventType] = None, + on_cell_activated: Optional[EventType[tuple[int, int]]] = None, + on_cell_clicked: Optional[EventType[tuple[int, int]]] = None, + on_cell_context_menu: Optional[EventType[tuple[int, int]]] = None, on_cell_edited: Optional[EventType] = None, on_click: Optional[EventType[[]]] = None, - on_column_resize: Optional[EventType] = None, + on_column_resize: Optional[EventType[GridColumn, int]] = None, on_context_menu: Optional[EventType[[]]] = None, - on_delete: Optional[EventType] = None, + on_delete: Optional[EventType[GridSelection]] = None, on_double_click: Optional[EventType[[]]] = None, - on_finished_editing: Optional[EventType] = None, + on_finished_editing: Optional[ + EventType[Union[GridCell, None], list[int]] + ] = None, on_focus: Optional[EventType[[]]] = None, on_group_header_clicked: Optional[EventType] = None, - on_group_header_context_menu: Optional[EventType] = None, - on_group_header_renamed: Optional[EventType] = None, - on_header_clicked: Optional[EventType] = None, - on_header_context_menu: Optional[EventType] = None, - on_header_menu_click: Optional[EventType] = None, - on_item_hovered: Optional[EventType] = None, + on_group_header_context_menu: Optional[ + EventType[int, GroupHeaderClickedEventArgs] + ] = None, + on_group_header_renamed: Optional[EventType[str, str]] = None, + on_header_clicked: Optional[EventType[tuple[int, int]]] = None, + on_header_context_menu: Optional[EventType[tuple[int, int]]] = None, + on_header_menu_click: Optional[EventType[int, Rectangle]] = None, + on_item_hovered: Optional[EventType[tuple[int, int]]] = None, on_mount: Optional[EventType[[]]] = None, on_mouse_down: Optional[EventType[[]]] = None, on_mouse_enter: Optional[EventType[[]]] = None, diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index 4f58fda7d..ccffbb8d1 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -58,7 +58,7 @@ class Moment(NoSSRComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, diff --git a/reflex/components/radix/primitives/drawer.pyi b/reflex/components/radix/primitives/drawer.pyi index 9c5463e56..c4493ee9b 100644 --- a/reflex/components/radix/primitives/drawer.pyi +++ b/reflex/components/radix/primitives/drawer.pyi @@ -101,7 +101,7 @@ class DrawerRoot(DrawerComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, @@ -511,7 +511,7 @@ class Drawer(ComponentNamespace): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/color_mode.pyi b/reflex/components/radix/themes/color_mode.pyi index 43703dc37..d856b0bbd 100644 --- a/reflex/components/radix/themes/color_mode.pyi +++ b/reflex/components/radix/themes/color_mode.pyi @@ -383,7 +383,7 @@ class ColorModeSwitch(Switch): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[bool]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, diff --git a/reflex/components/radix/themes/components/alert_dialog.pyi b/reflex/components/radix/themes/components/alert_dialog.pyi index d63fcae53..771def7d9 100644 --- a/reflex/components/radix/themes/components/alert_dialog.pyi +++ b/reflex/components/radix/themes/components/alert_dialog.pyi @@ -42,7 +42,7 @@ class AlertDialogRoot(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index fad4f5210..90a9220ef 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -116,7 +116,7 @@ class Checkbox(RadixThemesComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[bool]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, @@ -263,7 +263,7 @@ class HighLevelCheckbox(RadixThemesComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[bool]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, @@ -407,7 +407,7 @@ class CheckboxNamespace(ComponentNamespace): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[bool]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, diff --git a/reflex/components/radix/themes/components/context_menu.pyi b/reflex/components/radix/themes/components/context_menu.pyi index fbefa88de..56d8200e0 100644 --- a/reflex/components/radix/themes/components/context_menu.pyi +++ b/reflex/components/radix/themes/components/context_menu.pyi @@ -39,7 +39,7 @@ class ContextMenuRoot(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index e3f17d7e8..0713461e9 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -40,7 +40,7 @@ class DialogRoot(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, @@ -382,7 +382,7 @@ class Dialog(ComponentNamespace): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/components/dropdown_menu.pyi b/reflex/components/radix/themes/components/dropdown_menu.pyi index dba619e7d..8de273be9 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.pyi +++ b/reflex/components/radix/themes/components/dropdown_menu.pyi @@ -49,7 +49,7 @@ class DropdownMenuRoot(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, @@ -363,7 +363,7 @@ class DropdownMenuSub(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/components/hover_card.pyi b/reflex/components/radix/themes/components/hover_card.pyi index 8924ef1a8..fa169c852 100644 --- a/reflex/components/radix/themes/components/hover_card.pyi +++ b/reflex/components/radix/themes/components/hover_card.pyi @@ -43,7 +43,7 @@ class HoverCardRoot(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, @@ -256,7 +256,7 @@ class HoverCard(ComponentNamespace): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index 984a139d0..218392517 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -41,7 +41,7 @@ class PopoverRoot(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/components/radio_cards.pyi b/reflex/components/radix/themes/components/radio_cards.pyi index d73447622..d2f6a1425 100644 --- a/reflex/components/radix/themes/components/radio_cards.pyi +++ b/reflex/components/radix/themes/components/radio_cards.pyi @@ -177,7 +177,7 @@ class RadioCardsRoot(RadixThemesComponent): on_mouse_up: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, - on_value_change: Optional[EventType] = None, + on_value_change: Optional[EventType[str]] = None, **props, ) -> "RadioCardsRoot": """Create a new component instance. diff --git a/reflex/components/radix/themes/components/radio_group.pyi b/reflex/components/radix/themes/components/radio_group.pyi index c984fa1f2..f928421c5 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -113,7 +113,7 @@ class RadioGroupRoot(RadixThemesComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, diff --git a/reflex/components/radix/themes/components/select.pyi b/reflex/components/radix/themes/components/select.pyi index c43d58ada..e0e184482 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -44,7 +44,7 @@ class SelectRoot(RadixThemesComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, @@ -57,7 +57,7 @@ class SelectRoot(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, @@ -680,7 +680,7 @@ class HighLevelSelect(SelectRoot): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, @@ -693,7 +693,7 @@ class HighLevelSelect(SelectRoot): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, @@ -854,7 +854,7 @@ class Select(ComponentNamespace): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, @@ -867,7 +867,7 @@ class Select(ComponentNamespace): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index ba9c2595e..f8871872a 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -119,7 +119,7 @@ class Switch(RadixThemesComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[bool]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index 7b67bad6e..4272bf2a3 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -41,7 +41,7 @@ class TabsRoot(RadixThemesComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, @@ -340,7 +340,7 @@ class Tabs(ComponentNamespace): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[[]]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index ad7c4402f..ac2a36368 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -76,7 +76,7 @@ class Tooltip(RadixThemesComponent): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_pointer_down_outside: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index d1f29f508..2556c8e83 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -41,7 +41,7 @@ class Audio(ReactPlayer): on_context_menu: Optional[EventType[[]]] = None, on_disable_pip: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, - on_duration: Optional[EventType] = None, + on_duration: Optional[EventType[float]] = None, on_enable_pip: Optional[EventType[[]]] = None, on_ended: Optional[EventType[[]]] = None, on_error: Optional[EventType[[]]] = None, @@ -61,7 +61,7 @@ class Audio(ReactPlayer): on_progress: Optional[EventType] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, - on_seek: Optional[EventType] = None, + on_seek: Optional[EventType[float]] = None, on_start: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 940b09e51..9a445c294 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -39,7 +39,7 @@ class ReactPlayer(NoSSRComponent): on_context_menu: Optional[EventType[[]]] = None, on_disable_pip: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, - on_duration: Optional[EventType] = None, + on_duration: Optional[EventType[float]] = None, on_enable_pip: Optional[EventType[[]]] = None, on_ended: Optional[EventType[[]]] = None, on_error: Optional[EventType[[]]] = None, @@ -59,7 +59,7 @@ class ReactPlayer(NoSSRComponent): on_progress: Optional[EventType] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, - on_seek: Optional[EventType] = None, + on_seek: Optional[EventType[float]] = None, on_start: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index a50ccf71f..d46e2617d 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -41,7 +41,7 @@ class Video(ReactPlayer): on_context_menu: Optional[EventType[[]]] = None, on_disable_pip: Optional[EventType[[]]] = None, on_double_click: Optional[EventType[[]]] = None, - on_duration: Optional[EventType] = None, + on_duration: Optional[EventType[float]] = None, on_enable_pip: Optional[EventType[[]]] = None, on_ended: Optional[EventType[[]]] = None, on_error: Optional[EventType[[]]] = None, @@ -61,7 +61,7 @@ class Video(ReactPlayer): on_progress: Optional[EventType] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, - on_seek: Optional[EventType] = None, + on_seek: Optional[EventType[float]] = None, on_start: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index 5cc45dc98..73dd38fdc 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -128,7 +128,7 @@ class Editor(NoSSRComponent): autofocus: Optional[bool] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_blur: Optional[EventType[str]] = None, - on_change: Optional[EventType] = None, + on_change: Optional[EventType[str]] = None, on_click: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None, on_copy: Optional[EventType[[]]] = None, @@ -136,7 +136,7 @@ class Editor(NoSSRComponent): on_double_click: Optional[EventType[[]]] = None, on_focus: Optional[EventType[[]]] = None, on_input: Optional[EventType[[]]] = None, - on_load: Optional[EventType] = None, + on_load: Optional[EventType[bool]] = None, on_mount: Optional[EventType[[]]] = None, on_mouse_down: Optional[EventType[[]]] = None, on_mouse_enter: Optional[EventType[[]]] = None, @@ -148,8 +148,8 @@ class Editor(NoSSRComponent): on_paste: Optional[EventType[str, bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, - toggle_code_view: Optional[EventType] = None, - toggle_full_screen: Optional[EventType] = None, + toggle_code_view: Optional[EventType[bool]] = None, + toggle_full_screen: Optional[EventType[bool]] = None, **props, ) -> "Editor": """Create an instance of Editor. No children allowed. diff --git a/reflex/event.py b/reflex/event.py index 76a465739..cfe40ef9a 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -24,7 +24,7 @@ from typing import ( overload, ) -from typing_extensions import ParamSpec, get_args, get_origin +from typing_extensions import ParamSpec, Protocol, get_args, get_origin from reflex import constants from reflex.utils import console, format @@ -465,33 +465,97 @@ prevent_default = EventChain(events=[], args_spec=empty_event).prevent_default T = TypeVar("T") +U = TypeVar("U") -def identity_event(event_type: Type[T]) -> Callable[[Var[T]], Tuple[Var[T]]]: +# def identity_event(event_type: Type[T]) -> Callable[[Var[T]], Tuple[Var[T]]]: +# """A helper function that returns the input event as output. + +# Args: +# event_type: The type of the event. + +# Returns: +# A function that returns the input event as output. +# """ + +# def inner(ev: Var[T]) -> Tuple[Var[T]]: +# return (ev,) + +# inner.__signature__ = inspect.signature(inner).replace( # type: ignore +# parameters=[ +# inspect.Parameter( +# "ev", +# kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, +# annotation=Var[event_type], +# ) +# ], +# return_annotation=Tuple[Var[event_type]], +# ) +# inner.__annotations__["ev"] = Var[event_type] +# inner.__annotations__["return"] = Tuple[Var[event_type]] + +# return inner + + +class IdentityEventReturn(Generic[T], Protocol): + """Protocol for an identity event return.""" + + def __call__(self, *values: Var[T]) -> Tuple[Var[T], ...]: + """Return the input values. + + Args: + *values: The values to return. + + Returns: + The input values. + """ + return values + + +@overload +def identity_event(event_type: Type[T], /) -> Callable[[Var[T]], Tuple[Var[T]]]: ... # type: ignore + + +@overload +def identity_event( + event_type_1: Type[T], event_type2: Type[U], / +) -> Callable[[Var[T], Var[U]], Tuple[Var[T], Var[U]]]: ... + + +@overload +def identity_event(*event_types: Type[T]) -> IdentityEventReturn[T]: ... + + +def identity_event(*event_types: Type[T]) -> IdentityEventReturn[T]: # type: ignore """A helper function that returns the input event as output. Args: - event_type: The type of the event. + *event_types: The types of the events. Returns: A function that returns the input event as output. """ - def inner(ev: Var[T]) -> Tuple[Var[T]]: - return (ev,) + def inner(*values: Var[T]) -> Tuple[Var[T], ...]: + return values + + inner_type = tuple(Var[event_type] for event_type in event_types) + return_annotation = Tuple[inner_type] # type: ignore inner.__signature__ = inspect.signature(inner).replace( # type: ignore parameters=[ inspect.Parameter( - "ev", + f"ev_{i}", kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, annotation=Var[event_type], ) + for i, event_type in enumerate(event_types) ], - return_annotation=Tuple[Var[event_type]], + return_annotation=return_annotation, ) - inner.__annotations__["ev"] = Var[event_type] - inner.__annotations__["return"] = Tuple[Var[event_type]] + for i, event_type in enumerate(event_types): + inner.__annotations__[f"ev_{i}"] = Var[event_type] + inner.__annotations__["return"] = return_annotation return inner diff --git a/reflex/experimental/layout.pyi b/reflex/experimental/layout.pyi index e4c82b351..dcdac5b5d 100644 --- a/reflex/experimental/layout.pyi +++ b/reflex/experimental/layout.pyi @@ -129,7 +129,7 @@ class DrawerSidebar(DrawerRoot): on_mouse_out: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None, - on_open_change: Optional[EventType] = None, + on_open_change: Optional[EventType[bool]] = None, on_scroll: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None, **props, diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index fd76576b9..026a53bca 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -16,7 +16,7 @@ from itertools import chain from multiprocessing import Pool, cpu_count from pathlib import Path from types import ModuleType, SimpleNamespace -from typing import Any, Callable, Iterable, Type, get_args +from typing import Any, Callable, Iterable, Type, get_args, get_origin from reflex.components.component import Component from reflex.utils import types as rx_types @@ -372,6 +372,53 @@ def _extract_class_props_as_ast_nodes( return kwargs +def type_to_ast(typ) -> ast.AST: + """Converts any type annotation into its AST representation. + Handles nested generic types, unions, etc. + + Args: + typ: The type annotation to convert. + + Returns: + The AST representation of the type annotation. + """ + if typ is type(None): + return ast.Name(id="None") + + origin = get_origin(typ) + + # Handle plain types (int, str, custom classes, etc.) + if origin is None: + if hasattr(typ, "__name__"): + return ast.Name(id=typ.__name__) + elif hasattr(typ, "_name"): + return ast.Name(id=typ._name) + return ast.Name(id=str(typ)) + + # Get the base type name (List, Dict, Optional, etc.) + base_name = origin._name if hasattr(origin, "_name") else origin.__name__ + + # Get type arguments + args = get_args(typ) + + # Handle empty type arguments + if not args: + return ast.Name(id=base_name) + + # Convert all type arguments recursively + arg_nodes = [type_to_ast(arg) for arg in args] + + # Special case for single-argument types (like List[T] or Optional[T]) + if len(arg_nodes) == 1: + slice_value = arg_nodes[0] + else: + slice_value = ast.Tuple(elts=arg_nodes, ctx=ast.Load()) + + return ast.Subscript( + value=ast.Name(id=base_name), slice=ast.Index(value=slice_value), ctx=ast.Load() + ) + + def _get_parent_imports(func): _imports = {"reflex.vars": ["Var"]} for type_hint in inspect.get_annotations(func).values(): @@ -430,13 +477,40 @@ def _generate_component_create_functiondef( def figure_out_return_type(annotation: Any): if inspect.isclass(annotation) and issubclass(annotation, inspect._empty): return ast.Name(id="Optional[EventType]") + + if not isinstance(annotation, str) and get_origin(annotation) is tuple: + arguments = get_args(annotation) + + arguments_without_var = [ + get_args(argument)[0] if get_origin(argument) == Var else argument + for argument in arguments + ] + + # Convert each argument type to its AST representation + type_args = [type_to_ast(arg) for arg in arguments_without_var] + + # Join the type arguments with commas for EventType + args_str = ", ".join(ast.unparse(arg) for arg in type_args) + + # Create EventType using the joined string + event_type = ast.Name(id=f"EventType[{args_str}]") + + # Wrap in Optional + optional_type = ast.Subscript( + value=ast.Name(id="Optional"), + slice=ast.Index(value=event_type), + ctx=ast.Load(), + ) + + return ast.Name(id=ast.unparse(optional_type)) + if isinstance(annotation, str) and annotation.startswith("Tuple["): inside_of_tuple = annotation.removeprefix("Tuple[").removesuffix("]") if inside_of_tuple == "()": return ast.Name(id="Optional[EventType[[]]]") - arguments: list[str] = [""] + arguments = [""] bracket_count = 0 diff --git a/tests/integration/test_lifespan.py b/tests/integration/test_lifespan.py index f8bcf2397..22c399c07 100644 --- a/tests/integration/test_lifespan.py +++ b/tests/integration/test_lifespan.py @@ -51,6 +51,7 @@ def LifespanApp(): def context_global(self) -> int: return lifespan_context_global + @rx.event def tick(self, date): pass From d63b3a2bceb4ed1029487e7aff6c51ebd8b0fc3f Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Tue, 22 Oct 2024 17:01:34 +0000 Subject: [PATCH 195/201] [ENG-3848][ENG-3861]Shiki Code block Experimental (#4030) * Shiki Code block Experimental * refactor * update code * remove console.log * add transformers to namespace * some validations * fix components paths * fix ruff * add a high-level component * fix mapping * fix mapping * python 3.9+ * see if this fixes the tests * fix pyi and annotations * minimal update of theme and language map * add hack for reflex-web/flexdown * unit test file commit * [ENG-3895] [ENG-3896] Update styling for shiki code block * strip transformer triggers * minor refactor * linter * fix pyright * pyi fix * add unit tests * sneaky pyright ignore * the transformer trigger regex should remove the language comment character * minor refactor * fix silly mistake * component mapping in markdown should use the first child for codeblock * use ternary operator in numbers.py, move code block args to class for docs discoverability * precommit * pyright fix * remove id on copy button animation * pyright fix for real * pyi fix * pyi fix fr * check if svg exists * copy event chain * do a concatenation instead of first child * added comment --------- Co-authored-by: Carlos --- .../.templates/web/components/shiki/code.js | 29 + .../datadisplay/shiki_code_block.py | 813 ++++++ .../datadisplay/shiki_code_block.pyi | 2211 +++++++++++++++++ reflex/components/markdown/markdown.py | 13 +- reflex/experimental/__init__.py | 2 + reflex/vars/function.py | 1 + reflex/vars/sequence.py | 20 + .../components/datadisplay/test_shiki_code.py | 172 ++ 8 files changed, 3260 insertions(+), 1 deletion(-) create mode 100644 reflex/.templates/web/components/shiki/code.js create mode 100644 reflex/components/datadisplay/shiki_code_block.py create mode 100644 reflex/components/datadisplay/shiki_code_block.pyi create mode 100644 tests/units/components/datadisplay/test_shiki_code.py diff --git a/reflex/.templates/web/components/shiki/code.js b/reflex/.templates/web/components/shiki/code.js new file mode 100644 index 000000000..c655c3a60 --- /dev/null +++ b/reflex/.templates/web/components/shiki/code.js @@ -0,0 +1,29 @@ +import { useEffect, useState } from "react" +import { codeToHtml} from "shiki" + +export function Code ({code, theme, language, transformers, ...divProps}) { + const [codeResult, setCodeResult] = useState("") + useEffect(() => { + async function fetchCode() { + let final_code; + + if (Array.isArray(code)) { + final_code = code[0]; + } else { + final_code = code; + } + const result = await codeToHtml(final_code, { + lang: language, + theme, + transformers + }); + setCodeResult(result); + } + fetchCode(); + }, [code, language, theme, transformers] + + ) + return ( +
+ ) +} diff --git a/reflex/components/datadisplay/shiki_code_block.py b/reflex/components/datadisplay/shiki_code_block.py new file mode 100644 index 000000000..46199a6e4 --- /dev/null +++ b/reflex/components/datadisplay/shiki_code_block.py @@ -0,0 +1,813 @@ +"""Shiki syntax hghlighter component.""" + +from __future__ import annotations + +import re +from collections import defaultdict +from typing import Any, Literal, Optional, Union + +from reflex.base import Base +from reflex.components.component import Component, ComponentNamespace +from reflex.components.core.colors import color +from reflex.components.core.cond import color_mode_cond +from reflex.components.el.elements.forms import Button +from reflex.components.lucide.icon import Icon +from reflex.components.radix.themes.layout.box import Box +from reflex.event import call_script, set_clipboard +from reflex.style import Style +from reflex.utils.exceptions import VarTypeError +from reflex.utils.imports import ImportVar +from reflex.vars.base import LiteralVar, Var +from reflex.vars.function import FunctionStringVar +from reflex.vars.sequence import StringVar, string_replace_operation + + +def copy_script() -> Any: + """Copy script for the code block and modify the child SVG element. + + + Returns: + Any: The result of calling the script. + """ + return call_script( + f""" +// Event listener for the parent click +document.addEventListener('click', function(event) {{ + // Find the closest div (parent element) + const parent = event.target.closest('div'); + // If the parent is found + if (parent) {{ + // Find the SVG element within the parent + const svgIcon = parent.querySelector('svg'); + // If the SVG exists, proceed with the script + if (svgIcon) {{ + const originalPath = svgIcon.innerHTML; + const checkmarkPath = ''; // Checkmark SVG path + function transition(element, scale, opacity) {{ + element.style.transform = `scale(${{scale}})`; + element.style.opacity = opacity; + }} + // Animate the SVG + transition(svgIcon, 0, '0'); + setTimeout(() => {{ + svgIcon.innerHTML = checkmarkPath; // Replace content with checkmark + svgIcon.setAttribute('viewBox', '0 0 24 24'); // Adjust viewBox if necessary + transition(svgIcon, 1, '1'); + setTimeout(() => {{ + transition(svgIcon, 0, '0'); + setTimeout(() => {{ + svgIcon.innerHTML = originalPath; // Restore original SVG content + transition(svgIcon, 1, '1'); + }}, 125); + }}, 600); + }}, 125); + }} else {{ + // console.error('SVG element not found within the parent.'); + }} + }} else {{ + // console.error('Parent element not found.'); + }} +}}); +""" + ) + + +SHIKIJS_TRANSFORMER_FNS = { + "transformerNotationDiff", + "transformerNotationHighlight", + "transformerNotationWordHighlight", + "transformerNotationFocus", + "transformerNotationErrorLevel", + "transformerRenderWhitespace", + "transformerMetaHighlight", + "transformerMetaWordHighlight", + "transformerCompactLineOptions", + # TODO: this transformer when included adds a weird behavior which removes other code lines. Need to figure out why. + # "transformerRemoveLineBreak", + "transformerRemoveNotationEscape", +} +LINE_NUMBER_STYLING = { + "code": { + "counter-reset": "step", + "counter-increment": "step 0", + "display": "grid", + "line-height": "1.7", + "font-size": "0.875em", + }, + "code .line::before": { + "content": "counter(step)", + "counter-increment": "step", + "width": "1rem", + "margin-right": "1.5rem", + "display": "inline-block", + "text-align": "right", + "color": "rgba(115,138,148,.4)", + }, +} +BOX_PARENT_STYLING = { + "pre": { + "margin": "0", + "padding": "24px", + "background": "transparent", + "overflow-x": "auto", + "border-radius": "6px", + }, +} + +THEME_MAPPING = { + "light": "one-light", + "dark": "one-dark-pro", + "a11y-dark": "github-dark", +} +LANGUAGE_MAPPING = {"bash": "shellscript"} +LiteralCodeLanguage = Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", +] +LiteralCodeTheme = Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", +] + + +class ShikiBaseTransformers(Base): + """Base for creating transformers.""" + + library: str + fns: list[FunctionStringVar] + style: Optional[Style] + + +class ShikiJsTransformer(ShikiBaseTransformers): + """A Wrapped shikijs transformer.""" + + library: str = "@shikijs/transformers" + fns: list[FunctionStringVar] = [ + FunctionStringVar.create(fn) for fn in SHIKIJS_TRANSFORMER_FNS + ] + style: Optional[Style] = Style( + { + "code": {"line-height": "1.7", "font-size": "0.875em", "display": "grid"}, + # Diffs + ".diff": { + "margin": "0 -24px", + "padding": "0 24px", + "width": "calc(100% + 48px)", + "display": "inline-block", + }, + ".diff.add": { + "background-color": "rgba(16, 185, 129, .14)", + "position": "relative", + }, + ".diff.remove": { + "background-color": "rgba(244, 63, 94, .14)", + "opacity": "0.7", + "position": "relative", + }, + ".diff.remove:after": { + "position": "absolute", + "left": "10px", + "content": "'-'", + "color": "#b34e52", + }, + ".diff.add:after": { + "position": "absolute", + "left": "10px", + "content": "'+'", + "color": "#18794e", + }, + # Highlight + ".highlighted": { + "background-color": "rgba(142, 150, 170, .14)", + "margin": "0 -24px", + "padding": "0 24px", + "width": "calc(100% + 48px)", + "display": "inline-block", + }, + ".highlighted.error": { + "background-color": "rgba(244, 63, 94, .14)", + }, + ".highlighted.warning": { + "background-color": "rgba(234, 179, 8, .14)", + }, + # Highlighted Word + ".highlighted-word": { + "background-color": color("gray", 2), + "border": f"1px solid {color('gray', 5)}", + "padding": "1px 3px", + "margin": "-1px -3px", + "border-radius": "4px", + }, + # Focused Lines + ".has-focused .line:not(.focused)": { + "opacity": "0.7", + "filter": "blur(0.095rem)", + "transition": "filter .35s, opacity .35s", + }, + ".has-focused:hover .line:not(.focused)": { + "opacity": "1", + "filter": "none", + }, + # White Space + # ".tab, .space": { + # "position": "relative", + # }, + # ".tab::before": { + # "content": "'⇥'", + # "position": "absolute", + # "opacity": "0.3", + # }, + # ".space::before": { + # "content": "'·'", + # "position": "absolute", + # "opacity": "0.3", + # }, + } + ) + + def __init__(self, **kwargs): + """Initialize the transformer. + + Args: + kwargs: Kwargs to initialize the props. + + """ + fns = kwargs.pop("fns", None) + style = kwargs.pop("style", None) + if fns: + kwargs["fns"] = [ + ( + FunctionStringVar.create(x) + if not isinstance(x, FunctionStringVar) + else x + ) + for x in fns + ] + + if style: + kwargs["style"] = Style(style) + super().__init__(**kwargs) + + +class ShikiCodeBlock(Component): + """A Code block.""" + + library = "/components/shiki/code" + + tag = "Code" + + alias = "ShikiCode" + + lib_dependencies: list[str] = ["shiki"] + + # The language to use. + language: Var[LiteralCodeLanguage] = Var.create("python") + + # The theme to use ("light" or "dark"). + theme: Var[LiteralCodeTheme] = Var.create("one-light") + + # The set of themes to use for different modes. + themes: Var[Union[list[dict[str, Any]], dict[str, str]]] + + # The code to display. + code: Var[str] + + # The transformers to use for the syntax highlighter. + transformers: Var[list[Union[ShikiBaseTransformers, dict[str, Any]]]] = Var.create( + [] + ) + + @classmethod + def create( + cls, + *children, + **props, + ) -> Component: + """Create a code block component using [shiki syntax highlighter](https://shiki.matsu.io/). + + Args: + *children: The children of the component. + **props: The props to pass to the component. + + Returns: + The code block component. + """ + # Separate props for the code block and the wrapper + code_block_props = {} + code_wrapper_props = {} + + class_props = cls.get_props() + + # Distribute props between the code block and wrapper + for key, value in props.items(): + (code_block_props if key in class_props else code_wrapper_props)[key] = ( + value + ) + + code_block_props["code"] = children[0] + code_block = super().create(**code_block_props) + + transformer_styles = {} + # Collect styles from transformers and wrapper + for transformer in code_block.transformers._var_value: # type: ignore + if isinstance(transformer, ShikiBaseTransformers) and transformer.style: + transformer_styles.update(transformer.style) + transformer_styles.update(code_wrapper_props.pop("style", {})) + + return Box.create( + code_block, + *children[1:], + style=Style({**transformer_styles, **BOX_PARENT_STYLING}), + **code_wrapper_props, + ) + + def add_imports(self) -> dict[str, list[str]]: + """Add the necessary imports. + We add all referenced transformer functions as imports from their corresponding + libraries. + + Returns: + Imports for the component. + """ + imports = defaultdict(list) + for transformer in self.transformers._var_value: + if isinstance(transformer, ShikiBaseTransformers): + imports[transformer.library].extend( + [ImportVar(tag=str(fn)) for fn in transformer.fns] + ) + ( + self.lib_dependencies.append(transformer.library) + if transformer.library not in self.lib_dependencies + else None + ) + return imports + + @classmethod + def create_transformer(cls, library: str, fns: list[str]) -> ShikiBaseTransformers: + """Create a transformer from a third party library. + + Args: + library: The name of the library. + fns: The str names of the functions/callables to invoke from the library. + + Returns: + A transformer for the specified library. + + Raises: + ValueError: If a supplied function name is not valid str. + """ + if any(not isinstance(fn_name, str) for fn_name in fns): + raise ValueError( + f"the function names should be str names of functions in the specified transformer: {library!r}" + ) + return ShikiBaseTransformers( # type: ignore + library=library, fns=[FunctionStringVar.create(fn) for fn in fns] + ) + + def _render(self, props: dict[str, Any] | None = None): + """Renders the component with the given properties, processing transformers if present. + + Args: + props: Optional properties to pass to the render function. + + Returns: + Rendered component output. + """ + # Ensure props is initialized from class attributes if not provided + props = props or { + attr.rstrip("_"): getattr(self, attr) for attr in self.get_props() + } + + # Extract transformers and apply transformations + transformers = props.get("transformers") + if transformers is not None: + transformed_values = self._process_transformers(transformers._var_value) + props["transformers"] = LiteralVar.create(transformed_values) + + return super()._render(props) + + def _process_transformers(self, transformer_list: list) -> list: + """Processes a list of transformers, applying transformations where necessary. + + Args: + transformer_list: List of transformer objects or values. + + Returns: + list: A list of transformed values. + """ + processed = [] + + for transformer in transformer_list: + if isinstance(transformer, ShikiBaseTransformers): + processed.extend(fn.call() for fn in transformer.fns) + else: + processed.append(transformer) + + return processed + + +class ShikiHighLevelCodeBlock(ShikiCodeBlock): + """High level component for the shiki syntax highlighter.""" + + # If this is enabled, the default transformers(shikijs transformer) will be used. + use_transformers: Var[bool] + + # If this is enabled line numbers will be shown next to the code block. + show_line_numbers: Var[bool] + + # Whether a copy button should appear. + can_copy: Var[bool] = Var.create(False) + + # copy_button: A custom copy button to override the default one. + copy_button: Var[Optional[Union[Component, bool]]] = Var.create(None) + + @classmethod + def create( + cls, + *children, + **props, + ) -> Component: + """Create a code block component using [shiki syntax highlighter](https://shiki.matsu.io/). + + Args: + *children: The children of the component. + **props: The props to pass to the component. + + Returns: + The code block component. + """ + use_transformers = props.pop("use_transformers", False) + show_line_numbers = props.pop("show_line_numbers", False) + language = props.pop("language", None) + can_copy = props.pop("can_copy", False) + copy_button = props.pop("copy_button", None) + + if use_transformers: + props["transformers"] = [ShikiJsTransformer()] + + if language is not None: + props["language"] = cls._map_languages(language) + + # line numbers are generated via css + if show_line_numbers: + props["style"] = {**LINE_NUMBER_STYLING, **props.get("style", {})} + + theme = props.pop("theme", None) + props["theme"] = props["theme"] = ( + cls._map_themes(theme) + if theme is not None + else color_mode_cond( # Default color scheme responds to global color mode. + light="one-light", + dark="one-dark-pro", + ) + ) + + if can_copy: + code = children[0] + copy_button = ( # type: ignore + copy_button + if copy_button is not None + else Button.create( + Icon.create(tag="copy", size=16, color=color("gray", 11)), + on_click=[ + set_clipboard(cls._strip_transformer_triggers(code)), # type: ignore + copy_script(), + ], + style=Style( + { + "position": "absolute", + "top": "4px", + "right": "4px", + "background": color("gray", 3), + "border": "1px solid", + "border-color": color("gray", 5), + "border-radius": "6px", + "padding": "5px", + "opacity": "1", + "cursor": "pointer", + "_hover": { + "background": color("gray", 4), + }, + "transition": "background 0.250s ease-out", + "&>svg": { + "transition": "transform 0.250s ease-out, opacity 0.250s ease-out", + }, + "_active": { + "background": color("gray", 5), + }, + } + ), + ) + ) + + if copy_button: + return ShikiCodeBlock.create( + children[0], copy_button, position="relative", **props + ) + else: + return ShikiCodeBlock.create(children[0], **props) + + @staticmethod + def _map_themes(theme: str) -> str: + if isinstance(theme, str) and theme in THEME_MAPPING: + return THEME_MAPPING[theme] + return theme + + @staticmethod + def _map_languages(language: str) -> str: + if isinstance(language, str) and language in LANGUAGE_MAPPING: + return LANGUAGE_MAPPING[language] + return language + + @staticmethod + def _strip_transformer_triggers(code: str | StringVar) -> StringVar | str: + if not isinstance(code, (StringVar, str)): + raise VarTypeError( + f"code should be string literal or a StringVar type. Got {type(code)} instead." + ) + regex_pattern = r"[\/#]+ *\[!code.*?\]" + + if isinstance(code, Var): + return string_replace_operation( + code, StringVar(_js_expr=f"/{regex_pattern}/g", _var_type=str), "" + ) + if isinstance(code, str): + return re.sub(regex_pattern, "", code) + + +class TransformerNamespace(ComponentNamespace): + """Namespace for the Transformers.""" + + shikijs = ShikiJsTransformer + + +class CodeblockNamespace(ComponentNamespace): + """Namespace for the CodeBlock component.""" + + root = staticmethod(ShikiCodeBlock.create) + create_transformer = staticmethod(ShikiCodeBlock.create_transformer) + transformers = TransformerNamespace() + __call__ = staticmethod(ShikiHighLevelCodeBlock.create) + + +code_block = CodeblockNamespace() diff --git a/reflex/components/datadisplay/shiki_code_block.pyi b/reflex/components/datadisplay/shiki_code_block.pyi new file mode 100644 index 000000000..bcf2719e9 --- /dev/null +++ b/reflex/components/datadisplay/shiki_code_block.pyi @@ -0,0 +1,2211 @@ +"""Stub file for reflex/components/datadisplay/shiki_code_block.py""" + +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `reflex/utils/pyi_generator.py`! +# ------------------------------------------------------ +from typing import Any, Dict, Literal, Optional, Union, overload + +from reflex.base import Base +from reflex.components.component import Component, ComponentNamespace +from reflex.event import EventType +from reflex.style import Style +from reflex.vars.base import Var +from reflex.vars.function import FunctionStringVar + +def copy_script() -> Any: ... + +SHIKIJS_TRANSFORMER_FNS = { + "transformerNotationDiff", + "transformerNotationHighlight", + "transformerNotationWordHighlight", + "transformerNotationFocus", + "transformerNotationErrorLevel", + "transformerRenderWhitespace", + "transformerMetaHighlight", + "transformerMetaWordHighlight", + "transformerCompactLineOptions", + "transformerRemoveNotationEscape", +} +LINE_NUMBER_STYLING = { + "code": { + "counter-reset": "step", + "counter-increment": "step 0", + "display": "grid", + "line-height": "1.7", + "font-size": "0.875em", + }, + "code .line::before": { + "content": "counter(step)", + "counter-increment": "step", + "width": "1rem", + "margin-right": "1.5rem", + "display": "inline-block", + "text-align": "right", + "color": "rgba(115,138,148,.4)", + }, +} +BOX_PARENT_STYLING = { + "pre": { + "margin": "0", + "padding": "24px", + "background": "transparent", + "overflow-x": "auto", + "border-radius": "6px", + } +} +THEME_MAPPING = { + "light": "one-light", + "dark": "one-dark-pro", + "a11y-dark": "github-dark", +} +LANGUAGE_MAPPING = {"bash": "shellscript"} +LiteralCodeLanguage = Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", +] +LiteralCodeTheme = Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", +] + +class ShikiBaseTransformers(Base): + library: str + fns: list[FunctionStringVar] + style: Optional[Style] + +class ShikiJsTransformer(ShikiBaseTransformers): + library: str + fns: list[FunctionStringVar] + style: Optional[Style] + +class ShikiCodeBlock(Component): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + language: Optional[ + Union[ + Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", + ], + Var[ + Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", + ] + ], + ] + ] = None, + theme: Optional[ + Union[ + Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", + ], + Var[ + Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", + ] + ], + ] + ] = None, + themes: Optional[ + Union[ + Var[Union[dict[str, str], list[dict[str, Any]]]], + dict[str, str], + list[dict[str, Any]], + ] + ] = None, + code: Optional[Union[Var[str], str]] = None, + transformers: Optional[ + Union[ + Var[list[Union[ShikiBaseTransformers, dict[str, Any]]]], + list[Union[ShikiBaseTransformers, dict[str, Any]]], + ] + ] = 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, str]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + **props, + ) -> "ShikiCodeBlock": + """Create a code block component using [shiki syntax highlighter](https://shiki.matsu.io/). + + Args: + *children: The children of the component. + language: The language to use. + theme: The theme to use ("light" or "dark"). + themes: The set of themes to use for different modes. + code: The code to display. + transformers: The transformers to use for the syntax highlighter. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props to pass to the component. + + Returns: + The code block component. + """ + ... + + def add_imports(self) -> dict[str, list[str]]: ... + @classmethod + def create_transformer( + cls, library: str, fns: list[str] + ) -> ShikiBaseTransformers: ... + +class ShikiHighLevelCodeBlock(ShikiCodeBlock): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + use_transformers: Optional[Union[Var[bool], bool]] = None, + show_line_numbers: Optional[Union[Var[bool], bool]] = None, + can_copy: Optional[Union[Var[bool], bool]] = None, + copy_button: Optional[ + Union[Component, Var[Optional[Union[Component, bool]]], bool] + ] = None, + language: Optional[ + Union[ + Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", + ], + Var[ + Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", + ] + ], + ] + ] = None, + theme: Optional[ + Union[ + Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", + ], + Var[ + Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", + ] + ], + ] + ] = None, + themes: Optional[ + Union[ + Var[Union[dict[str, str], list[dict[str, Any]]]], + dict[str, str], + list[dict[str, Any]], + ] + ] = None, + code: Optional[Union[Var[str], str]] = None, + transformers: Optional[ + Union[ + Var[list[Union[ShikiBaseTransformers, dict[str, Any]]]], + list[Union[ShikiBaseTransformers, dict[str, Any]]], + ] + ] = 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, str]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + **props, + ) -> "ShikiHighLevelCodeBlock": + """Create a code block component using [shiki syntax highlighter](https://shiki.matsu.io/). + + Args: + *children: The children of the component. + use_transformers: If this is enabled, the default transformers(shikijs transformer) will be used. + show_line_numbers: If this is enabled line numbers will be shown next to the code block. + can_copy: Whether a copy button should appear. + copy_button: copy_button: A custom copy button to override the default one. + language: The language to use. + theme: The theme to use ("light" or "dark"). + themes: The set of themes to use for different modes. + code: The code to display. + transformers: The transformers to use for the syntax highlighter. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props to pass to the component. + + Returns: + The code block component. + """ + ... + +class TransformerNamespace(ComponentNamespace): + shikijs = ShikiJsTransformer + +class CodeblockNamespace(ComponentNamespace): + root = staticmethod(ShikiCodeBlock.create) + create_transformer = staticmethod(ShikiCodeBlock.create_transformer) + transformers = TransformerNamespace() + + @staticmethod + def __call__( + *children, + use_transformers: Optional[Union[Var[bool], bool]] = None, + show_line_numbers: Optional[Union[Var[bool], bool]] = None, + can_copy: Optional[Union[Var[bool], bool]] = None, + copy_button: Optional[ + Union[Component, Var[Optional[Union[Component, bool]]], bool] + ] = None, + language: Optional[ + Union[ + Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", + ], + Var[ + Literal[ + "abap", + "actionscript-3", + "ada", + "angular-html", + "angular-ts", + "apache", + "apex", + "apl", + "applescript", + "ara", + "asciidoc", + "asm", + "astro", + "awk", + "ballerina", + "bat", + "beancount", + "berry", + "bibtex", + "bicep", + "blade", + "c", + "cadence", + "clarity", + "clojure", + "cmake", + "cobol", + "codeowners", + "codeql", + "coffee", + "common-lisp", + "coq", + "cpp", + "crystal", + "csharp", + "css", + "csv", + "cue", + "cypher", + "d", + "dart", + "dax", + "desktop", + "diff", + "docker", + "dotenv", + "dream-maker", + "edge", + "elixir", + "elm", + "emacs-lisp", + "erb", + "erlang", + "fennel", + "fish", + "fluent", + "fortran-fixed-form", + "fortran-free-form", + "fsharp", + "gdresource", + "gdscript", + "gdshader", + "genie", + "gherkin", + "git-commit", + "git-rebase", + "gleam", + "glimmer-js", + "glimmer-ts", + "glsl", + "gnuplot", + "go", + "graphql", + "groovy", + "hack", + "haml", + "handlebars", + "haskell", + "haxe", + "hcl", + "hjson", + "hlsl", + "html", + "html-derivative", + "http", + "hxml", + "hy", + "imba", + "ini", + "java", + "javascript", + "jinja", + "jison", + "json", + "json5", + "jsonc", + "jsonl", + "jsonnet", + "jssm", + "jsx", + "julia", + "kotlin", + "kusto", + "latex", + "lean", + "less", + "liquid", + "log", + "logo", + "lua", + "luau", + "make", + "markdown", + "marko", + "matlab", + "mdc", + "mdx", + "mermaid", + "mojo", + "move", + "narrat", + "nextflow", + "nginx", + "nim", + "nix", + "nushell", + "objective-c", + "objective-cpp", + "ocaml", + "pascal", + "perl", + "php", + "plsql", + "po", + "postcss", + "powerquery", + "powershell", + "prisma", + "prolog", + "proto", + "pug", + "puppet", + "purescript", + "python", + "qml", + "qmldir", + "qss", + "r", + "racket", + "raku", + "razor", + "reg", + "regexp", + "rel", + "riscv", + "rst", + "ruby", + "rust", + "sas", + "sass", + "scala", + "scheme", + "scss", + "shaderlab", + "shellscript", + "shellsession", + "smalltalk", + "solidity", + "soy", + "sparql", + "splunk", + "sql", + "ssh-config", + "stata", + "stylus", + "svelte", + "swift", + "system-verilog", + "systemd", + "tasl", + "tcl", + "templ", + "terraform", + "tex", + "toml", + "ts-tags", + "tsv", + "tsx", + "turtle", + "twig", + "typescript", + "typespec", + "typst", + "v", + "vala", + "vb", + "verilog", + "vhdl", + "viml", + "vue", + "vue-html", + "vyper", + "wasm", + "wenyan", + "wgsl", + "wikitext", + "wolfram", + "xml", + "xsl", + "yaml", + "zenscript", + "zig", + ] + ], + ] + ] = None, + theme: Optional[ + Union[ + Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", + ], + Var[ + Literal[ + "andromeeda", + "aurora-x", + "ayu-dark", + "catppuccin-frappe", + "catppuccin-latte", + "catppuccin-macchiato", + "catppuccin-mocha", + "dark-plus", + "dracula", + "dracula-soft", + "everforest-dark", + "everforest-light", + "github-dark", + "github-dark-default", + "github-dark-dimmed", + "github-dark-high-contrast", + "github-light", + "github-light-default", + "github-light-high-contrast", + "houston", + "laserwave", + "light-plus", + "material-theme", + "material-theme-darker", + "material-theme-lighter", + "material-theme-ocean", + "material-theme-palenight", + "min-dark", + "min-light", + "monokai", + "night-owl", + "nord", + "one-dark-pro", + "one-light", + "plain", + "plastic", + "poimandres", + "red", + "rose-pine", + "rose-pine-dawn", + "rose-pine-moon", + "slack-dark", + "slack-ochin", + "snazzy-light", + "solarized-dark", + "solarized-light", + "synthwave-84", + "tokyo-night", + "vesper", + "vitesse-black", + "vitesse-dark", + "vitesse-light", + ] + ], + ] + ] = None, + themes: Optional[ + Union[ + Var[Union[dict[str, str], list[dict[str, Any]]]], + dict[str, str], + list[dict[str, Any]], + ] + ] = None, + code: Optional[Union[Var[str], str]] = None, + transformers: Optional[ + Union[ + Var[list[Union[ShikiBaseTransformers, dict[str, Any]]]], + list[Union[ShikiBaseTransformers, dict[str, Any]]], + ] + ] = 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, str]]] = None, + on_blur: Optional[EventType[[]]] = None, + on_click: Optional[EventType[[]]] = None, + on_context_menu: Optional[EventType[[]]] = None, + on_double_click: Optional[EventType[[]]] = None, + on_focus: Optional[EventType[[]]] = None, + on_mount: Optional[EventType[[]]] = None, + on_mouse_down: Optional[EventType[[]]] = None, + on_mouse_enter: Optional[EventType[[]]] = None, + on_mouse_leave: Optional[EventType[[]]] = None, + on_mouse_move: Optional[EventType[[]]] = None, + on_mouse_out: Optional[EventType[[]]] = None, + on_mouse_over: Optional[EventType[[]]] = None, + on_mouse_up: Optional[EventType[[]]] = None, + on_scroll: Optional[EventType[[]]] = None, + on_unmount: Optional[EventType[[]]] = None, + **props, + ) -> "ShikiHighLevelCodeBlock": + """Create a code block component using [shiki syntax highlighter](https://shiki.matsu.io/). + + Args: + *children: The children of the component. + use_transformers: If this is enabled, the default transformers(shikijs transformer) will be used. + show_line_numbers: If this is enabled line numbers will be shown next to the code block. + can_copy: Whether a copy button should appear. + copy_button: copy_button: A custom copy button to override the default one. + language: The language to use. + theme: The theme to use ("light" or "dark"). + themes: The set of themes to use for different modes. + code: The code to display. + transformers: The transformers to use for the syntax highlighter. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + class_name: The class name for the component. + autofocus: Whether the component should take the focus once the page is loaded + custom_attrs: custom attribute + **props: The props to pass to the component. + + Returns: + The code block component. + """ + ... + +code_block = CodeblockNamespace() diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index 1665144fd..b790bf7a1 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -20,6 +20,8 @@ from reflex.components.tags.tag import Tag from reflex.utils import types from reflex.utils.imports import ImportDict, ImportVar from reflex.vars.base import LiteralVar, Var +from reflex.vars.function import ARRAY_ISARRAY +from reflex.vars.number import ternary_operation # Special vars used in the component map. _CHILDREN = Var(_js_expr="children", _var_type=str) @@ -199,7 +201,16 @@ class Markdown(Component): raise ValueError(f"No markdown component found for tag: {tag}.") special_props = [_PROPS_IN_TAG] - children = [_CHILDREN] + children = [ + _CHILDREN + if tag != "codeblock" + # For codeblock, the mapping for some cases returns an array of elements. Let's join them into a string. + else ternary_operation( + ARRAY_ISARRAY.call(_CHILDREN), # type: ignore + _CHILDREN.to(list).join("\n"), + _CHILDREN, + ).to(str) + ] # For certain tags, the props from the markdown renderer are not actually valid for the component. if tag in NO_PROPS_TAGS: diff --git a/reflex/experimental/__init__.py b/reflex/experimental/__init__.py index 0c11deb85..164790fe5 100644 --- a/reflex/experimental/__init__.py +++ b/reflex/experimental/__init__.py @@ -2,6 +2,7 @@ from types import SimpleNamespace +from reflex.components.datadisplay.shiki_code_block import code_block as code_block from reflex.components.props import PropsBase from reflex.components.radix.themes.components.progress import progress as progress from reflex.components.sonner.toast import toast as toast @@ -67,4 +68,5 @@ _x = ExperimentalNamespace( layout=layout, PropsBase=PropsBase, run_in_thread=run_in_thread, + code_block=code_block, ) diff --git a/reflex/vars/function.py b/reflex/vars/function.py index a1f7fb7bd..9d734a458 100644 --- a/reflex/vars/function.py +++ b/reflex/vars/function.py @@ -180,6 +180,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): JSON_STRINGIFY = FunctionStringVar.create("JSON.stringify") +ARRAY_ISARRAY = FunctionStringVar.create("Array.isArray") PROTOTYPE_TO_STRING = FunctionStringVar.create( "((__to_string) => __to_string.toString())" ) diff --git a/reflex/vars/sequence.py b/reflex/vars/sequence.py index 149300028..39139ce3f 100644 --- a/reflex/vars/sequence.py +++ b/reflex/vars/sequence.py @@ -529,6 +529,26 @@ def array_join_operation(array: ArrayVar, sep: StringVar[Any] | str = ""): return var_operation_return(js_expression=f"{array}.join({sep})", var_type=str) +@var_operation +def string_replace_operation( + string: StringVar, search_value: StringVar | str, new_value: StringVar | str +): + """Replace a string with a value. + + Args: + string: The string. + search_value: The string to search. + new_value: The value to be replaced with. + + Returns: + The string replace operation. + """ + return var_operation_return( + js_expression=f"{string}.replace({search_value}, {new_value})", + var_type=str, + ) + + # Compile regex for finding reflex var tags. _decode_var_pattern_re = ( rf"{constants.REFLEX_VAR_OPENING_TAG}(.*?){constants.REFLEX_VAR_CLOSING_TAG}" diff --git a/tests/units/components/datadisplay/test_shiki_code.py b/tests/units/components/datadisplay/test_shiki_code.py new file mode 100644 index 000000000..eb473ba06 --- /dev/null +++ b/tests/units/components/datadisplay/test_shiki_code.py @@ -0,0 +1,172 @@ +import pytest + +from reflex.components.datadisplay.shiki_code_block import ( + ShikiBaseTransformers, + ShikiCodeBlock, + ShikiHighLevelCodeBlock, + ShikiJsTransformer, +) +from reflex.components.el.elements.forms import Button +from reflex.components.lucide.icon import Icon +from reflex.components.radix.themes.layout.box import Box +from reflex.style import Style +from reflex.vars import Var + + +@pytest.mark.parametrize( + "library, fns, expected_output, raises_exception", + [ + ("some_library", ["function_one"], ["function_one"], False), + ("some_library", [123], None, True), + ("some_library", [], [], False), + ( + "some_library", + ["function_one", "function_two"], + ["function_one", "function_two"], + False, + ), + ("", ["function_one"], ["function_one"], False), + ("some_library", ["function_one", 789], None, True), + ("", [], [], False), + ], +) +def test_create_transformer(library, fns, expected_output, raises_exception): + if raises_exception: + # Ensure ValueError is raised for invalid cases + with pytest.raises(ValueError): + ShikiCodeBlock.create_transformer(library, fns) + else: + transformer = ShikiCodeBlock.create_transformer(library, fns) + assert isinstance(transformer, ShikiBaseTransformers) + assert transformer.library == library + + # Verify that the functions are correctly wrapped in FunctionStringVar + function_names = [str(fn) for fn in transformer.fns] + assert function_names == expected_output + + +@pytest.mark.parametrize( + "code_block, children, props, expected_first_child, expected_styles", + [ + ("print('Hello')", ["print('Hello')"], {}, "print('Hello')", {}), + ( + "print('Hello')", + ["print('Hello')", "More content"], + {}, + "print('Hello')", + {}, + ), + ( + "print('Hello')", + ["print('Hello')"], + { + "transformers": [ + ShikiBaseTransformers( + library="lib", fns=[], style=Style({"color": "red"}) + ) + ] + }, + "print('Hello')", + {"color": "red"}, + ), + ( + "print('Hello')", + ["print('Hello')"], + { + "transformers": [ + ShikiBaseTransformers( + library="lib", fns=[], style=Style({"color": "red"}) + ) + ], + "style": {"background": "blue"}, + }, + "print('Hello')", + {"color": "red", "background": "blue"}, + ), + ], +) +def test_create_shiki_code_block( + code_block, children, props, expected_first_child, expected_styles +): + component = ShikiCodeBlock.create(code_block, *children, **props) + + # Test that the created component is a Box + assert isinstance(component, Box) + + # Test that the first child is the code + code_block_component = component.children[0] + assert code_block_component.code._var_value == expected_first_child # type: ignore + + applied_styles = component.style + for key, value in expected_styles.items(): + assert Var.create(applied_styles[key])._var_value == value + + +@pytest.mark.parametrize( + "children, props, expected_transformers, expected_button_type", + [ + (["print('Hello')"], {"use_transformers": True}, [ShikiJsTransformer], None), + (["print('Hello')"], {"can_copy": True}, None, Button), + ( + ["print('Hello')"], + { + "can_copy": True, + "copy_button": Button.create(Icon.create(tag="a_arrow_down")), + }, + None, + Button, + ), + ], +) +def test_create_shiki_high_level_code_block( + children, props, expected_transformers, expected_button_type +): + component = ShikiHighLevelCodeBlock.create(*children, **props) + + # Test that the created component is a Box + assert isinstance(component, Box) + + # Test that the first child is the code block component + code_block_component = component.children[0] + assert code_block_component.code._var_value == children[0] # type: ignore + + # Check if the transformer is set correctly if expected + if expected_transformers: + exp_trans_names = [t.__name__ for t in expected_transformers] + for transformer in code_block_component.transformers._var_value: # type: ignore + assert type(transformer).__name__ in exp_trans_names + + # Check if the second child is the copy button if can_copy is True + if props.get("can_copy", False): + if props.get("copy_button"): + assert isinstance(component.children[1], expected_button_type) + assert component.children[1] == props["copy_button"] + else: + assert isinstance(component.children[1], expected_button_type) + else: + assert len(component.children) == 1 + + +@pytest.mark.parametrize( + "children, props", + [ + (["print('Hello')"], {"theme": "dark"}), + (["print('Hello')"], {"language": "javascript"}), + ], +) +def test_shiki_high_level_code_block_theme_language_mapping(children, props): + component = ShikiHighLevelCodeBlock.create(*children, **props) + + # Test that the theme is mapped correctly + if "theme" in props: + assert component.children[ + 0 + ].theme._var_value == ShikiHighLevelCodeBlock._map_themes(props["theme"]) # type: ignore + + # Test that the language is mapped correctly + if "language" in props: + assert component.children[ + 0 + ].language._var_value == ShikiHighLevelCodeBlock._map_languages( # type: ignore + props["language"] + ) From 993bfaef2d668dc134440b4dd86f649a7a1f0f39 Mon Sep 17 00:00:00 2001 From: Simon Young <40179067+Kastier1@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:32:13 -0700 Subject: [PATCH 196/201] HOS-92: added max-request support to gunicorn (#4217) Co-authored-by: simon --- reflex/config.py | 6 ++++++ reflex/utils/exec.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/reflex/config.py b/reflex/config.py index 2e16e2eb0..00f33b653 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -418,6 +418,12 @@ class Config(Base): # Number of gunicorn workers from user gunicorn_workers: Optional[int] = None + # Number of requests before a worker is restarted + gunicorn_max_requests: int = 100 + + # Variance limit for max requests; gunicorn only + gunicorn_max_requests_jitter: int = 25 + # Indicate which type of state manager to use state_manager_mode: constants.StateManagerMode = constants.StateManagerMode.DISK diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index f5521c91f..bdc9be4ae 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -337,8 +337,8 @@ def run_uvicorn_backend_prod(host, port, loglevel): app_module = get_app_module() - RUN_BACKEND_PROD = f"gunicorn --worker-class {config.gunicorn_worker_class} --preload --timeout {config.timeout} --log-level critical".split() - RUN_BACKEND_PROD_WINDOWS = f"uvicorn --timeout-keep-alive {config.timeout}".split() + RUN_BACKEND_PROD = f"gunicorn --worker-class {config.gunicorn_worker_class} --max-requests {config.gunicorn_max_requests} --max-requests-jitter {config.gunicorn_max_requests_jitter} --preload --timeout {config.timeout} --log-level critical".split() + RUN_BACKEND_PROD_WINDOWS = f"uvicorn --limit-max-requests {config.gunicorn_max_requests} --timeout-keep-alive {config.timeout}".split() command = ( [ *RUN_BACKEND_PROD_WINDOWS, From 0aca89781fcd62ed7f1b5cc18a35d3a1d35b6e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 22 Oct 2024 11:48:47 -0700 Subject: [PATCH 197/201] bump ruff to 0.7.0 (#4213) * bump ruff to 0.7.0 * ignore SIM115 and reverse change for it --- .pre-commit-config.yaml | 2 +- poetry.lock | 46 ++++++++++++++++++++--------------------- pyproject.toml | 4 ++-- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d2e76b31..e2983d1d1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ fail_fast: true repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.6.9 + rev: v0.7.0 hooks: - id: ruff-format args: [reflex, tests] diff --git a/poetry.lock b/poetry.lock index 2f77234d4..bbd2735ac 100644 --- a/poetry.lock +++ b/poetry.lock @@ -970,13 +970,13 @@ test = ["pytest (>=7.4)", "pytest-cov (>=4.1)"] [[package]] name = "mako" -version = "1.3.5" +version = "1.3.6" description = "A super-fast templating language that borrows the best ideas from the existing templating languages." optional = false python-versions = ">=3.8" files = [ - {file = "Mako-1.3.5-py3-none-any.whl", hash = "sha256:260f1dbc3a519453a9c856dedfe4beb4e50bd5a26d96386cb6c80856556bb91a"}, - {file = "Mako-1.3.5.tar.gz", hash = "sha256:48dbc20568c1d276a2698b36d968fa76161bf127194907ea6fc594fa81f943bc"}, + {file = "Mako-1.3.6-py3-none-any.whl", hash = "sha256:a91198468092a2f1a0de86ca92690fb0cfc43ca90ee17e15d93662b4c04b241a"}, + {file = "mako-1.3.6.tar.gz", hash = "sha256:9ec3a1583713479fae654f83ed9fa8c9a4c16b7bb0daba0e6bbebff50c0d983d"}, ] [package.dependencies] @@ -2272,29 +2272,29 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "ruff" -version = "0.6.9" +version = "0.7.0" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.6.9-py3-none-linux_armv6l.whl", hash = "sha256:064df58d84ccc0ac0fcd63bc3090b251d90e2a372558c0f057c3f75ed73e1ccd"}, - {file = "ruff-0.6.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:140d4b5c9f5fc7a7b074908a78ab8d384dd7f6510402267bc76c37195c02a7ec"}, - {file = "ruff-0.6.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:53fd8ca5e82bdee8da7f506d7b03a261f24cd43d090ea9db9a1dc59d9313914c"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:645d7d8761f915e48a00d4ecc3686969761df69fb561dd914a773c1a8266e14e"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eae02b700763e3847595b9d2891488989cac00214da7f845f4bcf2989007d577"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d5ccc9e58112441de8ad4b29dcb7a86dc25c5f770e3c06a9d57e0e5eba48829"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:417b81aa1c9b60b2f8edc463c58363075412866ae4e2b9ab0f690dc1e87ac1b5"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c866b631f5fbce896a74a6e4383407ba7507b815ccc52bcedabb6810fdb3ef7"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7b118afbb3202f5911486ad52da86d1d52305b59e7ef2031cea3425142b97d6f"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a67267654edc23c97335586774790cde402fb6bbdb3c2314f1fc087dee320bfa"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3ef0cc774b00fec123f635ce5c547dac263f6ee9fb9cc83437c5904183b55ceb"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:12edd2af0c60fa61ff31cefb90aef4288ac4d372b4962c2864aeea3a1a2460c0"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:55bb01caeaf3a60b2b2bba07308a02fca6ab56233302406ed5245180a05c5625"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:925d26471fa24b0ce5a6cdfab1bb526fb4159952385f386bdcc643813d472039"}, - {file = "ruff-0.6.9-py3-none-win32.whl", hash = "sha256:eb61ec9bdb2506cffd492e05ac40e5bc6284873aceb605503d8494180d6fc84d"}, - {file = "ruff-0.6.9-py3-none-win_amd64.whl", hash = "sha256:785d31851c1ae91f45b3d8fe23b8ae4b5170089021fbb42402d811135f0b7117"}, - {file = "ruff-0.6.9-py3-none-win_arm64.whl", hash = "sha256:a9641e31476d601f83cd602608739a0840e348bda93fec9f1ee816f8b6798b93"}, - {file = "ruff-0.6.9.tar.gz", hash = "sha256:b076ef717a8e5bc819514ee1d602bbdca5b4420ae13a9cf61a0c0a4f53a2baa2"}, + {file = "ruff-0.7.0-py3-none-linux_armv6l.whl", hash = "sha256:0cdf20c2b6ff98e37df47b2b0bd3a34aaa155f59a11182c1303cce79be715628"}, + {file = "ruff-0.7.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:496494d350c7fdeb36ca4ef1c9f21d80d182423718782222c29b3e72b3512737"}, + {file = "ruff-0.7.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:214b88498684e20b6b2b8852c01d50f0651f3cc6118dfa113b4def9f14faaf06"}, + {file = "ruff-0.7.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:630fce3fefe9844e91ea5bbf7ceadab4f9981f42b704fae011bb8efcaf5d84be"}, + {file = "ruff-0.7.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:211d877674e9373d4bb0f1c80f97a0201c61bcd1e9d045b6e9726adc42c156aa"}, + {file = "ruff-0.7.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:194d6c46c98c73949a106425ed40a576f52291c12bc21399eb8f13a0f7073495"}, + {file = "ruff-0.7.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:82c2579b82b9973a110fab281860403b397c08c403de92de19568f32f7178598"}, + {file = "ruff-0.7.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9af971fe85dcd5eaed8f585ddbc6bdbe8c217fb8fcf510ea6bca5bdfff56040e"}, + {file = "ruff-0.7.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b641c7f16939b7d24b7bfc0be4102c56562a18281f84f635604e8a6989948914"}, + {file = "ruff-0.7.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d71672336e46b34e0c90a790afeac8a31954fd42872c1f6adaea1dff76fd44f9"}, + {file = "ruff-0.7.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ab7d98c7eed355166f367597e513a6c82408df4181a937628dbec79abb2a1fe4"}, + {file = "ruff-0.7.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1eb54986f770f49edb14f71d33312d79e00e629a57387382200b1ef12d6a4ef9"}, + {file = "ruff-0.7.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dc452ba6f2bb9cf8726a84aa877061a2462afe9ae0ea1d411c53d226661c601d"}, + {file = "ruff-0.7.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:4b406c2dce5be9bad59f2de26139a86017a517e6bcd2688da515481c05a2cb11"}, + {file = "ruff-0.7.0-py3-none-win32.whl", hash = "sha256:f6c968509f767776f524a8430426539587d5ec5c662f6addb6aa25bc2e8195ec"}, + {file = "ruff-0.7.0-py3-none-win_amd64.whl", hash = "sha256:ff4aabfbaaba880e85d394603b9e75d32b0693152e16fa659a3064a85df7fce2"}, + {file = "ruff-0.7.0-py3-none-win_arm64.whl", hash = "sha256:10842f69c245e78d6adec7e1db0a7d9ddc2fff0621d730e61657b64fa36f207e"}, + {file = "ruff-0.7.0.tar.gz", hash = "sha256:47a86360cf62d9cd53ebfb0b5eb0e882193fc191c6d717e8bef4462bc3b9ea2b"}, ] [[package]] @@ -3033,4 +3033,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "edb7145394dd61f5a665b5519cc0c091c8c1628200ea1170857cff1a6bdb829e" +content-hash = "8090ccaeca173bd8612e17a0b8d157d7492618e49450abd1c8373e2976349db0" diff --git a/pyproject.toml b/pyproject.toml index d4f583189..93f3c5d50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,7 @@ darglint = ">=1.8.1,<2.0" toml = ">=0.10.2,<1.0" pytest-asyncio = ">=0.24.0" pytest-cov = ">=4.0.0,<6.0" -ruff = "^0.6.9" +ruff = "^0.7.0" pandas = ">=2.1.1,<3.0" pillow = ">=10.0.0,<12.0" plotly = ">=5.13.0,<6.0" @@ -91,7 +91,7 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] target-version = "py39" lint.select = ["B", "D", "E", "F", "I", "SIM", "W"] -lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"] +lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541", "SIM115"] lint.pydocstyle.convention = "google" [tool.ruff.lint.per-file-ignores] From 13591793de2a5b870c7181c99b132fbc463ffc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 22 Oct 2024 12:17:31 -0700 Subject: [PATCH 198/201] move client storage classes to their own file (#4216) * move client storage classes to their own file * fix 3.9 annotations --- reflex/__init__.py | 8 ++- reflex/__init__.pyi | 6 +- reflex/compiler/utils.py | 3 +- reflex/istate/storage.py | 144 +++++++++++++++++++++++++++++++++++++++ reflex/state.py | 140 +------------------------------------ 5 files changed, 157 insertions(+), 144 deletions(-) create mode 100644 reflex/istate/storage.py diff --git a/reflex/__init__.py b/reflex/__init__.py index ad51d2cf4..979e5499a 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -320,13 +320,15 @@ _MAPPING: dict = { "upload_files", "window_alert", ], + "istate.storage": [ + "Cookie", + "LocalStorage", + "SessionStorage", + ], "middleware": ["middleware", "Middleware"], "model": ["session", "Model"], "state": [ "var", - "Cookie", - "LocalStorage", - "SessionStorage", "ComponentState", "State", ], diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index d928778d8..aeebaadf8 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -174,15 +174,15 @@ from .event import stop_propagation as stop_propagation from .event import upload_files as upload_files from .event import window_alert as window_alert from .experimental import _x as _x +from .istate.storage import Cookie as Cookie +from .istate.storage import LocalStorage as LocalStorage +from .istate.storage import SessionStorage as SessionStorage from .middleware import Middleware as Middleware from .middleware import middleware as middleware from .model import Model as Model from .model import session as session from .page import page as page from .state import ComponentState as ComponentState -from .state import Cookie as Cookie -from .state import LocalStorage as LocalStorage -from .state import SessionStorage as SessionStorage from .state import State as State from .state import var as var from .style import Style as Style diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 6f4fa2d1b..40640faa6 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -28,7 +28,8 @@ from reflex.components.base import ( Title, ) from reflex.components.component import Component, ComponentStyle, CustomComponent -from reflex.state import BaseState, Cookie, LocalStorage, SessionStorage +from reflex.istate.storage import Cookie, LocalStorage, SessionStorage +from reflex.state import BaseState from reflex.style import Style from reflex.utils import console, format, imports, path_ops from reflex.utils.imports import ImportVar, ParsedImportDict diff --git a/reflex/istate/storage.py b/reflex/istate/storage.py new file mode 100644 index 000000000..85e21ffa7 --- /dev/null +++ b/reflex/istate/storage.py @@ -0,0 +1,144 @@ +"""Client-side storage classes for reflex state variables.""" + +from __future__ import annotations + +from typing import Any + +from reflex.utils import format + + +class ClientStorageBase: + """Base class for client-side storage.""" + + def options(self) -> dict[str, Any]: + """Get the options for the storage. + + Returns: + All set options for the storage (not None). + """ + return { + format.to_camel_case(k): v for k, v in vars(self).items() if v is not None + } + + +class Cookie(ClientStorageBase, str): + """Represents a state Var that is stored as a cookie in the browser.""" + + name: str | None + path: str + max_age: int | None + domain: str | None + secure: bool | None + same_site: str + + def __new__( + cls, + object: Any = "", + encoding: str | None = None, + errors: str | None = None, + /, + name: str | None = None, + path: str = "/", + max_age: int | None = None, + domain: str | None = None, + secure: bool | None = None, + same_site: str = "lax", + ): + """Create a client-side Cookie (str). + + Args: + object: The initial object. + encoding: The encoding to use. + errors: The error handling scheme to use. + name: The name of the cookie on the client side. + path: Cookie path. Use / as the path if the cookie should be accessible on all pages. + max_age: Relative max age of the cookie in seconds from when the client receives it. + domain: Domain for the cookie (sub.domain.com or .allsubdomains.com). + secure: Is the cookie only accessible through HTTPS? + same_site: Whether the cookie is sent with third party requests. + One of (true|false|none|lax|strict) + + Returns: + The client-side Cookie object. + + Note: expires (absolute Date) is not supported at this time. + """ + if encoding or errors: + inst = super().__new__(cls, object, encoding or "utf-8", errors or "strict") + else: + inst = super().__new__(cls, object) + inst.name = name + inst.path = path + inst.max_age = max_age + inst.domain = domain + inst.secure = secure + inst.same_site = same_site + return inst + + +class LocalStorage(ClientStorageBase, str): + """Represents a state Var that is stored in localStorage in the browser.""" + + name: str | None + sync: bool = False + + def __new__( + cls, + object: Any = "", + encoding: str | None = None, + errors: str | None = None, + /, + name: str | None = None, + sync: bool = False, + ) -> "LocalStorage": + """Create a client-side localStorage (str). + + Args: + object: The initial object. + encoding: The encoding to use. + errors: The error handling scheme to use. + name: The name of the storage key on the client side. + sync: Whether changes should be propagated to other tabs. + + Returns: + The client-side localStorage object. + """ + if encoding or errors: + inst = super().__new__(cls, object, encoding or "utf-8", errors or "strict") + else: + inst = super().__new__(cls, object) + inst.name = name + inst.sync = sync + return inst + + +class SessionStorage(ClientStorageBase, str): + """Represents a state Var that is stored in sessionStorage in the browser.""" + + name: str | None + + def __new__( + cls, + object: Any = "", + encoding: str | None = None, + errors: str | None = None, + /, + name: str | None = None, + ) -> "SessionStorage": + """Create a client-side sessionStorage (str). + + Args: + object: The initial object. + encoding: The encoding to use. + errors: The error handling scheme to use + name: The name of the storage on the client side + + Returns: + The client-side sessionStorage object. + """ + if encoding or errors: + inst = super().__new__(cls, object, encoding or "utf-8", errors or "strict") + else: + inst = super().__new__(cls, object) + inst.name = name + return inst diff --git a/reflex/state.py b/reflex/state.py index 3422d1ba7..dcd576b3a 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -42,6 +42,9 @@ from typing_extensions import Self from reflex import event from reflex.config import get_config from reflex.istate.data import RouterData +from reflex.istate.storage import ( + ClientStorageBase, +) from reflex.vars.base import ( ComputedVar, DynamicRouteVar, @@ -3349,143 +3352,6 @@ def get_state_manager() -> StateManager: return app.state_manager -class ClientStorageBase: - """Base class for client-side storage.""" - - def options(self) -> dict[str, Any]: - """Get the options for the storage. - - Returns: - All set options for the storage (not None). - """ - return { - format.to_camel_case(k): v for k, v in vars(self).items() if v is not None - } - - -class Cookie(ClientStorageBase, str): - """Represents a state Var that is stored as a cookie in the browser.""" - - name: str | None - path: str - max_age: int | None - domain: str | None - secure: bool | None - same_site: str - - def __new__( - cls, - object: Any = "", - encoding: str | None = None, - errors: str | None = None, - /, - name: str | None = None, - path: str = "/", - max_age: int | None = None, - domain: str | None = None, - secure: bool | None = None, - same_site: str = "lax", - ): - """Create a client-side Cookie (str). - - Args: - object: The initial object. - encoding: The encoding to use. - errors: The error handling scheme to use. - name: The name of the cookie on the client side. - path: Cookie path. Use / as the path if the cookie should be accessible on all pages. - max_age: Relative max age of the cookie in seconds from when the client receives it. - domain: Domain for the cookie (sub.domain.com or .allsubdomains.com). - secure: Is the cookie only accessible through HTTPS? - same_site: Whether the cookie is sent with third party requests. - One of (true|false|none|lax|strict) - - Returns: - The client-side Cookie object. - - Note: expires (absolute Date) is not supported at this time. - """ - if encoding or errors: - inst = super().__new__(cls, object, encoding or "utf-8", errors or "strict") - else: - inst = super().__new__(cls, object) - inst.name = name - inst.path = path - inst.max_age = max_age - inst.domain = domain - inst.secure = secure - inst.same_site = same_site - return inst - - -class LocalStorage(ClientStorageBase, str): - """Represents a state Var that is stored in localStorage in the browser.""" - - name: str | None - sync: bool = False - - def __new__( - cls, - object: Any = "", - encoding: str | None = None, - errors: str | None = None, - /, - name: str | None = None, - sync: bool = False, - ) -> "LocalStorage": - """Create a client-side localStorage (str). - - Args: - object: The initial object. - encoding: The encoding to use. - errors: The error handling scheme to use. - name: The name of the storage key on the client side. - sync: Whether changes should be propagated to other tabs. - - Returns: - The client-side localStorage object. - """ - if encoding or errors: - inst = super().__new__(cls, object, encoding or "utf-8", errors or "strict") - else: - inst = super().__new__(cls, object) - inst.name = name - inst.sync = sync - return inst - - -class SessionStorage(ClientStorageBase, str): - """Represents a state Var that is stored in sessionStorage in the browser.""" - - name: str | None - - def __new__( - cls, - object: Any = "", - encoding: str | None = None, - errors: str | None = None, - /, - name: str | None = None, - ) -> "SessionStorage": - """Create a client-side sessionStorage (str). - - Args: - object: The initial object. - encoding: The encoding to use. - errors: The error handling scheme to use - name: The name of the storage on the client side - - Returns: - The client-side sessionStorage object. - """ - if encoding or errors: - inst = super().__new__(cls, object, encoding or "utf-8", errors or "strict") - else: - inst = super().__new__(cls, object) - inst.name = name - return inst - - class MutableProxy(wrapt.ObjectProxy): """A proxy for a mutable object that tracks changes.""" From 227fb2cb75176147356435de487097c4e8e574f5 Mon Sep 17 00:00:00 2001 From: Simon Young <40179067+Kastier1@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:37:17 -0700 Subject: [PATCH 199/201] HOS-93: add support for .env file (#4219) * HOS-93: add support for .env file * HOS-93: remove stray print * HOS-93: poetry lock * HOS-93: update comment --------- Co-authored-by: simon --- poetry.lock | 36 +++++++++++++++++++++++++----------- pyproject.toml | 1 + reflex/config.py | 10 ++++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/poetry.lock b/poetry.lock index bbd2735ac..7161e6af7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -570,18 +570,18 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.115.2" +version = "0.115.3" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.115.2-py3-none-any.whl", hash = "sha256:61704c71286579cc5a598763905928f24ee98bfcc07aabe84cfefb98812bbc86"}, - {file = "fastapi-0.115.2.tar.gz", hash = "sha256:3995739e0b09fa12f984bce8fa9ae197b35d433750d3d312422d846e283697ee"}, + {file = "fastapi-0.115.3-py3-none-any.whl", hash = "sha256:8035e8f9a2b0aa89cea03b6c77721178ed5358e1aea4cd8570d9466895c0638c"}, + {file = "fastapi-0.115.3.tar.gz", hash = "sha256:c091c6a35599c036d676fa24bd4a6e19fa30058d93d950216cdc672881f6f7db"}, ] [package.dependencies] pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" -starlette = ">=0.37.2,<0.41.0" +starlette = ">=0.40.0,<0.42.0" typing-extensions = ">=4.8.0" [package.extras] @@ -1977,6 +1977,20 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "python-dotenv" +version = "1.0.1" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, + {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + [[package]] name = "python-engineio" version = "4.10.1" @@ -2253,13 +2267,13 @@ idna2008 = ["idna"] [[package]] name = "rich" -version = "13.9.2" +version = "13.9.3" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false python-versions = ">=3.8.0" files = [ - {file = "rich-13.9.2-py3-none-any.whl", hash = "sha256:8c82a3d3f8dcfe9e734771313e606b39d8247bb6b826e196f4914b333b743cf1"}, - {file = "rich-13.9.2.tar.gz", hash = "sha256:51a2c62057461aaf7152b4d611168f93a9fc73068f8ded2790f29fe2b5366d0c"}, + {file = "rich-13.9.3-py3-none-any.whl", hash = "sha256:9836f5096eb2172c9e77df411c1b009bace4193d6a481d534fea75ebba758283"}, + {file = "rich-13.9.3.tar.gz", hash = "sha256:bc1e01b899537598cf02579d2b9f4a415104d3fc439313a7a2c165d76557a08e"}, ] [package.dependencies] @@ -2525,13 +2539,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.40.0" +version = "0.41.0" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.40.0-py3-none-any.whl", hash = "sha256:c494a22fae73805376ea6bf88439783ecfba9aac88a43911b48c653437e784c4"}, - {file = "starlette-0.40.0.tar.gz", hash = "sha256:1a3139688fb298ce5e2d661d37046a66ad996ce94be4d4983be019a23a04ea35"}, + {file = "starlette-0.41.0-py3-none-any.whl", hash = "sha256:a0193a3c413ebc9c78bff1c3546a45bb8c8bcb4a84cae8747d650a65bd37210a"}, + {file = "starlette-0.41.0.tar.gz", hash = "sha256:39cbd8768b107d68bfe1ff1672b38a2c38b49777de46d2a592841d58e3bf7c2a"}, ] [package.dependencies] @@ -3033,4 +3047,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "8090ccaeca173bd8612e17a0b8d157d7492618e49450abd1c8373e2976349db0" +content-hash = "c5da15520cef58124f6699007c81158036840469d4f9972592d72bd456c45e7e" diff --git a/pyproject.toml b/pyproject.toml index 93f3c5d50..3fe6041f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ jinja2 = ">=3.1.2,<4.0" psutil = ">=5.9.4,<7.0" pydantic = ">=1.10.2,<3.0" python-multipart = ">=0.0.5,<0.1" +python-dotenv = ">=1.0.1" python-socketio = ">=5.7.0,<6.0" redis = ">=4.3.5,<6.0" rich = ">=13.0.0,<14.0" diff --git a/reflex/config.py b/reflex/config.py index 00f33b653..eb319c5dd 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -436,6 +436,9 @@ class Config(Base): # Attributes that were explicitly set by the user. _non_default_attributes: Set[str] = pydantic.PrivateAttr(set()) + # Path to file containing key-values pairs to override in the environment; Dotenv format. + env_file: Optional[str] = None + def __init__(self, *args, **kwargs): """Initialize the config values. @@ -477,6 +480,7 @@ class Config(Base): def update_from_env(self) -> dict[str, Any]: """Update the config values based on set environment variables. + If there is a set env_file, it is loaded first. Returns: The updated config values. @@ -486,6 +490,12 @@ class Config(Base): """ from reflex.utils.exceptions import EnvVarValueError + if self.env_file: + from dotenv import load_dotenv + + # load env file if exists + load_dotenv(self.env_file, override=True) + updated_values = {} # Iterate over the fields. for key, field in self.__fields__.items(): From a65fc2e90b27af682181a47e8e2dc73820d1732a Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 22 Oct 2024 13:09:14 -0700 Subject: [PATCH 200/201] Add on progress typing to react player (#4211) * add on progress typing to react player * fix pyi file * have the pyi here as well * more pyi changes * fix imports * run pyi * for some reason it want event on three lines no clue why * simplify case for when type is in the same module * run pyi * remove last missing type for datadisplay --- reflex/components/datadisplay/dataeditor.py | 27 ++++++------------- reflex/components/datadisplay/dataeditor.pyi | 14 +++++----- .../radix/themes/components/tooltip.pyi | 4 ++- reflex/components/react_player/__init__.py | 1 + reflex/components/react_player/audio.pyi | 5 +++- .../components/react_player/react_player.py | 13 ++++++++- .../components/react_player/react_player.pyi | 10 ++++++- reflex/components/react_player/video.pyi | 5 +++- reflex/utils/pyi_generator.py | 22 ++++++++++++--- 9 files changed, 65 insertions(+), 36 deletions(-) diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index a192c7a45..b9bd4cebf 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -109,19 +109,6 @@ class DataEditorTheme(Base): text_medium: Optional[str] = None -def on_edit_spec(pos, data: dict[str, Any]): - """The on edit spec function. - - Args: - pos: The position of the edit event. - data: The data of the edit event. - - Returns: - The position and data. - """ - return [pos, data] - - class Bounds(TypedDict): """The bounds of the group header.""" @@ -149,7 +136,7 @@ class Rectangle(TypedDict): class GridSelectionCurrent(TypedDict): """The current selection.""" - cell: list[int] + cell: tuple[int, int] range: Rectangle rangeStack: list[Rectangle] @@ -167,7 +154,7 @@ class GroupHeaderClickedEventArgs(TypedDict): kind: str group: str - location: list[int] + location: tuple[int, int] bounds: Bounds isEdge: bool shiftKey: bool @@ -178,7 +165,7 @@ class GroupHeaderClickedEventArgs(TypedDict): localEventY: int button: int buttons: int - scrollEdge: list[int] + scrollEdge: tuple[int, int] class GridCell(TypedDict): @@ -306,10 +293,10 @@ class DataEditor(NoSSRComponent): on_cell_context_menu: EventHandler[identity_event(Tuple[int, int])] # Fired when a cell is edited. - on_cell_edited: EventHandler[on_edit_spec] + on_cell_edited: EventHandler[identity_event(Tuple[int, int], GridCell)] # Fired when a group header is clicked. - on_group_header_clicked: EventHandler[on_edit_spec] + on_group_header_clicked: EventHandler[identity_event(Tuple[int, int], GridCell)] # Fired when a group header is right-clicked. on_group_header_context_menu: EventHandler[ @@ -335,7 +322,9 @@ class DataEditor(NoSSRComponent): on_delete: EventHandler[identity_event(GridSelection)] # Fired when editing is finished. - on_finished_editing: EventHandler[identity_event(Union[GridCell, None], list[int])] + on_finished_editing: EventHandler[ + identity_event(Union[GridCell, None], tuple[int, int]) + ] # Fired when a row is appended. on_row_appended: EventHandler[empty_event] diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index aadd9666e..6402aaf42 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -78,8 +78,6 @@ class DataEditorTheme(Base): text_light: Optional[str] text_medium: Optional[str] -def on_edit_spec(pos, data: dict[str, Any]): ... - class Bounds(TypedDict): x: int y: int @@ -96,7 +94,7 @@ class Rectangle(TypedDict): height: int class GridSelectionCurrent(TypedDict): - cell: list[int] + cell: tuple[int, int] range: Rectangle rangeStack: list[Rectangle] @@ -108,7 +106,7 @@ class GridSelection(TypedDict): class GroupHeaderClickedEventArgs(TypedDict): kind: str group: str - location: list[int] + location: tuple[int, int] bounds: Bounds isEdge: bool shiftKey: bool @@ -119,7 +117,7 @@ class GroupHeaderClickedEventArgs(TypedDict): localEventY: int button: int buttons: int - scrollEdge: list[int] + scrollEdge: tuple[int, int] class GridCell(TypedDict): span: Optional[List[int]] @@ -189,17 +187,17 @@ class DataEditor(NoSSRComponent): on_cell_activated: Optional[EventType[tuple[int, int]]] = None, on_cell_clicked: Optional[EventType[tuple[int, int]]] = None, on_cell_context_menu: Optional[EventType[tuple[int, int]]] = None, - on_cell_edited: Optional[EventType] = None, + on_cell_edited: Optional[EventType[tuple[int, int], GridCell]] = None, on_click: Optional[EventType[[]]] = None, on_column_resize: Optional[EventType[GridColumn, int]] = None, on_context_menu: Optional[EventType[[]]] = None, on_delete: Optional[EventType[GridSelection]] = None, on_double_click: Optional[EventType[[]]] = None, on_finished_editing: Optional[ - EventType[Union[GridCell, None], list[int]] + EventType[Union[GridCell, None], tuple[int, int]] ] = None, on_focus: Optional[EventType[[]]] = None, - on_group_header_clicked: Optional[EventType] = None, + on_group_header_clicked: Optional[EventType[tuple[int, int], GridCell]] = None, on_group_header_context_menu: Optional[ EventType[int, GroupHeaderClickedEventArgs] ] = None, diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index ac2a36368..e78dd926d 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -5,7 +5,9 @@ # ------------------------------------------------------ from typing import Any, Dict, Literal, Optional, Union, overload -from reflex.event import EventType +from reflex.event import ( + EventType, +) from reflex.style import Style from reflex.vars.base import Var diff --git a/reflex/components/react_player/__init__.py b/reflex/components/react_player/__init__.py index 8c4a4486f..3f807b1a0 100644 --- a/reflex/components/react_player/__init__.py +++ b/reflex/components/react_player/__init__.py @@ -1,5 +1,6 @@ """React Player component for audio and video.""" +from . import react_player from .audio import Audio from .video import Video diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index 2556c8e83..1841829af 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -5,6 +5,7 @@ # ------------------------------------------------------ from typing import Any, Dict, Optional, Union, overload +import reflex from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventType from reflex.style import Style @@ -58,7 +59,9 @@ class Audio(ReactPlayer): on_play: Optional[EventType[[]]] = None, on_playback_quality_change: Optional[EventType[[]]] = None, on_playback_rate_change: Optional[EventType[[]]] = None, - on_progress: Optional[EventType] = None, + on_progress: Optional[ + EventType[reflex.components.react_player.react_player.Progress] + ] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_seek: Optional[EventType[float]] = None, diff --git a/reflex/components/react_player/react_player.py b/reflex/components/react_player/react_player.py index 7ad45b093..b2c58b754 100644 --- a/reflex/components/react_player/react_player.py +++ b/reflex/components/react_player/react_player.py @@ -2,11 +2,22 @@ from __future__ import annotations +from typing_extensions import TypedDict + from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, empty_event, identity_event from reflex.vars.base import Var +class Progress(TypedDict): + """Callback containing played and loaded progress as a fraction, and playedSeconds and loadedSeconds in seconds.""" + + played: float + playedSeconds: float + loaded: float + loadedSeconds: float + + class ReactPlayer(NoSSRComponent): """Using react-player and not implement all props and callback yet. reference: https://github.com/cookpete/react-player. @@ -55,7 +66,7 @@ class ReactPlayer(NoSSRComponent): on_play: EventHandler[empty_event] # Callback containing played and loaded progress as a fraction, and playedSeconds and loadedSeconds in seconds. eg { played: 0.12, playedSeconds: 11.3, loaded: 0.34, loadedSeconds: 16.7 } - on_progress: EventHandler[lambda progress: [progress]] + on_progress: EventHandler[identity_event(Progress)] # Callback containing duration of the media, in seconds. on_duration: EventHandler[identity_event(float)] diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 9a445c294..e4027cf40 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -5,11 +5,19 @@ # ------------------------------------------------------ from typing import Any, Dict, Optional, Union, overload +from typing_extensions import TypedDict + from reflex.components.component import NoSSRComponent from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var +class Progress(TypedDict): + played: float + playedSeconds: float + loaded: float + loadedSeconds: float + class ReactPlayer(NoSSRComponent): @overload @classmethod @@ -56,7 +64,7 @@ class ReactPlayer(NoSSRComponent): on_play: Optional[EventType[[]]] = None, on_playback_quality_change: Optional[EventType[[]]] = None, on_playback_rate_change: Optional[EventType[[]]] = None, - on_progress: Optional[EventType] = None, + on_progress: Optional[EventType[Progress]] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_seek: Optional[EventType[float]] = None, diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index d46e2617d..a05e3747b 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -5,6 +5,7 @@ # ------------------------------------------------------ from typing import Any, Dict, Optional, Union, overload +import reflex from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventType from reflex.style import Style @@ -58,7 +59,9 @@ class Video(ReactPlayer): on_play: Optional[EventType[[]]] = None, on_playback_quality_change: Optional[EventType[[]]] = None, on_playback_rate_change: Optional[EventType[[]]] = None, - on_progress: Optional[EventType] = None, + on_progress: Optional[ + EventType[reflex.components.react_player.react_player.Progress] + ] = None, on_ready: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None, on_seek: Optional[EventType[float]] = None, diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index 026a53bca..1fc17341b 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -214,7 +214,9 @@ def _get_type_hint(value, type_hint_globals, is_optional=True) -> str: return res -def _generate_imports(typing_imports: Iterable[str]) -> list[ast.ImportFrom]: +def _generate_imports( + typing_imports: Iterable[str], +) -> list[ast.ImportFrom | ast.Import]: """Generate the import statements for the stub file. Args: @@ -228,6 +230,7 @@ def _generate_imports(typing_imports: Iterable[str]) -> list[ast.ImportFrom]: ast.ImportFrom(module=name, names=[ast.alias(name=val) for val in values]) for name, values in DEFAULT_IMPORTS.items() ], + ast.Import([ast.alias("reflex")]), ] @@ -372,12 +375,13 @@ def _extract_class_props_as_ast_nodes( return kwargs -def type_to_ast(typ) -> ast.AST: +def type_to_ast(typ, cls: type) -> ast.AST: """Converts any type annotation into its AST representation. Handles nested generic types, unions, etc. Args: typ: The type annotation to convert. + cls: The class where the type annotation is used. Returns: The AST representation of the type annotation. @@ -390,6 +394,16 @@ def type_to_ast(typ) -> ast.AST: # Handle plain types (int, str, custom classes, etc.) if origin is None: if hasattr(typ, "__name__"): + if typ.__module__.startswith("reflex."): + typ_parts = typ.__module__.split(".") + cls_parts = cls.__module__.split(".") + + zipped = list(zip(typ_parts, cls_parts, strict=False)) + + if all(a == b for a, b in zipped) and len(typ_parts) == len(cls_parts): + return ast.Name(id=typ.__name__) + + return ast.Name(id=typ.__module__ + "." + typ.__name__) return ast.Name(id=typ.__name__) elif hasattr(typ, "_name"): return ast.Name(id=typ._name) @@ -406,7 +420,7 @@ def type_to_ast(typ) -> ast.AST: return ast.Name(id=base_name) # Convert all type arguments recursively - arg_nodes = [type_to_ast(arg) for arg in args] + arg_nodes = [type_to_ast(arg, cls) for arg in args] # Special case for single-argument types (like List[T] or Optional[T]) if len(arg_nodes) == 1: @@ -487,7 +501,7 @@ def _generate_component_create_functiondef( ] # Convert each argument type to its AST representation - type_args = [type_to_ast(arg) for arg in arguments_without_var] + type_args = [type_to_ast(arg, cls=clz) for arg in arguments_without_var] # Join the type arguments with commas for EventType args_str = ", ".join(ast.unparse(arg) for arg in type_args) From 3eab2b6e7d8dab972b9e5714a845777d664e7ecb Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 22 Oct 2024 14:27:04 -0700 Subject: [PATCH 201/201] implement rx dynamic (#4195) * implement rx dynamic * dang it darglint * add custom type --- reflex/__init__.py | 1 + reflex/__init__.pyi | 1 + reflex/state.py | 47 ++++++++++++++++++++++++++++++++++++++ reflex/utils/exceptions.py | 4 ++++ 4 files changed, 53 insertions(+) diff --git a/reflex/__init__.py b/reflex/__init__.py index 979e5499a..ffc4426f9 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -331,6 +331,7 @@ _MAPPING: dict = { "var", "ComponentState", "State", + "dynamic", ], "style": ["Style", "toggle_color_mode"], "utils.imports": ["ImportVar"], diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index aeebaadf8..aa1c92b72 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -184,6 +184,7 @@ from .model import session as session from .page import page as page from .state import ComponentState as ComponentState from .state import State as State +from .state import dynamic as dynamic from .state import var as var from .style import Style as Style from .style import toggle_color_mode as toggle_color_mode diff --git a/reflex/state.py b/reflex/state.py index dcd576b3a..208c23a0f 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -30,6 +30,7 @@ from typing import ( Set, Tuple, Type, + TypeVar, Union, cast, get_args, @@ -79,6 +80,7 @@ from reflex.utils import console, format, path_ops, prerequisites, types from reflex.utils.exceptions import ( ComputedVarShadowsBaseVars, ComputedVarShadowsStateVar, + DynamicComponentInvalidSignature, DynamicRouteArgShadowsStateVar, EventHandlerShadowsBuiltInStateMethod, ImmutableStateError, @@ -2095,6 +2097,51 @@ class State(BaseState): is_hydrated: bool = False +T = TypeVar("T", bound=BaseState) + + +def dynamic(func: Callable[[T], Component]): + """Create a dynamically generated components from a state class. + + Args: + func: The function to generate the component. + + Returns: + The dynamically generated component. + + Raises: + DynamicComponentInvalidSignature: If the function does not have exactly one parameter. + DynamicComponentInvalidSignature: If the function does not have a type hint for the state class. + """ + number_of_parameters = len(inspect.signature(func).parameters) + + func_signature = get_type_hints(func) + + if "return" in func_signature: + func_signature.pop("return") + + values = list(func_signature.values()) + + if number_of_parameters != 1: + raise DynamicComponentInvalidSignature( + "The function must have exactly one parameter, which is the state class." + ) + + if len(values) != 1: + raise DynamicComponentInvalidSignature( + "You must provide a type hint for the state class in the function." + ) + + state_class: Type[T] = values[0] + + def wrapper() -> Component: + from reflex.components.base.fragment import fragment + + return fragment(state_class._evaluate(lambda state: func(state))) + + return wrapper + + class FrontendEventExceptionState(State): """Substate for handling frontend exceptions.""" diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index cd3d108b4..f16338513 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -139,3 +139,7 @@ class StateSchemaMismatchError(ReflexError, TypeError): class EnvironmentVarValueError(ReflexError, ValueError): """Raised when an environment variable is set to an invalid value.""" + + +class DynamicComponentInvalidSignature(ReflexError, TypeError): + """Raised when a dynamic component has an invalid signature."""