From b58ce1082eef49d5c3dc49cfe9948def1f21cfc3 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Mon, 12 Aug 2024 02:42:39 +0200 Subject: [PATCH 01/10] fix appharness app_source typing (#3777) --- reflex/testing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/testing.py b/reflex/testing.py index bde218c5ec..52bff03c0a 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -115,7 +115,7 @@ class AppHarness: app_name: str app_source: Optional[ - types.FunctionType | types.ModuleType | str | functools.partial + types.FunctionType | types.ModuleType | str | functools.partial[Any] ] app_path: pathlib.Path app_module_path: pathlib.Path @@ -134,7 +134,9 @@ class AppHarness: def create( cls, root: pathlib.Path, - app_source: Optional[types.FunctionType | types.ModuleType | str] = None, + app_source: Optional[ + types.FunctionType | types.ModuleType | str | functools.partial[Any] + ] = None, app_name: Optional[str] = None, ) -> "AppHarness": """Create an AppHarness instance at root. From 0eff63eed4580679c2c04232a0d42ee0205f87ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 12 Aug 2024 12:04:55 +0200 Subject: [PATCH 02/10] fix import clash between connectionToaster and hooks.useState (#3749) --- reflex/experimental/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/experimental/hooks.py b/reflex/experimental/hooks.py index 090c2b39d2..848ad7fb79 100644 --- a/reflex/experimental/hooks.py +++ b/reflex/experimental/hooks.py @@ -7,7 +7,7 @@ def _compose_react_imports(tags: list[str]) -> dict[str, list[ImportVar]]: - return {"react": [ImportVar(tag=tag, install=False) for tag in tags]} + return {"react": [ImportVar(tag=tag) for tag in tags]} def const(name, value) -> Var: From 910bcdb017aba7a05b4efa6501c5f3dbff6f235d Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 12 Aug 2024 03:06:34 -0700 Subject: [PATCH 03/10] use different registry when in china, fixes #3700 (#3702) --- reflex/constants/installer.py | 2 ++ reflex/utils/prerequisites.py | 10 ++++++++ reflex/utils/registry.py | 48 +++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 reflex/utils/registry.py diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index fbee4cd5ac..4a7027ee82 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -51,6 +51,8 @@ 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" # FNM config. diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 72eb75b90c..a80bcd8146 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -38,6 +38,7 @@ from reflex.config import Config, get_config from reflex.utils import console, path_ops, processes from reflex.utils.format import format_library_name +from reflex.utils.registry import _get_best_registry CURRENTLY_INSTALLING_NODE = False @@ -577,6 +578,15 @@ def initialize_package_json(): code = _compile_package_json() output_path.write_text(code) + best_registry = _get_best_registry() + bun_config_path = get_web_dir() / constants.Bun.CONFIG_PATH + bun_config_path.write_text( + f""" +[install] +registry = "{best_registry}" +""" + ) + def init_reflex_json(project_hash: int | None): """Write the hash of the Reflex project to a REFLEX_JSON. diff --git a/reflex/utils/registry.py b/reflex/utils/registry.py new file mode 100644 index 0000000000..551292f2d4 --- /dev/null +++ b/reflex/utils/registry.py @@ -0,0 +1,48 @@ +"""Utilities for working with registries.""" + +import httpx + +from reflex.utils import console + + +def latency(registry: str) -> int: + """Get the latency of a registry. + + Args: + registry (str): The URL of the registry. + + Returns: + int: The latency of the registry in microseconds. + """ + try: + return httpx.get(registry).elapsed.microseconds + except httpx.HTTPError: + console.info(f"Failed to connect to {registry}.") + return 10_000_000 + + +def average_latency(registry, attempts: int = 3) -> int: + """Get the average latency of a registry. + + Args: + registry (str): The URL of the registry. + attempts (int): The number of attempts to make. Defaults to 10. + + Returns: + int: The average latency of the registry in microseconds. + """ + return sum(latency(registry) for _ in range(attempts)) // attempts + + +def _get_best_registry() -> str: + """Get the best registry based on latency. + + Returns: + str: The best registry. + """ + registries = [ + "https://registry.npmjs.org", + "https://r.cnpmjs.org", + ] + + return min(registries, key=average_latency) From 634c0916f6a893caa56b9aa8eb7a0c1159debd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Tue, 13 Aug 2024 23:14:38 +0200 Subject: [PATCH 04/10] do not reload compilation if using local app in AppHarness (#3790) * do not reload if using local app * Update reflex/testing.py Co-authored-by: Masen Furer --------- Co-authored-by: Masen Furer --- reflex/testing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reflex/testing.py b/reflex/testing.py index 52bff03c0a..c52396fc62 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -276,7 +276,10 @@ def _initialize_app(self): before_decorated_pages = reflex.app.DECORATED_PAGES[self.app_name].copy() # Ensure the AppHarness test does not skip State assignment due to running via pytest os.environ.pop(reflex.constants.PYTEST_CURRENT_TEST, None) - self.app_module = reflex.utils.prerequisites.get_compiled_app(reload=True) + self.app_module = reflex.utils.prerequisites.get_compiled_app( + # Do not reload the module for pre-existing apps (only apps generated from source) + reload=self.app_source is not None + ) # Save the pages that were added during testing self._decorated_pages = [ p From b01c4b6c6a0d5642079b73be6a5c27193730e425 Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Tue, 13 Aug 2024 15:49:43 -0700 Subject: [PATCH 05/10] Bump memory on relevant actions (#3781) Co-authored-by: Alek Petuskey --- .github/workflows/benchmarks.yml | 2 +- .github/workflows/integration_tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index c8ab75adb2..b849dd328c 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -17,7 +17,7 @@ defaults: env: PYTHONIOENCODING: 'utf8' TELEMETRY_ENABLED: false - NODE_OPTIONS: '--max_old_space_size=4096' + NODE_OPTIONS: '--max_old_space_size=8192' PR_TITLE: ${{ github.event.pull_request.title }} jobs: diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8fa787aba6..58f7a668af 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -29,7 +29,7 @@ env: # - Best effort print lines that contain illegal chars (map to some default char, etc.) PYTHONIOENCODING: 'utf8' TELEMETRY_ENABLED: false - NODE_OPTIONS: '--max_old_space_size=4096' + NODE_OPTIONS: '--max_old_space_size=8192' PR_TITLE: ${{ github.event.pull_request.title }} jobs: From 4190a7983572335311ce9572c42b22fb766250ad Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Thu, 15 Aug 2024 16:30:32 +0000 Subject: [PATCH 06/10] [REF-3334] Validate Toast Props (#3793) --- reflex/app.py | 2 +- reflex/components/sonner/toast.py | 28 +++++++++++++++++++++++++++- reflex/components/sonner/toast.pyi | 5 +++++ tests/test_state.py | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 7e40a95bf7..69a5ff9782 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -125,8 +125,8 @@ def default_backend_exception_handler(exception: Exception) -> EventSpec: ) if Toaster.is_used: return toast( + "An error occurred.", level="error", - title="An error occurred.", description="
".join(error_message), position="top-center", id="backend_error", diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index d4df31e82c..e00eaad4e5 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -4,6 +4,8 @@ from typing import Any, ClassVar, Literal, Optional, Union +from pydantic import ValidationError + from reflex.base import Base from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon @@ -27,7 +29,6 @@ "bottom-right", ] - toast_ref = Var.create_safe("refs['__toast']", _var_is_string=False) @@ -128,6 +129,24 @@ class ToastProps(PropsBase): # Function that gets called when the toast disappears automatically after it's timeout (duration` prop). on_auto_close: Optional[Any] + def __init__(self, **kwargs): + """Initialize the props. + + Args: + kwargs: Kwargs to initialize the props. + + Raises: + ValueError: If invalid props are passed on instantiation. + """ + try: + super().__init__(**kwargs) + except ValidationError as e: + invalid_fields = ", ".join([error["loc"][0] for error in e.errors()]) # type: ignore + supported_props_str = ", ".join(f'"{field}"' for field in self.get_fields()) + raise ValueError( + f"Invalid prop(s) {invalid_fields} for rx.toast. Supported props are {supported_props_str}" + ) from None + def dict(self, *args, **kwargs) -> dict[str, Any]: """Convert the object to a dictionary. @@ -159,6 +178,13 @@ def dict(self, *args, **kwargs) -> dict[str, Any]: ) return d + class Config: + """Pydantic config.""" + + arbitrary_types_allowed = True + use_enum_values = True + extra = "forbid" + class Toaster(Component): """A Toaster Component for displaying toast notifications.""" diff --git a/reflex/components/sonner/toast.pyi b/reflex/components/sonner/toast.pyi index 7e5758b16d..c7e6269151 100644 --- a/reflex/components/sonner/toast.pyi +++ b/reflex/components/sonner/toast.pyi @@ -51,6 +51,11 @@ class ToastProps(PropsBase): def dict(self, *args, **kwargs) -> dict[str, Any]: ... + class Config: + arbitrary_types_allowed = True + use_enum_values = True + extra = "forbid" + class Toaster(Component): is_used: ClassVar[bool] = False diff --git a/tests/test_state.py b/tests/test_state.py index aa5705b09a..1a014739d5 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -1565,7 +1565,7 @@ def invalid_handler(self): assert update.events == rx.event.fix_events( [ rx.toast( - title="An error occurred.", + "An error occurred.", description="TypeError: Your handler test_state_with_invalid_yield..StateWithInvalidYield.invalid_handler must only return/yield: None, Events or other EventHandlers referenced by their class (not using `self`).
See logs for details.", level="error", id="backend_error", From 1f3779f40e17a613db20c6ac40742ffa7d920e54 Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Mon, 19 Aug 2024 20:41:31 +0000 Subject: [PATCH 07/10] [REF-3536][REF-3537][REF-3541] Move chakra components into its repo(reflex-chakra) (#3798) --- benchmarks/test_benchmark_compile_pages.py | 3 +- integration/test_background_task.py | 5 +- integration/test_client_storage.py | 8 +- integration/test_dynamic_routes.py | 14 +- integration/test_event_actions.py | 8 +- integration/test_event_chain.py | 8 +- integration/test_form_submit.py | 44 +- integration/test_server_side_event.py | 10 +- integration/test_table.py | 60 +- integration/test_tailwind.py | 4 +- integration/test_upload.py | 4 +- integration/test_var_operations.py | 4 +- poetry.lock | 162 +++- pyproject.toml | 1 + reflex/__init__.py | 23 +- reflex/__init__.pyi | 1 - reflex/components/__init__.py | 1 - reflex/components/__init__.pyi | 1 - reflex/components/chakra/__init__.py | 204 ----- reflex/components/chakra/base.py | 210 ----- reflex/components/chakra/base.pyi | 319 -------- .../components/chakra/datadisplay/__init__.py | 10 - reflex/components/chakra/datadisplay/badge.py | 16 - .../components/chakra/datadisplay/badge.pyi | 96 --- reflex/components/chakra/datadisplay/code.py | 11 - reflex/components/chakra/datadisplay/code.pyi | 87 -- .../components/chakra/datadisplay/divider.py | 20 - .../components/chakra/datadisplay/divider.pyi | 100 --- .../chakra/datadisplay/keyboard_key.py | 9 - .../chakra/datadisplay/keyboard_key.pyi | 87 -- reflex/components/chakra/datadisplay/list.py | 60 -- reflex/components/chakra/datadisplay/list.pyi | 339 -------- reflex/components/chakra/datadisplay/stat.py | 80 -- reflex/components/chakra/datadisplay/stat.pyi | 477 ----------- reflex/components/chakra/datadisplay/table.py | 305 ------- .../components/chakra/datadisplay/table.pyi | 737 ----------------- reflex/components/chakra/datadisplay/tag.py | 85 -- reflex/components/chakra/datadisplay/tag.pyi | 433 ---------- .../components/chakra/disclosure/__init__.py | 14 - .../components/chakra/disclosure/accordion.py | 110 --- .../chakra/disclosure/accordion.pyi | 411 ---------- reflex/components/chakra/disclosure/tabs.py | 117 --- reflex/components/chakra/disclosure/tabs.pyi | 496 ------------ .../chakra/disclosure/transition.py | 73 -- .../chakra/disclosure/transition.pyi | 509 ------------ .../chakra/disclosure/visuallyhidden.py | 9 - .../chakra/disclosure/visuallyhidden.pyi | 87 -- reflex/components/chakra/feedback/__init__.py | 7 - reflex/components/chakra/feedback/alert.py | 68 -- reflex/components/chakra/feedback/alert.pyi | 335 -------- .../chakra/feedback/circularprogress.py | 68 -- .../chakra/feedback/circularprogress.pyi | 185 ----- reflex/components/chakra/feedback/progress.py | 33 - .../components/chakra/feedback/progress.pyi | 101 --- reflex/components/chakra/feedback/skeleton.py | 70 -- .../components/chakra/feedback/skeleton.pyi | 271 ------- reflex/components/chakra/feedback/spinner.py | 25 - reflex/components/chakra/feedback/spinner.pyi | 102 --- reflex/components/chakra/forms/__init__.py | 49 -- reflex/components/chakra/forms/button.py | 83 -- reflex/components/chakra/forms/button.pyi | 262 ------ reflex/components/chakra/forms/checkbox.py | 77 -- reflex/components/chakra/forms/checkbox.pyi | 247 ------ .../chakra/forms/colormodeswitch.py | 104 --- .../chakra/forms/colormodeswitch.pyi | 473 ----------- reflex/components/chakra/forms/date_picker.py | 11 - .../components/chakra/forms/date_picker.pyi | 129 --- .../chakra/forms/date_time_picker.py | 11 - .../chakra/forms/date_time_picker.pyi | 129 --- reflex/components/chakra/forms/editable.py | 67 -- reflex/components/chakra/forms/editable.pyi | 343 -------- reflex/components/chakra/forms/email.py | 11 - reflex/components/chakra/forms/email.pyi | 129 --- reflex/components/chakra/forms/form.py | 103 --- reflex/components/chakra/forms/form.pyi | 484 ----------- reflex/components/chakra/forms/iconbutton.py | 38 - reflex/components/chakra/forms/iconbutton.pyi | 108 --- reflex/components/chakra/forms/input.py | 130 --- reflex/components/chakra/forms/input.pyi | 566 ------------- reflex/components/chakra/forms/multiselect.py | 355 -------- reflex/components/chakra/forms/numberinput.py | 128 --- .../components/chakra/forms/numberinput.pyi | 442 ---------- reflex/components/chakra/forms/password.py | 11 - reflex/components/chakra/forms/password.pyi | 129 --- reflex/components/chakra/forms/pininput.py | 201 ----- reflex/components/chakra/forms/pininput.pyi | 215 ----- reflex/components/chakra/forms/radio.py | 101 --- reflex/components/chakra/forms/radio.pyi | 197 ----- reflex/components/chakra/forms/rangeslider.py | 149 ---- .../components/chakra/forms/rangeslider.pyi | 354 -------- reflex/components/chakra/forms/select.py | 103 --- reflex/components/chakra/forms/select.pyi | 204 ----- reflex/components/chakra/forms/slider.py | 130 --- reflex/components/chakra/forms/slider.pyi | 449 ----------- reflex/components/chakra/forms/switch.py | 49 -- reflex/components/chakra/forms/switch.pyi | 159 ---- reflex/components/chakra/forms/textarea.py | 79 -- reflex/components/chakra/forms/textarea.pyi | 123 --- reflex/components/chakra/forms/time_picker.py | 11 - .../components/chakra/forms/time_picker.pyi | 129 --- reflex/components/chakra/layout/__init__.py | 14 - .../components/chakra/layout/aspect_ratio.py | 13 - .../components/chakra/layout/aspect_ratio.pyi | 89 -- reflex/components/chakra/layout/box.py | 31 - reflex/components/chakra/layout/box.pyi | 93 --- reflex/components/chakra/layout/card.py | 100 --- reflex/components/chakra/layout/card.pyi | 379 --------- reflex/components/chakra/layout/center.py | 21 - reflex/components/chakra/layout/center.pyi | 239 ------ reflex/components/chakra/layout/container.py | 13 - reflex/components/chakra/layout/container.pyi | 89 -- reflex/components/chakra/layout/flex.py | 33 - reflex/components/chakra/layout/flex.pyi | 101 --- reflex/components/chakra/layout/grid.py | 125 --- reflex/components/chakra/layout/grid.pyi | 293 ------- reflex/components/chakra/layout/spacer.py | 9 - reflex/components/chakra/layout/spacer.pyi | 87 -- reflex/components/chakra/layout/stack.py | 48 -- reflex/components/chakra/layout/stack.pyi | 305 ------- reflex/components/chakra/layout/wrap.py | 57 -- reflex/components/chakra/layout/wrap.pyi | 179 ---- reflex/components/chakra/media/__init__.py | 7 - reflex/components/chakra/media/avatar.py | 58 -- reflex/components/chakra/media/avatar.pyi | 267 ------ reflex/components/chakra/media/icon.py | 111 --- reflex/components/chakra/media/icon.pyi | 171 ---- reflex/components/chakra/media/image.py | 74 -- reflex/components/chakra/media/image.pyi | 118 --- .../components/chakra/navigation/__init__.py | 18 - .../chakra/navigation/breadcrumb.py | 98 --- .../chakra/navigation/breadcrumb.pyi | 351 -------- reflex/components/chakra/navigation/link.py | 62 -- reflex/components/chakra/navigation/link.pyi | 105 --- .../chakra/navigation/linkoverlay.py | 22 - .../chakra/navigation/linkoverlay.pyi | 167 ---- .../components/chakra/navigation/stepper.py | 113 --- .../components/chakra/navigation/stepper.pyi | 762 ------------------ reflex/components/chakra/overlay/__init__.py | 50 -- .../components/chakra/overlay/alertdialog.py | 153 ---- .../components/chakra/overlay/alertdialog.pyi | 612 -------------- reflex/components/chakra/overlay/drawer.py | 168 ---- reflex/components/chakra/overlay/drawer.pyi | 652 --------------- reflex/components/chakra/overlay/menu.py | 225 ------ reflex/components/chakra/overlay/menu.pyi | 708 ---------------- reflex/components/chakra/overlay/modal.py | 166 ---- reflex/components/chakra/overlay/modal.pyi | 600 -------------- reflex/components/chakra/overlay/popover.py | 183 ----- reflex/components/chakra/overlay/popover.pyi | 757 ----------------- reflex/components/chakra/overlay/tooltip.py | 70 -- reflex/components/chakra/overlay/tooltip.pyi | 129 --- .../components/chakra/typography/__init__.py | 10 - .../components/chakra/typography/heading.py | 16 - .../components/chakra/typography/heading.pyi | 96 --- .../components/chakra/typography/highlight.py | 23 - .../chakra/typography/highlight.pyi | 91 --- reflex/components/chakra/typography/span.py | 15 - reflex/components/chakra/typography/span.pyi | 89 -- reflex/components/chakra/typography/text.py | 18 - reflex/components/chakra/typography/text.pyi | 91 --- reflex/components/media/__init__.py | 1 - reflex/components/media/icon.py | 3 - reflex/reflex.py | 15 - reflex/utils/prerequisites.py | 110 --- scripts/migrate_project_to_rx_chakra.py | 13 - tests/components/datadisplay/test_table.py | 2 +- tests/components/forms/test_form.py | 3 +- tests/components/media/test_icon.py | 2 +- tests/components/test_component.py | 5 +- tests/components/typography/test_markdown.py | 3 +- tests/test_app.py | 5 +- 170 files changed, 283 insertions(+), 24032 deletions(-) delete mode 100644 reflex/components/chakra/__init__.py delete mode 100644 reflex/components/chakra/base.py delete mode 100644 reflex/components/chakra/base.pyi delete mode 100644 reflex/components/chakra/datadisplay/__init__.py delete mode 100644 reflex/components/chakra/datadisplay/badge.py delete mode 100644 reflex/components/chakra/datadisplay/badge.pyi delete mode 100644 reflex/components/chakra/datadisplay/code.py delete mode 100644 reflex/components/chakra/datadisplay/code.pyi delete mode 100644 reflex/components/chakra/datadisplay/divider.py delete mode 100644 reflex/components/chakra/datadisplay/divider.pyi delete mode 100644 reflex/components/chakra/datadisplay/keyboard_key.py delete mode 100644 reflex/components/chakra/datadisplay/keyboard_key.pyi delete mode 100644 reflex/components/chakra/datadisplay/list.py delete mode 100644 reflex/components/chakra/datadisplay/list.pyi delete mode 100644 reflex/components/chakra/datadisplay/stat.py delete mode 100644 reflex/components/chakra/datadisplay/stat.pyi delete mode 100644 reflex/components/chakra/datadisplay/table.py delete mode 100644 reflex/components/chakra/datadisplay/table.pyi delete mode 100644 reflex/components/chakra/datadisplay/tag.py delete mode 100644 reflex/components/chakra/datadisplay/tag.pyi delete mode 100644 reflex/components/chakra/disclosure/__init__.py delete mode 100644 reflex/components/chakra/disclosure/accordion.py delete mode 100644 reflex/components/chakra/disclosure/accordion.pyi delete mode 100644 reflex/components/chakra/disclosure/tabs.py delete mode 100644 reflex/components/chakra/disclosure/tabs.pyi delete mode 100644 reflex/components/chakra/disclosure/transition.py delete mode 100644 reflex/components/chakra/disclosure/transition.pyi delete mode 100644 reflex/components/chakra/disclosure/visuallyhidden.py delete mode 100644 reflex/components/chakra/disclosure/visuallyhidden.pyi delete mode 100644 reflex/components/chakra/feedback/__init__.py delete mode 100644 reflex/components/chakra/feedback/alert.py delete mode 100644 reflex/components/chakra/feedback/alert.pyi delete mode 100644 reflex/components/chakra/feedback/circularprogress.py delete mode 100644 reflex/components/chakra/feedback/circularprogress.pyi delete mode 100644 reflex/components/chakra/feedback/progress.py delete mode 100644 reflex/components/chakra/feedback/progress.pyi delete mode 100644 reflex/components/chakra/feedback/skeleton.py delete mode 100644 reflex/components/chakra/feedback/skeleton.pyi delete mode 100644 reflex/components/chakra/feedback/spinner.py delete mode 100644 reflex/components/chakra/feedback/spinner.pyi delete mode 100644 reflex/components/chakra/forms/__init__.py delete mode 100644 reflex/components/chakra/forms/button.py delete mode 100644 reflex/components/chakra/forms/button.pyi delete mode 100644 reflex/components/chakra/forms/checkbox.py delete mode 100644 reflex/components/chakra/forms/checkbox.pyi delete mode 100644 reflex/components/chakra/forms/colormodeswitch.py delete mode 100644 reflex/components/chakra/forms/colormodeswitch.pyi delete mode 100644 reflex/components/chakra/forms/date_picker.py delete mode 100644 reflex/components/chakra/forms/date_picker.pyi delete mode 100644 reflex/components/chakra/forms/date_time_picker.py delete mode 100644 reflex/components/chakra/forms/date_time_picker.pyi delete mode 100644 reflex/components/chakra/forms/editable.py delete mode 100644 reflex/components/chakra/forms/editable.pyi delete mode 100644 reflex/components/chakra/forms/email.py delete mode 100644 reflex/components/chakra/forms/email.pyi delete mode 100644 reflex/components/chakra/forms/form.py delete mode 100644 reflex/components/chakra/forms/form.pyi delete mode 100644 reflex/components/chakra/forms/iconbutton.py delete mode 100644 reflex/components/chakra/forms/iconbutton.pyi delete mode 100644 reflex/components/chakra/forms/input.py delete mode 100644 reflex/components/chakra/forms/input.pyi delete mode 100644 reflex/components/chakra/forms/multiselect.py delete mode 100644 reflex/components/chakra/forms/numberinput.py delete mode 100644 reflex/components/chakra/forms/numberinput.pyi delete mode 100644 reflex/components/chakra/forms/password.py delete mode 100644 reflex/components/chakra/forms/password.pyi delete mode 100644 reflex/components/chakra/forms/pininput.py delete mode 100644 reflex/components/chakra/forms/pininput.pyi delete mode 100644 reflex/components/chakra/forms/radio.py delete mode 100644 reflex/components/chakra/forms/radio.pyi delete mode 100644 reflex/components/chakra/forms/rangeslider.py delete mode 100644 reflex/components/chakra/forms/rangeslider.pyi delete mode 100644 reflex/components/chakra/forms/select.py delete mode 100644 reflex/components/chakra/forms/select.pyi delete mode 100644 reflex/components/chakra/forms/slider.py delete mode 100644 reflex/components/chakra/forms/slider.pyi delete mode 100644 reflex/components/chakra/forms/switch.py delete mode 100644 reflex/components/chakra/forms/switch.pyi delete mode 100644 reflex/components/chakra/forms/textarea.py delete mode 100644 reflex/components/chakra/forms/textarea.pyi delete mode 100644 reflex/components/chakra/forms/time_picker.py delete mode 100644 reflex/components/chakra/forms/time_picker.pyi delete mode 100644 reflex/components/chakra/layout/__init__.py delete mode 100644 reflex/components/chakra/layout/aspect_ratio.py delete mode 100644 reflex/components/chakra/layout/aspect_ratio.pyi delete mode 100644 reflex/components/chakra/layout/box.py delete mode 100644 reflex/components/chakra/layout/box.pyi delete mode 100644 reflex/components/chakra/layout/card.py delete mode 100644 reflex/components/chakra/layout/card.pyi delete mode 100644 reflex/components/chakra/layout/center.py delete mode 100644 reflex/components/chakra/layout/center.pyi delete mode 100644 reflex/components/chakra/layout/container.py delete mode 100644 reflex/components/chakra/layout/container.pyi delete mode 100644 reflex/components/chakra/layout/flex.py delete mode 100644 reflex/components/chakra/layout/flex.pyi delete mode 100644 reflex/components/chakra/layout/grid.py delete mode 100644 reflex/components/chakra/layout/grid.pyi delete mode 100644 reflex/components/chakra/layout/spacer.py delete mode 100644 reflex/components/chakra/layout/spacer.pyi delete mode 100644 reflex/components/chakra/layout/stack.py delete mode 100644 reflex/components/chakra/layout/stack.pyi delete mode 100644 reflex/components/chakra/layout/wrap.py delete mode 100644 reflex/components/chakra/layout/wrap.pyi delete mode 100644 reflex/components/chakra/media/__init__.py delete mode 100644 reflex/components/chakra/media/avatar.py delete mode 100644 reflex/components/chakra/media/avatar.pyi delete mode 100644 reflex/components/chakra/media/icon.py delete mode 100644 reflex/components/chakra/media/icon.pyi delete mode 100644 reflex/components/chakra/media/image.py delete mode 100644 reflex/components/chakra/media/image.pyi delete mode 100644 reflex/components/chakra/navigation/__init__.py delete mode 100644 reflex/components/chakra/navigation/breadcrumb.py delete mode 100644 reflex/components/chakra/navigation/breadcrumb.pyi delete mode 100644 reflex/components/chakra/navigation/link.py delete mode 100644 reflex/components/chakra/navigation/link.pyi delete mode 100644 reflex/components/chakra/navigation/linkoverlay.py delete mode 100644 reflex/components/chakra/navigation/linkoverlay.pyi delete mode 100644 reflex/components/chakra/navigation/stepper.py delete mode 100644 reflex/components/chakra/navigation/stepper.pyi delete mode 100644 reflex/components/chakra/overlay/__init__.py delete mode 100644 reflex/components/chakra/overlay/alertdialog.py delete mode 100644 reflex/components/chakra/overlay/alertdialog.pyi delete mode 100644 reflex/components/chakra/overlay/drawer.py delete mode 100644 reflex/components/chakra/overlay/drawer.pyi delete mode 100644 reflex/components/chakra/overlay/menu.py delete mode 100644 reflex/components/chakra/overlay/menu.pyi delete mode 100644 reflex/components/chakra/overlay/modal.py delete mode 100644 reflex/components/chakra/overlay/modal.pyi delete mode 100644 reflex/components/chakra/overlay/popover.py delete mode 100644 reflex/components/chakra/overlay/popover.pyi delete mode 100644 reflex/components/chakra/overlay/tooltip.py delete mode 100644 reflex/components/chakra/overlay/tooltip.pyi delete mode 100644 reflex/components/chakra/typography/__init__.py delete mode 100644 reflex/components/chakra/typography/heading.py delete mode 100644 reflex/components/chakra/typography/heading.pyi delete mode 100644 reflex/components/chakra/typography/highlight.py delete mode 100644 reflex/components/chakra/typography/highlight.pyi delete mode 100644 reflex/components/chakra/typography/span.py delete mode 100644 reflex/components/chakra/typography/span.pyi delete mode 100644 reflex/components/chakra/typography/text.py delete mode 100644 reflex/components/chakra/typography/text.pyi delete mode 100644 reflex/components/media/__init__.py delete mode 100644 reflex/components/media/icon.py delete mode 100644 scripts/migrate_project_to_rx_chakra.py diff --git a/benchmarks/test_benchmark_compile_pages.py b/benchmarks/test_benchmark_compile_pages.py index 3a0164b2fa..00fc86ff90 100644 --- a/benchmarks/test_benchmark_compile_pages.py +++ b/benchmarks/test_benchmark_compile_pages.py @@ -7,6 +7,7 @@ from typing import Generator import pytest +import reflex_chakra as rc from benchmarks import WINDOWS_SKIP_REASON from reflex import constants @@ -144,7 +145,7 @@ class State(rx.State): def index() -> rx.Component: return rx.center( - rx.chakra.input( + rc.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 98b6e48ffe..45866ba005 100644 --- a/integration/test_background_task.py +++ b/integration/test_background_task.py @@ -13,6 +13,7 @@ def BackgroundTask(): import asyncio import pytest + import reflex_chakra as rc import reflex as rx from reflex.state import ImmutableStateError @@ -108,11 +109,11 @@ async def _triple_count(self): def index() -> rx.Component: return rx.vstack( - rx.chakra.input( + rc.input( id="token", value=State.router.session.client_token, is_read_only=True ), rx.heading(State.counter, id="counter"), - rx.chakra.input( + rc.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 b69009a091..e88d2fa148 100644 --- a/integration/test_client_storage.py +++ b/integration/test_client_storage.py @@ -17,6 +17,8 @@ def ClientSide(): """App for testing client-side state.""" + import reflex_chakra as rc + import reflex as rx class ClientSideState(rx.State): @@ -70,18 +72,18 @@ def set_var(self): def index(): return rx.fragment( - rx.chakra.input( + rc.input( value=ClientSideState.router.session.client_token, is_read_only=True, id="token", ), - rx.chakra.input( + rc.input( placeholder="state var", value=ClientSideState.state_var, on_change=ClientSideState.set_state_var, # type: ignore id="state_var", ), - rx.chakra.input( + rc.input( placeholder="input value", value=ClientSideState.input_value, on_change=ClientSideState.set_input_value, # type: ignore diff --git a/integration/test_dynamic_routes.py b/integration/test_dynamic_routes.py index e3686ee1a6..0ce4ef2c91 100644 --- a/integration/test_dynamic_routes.py +++ b/integration/test_dynamic_routes.py @@ -17,6 +17,8 @@ def DynamicRoute(): """App for testing dynamic routes.""" from typing import List + import reflex_chakra as rc + import reflex as rx class DynamicState(rx.State): @@ -40,15 +42,13 @@ def next_page(self) -> str: def index(): return rx.fragment( - rx.chakra.input( + rc.input( value=DynamicState.router.session.client_token, is_read_only=True, id="token", ), - rx.chakra.input( - value=DynamicState.page_id, is_read_only=True, id="page_id" - ), - rx.chakra.input( + rc.input(value=DynamicState.page_id, is_read_only=True, id="page_id"), + rc.input( value=DynamicState.router.page.raw_path, is_read_only=True, id="raw_path", @@ -61,10 +61,10 @@ def index(): id="link_page_next", # type: ignore ), rx.link("missing", href="/missing", id="link_missing"), - rx.chakra.list( + rc.list( rx.foreach( DynamicState.order, # type: ignore - lambda i: rx.chakra.list_item(rx.text(i)), + lambda i: rc.list_item(rx.text(i)), ), ), ) diff --git a/integration/test_event_actions.py b/integration/test_event_actions.py index e2704fa708..5845d80f1f 100644 --- a/integration/test_event_actions.py +++ b/integration/test_event_actions.py @@ -16,6 +16,8 @@ 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): @@ -53,7 +55,7 @@ def get_event_triggers(self): def index(): return rx.vstack( - rx.chakra.input( + rc.input( value=EventActionState.router.session.client_token, is_read_only=True, id="token", @@ -146,10 +148,10 @@ def index(): 200 ).stop_propagation, ), - rx.chakra.list( + rc.list( rx.foreach( EventActionState.order, # type: ignore - rx.chakra.list_item, + rc.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 b0feb3e469..cdef575a15 100644 --- a/integration/test_event_chain.py +++ b/integration/test_event_chain.py @@ -18,6 +18,8 @@ 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 @@ -127,7 +129,7 @@ def click_yield_interim_value(self): app = rx.App(state=rx.State) - token_input = rx.chakra.input( + token_input = rc.input( value=State.router.session.client_token, is_read_only=True, id="token" ) @@ -135,9 +137,7 @@ def click_yield_interim_value(self): def index(): return rx.fragment( token_input, - rx.chakra.input( - value=State.interim_value, is_read_only=True, id="interim_value" - ), + rc.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 c9eb451469..7858cce770 100644 --- a/integration/test_form_submit.py +++ b/integration/test_form_submit.py @@ -20,6 +20,8 @@ def FormSubmit(form_component): """ from typing import Dict, List + import reflex_chakra as rc + import reflex as rx class FormState(rx.State): @@ -35,28 +37,28 @@ def form_submit(self, form_data: Dict): @app.add_page def index(): return rx.vstack( - rx.chakra.input( + rc.input( value=FormState.router.session.client_token, is_read_only=True, id="token", ), eval(form_component)( rx.vstack( - rx.chakra.input(id="name_input"), - rx.hstack(rx.chakra.pin_input(length=4, id="pin_input")), - rx.chakra.number_input(id="number_input"), + rc.input(id="name_input"), + rx.hstack(rc.pin_input(length=4, id="pin_input")), + rc.number_input(id="number_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%"), - rx.chakra.range_slider(id="range_input"), + rc.range_slider(id="range_input"), rx.radio(["option1", "option2"], id="radio_input"), rx.radio(FormState.var_options, id="radio_input_var"), - rx.chakra.select(["option1", "option2"], id="select_input"), - rx.chakra.select(FormState.var_options, id="select_input_var"), + rc.select(["option1", "option2"], id="select_input"), + rc.select(FormState.var_options, id="select_input_var"), rx.text_area(id="text_area_input"), - rx.chakra.input( + rc.input( id="debounce_input", debounce_timeout=0, on_change=rx.console_log, @@ -79,6 +81,8 @@ def FormSubmitName(form_component): """ from typing import Dict, List + import reflex_chakra as rc + import reflex as rx class FormState(rx.State): @@ -94,22 +98,22 @@ def form_submit(self, form_data: Dict): @app.add_page def index(): return rx.vstack( - rx.chakra.input( + rc.input( value=FormState.router.session.client_token, is_read_only=True, id="token", ), eval(form_component)( rx.vstack( - rx.chakra.input(name="name_input"), - rx.hstack(rx.chakra.pin_input(length=4, name="pin_input")), - rx.chakra.number_input(name="number_input"), + rc.input(name="name_input"), + rx.hstack(rc.pin_input(length=4, name="pin_input")), + rc.number_input(name="number_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%"), - rx.chakra.range_slider(name="range_input"), + rc.range_slider(name="range_input"), rx.radio(FormState.options, name="radio_input"), rx.select( FormState.options, @@ -117,16 +121,16 @@ def index(): default_value=FormState.options[0], ), rx.text_area(name="text_area_input"), - rx.chakra.input_group( - rx.chakra.input_left_element(rx.icon(tag="chevron_right")), - rx.chakra.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, ), - rx.chakra.input_right_element(rx.icon(tag="chevron_left")), + rc.input_right_element(rx.icon(tag="chevron_left")), ), - rx.chakra.button_group( + rc.button_group( rx.button("Submit", type_="submit"), rx.icon_button(FormState.val, icon=rx.icon(tag="plus")), variant="outline", @@ -148,8 +152,8 @@ def index(): 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="rx.chakra.form"), - functools.partial(FormSubmitName, form_component="rx.chakra.form"), + functools.partial(FormSubmit, form_component="rc.form"), + functools.partial(FormSubmitName, form_component="rc.form"), ], ids=[ "id-radix", diff --git a/integration/test_server_side_event.py b/integration/test_server_side_event.py index 9bb20c3455..8687b0f32a 100644 --- a/integration/test_server_side_event.py +++ b/integration/test_server_side_event.py @@ -11,6 +11,8 @@ 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): @@ -39,12 +41,12 @@ def set_value_return_c(self): @app.add_page def index(): return rx.fragment( - rx.chakra.input( + rc.input( id="token", value=SSState.router.session.client_token, is_read_only=True ), - rx.chakra.input(default_value="a", id="a"), - rx.chakra.input(default_value="b", id="b"), - rx.chakra.input(default_value="c", id="c"), + rc.input(default_value="a", id="a"), + rc.input(default_value="b", id="b"), + rc.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 c513c9d569..d28798a987 100644 --- a/integration/test_table.py +++ b/integration/test_table.py @@ -12,6 +12,8 @@ def Table(): """App using table component.""" from typing import List + import reflex_chakra as rc + import reflex as rx class TableState(rx.State): @@ -32,13 +34,13 @@ class TableState(rx.State): @app.add_page def index(): return rx.center( - rx.chakra.input( + rc.input( id="token", value=TableState.router.session.client_token, is_read_only=True, ), - rx.chakra.table_container( - rx.chakra.table( + rc.table_container( + rc.table( headers=TableState.headers, rows=TableState.rows, footers=TableState.footers, @@ -53,40 +55,40 @@ def index(): @app.add_page def another(): return rx.center( - rx.chakra.table_container( - rx.chakra.table( # type: ignore - rx.chakra.thead( # type: ignore - rx.chakra.tr( # type: ignore - rx.chakra.th("Name"), - rx.chakra.th("Age"), - rx.chakra.th("Location"), + rc.table_container( + rc.table( # type: ignore + rc.thead( # type: ignore + rc.tr( # type: ignore + rc.th("Name"), + rc.th("Age"), + rc.th("Location"), ) ), - rx.chakra.tbody( # type: ignore - rx.chakra.tr( # type: ignore - rx.chakra.td("John"), - rx.chakra.td(30), - rx.chakra.td("New York"), + rc.tbody( # type: ignore + rc.tr( # type: ignore + rc.td("John"), + rc.td(30), + rc.td("New York"), ), - rx.chakra.tr( # type: ignore - rx.chakra.td("Jane"), - rx.chakra.td(31), - rx.chakra.td("San Francisco"), + rc.tr( # type: ignore + rc.td("Jane"), + rc.td(31), + rc.td("San Francisco"), ), - rx.chakra.tr( # type: ignore - rx.chakra.td("Joe"), - rx.chakra.td(32), - rx.chakra.td("Los Angeles"), + rc.tr( # type: ignore + rc.td("Joe"), + rc.td(32), + rc.td("Los Angeles"), ), ), - rx.chakra.tfoot( # type: ignore - rx.chakra.tr( - rx.chakra.td("footer1"), - rx.chakra.td("footer2"), - rx.chakra.td("footer3"), + rc.tfoot( # type: ignore + rc.tr( + rc.td("footer1"), + rc.td("footer2"), + rc.td("footer3"), ) # type: ignore ), - rx.chakra.table_caption("random caption"), + rc.table_caption("random caption"), variant="striped", color_scheme="teal", ) diff --git a/integration/test_tailwind.py b/integration/test_tailwind.py index c7320cb219..491eba5386 100644 --- a/integration/test_tailwind.py +++ b/integration/test_tailwind.py @@ -27,6 +27,8 @@ def TailwindApp( """ from pathlib import Path + import reflex_chakra as rc + import reflex as rx class UnusedState(rx.State): @@ -34,7 +36,7 @@ class UnusedState(rx.State): def index(): return rx.el.div( - rx.chakra.text(paragraph_text, class_name=paragraph_class_name), + rc.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 77199ca4ed..1f8b39efc7 100644 --- a/integration/test_upload.py +++ b/integration/test_upload.py @@ -16,6 +16,8 @@ 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): @@ -44,7 +46,7 @@ def chain_event(self): def index(): return rx.vstack( - rx.chakra.input( + rc.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 5cf644ca23..e88449b69a 100644 --- a/integration/test_var_operations.py +++ b/integration/test_var_operations.py @@ -14,6 +14,8 @@ def VarOperations(): """App with var operations.""" from typing import Dict, List + import reflex_chakra as rc + import reflex as rx class VarOperationState(rx.State): @@ -543,7 +545,7 @@ def index(): VarOperationState.html_str, id="html_str", ), - rx.chakra.highlight( + rc.highlight( "second", query=[VarOperationState.str_var2], ), diff --git a/poetry.lock b/poetry.lock index 3c2def5b78..22f455f244 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,9 +1,10 @@ -# 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.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 = "23.2.0" description = "Classes Without Boilerplate" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -102,6 +108,7 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p 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.1" 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.6.2" 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.16.0" description = "Foreign Function Interface for Python calling C code." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -228,6 +239,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 = [ @@ -239,6 +251,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 = [ @@ -338,6 +351,7 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -352,6 +366,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 = [ @@ -363,6 +378,7 @@ files = [ name = "coverage" version = "7.5.4" description = "Code coverage measurement for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -430,6 +446,7 @@ toml = ["tomli"] name = "cryptography" version = "42.0.8" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -484,6 +501,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 = [ @@ -495,6 +513,7 @@ files = [ name = "dill" version = "0.3.8" description = "serialize all of Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -510,6 +529,7 @@ profile = ["gprof2dot (>=2022.7.29)"] name = "distlib" version = "0.3.8" description = "Distribution utilities" +category = "dev" optional = false python-versions = "*" files = [ @@ -521,6 +541,7 @@ files = [ name = "distro" version = "1.9.0" description = "Distro - an OS platform information API" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -532,14 +553,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.1" description = "Backport of PEP 654 (exception groups)" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -554,6 +580,7 @@ test = ["pytest (>=6)"] name = "fastapi" version = "0.110.3" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -573,6 +600,7 @@ all = ["email_validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)" name = "filelock" version = "3.15.4" description = "A platform independent file lock." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -589,6 +617,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 = [ @@ -660,6 +689,7 @@ test = ["objgraph", "psutil"] name = "gunicorn" version = "22.0.0" description = "WSGI HTTP Server for UNIX" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -681,6 +711,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 = [ @@ -692,6 +723,7 @@ files = [ name = "httpcore" version = "1.0.5" description = "A minimal low-level HTTP client." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -706,13 +738,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.0" description = "The next generation HTTP client." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -723,20 +756,21 @@ 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)"] [[package]] name = "identify" version = "2.5.36" description = "File identification library for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -751,6 +785,7 @@ license = ["ukkonen"] name = "idna" version = "3.7" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -762,6 +797,7 @@ files = [ name = "importlib-metadata" version = "8.0.0" description = "Read metadata from Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -781,6 +817,7 @@ test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "p name = "importlib-resources" version = "6.4.0" description = "Read resources from Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -799,6 +836,7 @@ testing = ["jaraco.test (>=5.4)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "p name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -810,6 +848,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 = [ @@ -828,6 +867,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-ena name = "jaraco-context" version = "5.3.0" description = "Useful decorators and context managers" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -846,6 +886,7 @@ testing = ["portend", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytes name = "jaraco-functools" version = "4.0.1" description = "Functools like those found in stdlib" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -864,6 +905,7 @@ testing = ["jaraco.classes", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest name = "jeepney" version = "0.8.0" description = "Low-level, pure Python DBus protocol wrapper." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -879,6 +921,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 = [ @@ -896,6 +939,7 @@ i18n = ["Babel (>=2.7)"] name = "keyring" version = "25.2.1" description = "Store and access your passwords safely." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -922,6 +966,7 @@ testing = ["pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "py 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 = [ @@ -941,6 +986,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 = [ @@ -960,6 +1006,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 = [ @@ -984,6 +1031,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 = [ @@ -1053,6 +1101,7 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1064,6 +1113,7 @@ files = [ name = "more-itertools" version = "10.3.0" description = "More routines for operating on iterables, beyond itertools" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1075,6 +1125,7 @@ files = [ name = "nh3" version = "0.2.17" description = "Python bindings to the ammonia HTML sanitization library." +category = "main" optional = false python-versions = "*" files = [ @@ -1100,6 +1151,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 = [ @@ -1111,6 +1163,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 = [ @@ -1148,6 +1201,7 @@ files = [ name = "numpy" version = "2.0.0" description = "Fundamental package for array computing in Python" +category = "dev" optional = false python-versions = ">=3.9" files = [ @@ -1202,6 +1256,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 = [ @@ -1216,6 +1271,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 = [ @@ -1227,6 +1283,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 = [ @@ -1271,6 +1328,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 = [ @@ -1344,6 +1402,7 @@ xml = ["lxml (>=4.9.2)"] name = "pillow" version = "10.3.0" description = "Python Imaging Library (Fork)" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1430,6 +1489,7 @@ xmp = ["defusedxml"] name = "pip" version = "24.1.1" description = "The PyPA recommended tool for installing Python packages." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1441,6 +1501,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 = [ @@ -1459,6 +1520,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 = [ @@ -1473,6 +1535,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 = [ @@ -1489,6 +1552,7 @@ type = ["mypy (>=1.8)"] name = "plotly" version = "5.22.0" description = "An open-source, interactive data visualization library for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1504,6 +1568,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 = [ @@ -1519,6 +1584,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 = [ @@ -1537,6 +1603,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 = [ @@ -1566,6 +1633,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 = [ @@ -1577,6 +1645,7 @@ files = [ name = "pycparser" version = "2.22" description = "C parser in Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1588,6 +1657,7 @@ files = [ name = "pydantic" version = "2.7.4" description = "Data validation using Python type hints" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1607,6 +1677,7 @@ email = ["email-validator (>=2.0.0)"] name = "pydantic-core" version = "2.18.4" description = "Core functionality for Pydantic validation and serialization" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1698,6 +1769,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 = [ @@ -1712,6 +1784,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 = [ @@ -1723,6 +1796,7 @@ files = [ name = "pyright" version = "1.1.334" description = "Command line wrapper for pyright" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1741,6 +1815,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 = [ @@ -1753,6 +1828,7 @@ files = [ name = "pytest" version = "7.4.4" description = "pytest: simple powerful testing with Python" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1775,6 +1851,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 = [ @@ -1793,6 +1870,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 = [ @@ -1813,6 +1891,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 = [ @@ -1831,6 +1910,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 = [ @@ -1848,6 +1928,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 = [ @@ -1862,6 +1943,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 = [ @@ -1881,6 +1963,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 = [ @@ -1895,6 +1978,7 @@ dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatc name = "python-socketio" version = "5.11.3" description = "Socket.IO server and client for Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1915,6 +1999,7 @@ docs = ["sphinx"] name = "pytz" version = "2024.1" description = "World timezone definitions, modern and historical" +category = "dev" optional = false python-versions = "*" files = [ @@ -1926,6 +2011,7 @@ files = [ name = "pywin32-ctypes" version = "0.2.2" description = "A (partial) reimplementation of pywin32 using ctypes/cffi" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1937,6 +2023,7 @@ files = [ name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1986,6 +2073,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 = [ @@ -2005,6 +2093,7 @@ md = ["cmarkgfm (>=0.8.0)"] name = "redis" version = "5.0.7" description = "Python client for Redis database and key-value store" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2019,10 +2108,26 @@ async-timeout = {version = ">=4.0.3", markers = "python_full_version < \"3.11.3\ hiredis = ["hiredis (>=1.0.0)"] ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] +[[package]] +name = "reflex-chakra" +version = "0.1.1a1" +description = "reflex using chakra components" +category = "main" +optional = false +python-versions = "<4.0,>=3.8" +files = [ + {file = "reflex_chakra-0.1.1a1-py3-none-any.whl", hash = "sha256:e27a3ffb171802a5309a4a7215e7f894810a4a8f0753e2779b5a7010ef36173c"}, + {file = "reflex_chakra-0.1.1a1.tar.gz", hash = "sha256:f224d42255fde675a65a622cdb19bff0e073edafe94b15019bfd8b21a461801c"}, +] + +[package.dependencies] +reflex = ">=0.5.9" + [[package]] name = "reflex-hosting-cli" version = "0.1.13" description = "Reflex Hosting CLI" +category = "main" optional = false python-versions = "<4.0,>=3.8" files = [ @@ -2046,6 +2151,7 @@ websockets = ">=10.4" name = "requests" version = "2.32.3" description = "Python HTTP for Humans." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2067,6 +2173,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 = [ @@ -2081,6 +2188,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 = [ @@ -2095,6 +2203,7 @@ idna2008 = ["idna"] name = "rich" version = "13.7.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 = [ @@ -2114,6 +2223,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 = [ @@ -2140,6 +2250,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 = [ @@ -2155,6 +2266,7 @@ jeepney = ">=0.6" name = "selenium" version = "4.22.0" description = "Official Python bindings for Selenium WebDriver" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2174,6 +2286,7 @@ websocket-client = ">=1.8.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 = [ @@ -2189,6 +2302,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 = [ @@ -2200,6 +2314,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 = [ @@ -2217,6 +2332,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 = [ @@ -2228,6 +2344,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 = [ @@ -2239,6 +2356,7 @@ files = [ name = "sortedcontainers" version = "2.4.0" description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" +category = "dev" optional = false python-versions = "*" files = [ @@ -2250,6 +2368,7 @@ files = [ name = "sqlalchemy" version = "2.0.31" description = "Database Abstraction Library" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2305,7 +2424,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] @@ -2337,6 +2456,7 @@ sqlcipher = ["sqlcipher3_binary"] name = "sqlmodel" version = "0.0.19" description = "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2352,6 +2472,7 @@ SQLAlchemy = ">=2.0.14,<2.1.0" name = "starlette" version = "0.37.2" description = "The little ASGI library that shines." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2370,6 +2491,7 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7 name = "starlette-admin" version = "0.14.0" description = "Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2393,6 +2515,7 @@ test = ["aiomysql (>=0.1.1,<0.3.0)", "aiosqlite (>=0.17.0,<0.20.0)", "arrow (>=1 name = "tabulate" version = "0.9.0" description = "Pretty-print tabular data" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2407,6 +2530,7 @@ widechars = ["wcwidth"] name = "tenacity" version = "8.4.2" description = "Retry code until it succeeds" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2422,6 +2546,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 = [ @@ -2433,6 +2558,7 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2444,6 +2570,7 @@ files = [ name = "tomlkit" version = "0.12.5" description = "Style preserving TOML library" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2455,6 +2582,7 @@ files = [ name = "trio" version = "0.25.1" description = "A friendly Python library for async concurrency and I/O" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2475,6 +2603,7 @@ sortedcontainers = "*" name = "trio-websocket" version = "0.11.1" description = "WebSocket library for Trio" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -2491,6 +2620,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 = [ @@ -2513,6 +2643,7 @@ urllib3 = ">=1.26.0" name = "typer" version = "0.12.3" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -2530,6 +2661,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 = [ @@ -2541,6 +2673,7 @@ files = [ name = "tzdata" version = "2024.1" description = "Provider of IANA time zone data" +category = "dev" optional = false python-versions = ">=2" files = [ @@ -2552,6 +2685,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 = [ @@ -2572,6 +2706,7 @@ zstd = ["zstandard (>=0.18.0)"] name = "uvicorn" version = "0.30.1" description = "The lightning-fast ASGI server." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2591,6 +2726,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 = [ @@ -2611,6 +2747,7 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess name = "watchdog" version = "4.0.1" description = "Filesystem events monitoring" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2655,6 +2792,7 @@ watchmedo = ["PyYAML (>=3.10)"] name = "watchfiles" version = "0.22.0" description = "Simple, modern and high performance file watching and code reload in python." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2742,6 +2880,7 @@ anyio = ">=3.0.0" 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 = [ @@ -2758,6 +2897,7 @@ test = ["websockets"] name = "websockets" version = "12.0" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2839,6 +2979,7 @@ files = [ name = "wheel" version = "0.43.0" description = "A built-package format for Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2853,6 +2994,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 = [ @@ -2932,6 +3074,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 = [ @@ -2946,6 +3089,7 @@ h11 = ">=0.9.0,<1" name = "zipp" version = "3.19.2" description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2960,4 +3104,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "c17ccb320267b8b3a56c698bd07c2b02dda13824d4bf4b1657de752ad361e643" +content-hash = "6ccb5032cfabd61c45fd11151c91adfb3e4aae7260fadc7184248e65207d27f0" diff --git a/pyproject.toml b/pyproject.toml index 656ff091a3..111c5c1913 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,6 +61,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.1.1a1" [tool.poetry.group.dev.dependencies] pytest = ">=7.1.2,<8.0" diff --git a/reflex/__init__.py b/reflex/__init__.py index faf3e087eb..a4f6dad333 100644 --- a/reflex/__init__.py +++ b/reflex/__init__.py @@ -270,7 +270,7 @@ "EditorButtonList", "EditorOptions", ], - "components": ["el", "chakra", "radix", "lucide", "recharts", "next"], + "components": ["el", "radix", "lucide", "recharts", "next"], "components.markdown": ["markdown"], **RADIX_MAPPING, "components.plotly": ["plotly"], @@ -342,8 +342,27 @@ "compiler", } _SUBMOD_ATTRS: dict = _MAPPING -__getattr__, __dir__, __all__ = lazy_loader.attach( +getattr, __dir__, __all__ = lazy_loader.attach( __name__, submodules=_SUBMODULES, submod_attrs=_SUBMOD_ATTRS, ) + + +def __getattr__(name): + if name == "chakra": + from reflex.utils import console + + console.deprecate( + "rx.chakra", + reason="and moved to a separate package. " + "To continue using Chakra UI components, install the `reflex-chakra` package via `pip install " + "reflex-chakra`.", + deprecation_version="0.6.0", + removal_version="0.7.0", + dedupe=True, + ) + import reflex_chakra as rc + + return rc + return getattr(name) diff --git a/reflex/__init__.pyi b/reflex/__init__.pyi index 8fe42cfb3e..2c89545db3 100644 --- a/reflex/__init__.pyi +++ b/reflex/__init__.pyi @@ -21,7 +21,6 @@ from .admin import AdminDash as AdminDash from .app import App as App from .app import UploadFile as UploadFile from .base import Base as Base -from .components import chakra as chakra from .components import el as el from .components import lucide as lucide from .components import next as next diff --git a/reflex/components/__init__.py b/reflex/components/__init__.py index a1fd95f450..250df4e712 100644 --- a/reflex/components/__init__.py +++ b/reflex/components/__init__.py @@ -16,7 +16,6 @@ "react_player", "sonner", "suneditor", - "chakra", "el", "base", "recharts", diff --git a/reflex/components/__init__.pyi b/reflex/components/__init__.pyi index eb858f5128..781e75eb0a 100644 --- a/reflex/components/__init__.pyi +++ b/reflex/components/__init__.pyi @@ -4,7 +4,6 @@ # ------------------------------------------------------ from . import base as base -from . import chakra as chakra from . import core as core from . import datadisplay as datadisplay from . import el as el diff --git a/reflex/components/chakra/__init__.py b/reflex/components/chakra/__init__.py deleted file mode 100644 index ea0976f8c8..0000000000 --- a/reflex/components/chakra/__init__.py +++ /dev/null @@ -1,204 +0,0 @@ -"""Chakra components.""" - -from .base import * -from .datadisplay import * -from .disclosure import * -from .feedback import * -from .forms import * -from .layout import * -from .media import * -from .navigation import * -from .overlay import * -from .typography import * - -accordion = Accordion.create -accordion_button = AccordionButton.create -accordion_icon = AccordionIcon.create -accordion_item = AccordionItem.create -accordion_panel = AccordionPanel.create -alert = Alert.create -alert_description = AlertDescription.create -alert_dialog = AlertDialog.create -alert_dialog_body = AlertDialogBody.create -alert_dialog_content = AlertDialogContent.create -alert_dialog_footer = AlertDialogFooter.create -alert_dialog_header = AlertDialogHeader.create -alert_dialog_overlay = AlertDialogOverlay.create -alert_icon = AlertIcon.create -alert_title = AlertTitle.create -aspect_ratio = AspectRatio.create -avatar = Avatar.create -avatar_badge = AvatarBadge.create -avatar_group = AvatarGroup.create -badge = Badge.create -box = Box.create -breadcrumb = Breadcrumb.create -breadcrumb_item = BreadcrumbItem.create -breadcrumb_link = BreadcrumbLink.create -breadcrumb_separator = BreadcrumbSeparator.create -button = Button.create -button_group = ButtonGroup.create -card = Card.create -card_body = CardBody.create -card_footer = CardFooter.create -card_header = CardHeader.create -center = Center.create -checkbox = Checkbox.create -checkbox_group = CheckboxGroup.create -circle = Circle.create -circular_progress = CircularProgress.create -circular_progress_label = CircularProgressLabel.create -code = Code.create -collapse = Collapse.create -color_mode_button = ColorModeButton.create -color_mode_icon = ColorModeIcon.create -color_mode_switch = ColorModeSwitch.create -component = Component.create -container = Container.create -date_picker = DatePicker.create -date_time_picker = DateTimePicker.create -divider = Divider.create -drawer = Drawer.create -drawer_body = DrawerBody.create -drawer_close_button = DrawerCloseButton.create -drawer_content = DrawerContent.create -drawer_footer = DrawerFooter.create -drawer_header = DrawerHeader.create -drawer_overlay = DrawerOverlay.create -editable = Editable.create -editable_input = EditableInput.create -editable_preview = EditablePreview.create -editable_textarea = EditableTextarea.create -email = Email.create -fade = Fade.create -flex = Flex.create -form = Form.create -form_control = FormControl.create -form_error_message = FormErrorMessage.create -form_helper_text = FormHelperText.create -form_label = FormLabel.create -grid = Grid.create -grid_item = GridItem.create -heading = Heading.create -highlight = Highlight.create -hstack = Hstack.create -icon = Icon.create -icon_button = IconButton.create -image = Image.create -input = Input.create -input_group = InputGroup.create -input_left_addon = InputLeftAddon.create -input_left_element = InputLeftElement.create -input_right_addon = InputRightAddon.create -input_right_element = InputRightElement.create -kbd = Kbd.create -link = Link.create -link_box = LinkBox.create -link_overlay = LinkOverlay.create -list = List.create -list_item = ListItem.create -menu = Menu.create -menu_button = MenuButton.create -menu_divider = MenuDivider.create -menu_group = MenuGroup.create -menu_item = MenuItem.create -menu_item_option = MenuItemOption.create -menu_list = MenuList.create -menu_option_group = MenuOptionGroup.create -modal = Modal.create -modal_body = ModalBody.create -modal_close_button = ModalCloseButton.create -modal_content = ModalContent.create -modal_footer = ModalFooter.create -modal_header = ModalHeader.create -modal_overlay = ModalOverlay.create -multi_select = MultiSelect.create -multi_select_option = MultiSelectOption -number_decrement_stepper = NumberDecrementStepper.create -number_increment_stepper = NumberIncrementStepper.create -number_input = NumberInput.create -number_input_field = NumberInputField.create -number_input_stepper = NumberInputStepper.create -option = Option.create -ordered_list = OrderedList.create -password = Password.create -pin_input = PinInput.create -pin_input_field = PinInputField.create -popover = Popover.create -popover_anchor = PopoverAnchor.create -popover_arrow = PopoverArrow.create -popover_body = PopoverBody.create -popover_close_button = PopoverCloseButton.create -popover_content = PopoverContent.create -popover_footer = PopoverFooter.create -popover_header = PopoverHeader.create -popover_trigger = PopoverTrigger.create -progress = Progress.create -radio = Radio.create -radio_group = RadioGroup.create -range_slider = RangeSlider.create -range_slider_filled_track = RangeSliderFilledTrack.create -range_slider_thumb = RangeSliderThumb.create -range_slider_track = RangeSliderTrack.create -responsive_grid = ResponsiveGrid.create -scale_fade = ScaleFade.create -select = Select.create -skeleton = Skeleton.create -skeleton_circle = SkeletonCircle.create -skeleton_text = SkeletonText.create -slide = Slide.create -slide_fade = SlideFade.create -slider = Slider.create -slider_filled_track = SliderFilledTrack.create -slider_mark = SliderMark.create -slider_thumb = SliderThumb.create -slider_track = SliderTrack.create -spacer = Spacer.create -span = Span.create -spinner = Spinner.create -square = Square.create -stack = Stack.create -stat = Stat.create -stat_arrow = StatArrow.create -stat_group = StatGroup.create -stat_help_text = StatHelpText.create -stat_label = StatLabel.create -stat_number = StatNumber.create -step = Step.create -step_description = StepDescription.create -step_icon = StepIcon.create -step_indicator = StepIndicator.create -step_number = StepNumber.create -step_separator = StepSeparator.create -step_status = StepStatus.create -step_title = StepTitle.create -stepper = Stepper.create -switch = Switch.create -tab = Tab.create -tab_list = TabList.create -tab_panel = TabPanel.create -tab_panels = TabPanels.create -table = Table.create -table_caption = TableCaption.create -table_container = TableContainer.create -tabs = Tabs.create -tag = Tag.create -tag_close_button = TagCloseButton.create -tag_label = TagLabel.create -tag_left_icon = TagLeftIcon.create -tag_right_icon = TagRightIcon.create -tbody = Tbody.create -td = Td.create -text = Text.create -text_area = TextArea.create -tfoot = Tfoot.create -th = Th.create -thead = Thead.create -time_picker = TimePicker.create -tooltip = Tooltip.create -tr = Tr.create -unordered_list = UnorderedList.create -visually_hidden = VisuallyHidden.create -vstack = Vstack.create -wrap = Wrap.create -wrap_item = WrapItem.create diff --git a/reflex/components/chakra/base.py b/reflex/components/chakra/base.py deleted file mode 100644 index 0b6b97b618..0000000000 --- a/reflex/components/chakra/base.py +++ /dev/null @@ -1,210 +0,0 @@ -"""Components that are based on Chakra-UI.""" - -from __future__ import annotations - -from functools import lru_cache -from typing import List, Literal - -from reflex.components.component import Component -from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars import Var - - -class ChakraComponent(Component): - """A component that wraps a Chakra component.""" - - library: str = "@chakra-ui/react@2.6.1" # type: ignore - lib_dependencies: List[str] = [ - "@chakra-ui/system@2.5.7", - "framer-motion@10.16.4", - ] - - @staticmethod - @lru_cache(maxsize=None) - def _get_app_wrap_components() -> dict[tuple[int, str], Component]: - return { - (60, "ChakraProvider"): chakra_provider, - } - - def _get_style(self) -> dict: - """Get the style for the component. - - Returns: - The dictionary of the component style as value and the style notation as key. - """ - return {"sx": self.style} - - @classmethod - @lru_cache(maxsize=None) - def _get_dependencies_imports(cls) -> ImportDict: - """Get the imports from lib_dependencies for installing. - - Returns: - The dependencies imports of the component. - """ - return { - dep: [ImportVar(tag=None, render=False)] - for dep in [ - "@chakra-ui/system@2.5.7", - "framer-motion@10.16.4", - ] - } - - -class ChakraProvider(ChakraComponent): - """Top level Chakra provider must be included in any app using chakra components.""" - - tag = "ChakraProvider" - - theme: Var[str] - - @classmethod - def create(cls) -> Component: - """Create a new ChakraProvider component. - - Returns: - A new ChakraProvider component. - """ - return super().create( - theme=Var.create( - "extendTheme(theme)", _var_is_local=False, _var_is_string=False - ), - ) - - def add_imports(self) -> ImportDict: - """Add imports for the ChakraProvider component. - - Returns: - The import dict for the component. - """ - return { - self.library: ImportVar(tag="extendTheme", is_default=False), - "/utils/theme.js": ImportVar(tag="theme", is_default=True), - } - - @staticmethod - @lru_cache(maxsize=None) - def _get_app_wrap_components() -> dict[tuple[int, str], Component]: - return { - (50, "ChakraColorModeProvider"): chakra_color_mode_provider, - } - - -chakra_provider = ChakraProvider.create() - - -class ChakraColorModeProvider(Component): - """Next-themes integration for chakra colorModeProvider.""" - - library = "/components/reflex/chakra_color_mode_provider.js" - tag = "ChakraColorModeProvider" - is_default = True - - -chakra_color_mode_provider = ChakraColorModeProvider.create() - - -LiteralColorScheme = Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", -] - - -LiteralVariant = Literal["solid", "subtle", "outline"] -LiteralDividerVariant = Literal["solid", "dashed"] -LiteralTheme = Literal["light", "dark"] - - -LiteralTagColorScheme = Literal[ - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", -] -LiteralTagAlign = Literal["center", "end", "start"] -LiteralTabsVariant = Literal[ - "line", - "enclosed", - "enclosed-colored", - "soft-rounded", - "solid-rounded", - "unstyled", -] - -LiteralStatus = Literal["success", "info", "warning", "error"] -LiteralAlertVariant = Literal["subtle", "left-accent", "top-accent", "solid"] -LiteralButtonVariant = Literal["ghost", "outline", "solid", "link", "unstyled"] -LiteralSpinnerPlacement = Literal["start", "end"] -LiteralLanguage = Literal[ - "en", - "da", - "de", - "es", - "fr", - "ja", - "ko", - "pt_br", - "ru", - "zh_cn", - "ro", - "pl", - "ckb", - "lv", - "se", - "ua", - "he", - "it", -] -LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"] -LiteralInputNumberMode = [ - "text", - "search", - "none", - "tel", - "url", - "email", - "numeric", - "decimal", -] -LiteralChakraDirection = Literal["ltr", "rtl"] -LiteralCardVariant = Literal["outline", "filled", "elevated", "unstyled"] -LiteralStackDirection = Literal["row", "column"] -LiteralImageLoading = Literal["eager", "lazy"] -LiteralTagSize = Literal["sm", "md", "lg"] -LiteralSpinnerSize = Literal[Literal[LiteralTagSize], "xs", "xl"] -LiteralAvatarSize = Literal[Literal[LiteralTagSize], "xl", "xs", "2xl", "full", "2xs"] -LiteralButtonSize = Literal["sm", "md", "lg", "xs"] -# Applies to AlertDialog and Modal -LiteralAlertDialogSize = Literal[ - "sm", "md", "lg", "xs", "2xl", "full", "3xl", "4xl", "5xl", "6xl" -] -LiteralDrawerSize = Literal[Literal[LiteralSpinnerSize], "xl", "full"] - -LiteralMenuStrategy = Literal["fixed", "absolute"] -LiteralMenuOption = Literal["checkbox", "radio"] -LiteralPopOverTrigger = Literal["click", "hover"] - -LiteralHeadingSize = Literal["lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl"] diff --git a/reflex/components/chakra/base.pyi b/reflex/components/chakra/base.pyi deleted file mode 100644 index 46ab1a0dbb..0000000000 --- a/reflex/components/chakra/base.pyi +++ /dev/null @@ -1,319 +0,0 @@ -"""Stub file for reflex/components/chakra/base.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.utils.imports import ImportDict -from reflex.vars import BaseVar, Var - -class ChakraComponent(Component): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ChakraComponent": - """Create the component. - - Args: - *children: The children of the component. - 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 ChakraProvider(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - theme: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ChakraProvider": - """Create a new ChakraProvider component. - - Returns: - A new ChakraProvider component. - """ - ... - - def add_imports(self) -> ImportDict: ... - -chakra_provider = ChakraProvider.create() - -class ChakraColorModeProvider(Component): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ChakraColorModeProvider": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... - -chakra_color_mode_provider = ChakraColorModeProvider.create() -LiteralColorScheme = Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", -] -LiteralVariant = Literal["solid", "subtle", "outline"] -LiteralDividerVariant = Literal["solid", "dashed"] -LiteralTheme = Literal["light", "dark"] -LiteralTagColorScheme = Literal[ - "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink" -] -LiteralTagAlign = Literal["center", "end", "start"] -LiteralTabsVariant = Literal[ - "line", "enclosed", "enclosed-colored", "soft-rounded", "solid-rounded", "unstyled" -] -LiteralStatus = Literal["success", "info", "warning", "error"] -LiteralAlertVariant = Literal["subtle", "left-accent", "top-accent", "solid"] -LiteralButtonVariant = Literal["ghost", "outline", "solid", "link", "unstyled"] -LiteralSpinnerPlacement = Literal["start", "end"] -LiteralLanguage = Literal[ - "en", - "da", - "de", - "es", - "fr", - "ja", - "ko", - "pt_br", - "ru", - "zh_cn", - "ro", - "pl", - "ckb", - "lv", - "se", - "ua", - "he", - "it", -] -LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"] -LiteralInputNumberMode = [ - "text", - "search", - "none", - "tel", - "url", - "email", - "numeric", - "decimal", -] -LiteralChakraDirection = Literal["ltr", "rtl"] -LiteralCardVariant = Literal["outline", "filled", "elevated", "unstyled"] -LiteralStackDirection = Literal["row", "column"] -LiteralImageLoading = Literal["eager", "lazy"] -LiteralTagSize = Literal["sm", "md", "lg"] -LiteralSpinnerSize = Literal[Literal[LiteralTagSize], "xs", "xl"] -LiteralAvatarSize = Literal[Literal[LiteralTagSize], "xl", "xs", "2xl", "full", "2xs"] -LiteralButtonSize = Literal["sm", "md", "lg", "xs"] -LiteralAlertDialogSize = Literal[ - "sm", "md", "lg", "xs", "2xl", "full", "3xl", "4xl", "5xl", "6xl" -] -LiteralDrawerSize = Literal[Literal[LiteralSpinnerSize], "xl", "full"] -LiteralMenuStrategy = Literal["fixed", "absolute"] -LiteralMenuOption = Literal["checkbox", "radio"] -LiteralPopOverTrigger = Literal["click", "hover"] -LiteralHeadingSize = Literal["lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl"] diff --git a/reflex/components/chakra/datadisplay/__init__.py b/reflex/components/chakra/datadisplay/__init__.py deleted file mode 100644 index b20d17248d..0000000000 --- a/reflex/components/chakra/datadisplay/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Data display components.""" - -from .badge import Badge -from .code import Code -from .divider import Divider -from .keyboard_key import KeyboardKey as Kbd -from .list import List, ListItem, OrderedList, UnorderedList -from .stat import Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber -from .table import Table, TableCaption, TableContainer, Tbody, Td, Tfoot, Th, Thead, Tr -from .tag import Tag, TagCloseButton, TagLabel, TagLeftIcon, TagRightIcon diff --git a/reflex/components/chakra/datadisplay/badge.py b/reflex/components/chakra/datadisplay/badge.py deleted file mode 100644 index 52d36fe7c1..0000000000 --- a/reflex/components/chakra/datadisplay/badge.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Badge component.""" - -from reflex.components.chakra import ChakraComponent, LiteralVariant -from reflex.vars import Var - - -class Badge(ChakraComponent): - """A badge component.""" - - tag = "Badge" - - # Variant of the badge ("solid" | "subtle" | "outline") - variant: Var[LiteralVariant] - - # The color of the badge - color_scheme: Var[str] diff --git a/reflex/components/chakra/datadisplay/badge.pyi b/reflex/components/chakra/datadisplay/badge.pyi deleted file mode 100644 index d3d821a30f..0000000000 --- a/reflex/components/chakra/datadisplay/badge.pyi +++ /dev/null @@ -1,96 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/badge.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Badge(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - variant: Optional[ - Union[ - Var[Literal["solid", "subtle", "outline"]], - Literal["solid", "subtle", "outline"], - ] - ] = None, - color_scheme: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Badge": - """Create the component. - - Args: - *children: The children of the component. - variant: Variant of the badge ("solid" | "subtle" | "outline") - color_scheme: The color of the badge - 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. - """ - ... diff --git a/reflex/components/chakra/datadisplay/code.py b/reflex/components/chakra/datadisplay/code.py deleted file mode 100644 index ad85327bfb..0000000000 --- a/reflex/components/chakra/datadisplay/code.py +++ /dev/null @@ -1,11 +0,0 @@ -"""A code component.""" - -from reflex.components.chakra import ( - ChakraComponent, -) - - -class Code(ChakraComponent): - """Used to display inline code.""" - - tag = "Code" diff --git a/reflex/components/chakra/datadisplay/code.pyi b/reflex/components/chakra/datadisplay/code.pyi deleted file mode 100644 index 7866e92d73..0000000000 --- a/reflex/components/chakra/datadisplay/code.pyi +++ /dev/null @@ -1,87 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/code.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Code(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Code": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/datadisplay/divider.py b/reflex/components/chakra/datadisplay/divider.py deleted file mode 100644 index 9333be49a7..0000000000 --- a/reflex/components/chakra/datadisplay/divider.py +++ /dev/null @@ -1,20 +0,0 @@ -"""A line to divide parts of the layout.""" - -from typing import Literal - -from reflex.components.chakra import ChakraComponent, LiteralDividerVariant -from reflex.vars import Var - -LiteralLayout = Literal["horizontal", "vertical"] - - -class Divider(ChakraComponent): - """Dividers are used to visually separate content in a list or group.""" - - tag = "Divider" - - # Pass the orientation prop and set it to either horizontal or vertical. If the vertical orientation is used, make sure that the parent element is assigned a height. - orientation: Var[LiteralLayout] - - # Variant of the divider ("solid" | "dashed") - variant: Var[LiteralDividerVariant] diff --git a/reflex/components/chakra/datadisplay/divider.pyi b/reflex/components/chakra/datadisplay/divider.pyi deleted file mode 100644 index 0b04398339..0000000000 --- a/reflex/components/chakra/datadisplay/divider.pyi +++ /dev/null @@ -1,100 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/divider.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -LiteralLayout = Literal["horizontal", "vertical"] - -class Divider(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - orientation: Optional[ - Union[ - Var[Literal["horizontal", "vertical"]], - Literal["horizontal", "vertical"], - ] - ] = None, - variant: Optional[ - Union[Var[Literal["solid", "dashed"]], Literal["solid", "dashed"]] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Divider": - """Create the component. - - Args: - *children: The children of the component. - orientation: Pass the orientation prop and set it to either horizontal or vertical. If the vertical orientation is used, make sure that the parent element is assigned a height. - variant: Variant of the divider ("solid" | "dashed") - 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. - """ - ... diff --git a/reflex/components/chakra/datadisplay/keyboard_key.py b/reflex/components/chakra/datadisplay/keyboard_key.py deleted file mode 100644 index f9068284d5..0000000000 --- a/reflex/components/chakra/datadisplay/keyboard_key.py +++ /dev/null @@ -1,9 +0,0 @@ -"""A Keyboard Key Component.""" - -from reflex.components.chakra import ChakraComponent - - -class KeyboardKey(ChakraComponent): - """Display a keyboard key text.""" - - tag = "Kbd" diff --git a/reflex/components/chakra/datadisplay/keyboard_key.pyi b/reflex/components/chakra/datadisplay/keyboard_key.pyi deleted file mode 100644 index 000fb8fb8a..0000000000 --- a/reflex/components/chakra/datadisplay/keyboard_key.pyi +++ /dev/null @@ -1,87 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/keyboard_key.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class KeyboardKey(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "KeyboardKey": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/datadisplay/list.py b/reflex/components/chakra/datadisplay/list.py deleted file mode 100644 index 0bfe155fa2..0000000000 --- a/reflex/components/chakra/datadisplay/list.py +++ /dev/null @@ -1,60 +0,0 @@ -"""List components.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.components.core.foreach import Foreach -from reflex.vars import Var - - -class List(ChakraComponent): - """Display a list of items.""" - - tag = "List" - - # The space between each list item - spacing: Var[str] - - # Shorthand prop for listStylePosition - style_position: Var[str] - - # Shorthand prop for listStyleType - style_type: Var[str] - - @classmethod - def create(cls, *children, items: Var[list] | None = None, **props) -> Component: - """Create a list component. - - Args: - *children: The children of the component. - items: A list of items to add to the list. - **props: The properties of the component. - - Returns: - The list component. - """ - if len(children) == 0: - if isinstance(items, Var): - children = [Foreach.create(items, ListItem.create)] - else: - children = [ListItem.create(item) for item in items or []] - return super().create(*children, **props) - - -class ListItem(ChakraComponent): - """A single list item.""" - - tag = "ListItem" - - -class OrderedList(List): - """An ordered list component with numbers.""" - - tag = "OrderedList" - - -class UnorderedList(List): - """An unordered list component with bullets.""" - - tag = "UnorderedList" diff --git a/reflex/components/chakra/datadisplay/list.pyi b/reflex/components/chakra/datadisplay/list.pyi deleted file mode 100644 index e266791fa8..0000000000 --- a/reflex/components/chakra/datadisplay/list.pyi +++ /dev/null @@ -1,339 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/list.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class List(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items: Optional[Union[Var[list], list]] = None, - spacing: Optional[Union[Var[str], str]] = None, - style_position: Optional[Union[Var[str], str]] = None, - style_type: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "List": - """Create a list component. - - Args: - *children: The children of the component. - items: A list of items to add to the list. - spacing: The space between each list item - style_position: Shorthand prop for listStylePosition - style_type: Shorthand prop for listStyleType - 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 properties of the component. - - Returns: - The list component. - """ - ... - -class ListItem(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ListItem": - """Create the component. - - Args: - *children: The children of the component. - 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 OrderedList(List): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items: Optional[Union[Var[list], list]] = None, - spacing: Optional[Union[Var[str], str]] = None, - style_position: Optional[Union[Var[str], str]] = None, - style_type: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "OrderedList": - """Create a list component. - - Args: - *children: The children of the component. - items: A list of items to add to the list. - spacing: The space between each list item - style_position: Shorthand prop for listStylePosition - style_type: Shorthand prop for listStyleType - 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 properties of the component. - - Returns: - The list component. - """ - ... - -class UnorderedList(List): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items: Optional[Union[Var[list], list]] = None, - spacing: Optional[Union[Var[str], str]] = None, - style_position: Optional[Union[Var[str], str]] = None, - style_type: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "UnorderedList": - """Create a list component. - - Args: - *children: The children of the component. - items: A list of items to add to the list. - spacing: The space between each list item - style_position: Shorthand prop for listStylePosition - style_type: Shorthand prop for listStyleType - 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 properties of the component. - - Returns: - The list component. - """ - ... diff --git a/reflex/components/chakra/datadisplay/stat.py b/reflex/components/chakra/datadisplay/stat.py deleted file mode 100644 index b9fe7f3329..0000000000 --- a/reflex/components/chakra/datadisplay/stat.py +++ /dev/null @@ -1,80 +0,0 @@ -"""Statistics components.""" - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.vars import Var - - -class Stat(ChakraComponent): - """The Stat component is used to display some statistics. It can take in a label, a number and a help text.""" - - tag = "Stat" - - @classmethod - def create( - cls, *children, label=None, number=0, help_text=None, arrow_type=None, **props - ) -> Component: - """Create a stat component. - - Args: - *children: The children of the component. - label: A label for the stat component. - number: The value of the stat component. - help_text: A text added to the stat component. - arrow_type: The type of the arrow ("increase", "decrease", None) - **props: The properties of the component. - - Returns: - The stat component. - """ - if len(children) == 0: - children = [] - if label: - children.append(StatLabel.create(label)) - - children.append(StatNumber.create(number)) - - if help_text: - if arrow_type: - children.append( - StatHelpText.create( - help_text, StatArrow.create(type_=arrow_type) - ) - ) - else: - children.append(StatHelpText.create(help_text)) - - return super().create(*children, **props) - - -class StatLabel(ChakraComponent): - """A stat label component.""" - - tag = "StatLabel" - - -class StatNumber(ChakraComponent): - """The stat to display.""" - - tag = "StatNumber" - - -class StatHelpText(ChakraComponent): - """A helper text to display under the stat.""" - - tag = "StatHelpText" - - -class StatArrow(ChakraComponent): - """A stat arrow component indicating the direction of change.""" - - tag = "StatArrow" - - # The type of arrow, either increase or decrease. - type_: Var[str] - - -class StatGroup(ChakraComponent): - """A stat group component to evenly space out the stats.""" - - tag = "StatGroup" diff --git a/reflex/components/chakra/datadisplay/stat.pyi b/reflex/components/chakra/datadisplay/stat.pyi deleted file mode 100644 index bbade38bfe..0000000000 --- a/reflex/components/chakra/datadisplay/stat.pyi +++ /dev/null @@ -1,477 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/stat.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Stat(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - label=None, - number=0, - help_text=None, - arrow_type=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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Stat": - """Create a stat component. - - Args: - *children: The children of the component. - label: A label for the stat component. - number: The value of the stat component. - help_text: A text added to the stat component. - arrow_type: The type of the arrow ("increase", "decrease", None) - 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 properties of the component. - - Returns: - The stat component. - """ - ... - -class StatLabel(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StatLabel": - """Create the component. - - Args: - *children: The children of the component. - 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 StatNumber(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StatNumber": - """Create the component. - - Args: - *children: The children of the component. - 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 StatHelpText(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StatHelpText": - """Create the component. - - Args: - *children: The children of the component. - 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 StatArrow(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type_: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StatArrow": - """Create the component. - - Args: - *children: The children of the component. - type_: The type of arrow, either increase or decrease. - 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 StatGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StatGroup": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/datadisplay/table.py b/reflex/components/chakra/datadisplay/table.py deleted file mode 100644 index c49d909ad3..0000000000 --- a/reflex/components/chakra/datadisplay/table.py +++ /dev/null @@ -1,305 +0,0 @@ -"""Table components.""" - -from typing import List, Tuple - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.components.core.foreach import Foreach -from reflex.utils import types -from reflex.vars import Var - - -class Table(ChakraComponent): - """A table component.""" - - tag = "Table" - - # The color scheme of the table - color_scheme: Var[str] - - # The variant of the table style to use - variant: Var[str] - - # The size of the table - size: Var[str] - - # The placement of the table caption. - placement: Var[str] - - @classmethod - def create( - cls, *children, caption=None, headers=None, rows=None, footers=None, **props - ) -> Component: - """Create a table component. - - Args: - *children: The children of the component. - caption: The caption of the table component. - headers: The headers of the table component. - rows: The rows of the table component. - footers: The footers of the table component. - **props: The properties of the component. - - Returns: - The table component. - """ - if len(children) == 0: - children = [] - - if caption is not None: - children.append(TableCaption.create(caption)) - - if headers is not None: - children.append(Thead.create(headers=headers)) - - if rows is not None: - children.append(Tbody.create(rows=rows)) - - if footers is not None: - children.append(Tfoot.create(footers=footers)) - return super().create(*children, **props) - - -class Thead(ChakraComponent): - """A table header component.""" - - tag = "Thead" - - # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tfoot"] - - @classmethod - def create(cls, *children, headers=None, **props) -> Component: - """Create a table header component. - - Args: - *children: The children of the component. - headers (list, optional): List of headers. Defaults to None. - **props: The properties of the component. - - Returns: - The table header component. - - """ - if len(children) == 0: - cls.validate_headers(headers) - - children = [Tr.create(cell_type="header", cells=headers)] - return super().create(*children, **props) - - @staticmethod - def validate_headers(headers): - """Type checking for table headers. - - Args: - headers: The table headers. - - Raises: - TypeError: If headers are not of type list or type tuple. - - """ - allowed_types = (list, tuple) - if ( - ( - isinstance(headers, Var) - and not types.check_type_in_allowed_types( - headers._var_type, allowed_types - ) - ) - or not isinstance(headers, Var) - and not types.check_type_in_allowed_types(type(headers), allowed_types) - ): - raise TypeError("table headers should be a list or tuple") - - -class Tbody(ChakraComponent): - """A table body component.""" - - tag = "Tbody" - - # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tfoot", "Td", "Th"] - - @classmethod - def create(cls, *children, rows=None, **props) -> Component: - """Create a table body component. - - Args: - *children: The children of the component. - rows (list[list], optional): The rows of the table body. Defaults to None. - **props: The properties of the component. - - Returns: - Component: The table body component - """ - if len(children) == 0: - cls.validate_rows(rows) if rows is not None else None - - if isinstance(rows, Var): - children = [ - Foreach.create( - rows, lambda row: Tr.create(cell_type="data", cells=row) - ) - ] - else: - children = [ - Tr.create(cell_type="data", cells=row) for row in rows or [] - ] - return super().create(*children, **props) - - @staticmethod - def validate_rows(rows): - """Type checking for table rows. - - Args: - rows: Table rows. - - Raises: - TypeError: If rows are not lists or tuples containing inner lists or tuples. - """ - allowed_subclasses = (List, Tuple) - if isinstance(rows, Var): - outer_type = rows._var_type - inner_type = ( - outer_type.__args__[0] if hasattr(outer_type, "__args__") else None - ) - - # check that the outer container and inner container types are lists or tuples. - if not ( - types._issubclass(types.get_base_class(outer_type), allowed_subclasses) - and ( - inner_type is None - or types._issubclass( - types.get_base_class(inner_type), allowed_subclasses - ) - ) - ): - raise TypeError( - f"table rows should be a list or tuple containing inner lists or tuples. Got {outer_type} instead" - ) - elif not ( - types._issubclass(type(rows), allowed_subclasses) - and (not rows or types._issubclass(type(rows[0]), allowed_subclasses)) - ): - raise TypeError( - "table rows should be a list or tuple containing inner lists or tuples." - ) - - -class Tfoot(ChakraComponent): - """A table footer component.""" - - tag = "Tfoot" - - # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Td", "Th", "Tfoot"] - - @classmethod - def create(cls, *children, footers=None, **props) -> Component: - """Create a table footer component. - - Args: - *children: The children of the component. - footers (list, optional): List of footers. Defaults to None. - **props: The properties of the component. - - Returns: - The table footer component. - """ - if len(children) == 0: - cls.validate_footers(footers) - children = [Tr.create(cell_type="header", cells=footers)] - return super().create(*children, **props) - - @staticmethod - def validate_footers(footers): - """Type checking for table footers. - - Args: - footers: Table rows. - - Raises: - TypeError: If footers are not of type list. - """ - allowed_types = (list, tuple) - if ( - ( - isinstance(footers, Var) - and not types.check_type_in_allowed_types( - footers._var_type, allowed_types - ) - ) - or not isinstance(footers, Var) - and not types.check_type_in_allowed_types(type(footers), allowed_types) - ): - raise TypeError("table headers should be a list or tuple") - - -class Tr(ChakraComponent): - """A table row component.""" - - tag = "Tr" - - # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tfoot", "Tr"] - - @classmethod - def create(cls, *children, cell_type: str = "", cells=None, **props) -> Component: - """Create a table row component. - - Args: - *children: The children of the component. - cell_type: the type of cells in this table row. "header" or "data". Defaults to None. - cells: The cells value to add in the table row. Defaults to None. - **props: The properties of the component. - - Returns: - The table row component - """ - types = {"header": Th, "data": Td} - cell_cls = types.get(cell_type) - if len(children) == 0 and cell_cls: - if isinstance(cells, Var): - children = [Foreach.create(cells, cell_cls.create)] - else: - children = [cell_cls.create(cell) for cell in cells or []] - return super().create(*children, **props) - - -class Th(ChakraComponent): - """A table header cell component.""" - - tag = "Th" - - # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tr", "Td", "Th"] - - # Aligns the cell content to the right. - is_numeric: Var[bool] - - -class Td(ChakraComponent): - """A table data cell component.""" - - tag = "Td" - - # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead"] - - # Aligns the cell content to the right. - is_numeric: Var[bool] - - -class TableCaption(ChakraComponent): - """A table caption component.""" - - tag = "TableCaption" - - # The placement of the table caption. This sets the `caption-side` CSS attribute. - placement: Var[str] - - -class TableContainer(ChakraComponent): - """The table container component renders a div that wraps the table component.""" - - tag = "TableContainer" diff --git a/reflex/components/chakra/datadisplay/table.pyi b/reflex/components/chakra/datadisplay/table.pyi deleted file mode 100644 index 48b0d6db73..0000000000 --- a/reflex/components/chakra/datadisplay/table.pyi +++ /dev/null @@ -1,737 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/table.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Table(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - caption=None, - headers=None, - rows=None, - footers=None, - color_scheme: Optional[Union[Var[str], str]] = None, - variant: Optional[Union[Var[str], str]] = None, - size: Optional[Union[Var[str], str]] = None, - placement: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Table": - """Create a table component. - - Args: - *children: The children of the component. - caption: The caption of the table component. - headers: The headers of the table component. - rows: The rows of the table component. - footers: The footers of the table component. - color_scheme: The color scheme of the table - variant: The variant of the table style to use - size: The size of the table - placement: The placement of the table caption. - 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 properties of the component. - - Returns: - The table component. - """ - ... - -class Thead(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - headers=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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Thead": - """Create a table header component. - - Args: - *children: The children of the component. - headers (list, optional): List of headers. Defaults to None. - 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 properties of the component. - - Returns: - The table header component. - - """ - ... - - @staticmethod - def validate_headers(headers): ... - -class Tbody(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - rows=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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Tbody": - """Create a table body component. - - Args: - *children: The children of the component. - rows (list[list], optional): The rows of the table body. Defaults to None. - 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 properties of the component. - - Returns: - Component: The table body component - """ - ... - - @staticmethod - def validate_rows(rows): ... - -class Tfoot(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - footers=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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Tfoot": - """Create a table footer component. - - Args: - *children: The children of the component. - footers (list, optional): List of footers. Defaults to None. - 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 properties of the component. - - Returns: - The table footer component. - """ - ... - - @staticmethod - def validate_footers(footers): ... - -class Tr(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - cell_type: Optional[str] = "", - cells=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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Tr": - """Create a table row component. - - Args: - *children: The children of the component. - cell_type: the type of cells in this table row. "header" or "data". Defaults to None. - cells: The cells value to add in the table row. Defaults to None. - 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 properties of the component. - - Returns: - The table row component - """ - ... - -class Th(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_numeric: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Th": - """Create the component. - - Args: - *children: The children of the component. - is_numeric: Aligns the cell content to the right. - 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 Td(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_numeric: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Td": - """Create the component. - - Args: - *children: The children of the component. - is_numeric: Aligns the cell content to the right. - 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 TableCaption(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - placement: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TableCaption": - """Create the component. - - Args: - *children: The children of the component. - placement: The placement of the table caption. This sets the `caption-side` CSS attribute. - 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 TableContainer(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TableContainer": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/datadisplay/tag.py b/reflex/components/chakra/datadisplay/tag.py deleted file mode 100644 index c5b448ab45..0000000000 --- a/reflex/components/chakra/datadisplay/tag.py +++ /dev/null @@ -1,85 +0,0 @@ -"""Chakra Tag Component.""" - -from typing import Optional - -from reflex.components.chakra import ( - ChakraComponent, - LiteralTagColorScheme, - LiteralTagSize, - LiteralVariant, -) -from reflex.components.component import Component -from reflex.vars import Var - - -class TagLabel(ChakraComponent): - """The label of the tag.""" - - tag = "TagLabel" - - -class TagLeftIcon(ChakraComponent): - """The left icon of the tag.""" - - tag = "TagLeftIcon" - - -class TagRightIcon(ChakraComponent): - """The right icon of the tag.""" - - tag = "TagRightIcon" - - -class TagCloseButton(ChakraComponent): - """The close button of the tag.""" - - tag = "TagCloseButton" - - -class Tag(ChakraComponent): - """The parent wrapper that provides context for its children.""" - - tag = "Tag" - - # The visual color appearance of the tag. - # options: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | - # "cyan" | "purple" | "pink" - # default: "gray" - color_scheme: Var[LiteralTagColorScheme] - - # The size of the tag - # options: "sm" | "md" | "lg" - # default: "md" - size: Var[LiteralTagSize] - - # The variant of the tag - # options: "solid" | "subtle" | "outline" - # default: "solid" - variant: Var[LiteralVariant] - - @classmethod - def create( - cls, - label: Component, - *, - left_icon: Optional[Component] = None, - right_icon: Optional[Component] = None, - close_button: Optional[Component] = None, - **props, - ) -> Component: - """Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it. - - Args: - label (Component): The label of the Tag that will be created. - left_icon (Optional[Component]): Should be a rx.TagLeftIcon instance. - right_icon (Optional[Component]): Should be a rx.TagRightIcon instance. - close_button (Optional[Component]): Should be a rx.TagCloseButton instance. - props: The properties to be passed to the component. - - Returns: - The `create()` method returns a Tag object. - """ - children = [ - x for x in (left_icon, label, right_icon, close_button) if x is not None - ] - return super().create(*children, **props) diff --git a/reflex/components/chakra/datadisplay/tag.pyi b/reflex/components/chakra/datadisplay/tag.pyi deleted file mode 100644 index bd4e76bc51..0000000000 --- a/reflex/components/chakra/datadisplay/tag.pyi +++ /dev/null @@ -1,433 +0,0 @@ -"""Stub file for reflex/components/chakra/datadisplay/tag.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class TagLabel(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TagLabel": - """Create the component. - - Args: - *children: The children of the component. - 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 TagLeftIcon(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TagLeftIcon": - """Create the component. - - Args: - *children: The children of the component. - 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 TagRightIcon(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TagRightIcon": - """Create the component. - - Args: - *children: The children of the component. - 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 TagCloseButton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TagCloseButton": - """Create the component. - - Args: - *children: The children of the component. - 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 Tag(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - left_icon: Optional[Component] = None, - right_icon: Optional[Component] = None, - close_button: Optional[Component] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - ] - ], - Literal[ - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - ], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg"]], Literal["sm", "md", "lg"]] - ] = None, - variant: Optional[ - Union[ - Var[Literal["solid", "subtle", "outline"]], - Literal["solid", "subtle", "outline"], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Tag": - """Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it. - - Args: - label (Component): The label of the Tag that will be created. - left_icon (Optional[Component]): Should be a rx.TagLeftIcon instance. - right_icon (Optional[Component]): Should be a rx.TagRightIcon instance. - close_button (Optional[Component]): Should be a rx.TagCloseButton instance. - props: The properties to be passed to the component. - - Returns: - The `create()` method returns a Tag object. - """ - ... diff --git a/reflex/components/chakra/disclosure/__init__.py b/reflex/components/chakra/disclosure/__init__.py deleted file mode 100644 index 7a756c603c..0000000000 --- a/reflex/components/chakra/disclosure/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Disclosure components.""" - -from .accordion import ( - Accordion, - AccordionButton, - AccordionIcon, - AccordionItem, - AccordionPanel, -) -from .tabs import Tab, TabList, TabPanel, TabPanels, Tabs -from .transition import Collapse, Fade, ScaleFade, Slide, SlideFade -from .visuallyhidden import VisuallyHidden - -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore diff --git a/reflex/components/chakra/disclosure/accordion.py b/reflex/components/chakra/disclosure/accordion.py deleted file mode 100644 index f92bc3ad9b..0000000000 --- a/reflex/components/chakra/disclosure/accordion.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Container to stack elements with spacing.""" - -from typing import List, Optional, Union - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.vars import Var - - -class Accordion(ChakraComponent): - """The wrapper that uses cloneElement to pass props to AccordionItem children.""" - - tag = "Accordion" - - # If true, multiple accordion items can be expanded at once. - allow_multiple: Var[bool] - - # If true, any expanded accordion item can be collapsed again. - allow_toggle: Var[bool] - - # The initial index(es) of the expanded accordion item(s). - default_index: Var[Optional[List[int]]] - - # The index(es) of the expanded accordion item - index: Var[Union[int, List[int]]] - - # If true, height animation and transitions will be disabled. - reduce_motion: Var[bool] - - @classmethod - def create( - cls, - *children, - items=None, - icon_pos="right", - allow_multiple: Optional[Var[bool]] = None, - allow_toggle: Optional[Var[bool]] = None, - **props, - ) -> Component: - """Create an accordion component. - - Args: - *children: The children of the component. - items: The items of the accordion component: list of tuples (label,panel) - icon_pos: The position of the arrow icon of the accordion. "right", "left" or None - allow_multiple: The allow_multiple property of the accordion. (True or False) - allow_toggle: The allow_toggle property of the accordion. (True or False) - **props: The properties of the component. - - Returns: - The accordion component - """ - if len(children) == 0: - children = [] - if not items: - items = [] - for label, panel in items: - if icon_pos == "right": - button = AccordionButton.create(label, AccordionIcon.create()) - elif icon_pos == "left": - button = AccordionButton.create(AccordionIcon.create(), label) - else: - button = AccordionButton.create(label) - - children.append( - AccordionItem.create( - button, - AccordionPanel.create(panel), - ) - ) - - # if allow_multiple is True, allow_toggle is implicitely used and does not need to be defined - if allow_multiple: - props.update({"allow_multiple": allow_multiple}) - elif allow_toggle: - props.update({"allow_toggle": allow_toggle}) - return super().create(*children, **props) - - -class AccordionItem(ChakraComponent): - """A single accordion item.""" - - tag = "AccordionItem" - - # A unique id for the accordion item. - id_: Var[str] - - # If true, the accordion item will be disabled. - is_disabled: Var[bool] - - # If true, the accordion item will be focusable. - is_focusable: Var[bool] - - -class AccordionButton(ChakraComponent): - """The button that toggles the expand/collapse state of the accordion item. This button must be wrapped in an element with role heading.""" - - tag = "AccordionButton" - - -class AccordionPanel(ChakraComponent): - """The container for the details to be revealed.""" - - tag = "AccordionPanel" - - -class AccordionIcon(ChakraComponent): - """A chevron-down icon that rotates based on the expanded/collapsed state.""" - - tag = "AccordionIcon" diff --git a/reflex/components/chakra/disclosure/accordion.pyi b/reflex/components/chakra/disclosure/accordion.pyi deleted file mode 100644 index cf6e6b4cbd..0000000000 --- a/reflex/components/chakra/disclosure/accordion.pyi +++ /dev/null @@ -1,411 +0,0 @@ -"""Stub file for reflex/components/chakra/disclosure/accordion.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Accordion(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items=None, - icon_pos="right", - allow_multiple: Optional[Union[Var[bool], bool]] = None, - allow_toggle: Optional[Union[Var[bool], bool]] = None, - default_index: Optional[Union[Var[Optional[List[int]]], List[int]]] = None, - index: Optional[Union[Var[Union[List[int], int]], int, List[int]]] = None, - reduce_motion: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Accordion": - """Create an accordion component. - - Args: - *children: The children of the component. - items: The items of the accordion component: list of tuples (label,panel) - icon_pos: The position of the arrow icon of the accordion. "right", "left" or None - allow_multiple: The allow_multiple property of the accordion. (True or False) - allow_toggle: The allow_toggle property of the accordion. (True or False) - default_index: The initial index(es) of the expanded accordion item(s). - index: The index(es) of the expanded accordion item - reduce_motion: If true, height animation and transitions will be disabled. - 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 properties of the component. - - Returns: - The accordion component - """ - ... - -class AccordionItem(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - id_: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_focusable: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AccordionItem": - """Create the component. - - Args: - *children: The children of the component. - id_: A unique id for the accordion item. - is_disabled: If true, the accordion item will be disabled. - is_focusable: If true, the accordion item will be focusable. - 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 AccordionButton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AccordionButton": - """Create the component. - - Args: - *children: The children of the component. - 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 AccordionPanel(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AccordionPanel": - """Create the component. - - Args: - *children: The children of the component. - 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 AccordionIcon(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AccordionIcon": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/disclosure/tabs.py b/reflex/components/chakra/disclosure/tabs.py deleted file mode 100644 index 4600384b4e..0000000000 --- a/reflex/components/chakra/disclosure/tabs.py +++ /dev/null @@ -1,117 +0,0 @@ -"""Tab components.""" - -from typing import List, Optional, Tuple - -from reflex.components.chakra import ( - ChakraComponent, - LiteralColorScheme, - LiteralTabsVariant, - LiteralTagAlign, -) -from reflex.components.component import Component -from reflex.vars import Var - - -class Tabs(ChakraComponent): - """An accessible tabs component that provides keyboard interactions and ARIA attributes described in the WAI-ARIA Tabs Design Pattern. Tabs, provides context and state for all components.""" - - tag = "Tabs" - - # The alignment of the tabs ("center" | "end" | "start"). - align: Var[LiteralTagAlign] - - # The initial index of the selected tab (in uncontrolled mode). - default_index: Var[int] - - # The id of the tab. - id_: Var[str] - - # If true, tabs will stretch to width of the tablist. - is_fitted: Var[bool] - - # Performance booster. If true, rendering of the tab panel's will be deferred until it is selected. - is_lazy: Var[bool] - - # If true, the tabs will be manually activated and display its panel by pressing Space or Enter. If false, the tabs will be automatically activated and their panel is displayed when they receive focus. - is_manual: Var[bool] - - # The orientation of the tab list. - orientation: Var[str] - - # "line" | "enclosed" | "enclosed-colored" | "soft-rounded" | "solid-rounded" | "unstyled" - variant: Var[LiteralTabsVariant] - - # The color scheme of the tabs. - color_scheme: Var[LiteralColorScheme] - - # Index of the selected tab (in controlled mode). - index: Var[int] - - @classmethod - def create( - cls, *children, items: Optional[List[Tuple[str, str]]] = None, **props - ) -> Component: - """Create a tab component. - - Args: - *children: The children of the component. - items: The items for the tabs component, a list of tuple (label, panel) - **props: The properties of the component. - - Returns: - The tab component - """ - if len(children) == 0: - tabs = [] - panels = [] - if not items: - items = [] - for label, panel in items: - tabs.append(Tab.create(label)) - panels.append(TabPanel.create(panel)) - children = [TabList.create(*tabs), TabPanels.create(*panels)] # type: ignore - return super().create(*children, **props) - - -class Tab(ChakraComponent): - """An element that serves as a label for one of the tab panels and can be activated to display that panel..""" - - tag = "Tab" - - # If true, the Tab won't be toggleable. - is_disabled: Var[bool] - - # If true, the Tab will be selected. - is_selected: Var[bool] - - # The id of the tab. - id_: Var[str] - - # The id of the panel. - panel_id: Var[str] - - _valid_parents: List[str] = ["TabList"] - - -class TabList(ChakraComponent): - """Wrapper for the Tab components.""" - - tag = "TabList" - - _valid_parents: List[str] = ["Tabs"] - - -class TabPanels(ChakraComponent): - """Wrapper for the Tab components.""" - - tag = "TabPanels" - - _valid_parents: List[str] = ["Tabs"] - - -class TabPanel(ChakraComponent): - """An element that contains the content associated with a tab.""" - - tag = "TabPanel" - - _valid_parents: List[str] = ["TabPanels"] diff --git a/reflex/components/chakra/disclosure/tabs.pyi b/reflex/components/chakra/disclosure/tabs.pyi deleted file mode 100644 index c76f4125e9..0000000000 --- a/reflex/components/chakra/disclosure/tabs.pyi +++ /dev/null @@ -1,496 +0,0 @@ -"""Stub file for reflex/components/chakra/disclosure/tabs.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Tabs(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items: Optional[List[Tuple[str, str]]] = None, - align: Optional[ - Union[ - Var[Literal["center", "end", "start"]], - Literal["center", "end", "start"], - ] - ] = None, - default_index: Optional[Union[Var[int], int]] = None, - id_: Optional[Union[Var[str], str]] = None, - is_fitted: Optional[Union[Var[bool], bool]] = None, - is_lazy: Optional[Union[Var[bool], bool]] = None, - is_manual: Optional[Union[Var[bool], bool]] = None, - orientation: Optional[Union[Var[str], str]] = None, - variant: Optional[ - Union[ - Var[ - Literal[ - "line", - "enclosed", - "enclosed-colored", - "soft-rounded", - "solid-rounded", - "unstyled", - ] - ], - Literal[ - "line", - "enclosed", - "enclosed-colored", - "soft-rounded", - "solid-rounded", - "unstyled", - ], - ] - ] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = None, - 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Tabs": - """Create a tab component. - - Args: - *children: The children of the component. - items: The items for the tabs component, a list of tuple (label, panel) - align: The alignment of the tabs ("center" | "end" | "start"). - default_index: The initial index of the selected tab (in uncontrolled mode). - id_: The id of the tab. - is_fitted: If true, tabs will stretch to width of the tablist. - is_lazy: Performance booster. If true, rendering of the tab panel's will be deferred until it is selected. - is_manual: If true, the tabs will be manually activated and display its panel by pressing Space or Enter. If false, the tabs will be automatically activated and their panel is displayed when they receive focus. - orientation: The orientation of the tab list. - variant: "line" | "enclosed" | "enclosed-colored" | "soft-rounded" | "solid-rounded" | "unstyled" - color_scheme: The color scheme of the tabs. - index: Index of the selected tab (in controlled mode). - 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 properties of the component. - - Returns: - The tab component - """ - ... - -class Tab(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_selected: Optional[Union[Var[bool], bool]] = None, - id_: Optional[Union[Var[str], str]] = None, - panel_id: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Tab": - """Create the component. - - Args: - *children: The children of the component. - is_disabled: If true, the Tab won't be toggleable. - is_selected: If true, the Tab will be selected. - id_: The id of the tab. - panel_id: The id of the panel. - 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 TabList(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TabList": - """Create the component. - - Args: - *children: The children of the component. - 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 TabPanels(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TabPanels": - """Create the component. - - Args: - *children: The children of the component. - 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 TabPanel(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TabPanel": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/disclosure/transition.py b/reflex/components/chakra/disclosure/transition.py deleted file mode 100644 index f0d01f3a02..0000000000 --- a/reflex/components/chakra/disclosure/transition.py +++ /dev/null @@ -1,73 +0,0 @@ -"""A transition Component.""" - -from typing import Union - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Transition(ChakraComponent): - """Base componemt of all transitions.""" - - # Show the component; triggers when enter or exit states - in_: Var[bool] - - # If true, the element will unmount when `in={false}` and animation is done - unmount_on_exit: Var[bool] - - -class Fade(Transition): - """Fade component cab be used show and hide content of your app.""" - - tag = "Fade" - - -class ScaleFade(Transition): - """Fade component can be scaled and reverse your app.""" - - tag = "ScaleFade" - - # The initial scale of the element - initial_scale: Var[float] - - # If true, the element will transition back to exit state - reverse: Var[bool] - - -class Slide(Transition): - """Side can be used show content below your app.""" - - tag = "Slide" - - # The direction to slide from - direction: Var[str] - - -class SlideFade(Transition): - """SlideFade component.""" - - tag = "SlideFade" - - # The offset on the horizontal or x axis - offsetX: Var[Union[str, int]] - - # The offset on the vertical or y axis - offsetY: Var[Union[str, int]] - - # If true, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out - reverse: Var[bool] - - -class Collapse(Transition): - """Collapse component can collapse some content.""" - - tag = "Collapse" - - # If true, the opacity of the content will be animated - animateOpacity: Var[bool] - - # The height you want the content in its expanded state. - endingHeight: Var[str] - - # The height you want the content in its collapsed state. - startingHeight: Var[Union[str, int]] diff --git a/reflex/components/chakra/disclosure/transition.pyi b/reflex/components/chakra/disclosure/transition.pyi deleted file mode 100644 index a7598e3593..0000000000 --- a/reflex/components/chakra/disclosure/transition.pyi +++ /dev/null @@ -1,509 +0,0 @@ -"""Stub file for reflex/components/chakra/disclosure/transition.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Transition(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - in_: Optional[Union[Var[bool], bool]] = None, - unmount_on_exit: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Transition": - """Create the component. - - Args: - *children: The children of the component. - in_: Show the component; triggers when enter or exit states - unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done - 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 Fade(Transition): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - in_: Optional[Union[Var[bool], bool]] = None, - unmount_on_exit: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Fade": - """Create the component. - - Args: - *children: The children of the component. - in_: Show the component; triggers when enter or exit states - unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done - 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 ScaleFade(Transition): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - initial_scale: Optional[Union[Var[float], float]] = None, - reverse: Optional[Union[Var[bool], bool]] = None, - in_: Optional[Union[Var[bool], bool]] = None, - unmount_on_exit: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ScaleFade": - """Create the component. - - Args: - *children: The children of the component. - initial_scale: The initial scale of the element - reverse: If true, the element will transition back to exit state - in_: Show the component; triggers when enter or exit states - unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done - 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 Slide(Transition): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - direction: Optional[Union[Var[str], str]] = None, - in_: Optional[Union[Var[bool], bool]] = None, - unmount_on_exit: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Slide": - """Create the component. - - Args: - *children: The children of the component. - direction: The direction to slide from - in_: Show the component; triggers when enter or exit states - unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done - 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 SlideFade(Transition): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - offsetX: Optional[Union[Var[Union[int, str]], str, int]] = None, - offsetY: Optional[Union[Var[Union[int, str]], str, int]] = None, - reverse: Optional[Union[Var[bool], bool]] = None, - in_: Optional[Union[Var[bool], bool]] = None, - unmount_on_exit: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "SlideFade": - """Create the component. - - Args: - *children: The children of the component. - offsetX: The offset on the horizontal or x axis - offsetY: The offset on the vertical or y axis - reverse: If true, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out - in_: Show the component; triggers when enter or exit states - unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done - 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 Collapse(Transition): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - animateOpacity: Optional[Union[Var[bool], bool]] = None, - endingHeight: Optional[Union[Var[str], str]] = None, - startingHeight: Optional[Union[Var[Union[int, str]], str, int]] = None, - in_: Optional[Union[Var[bool], bool]] = None, - unmount_on_exit: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Collapse": - """Create the component. - - Args: - *children: The children of the component. - animateOpacity: If true, the opacity of the content will be animated - endingHeight: The height you want the content in its expanded state. - startingHeight: The height you want the content in its collapsed state. - in_: Show the component; triggers when enter or exit states - unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done - 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. - """ - ... diff --git a/reflex/components/chakra/disclosure/visuallyhidden.py b/reflex/components/chakra/disclosure/visuallyhidden.py deleted file mode 100644 index 161b130b2a..0000000000 --- a/reflex/components/chakra/disclosure/visuallyhidden.py +++ /dev/null @@ -1,9 +0,0 @@ -"""A component to display visually hidden text.""" - -from reflex.components.chakra import ChakraComponent - - -class VisuallyHidden(ChakraComponent): - """A component that visually hides content while still allowing it to be read by screen readers.""" - - tag = "VisuallyHidden" diff --git a/reflex/components/chakra/disclosure/visuallyhidden.pyi b/reflex/components/chakra/disclosure/visuallyhidden.pyi deleted file mode 100644 index d5fa8e983e..0000000000 --- a/reflex/components/chakra/disclosure/visuallyhidden.pyi +++ /dev/null @@ -1,87 +0,0 @@ -"""Stub file for reflex/components/chakra/disclosure/visuallyhidden.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class VisuallyHidden(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "VisuallyHidden": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/feedback/__init__.py b/reflex/components/chakra/feedback/__init__.py deleted file mode 100644 index 8037e366a0..0000000000 --- a/reflex/components/chakra/feedback/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Convenience functions to define core components.""" - -from .alert import Alert, AlertDescription, AlertIcon, AlertTitle -from .circularprogress import CircularProgress, CircularProgressLabel -from .progress import Progress -from .skeleton import Skeleton, SkeletonCircle, SkeletonText -from .spinner import Spinner diff --git a/reflex/components/chakra/feedback/alert.py b/reflex/components/chakra/feedback/alert.py deleted file mode 100644 index 57f99817fb..0000000000 --- a/reflex/components/chakra/feedback/alert.py +++ /dev/null @@ -1,68 +0,0 @@ -"""Alert components.""" - -from reflex.components.chakra import ( - ChakraComponent, - LiteralAlertVariant, - LiteralStatus, -) -from reflex.components.component import Component -from reflex.vars import Var - - -class Alert(ChakraComponent): - """An alert feedback box.""" - - tag = "Alert" - - # The status of the alert ("success" | "info" | "warning" | "error") - status: Var[LiteralStatus] - - # "subtle" | "left-accent" | "top-accent" | "solid" - variant: Var[LiteralAlertVariant] - - @classmethod - def create( - cls, *children, icon=True, title="Alert title", desc=None, **props - ) -> Component: - """Create an alert component. - - Args: - *children: The children of the component. - icon: The icon of the alert. - title: The title of the alert. - desc: The description of the alert - **props: The properties of the component. - - Returns: - The alert component. - """ - if len(children) == 0: - children = [] - - if icon: - children.append(AlertIcon.create()) - - children.append(AlertTitle.create(title)) - - if desc: - children.append(AlertDescription.create(desc)) - - return super().create(*children, **props) - - -class AlertIcon(ChakraComponent): - """An icon displayed in the alert.""" - - tag = "AlertIcon" - - -class AlertTitle(ChakraComponent): - """The title of the alert.""" - - tag = "AlertTitle" - - -class AlertDescription(ChakraComponent): - """AlertDescription composes the Box component.""" - - tag = "AlertDescription" diff --git a/reflex/components/chakra/feedback/alert.pyi b/reflex/components/chakra/feedback/alert.pyi deleted file mode 100644 index da1a7e2d9c..0000000000 --- a/reflex/components/chakra/feedback/alert.pyi +++ /dev/null @@ -1,335 +0,0 @@ -"""Stub file for reflex/components/chakra/feedback/alert.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Alert(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - icon=True, - title="Alert title", - desc=None, - status: Optional[ - Union[ - Var[Literal["success", "info", "warning", "error"]], - Literal["success", "info", "warning", "error"], - ] - ] = None, - variant: Optional[ - Union[ - Var[Literal["subtle", "left-accent", "top-accent", "solid"]], - Literal["subtle", "left-accent", "top-accent", "solid"], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Alert": - """Create an alert component. - - Args: - *children: The children of the component. - icon: The icon of the alert. - title: The title of the alert. - desc: The description of the alert - status: The status of the alert ("success" | "info" | "warning" | "error") - variant: "subtle" | "left-accent" | "top-accent" | "solid" - 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 properties of the component. - - Returns: - The alert component. - """ - ... - -class AlertIcon(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertIcon": - """Create the component. - - Args: - *children: The children of the component. - 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 AlertTitle(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertTitle": - """Create the component. - - Args: - *children: The children of the component. - 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 AlertDescription(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDescription": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/feedback/circularprogress.py b/reflex/components/chakra/feedback/circularprogress.py deleted file mode 100644 index 25bb3c3486..0000000000 --- a/reflex/components/chakra/feedback/circularprogress.py +++ /dev/null @@ -1,68 +0,0 @@ -"""Container to stack elements with spacing.""" - -from typing import Union - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.vars import Var - - -class CircularProgress(ChakraComponent): - """The CircularProgress component is used to indicate the progress for determinate and indeterminate processes.""" - - tag = "CircularProgress" - - # If true, the cap of the progress indicator will be rounded. - cap_is_round: Var[bool] - - # If true, the progress will be indeterminate and the value prop will be ignored - is_indeterminate: Var[bool] - - # Maximum value defining 100% progress made (must be higher than 'min') - max_: Var[int] - - # Minimum value defining 'no progress' (must be lower than 'max') - min_: Var[int] - - # This defines the stroke width of the svg circle. - thickness: Var[Union[str, int]] - - # The color name of the progress track. Use a color key in the theme object - track_color: Var[str] - - # Current progress (must be between min/max). - value: Var[int] - - # The desired valueText to use in place of the value. - value_text: Var[str] - - # The color name of the progress bar - color: Var[str] - - # The size of the circular progress - size: Var[str] - - @classmethod - def create(cls, *children, label=None, **props) -> Component: - """Create a circular progress component. - - Args: - *children: the children of the component. - label: A label to add in the circular progress. Defaults to None. - **props: the props of the component. - - Returns: - The circular progress component. - """ - if len(children) == 0: - children = [] - - if label is not None: - children.append(CircularProgressLabel.create(label)) - return super().create(*children, **props) - - -class CircularProgressLabel(ChakraComponent): - """Label of CircularProcess.""" - - tag = "CircularProgressLabel" diff --git a/reflex/components/chakra/feedback/circularprogress.pyi b/reflex/components/chakra/feedback/circularprogress.pyi deleted file mode 100644 index 5a788d7d39..0000000000 --- a/reflex/components/chakra/feedback/circularprogress.pyi +++ /dev/null @@ -1,185 +0,0 @@ -"""Stub file for reflex/components/chakra/feedback/circularprogress.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class CircularProgress(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - label=None, - cap_is_round: Optional[Union[Var[bool], bool]] = None, - is_indeterminate: Optional[Union[Var[bool], bool]] = None, - max_: Optional[Union[Var[int], int]] = None, - min_: Optional[Union[Var[int], int]] = None, - thickness: Optional[Union[Var[Union[int, str]], str, int]] = None, - track_color: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[int], int]] = None, - value_text: Optional[Union[Var[str], str]] = None, - color: Optional[Union[Var[str], str]] = None, - size: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "CircularProgress": - """Create a circular progress component. - - Args: - *children: the children of the component. - label: A label to add in the circular progress. Defaults to None. - cap_is_round: If true, the cap of the progress indicator will be rounded. - is_indeterminate: If true, the progress will be indeterminate and the value prop will be ignored - max_: Maximum value defining 100% progress made (must be higher than 'min') - min_: Minimum value defining 'no progress' (must be lower than 'max') - thickness: This defines the stroke width of the svg circle. - track_color: The color name of the progress track. Use a color key in the theme object - value: Current progress (must be between min/max). - value_text: The desired valueText to use in place of the value. - color: The color name of the progress bar - size: The size of the circular progress - 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 circular progress component. - """ - ... - -class CircularProgressLabel(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "CircularProgressLabel": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/feedback/progress.py b/reflex/components/chakra/feedback/progress.py deleted file mode 100644 index 6dbaf1e94c..0000000000 --- a/reflex/components/chakra/feedback/progress.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Container to stack elements with spacing.""" - -from typing import Union - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Progress(ChakraComponent): - """A bar to display progress.""" - - tag = "Progress" - - # If true, the progress bar will show stripe - has_stripe: Var[bool] - - # If true, and has_stripe is true, the stripes will be animated - is_animated: Var[bool] - - # If true, the progress will be indeterminate and the value prop will be ignored - is_indeterminate: Var[bool] - - # The maximum value of the progress - max_: Var[int] - - # The minimum value of the progress - min_: Var[int] - - # The value of the progress indicator. If undefined the progress bar will be in indeterminate state - value: Var[Union[int, float]] - - # The color scheme of the progress bar. - color_scheme: Var[str] diff --git a/reflex/components/chakra/feedback/progress.pyi b/reflex/components/chakra/feedback/progress.pyi deleted file mode 100644 index bcd3f56318..0000000000 --- a/reflex/components/chakra/feedback/progress.pyi +++ /dev/null @@ -1,101 +0,0 @@ -"""Stub file for reflex/components/chakra/feedback/progress.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Progress(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - has_stripe: Optional[Union[Var[bool], bool]] = None, - is_animated: Optional[Union[Var[bool], bool]] = None, - is_indeterminate: Optional[Union[Var[bool], bool]] = None, - max_: Optional[Union[Var[int], int]] = None, - min_: Optional[Union[Var[int], int]] = None, - value: Optional[Union[Var[Union[float, int]], int, float]] = None, - color_scheme: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Progress": - """Create the component. - - Args: - *children: The children of the component. - has_stripe: If true, the progress bar will show stripe - is_animated: If true, and has_stripe is true, the stripes will be animated - is_indeterminate: If true, the progress will be indeterminate and the value prop will be ignored - max_: The maximum value of the progress - min_: The minimum value of the progress - value: The value of the progress indicator. If undefined the progress bar will be in indeterminate state - color_scheme: The color scheme of the progress bar. - 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. - """ - ... diff --git a/reflex/components/chakra/feedback/skeleton.py b/reflex/components/chakra/feedback/skeleton.py deleted file mode 100644 index ef71cd5143..0000000000 --- a/reflex/components/chakra/feedback/skeleton.py +++ /dev/null @@ -1,70 +0,0 @@ -"""Container to stack elements with spacing.""" - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Skeleton(ChakraComponent): - """Skeleton is used to display the loading state of some components. You can use it as a standalone component. Or to wrap another component to take the same height and width.""" - - tag = "Skeleton" - - # The color at the animation end - end_color: Var[str] - - # The fadeIn duration in seconds - fade_duration: Var[float] - - # If true, it'll render its children with a nice fade transition - is_loaded: Var[bool] - - # The animation speed in seconds - speed: Var[float] - - # The color at the animation start - start_color: Var[str] - - -class SkeletonCircle(ChakraComponent): - """SkeletonCircle is used to display the loading state of some components.""" - - tag = "SkeletonCircle" - - # The color at the animation end - end_color: Var[str] - - # The fadeIn duration in seconds - fade_duration: Var[float] - - # If true, it'll render its children with a nice fade transition - is_loaded: Var[bool] - - # The animation speed in seconds - speed: Var[float] - - # The color at the animation start - start_color: Var[str] - - -class SkeletonText(ChakraComponent): - """SkeletonText is used to display the loading state of some components.""" - - tag = "SkeletonText" - - # The color at the animation end - end_color: Var[str] - - # The fadeIn duration in seconds - fade_duration: Var[float] - - # If true, it'll render its children with a nice fade transition - is_loaded: Var[bool] - - # The animation speed in seconds - speed: Var[float] - - # The color at the animation start - start_color: Var[str] - - # Number is lines of text. - no_of_lines: Var[int] diff --git a/reflex/components/chakra/feedback/skeleton.pyi b/reflex/components/chakra/feedback/skeleton.pyi deleted file mode 100644 index b121a86c84..0000000000 --- a/reflex/components/chakra/feedback/skeleton.pyi +++ /dev/null @@ -1,271 +0,0 @@ -"""Stub file for reflex/components/chakra/feedback/skeleton.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Skeleton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - end_color: Optional[Union[Var[str], str]] = None, - fade_duration: Optional[Union[Var[float], float]] = None, - is_loaded: Optional[Union[Var[bool], bool]] = None, - speed: Optional[Union[Var[float], float]] = None, - start_color: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Skeleton": - """Create the component. - - Args: - *children: The children of the component. - end_color: The color at the animation end - fade_duration: The fadeIn duration in seconds - is_loaded: If true, it'll render its children with a nice fade transition - speed: The animation speed in seconds - start_color: The color at the animation start - 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 SkeletonCircle(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - end_color: Optional[Union[Var[str], str]] = None, - fade_duration: Optional[Union[Var[float], float]] = None, - is_loaded: Optional[Union[Var[bool], bool]] = None, - speed: Optional[Union[Var[float], float]] = None, - start_color: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "SkeletonCircle": - """Create the component. - - Args: - *children: The children of the component. - end_color: The color at the animation end - fade_duration: The fadeIn duration in seconds - is_loaded: If true, it'll render its children with a nice fade transition - speed: The animation speed in seconds - start_color: The color at the animation start - 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 SkeletonText(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - end_color: Optional[Union[Var[str], str]] = None, - fade_duration: Optional[Union[Var[float], float]] = None, - is_loaded: Optional[Union[Var[bool], bool]] = None, - speed: Optional[Union[Var[float], float]] = None, - start_color: Optional[Union[Var[str], str]] = None, - no_of_lines: 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "SkeletonText": - """Create the component. - - Args: - *children: The children of the component. - end_color: The color at the animation end - fade_duration: The fadeIn duration in seconds - is_loaded: If true, it'll render its children with a nice fade transition - speed: The animation speed in seconds - start_color: The color at the animation start - no_of_lines: Number is lines of text. - 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. - """ - ... diff --git a/reflex/components/chakra/feedback/spinner.py b/reflex/components/chakra/feedback/spinner.py deleted file mode 100644 index eed335ce19..0000000000 --- a/reflex/components/chakra/feedback/spinner.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Container to stack elements with spacing.""" - -from reflex.components.chakra import ChakraComponent, LiteralSpinnerSize -from reflex.vars import Var - - -class Spinner(ChakraComponent): - """The component that spins.""" - - tag = "Spinner" - - # The color of the empty area in the spinner - empty_color: Var[str] - - # For accessibility, it is important to add a fallback loading text. This text will be visible to screen readers. - label: Var[str] - - # The speed of the spinner must be as a string and in seconds '1s'. Default is '0.45s'. - speed: Var[str] - - # The thickness of the spinner. - thickness: Var[int] - - # "xs" | "sm" | "md" | "lg" | "xl" - size: Var[LiteralSpinnerSize] diff --git a/reflex/components/chakra/feedback/spinner.pyi b/reflex/components/chakra/feedback/spinner.pyi deleted file mode 100644 index d2c45ca1d9..0000000000 --- a/reflex/components/chakra/feedback/spinner.pyi +++ /dev/null @@ -1,102 +0,0 @@ -"""Stub file for reflex/components/chakra/feedback/spinner.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Spinner(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - empty_color: Optional[Union[Var[str], str]] = None, - label: Optional[Union[Var[str], str]] = None, - speed: Optional[Union[Var[str], str]] = None, - thickness: Optional[Union[Var[int], int]] = None, - size: Optional[ - Union[ - Var[Literal["sm", "md", "lg", "xs", "xl"]], - Literal["sm", "md", "lg", "xs", "xl"], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Spinner": - """Create the component. - - Args: - *children: The children of the component. - empty_color: The color of the empty area in the spinner - label: For accessibility, it is important to add a fallback loading text. This text will be visible to screen readers. - speed: The speed of the spinner must be as a string and in seconds '1s'. Default is '0.45s'. - thickness: The thickness of the spinner. - size: "xs" | "sm" | "md" | "lg" | "xl" - 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. - """ - ... diff --git a/reflex/components/chakra/forms/__init__.py b/reflex/components/chakra/forms/__init__.py deleted file mode 100644 index 7bf225e35f..0000000000 --- a/reflex/components/chakra/forms/__init__.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Convenience functions to define core components.""" - -from .button import Button, ButtonGroup -from .checkbox import Checkbox, CheckboxGroup -from .colormodeswitch import ( - ColorModeButton, - ColorModeIcon, - ColorModeScript, - ColorModeSwitch, -) -from .date_picker import DatePicker -from .date_time_picker import DateTimePicker -from .editable import Editable, EditableInput, EditablePreview, EditableTextarea -from .email import Email -from .form import Form, FormControl, FormErrorMessage, FormHelperText, FormLabel -from .iconbutton import IconButton -from .input import ( - Input, - InputGroup, - InputLeftAddon, - InputLeftElement, - InputRightAddon, - InputRightElement, -) -from .multiselect import Option as MultiSelectOption -from .multiselect import Select as MultiSelect -from .numberinput import ( - NumberDecrementStepper, - NumberIncrementStepper, - NumberInput, - NumberInputField, - NumberInputStepper, -) -from .password import Password -from .pininput import PinInput, PinInputField -from .radio import Radio, RadioGroup -from .rangeslider import ( - RangeSlider, - RangeSliderFilledTrack, - RangeSliderThumb, - RangeSliderTrack, -) -from .select import Option, Select -from .slider import Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack -from .switch import Switch -from .textarea import TextArea -from .time_picker import TimePicker - -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore diff --git a/reflex/components/chakra/forms/button.py b/reflex/components/chakra/forms/button.py deleted file mode 100644 index e7109a5fed..0000000000 --- a/reflex/components/chakra/forms/button.py +++ /dev/null @@ -1,83 +0,0 @@ -"""A button component.""" - -from typing import List - -from reflex.components.chakra import ( - ChakraComponent, - LiteralButtonSize, - LiteralButtonVariant, - LiteralColorScheme, - LiteralSpinnerPlacement, -) -from reflex.vars import Var - - -class Button(ChakraComponent): - """The Button component is used to trigger an event or event, such as submitting a form, opening a dialog, canceling an event, or performing a delete operation.""" - - tag = "Button" - - # The space between the button icon and label. - icon_spacing: Var[int] - - # If true, the button will be styled in its active state. - is_active: Var[bool] - - # If true, the button will be styled in its disabled state. - is_disabled: Var[bool] - - # If true, the button will take up the full width of its container. - is_full_width: Var[bool] - - # If true, the button will show a spinner. - is_loading: Var[bool] - - # The label to show in the button when isLoading is true If no text is passed, it only shows the spinner. - loading_text: Var[str] - - # "lg" | "md" | "sm" | "xs" - size: Var[LiteralButtonSize] - - # "ghost" | "outline" | "solid" | "link" | "unstyled" - variant: Var[LiteralButtonVariant] - - # Built in color scheme for ease of use. - # Options: - # "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" - # | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - color_scheme: Var[LiteralColorScheme] - - # Position of the loading spinner. - # Options: - # "start" | "end" - spinner_placement: Var[LiteralSpinnerPlacement] - - # The type of button. - type_: Var[str] - - # Components that are not allowed as children. - _invalid_children: List[str] = ["Button", "MenuButton"] - - # The name of the form field - name: Var[str] - - -class ButtonGroup(ChakraComponent): - """A group of buttons.""" - - tag = "ButtonGroup" - - # If true, the borderRadius of button that are direct children will be altered to look flushed together. - is_attached: Var[bool] - - # If true, all wrapped button will be disabled. - is_disabled: Var[bool] - - # The spacing between the buttons. - spacing: Var[int] - - # "lg" | "md" | "sm" | "xs" - size: Var[LiteralButtonSize] - - # "ghost" | "outline" | "solid" | "link" | "unstyled" - variant: Var[LiteralButtonVariant] diff --git a/reflex/components/chakra/forms/button.pyi b/reflex/components/chakra/forms/button.pyi deleted file mode 100644 index 71c632178b..0000000000 --- a/reflex/components/chakra/forms/button.pyi +++ /dev/null @@ -1,262 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/button.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Button(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - icon_spacing: Optional[Union[Var[int], int]] = None, - is_active: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_full_width: Optional[Union[Var[bool], bool]] = None, - is_loading: Optional[Union[Var[bool], bool]] = None, - loading_text: Optional[Union[Var[str], str]] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = None, - variant: Optional[ - Union[ - Var[Literal["ghost", "outline", "solid", "link", "unstyled"]], - Literal["ghost", "outline", "solid", "link", "unstyled"], - ] - ] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = None, - spinner_placement: Optional[ - Union[Var[Literal["start", "end"]], Literal["start", "end"]] - ] = None, - type_: Optional[Union[Var[str], 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Button": - """Create the component. - - Args: - *children: The children of the component. - icon_spacing: The space between the button icon and label. - is_active: If true, the button will be styled in its active state. - is_disabled: If true, the button will be styled in its disabled state. - is_full_width: If true, the button will take up the full width of its container. - is_loading: If true, the button will show a spinner. - loading_text: The label to show in the button when isLoading is true If no text is passed, it only shows the spinner. - size: "lg" | "md" | "sm" | "xs" - variant: "ghost" | "outline" | "solid" | "link" | "unstyled" - color_scheme: Built in color scheme for ease of use. Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - spinner_placement: Position of the loading spinner. Options: "start" | "end" - type_: The type of button. - name: The name of the form field - 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 ButtonGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_attached: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - spacing: Optional[Union[Var[int], int]] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = None, - variant: Optional[ - Union[ - Var[Literal["ghost", "outline", "solid", "link", "unstyled"]], - Literal["ghost", "outline", "solid", "link", "unstyled"], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ButtonGroup": - """Create the component. - - Args: - *children: The children of the component. - is_attached: If true, the borderRadius of button that are direct children will be altered to look flushed together. - is_disabled: If true, all wrapped button will be disabled. - spacing: The spacing between the buttons. - size: "lg" | "md" | "sm" | "xs" - variant: "ghost" | "outline" | "solid" | "link" | "unstyled" - 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. - """ - ... diff --git a/reflex/components/chakra/forms/checkbox.py b/reflex/components/chakra/forms/checkbox.py deleted file mode 100644 index 7b5ed7b50b..0000000000 --- a/reflex/components/chakra/forms/checkbox.py +++ /dev/null @@ -1,77 +0,0 @@ -"""A checkbox component.""" - -from __future__ import annotations - -from reflex.components.chakra import ( - ChakraComponent, - LiteralColorScheme, - LiteralTagSize, -) -from reflex.event import EventHandler -from reflex.vars import Var - - -class Checkbox(ChakraComponent): - """The Checkbox component is used in forms when a user needs to select multiple values from several options.""" - - tag = "Checkbox" - - # Color scheme for checkbox. - # Options: - # "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" - # | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - color_scheme: Var[LiteralColorScheme] - - # "sm" | "md" | "lg" - size: Var[LiteralTagSize] - - # If true, the checkbox will be checked. - is_checked: Var[bool] - - # If true, the checkbox will be disabled - is_disabled: Var[bool] - - # If true and is_disabled is passed, the checkbox will remain tabbable but not interactive - is_focusable: Var[bool] - - # If true, the checkbox will be indeterminate. This only affects the icon shown inside checkbox and does not modify the is_checked var. - is_indeterminate: Var[bool] - - # If true, the checkbox is marked as invalid. Changes style of unchecked state. - is_invalid: Var[bool] - - # If true, the checkbox will be readonly - is_read_only: Var[bool] - - # If true, the checkbox input is marked as required, and required attribute will be added - is_required: Var[bool] - - # The name of the input field in a checkbox (Useful for form submission). - name: Var[str] - - # The value of the input field when checked (use is_checked prop for a bool) - value: Var[str] = Var.create("true", _var_is_string=True) # type: ignore - - # The spacing between the checkbox and its label text (0.5rem) - spacing: Var[str] - - # Fired when the checkbox is checked or unchecked - on_change: EventHandler[lambda e0: [e0.target.checked]] - - -class CheckboxGroup(ChakraComponent): - """A group of checkboxes.""" - - tag = "CheckboxGroup" - - # The value of the checkbox group - value: Var[str] - - # The initial value of the checkbox group - default_value: Var[str] - - # If true, all wrapped checkbox inputs will be disabled - is_disabled: Var[bool] - - # If true, input elements will receive checked attribute instead of isChecked. This assumes, you're using native radio inputs - is_native: Var[bool] diff --git a/reflex/components/chakra/forms/checkbox.pyi b/reflex/components/chakra/forms/checkbox.pyi deleted file mode 100644 index 7a2195411a..0000000000 --- a/reflex/components/chakra/forms/checkbox.pyi +++ /dev/null @@ -1,247 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/checkbox.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Checkbox(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg"]], Literal["sm", "md", "lg"]] - ] = None, - is_checked: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_focusable: Optional[Union[Var[bool], bool]] = None, - is_indeterminate: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - name: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - spacing: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Checkbox": - """Create the component. - - Args: - *children: The children of the component. - color_scheme: Color scheme for checkbox. Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - size: "sm" | "md" | "lg" - is_checked: If true, the checkbox will be checked. - is_disabled: If true, the checkbox will be disabled - is_focusable: If true and is_disabled is passed, the checkbox will remain tabbable but not interactive - is_indeterminate: If true, the checkbox will be indeterminate. This only affects the icon shown inside checkbox and does not modify the is_checked var. - is_invalid: If true, the checkbox is marked as invalid. Changes style of unchecked state. - is_read_only: If true, the checkbox will be readonly - is_required: If true, the checkbox input is marked as required, and required attribute will be added - name: The name of the input field in a checkbox (Useful for form submission). - value: The value of the input field when checked (use is_checked prop for a bool) - spacing: The spacing between the checkbox and its label text (0.5rem) - 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 CheckboxGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_native: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "CheckboxGroup": - """Create the component. - - Args: - *children: The children of the component. - value: The value of the checkbox group - default_value: The initial value of the checkbox group - is_disabled: If true, all wrapped checkbox inputs will be disabled - is_native: If true, input elements will receive checked attribute instead of isChecked. This assumes, you're using native radio inputs - 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. - """ - ... diff --git a/reflex/components/chakra/forms/colormodeswitch.py b/reflex/components/chakra/forms/colormodeswitch.py deleted file mode 100644 index 667e07b7b2..0000000000 --- a/reflex/components/chakra/forms/colormodeswitch.py +++ /dev/null @@ -1,104 +0,0 @@ -"""A switch component for toggling color_mode. - -To style components based on color mode, use style props with `color_mode_cond`: - -``` -rx.text( - "Hover over me", - _hover={ - "background": rx.color_mode_cond( - light="var(--chakra-colors-gray-200)", - dark="var(--chakra-colors-gray-700)", - ), - }, -) -``` -""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.media.icon import Icon -from reflex.components.component import BaseComponent -from reflex.components.core.cond import Cond, color_mode_cond -from reflex.style import LIGHT_COLOR_MODE, color_mode, toggle_color_mode - -from .button import Button -from .switch import Switch - -DEFAULT_LIGHT_ICON: Icon = Icon.create(tag="sun") -DEFAULT_DARK_ICON: Icon = Icon.create(tag="moon") - - -class ColorModeIcon(Cond): - """Displays the current color mode as an icon.""" - - @classmethod - def create( - cls, - light_component: BaseComponent | None = None, - dark_component: BaseComponent | None = None, - ): - """Create an icon component based on color_mode. - - Args: - light_component: the component to display when color mode is default - dark_component: the component to display when color mode is dark (non-default) - - Returns: - The conditionally rendered component - """ - return color_mode_cond( - light=light_component or DEFAULT_LIGHT_ICON, - dark=dark_component or DEFAULT_DARK_ICON, - ) - - -class ColorModeSwitch(Switch): - """Switch for toggling chakra light / dark mode via toggle_color_mode.""" - - @classmethod - def create(cls, *children, **props): - """Create a switch component bound to color_mode. - - Args: - *children: The children of the component. - **props: The props to pass to the component. - - Returns: - The switch component. - """ - return Switch.create( - *children, - is_checked=color_mode != LIGHT_COLOR_MODE, - on_change=toggle_color_mode, - **props, - ) - - -class ColorModeButton(Button): - """Button for toggling chakra light / dark mode via toggle_color_mode.""" - - @classmethod - def create(cls, *children, **props): - """Create a button component that calls toggle_color_mode on click. - - Args: - *children: The children of the component. - **props: The props to pass to the component. - - Returns: - The switch component. - """ - return Button.create( - *children, - on_click=toggle_color_mode, - **props, - ) - - -class ColorModeScript(ChakraComponent): - """Chakra color mode script.""" - - tag = "ColorModeScript" - initialColorMode = LIGHT_COLOR_MODE diff --git a/reflex/components/chakra/forms/colormodeswitch.pyi b/reflex/components/chakra/forms/colormodeswitch.pyi deleted file mode 100644 index 05e354bbc0..0000000000 --- a/reflex/components/chakra/forms/colormodeswitch.pyi +++ /dev/null @@ -1,473 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/colormodeswitch.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.media.icon import Icon -from reflex.components.component import BaseComponent -from reflex.components.core.cond import Cond -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -from .button import Button -from .switch import Switch - -DEFAULT_LIGHT_ICON: Icon -DEFAULT_DARK_ICON: Icon - -class ColorModeIcon(Cond): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - cond: Optional[Union[Var[Any], Any]] = None, - comp1: Optional[BaseComponent] = None, - comp2: Optional[BaseComponent] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ColorModeIcon": - """Create an icon component based on color_mode. - - Args: - light_component: the component to display when color mode is default - dark_component: the component to display when color mode is dark (non-default) - - Returns: - The conditionally rendered component - """ - ... - -class ColorModeSwitch(Switch): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_checked: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_focusable: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - name: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - spacing: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = 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, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ColorModeSwitch": - """Create a switch component bound to color_mode. - - Args: - *children: The children of the component. - is_checked: If true, the switch will be checked. You'll need to set an on_change event handler to update its value (since it is now controlled) - is_disabled: If true, the switch will be disabled - is_focusable: If true and is_disabled prop is set, the switch will remain tabbable but not interactive. - is_invalid: If true, the switch is marked as invalid. Changes style of unchecked state. - is_read_only: If true, the switch will be readonly - is_required: If true, the switch will be required - name: The name of the input field in a switch (Useful for form submission). - value: The value of the input field when checked (use is_checked prop for a bool) - spacing: The spacing between the switch and its label text (0.5rem) - placeholder: The placeholder text. - color_scheme: The color scheme of the switch (e.g. "blue", "green", "red", etc.) - 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 switch component. - """ - ... - -class ColorModeButton(Button): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - icon_spacing: Optional[Union[Var[int], int]] = None, - is_active: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_full_width: Optional[Union[Var[bool], bool]] = None, - is_loading: Optional[Union[Var[bool], bool]] = None, - loading_text: Optional[Union[Var[str], str]] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = None, - variant: Optional[ - Union[ - Var[Literal["ghost", "outline", "solid", "link", "unstyled"]], - Literal["ghost", "outline", "solid", "link", "unstyled"], - ] - ] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = None, - spinner_placement: Optional[ - Union[Var[Literal["start", "end"]], Literal["start", "end"]] - ] = None, - type_: Optional[Union[Var[str], 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ColorModeButton": - """Create a button component that calls toggle_color_mode on click. - - Args: - *children: The children of the component. - icon_spacing: The space between the button icon and label. - is_active: If true, the button will be styled in its active state. - is_disabled: If true, the button will be styled in its disabled state. - is_full_width: If true, the button will take up the full width of its container. - is_loading: If true, the button will show a spinner. - loading_text: The label to show in the button when isLoading is true If no text is passed, it only shows the spinner. - size: "lg" | "md" | "sm" | "xs" - variant: "ghost" | "outline" | "solid" | "link" | "unstyled" - color_scheme: Built in color scheme for ease of use. Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - spinner_placement: Position of the loading spinner. Options: "start" | "end" - type_: The type of button. - name: The name of the form field - 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 switch component. - """ - ... - -class ColorModeScript(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ColorModeScript": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/date_picker.py b/reflex/components/chakra/forms/date_picker.py deleted file mode 100644 index 350e700b6a..0000000000 --- a/reflex/components/chakra/forms/date_picker.py +++ /dev/null @@ -1,11 +0,0 @@ -"""A date input component.""" - -from reflex.components.chakra.forms.input import Input -from reflex.vars import Var - - -class DatePicker(Input): - """A date input component.""" - - # The type of input. - type_: Var[str] = "date" # type: ignore diff --git a/reflex/components/chakra/forms/date_picker.pyi b/reflex/components/chakra/forms/date_picker.pyi deleted file mode 100644 index 4e2a42b5c0..0000000000 --- a/reflex/components/chakra/forms/date_picker.pyi +++ /dev/null @@ -1,129 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/date_picker.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class DatePicker(Input): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type_: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DatePicker": - """Create an Input component. - - Args: - *children: The children of the component. - type_: The type of input. - value: State var to bind the input. - default_value: The default value of the input. - placeholder: The placeholder text. - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled - is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_read_only: If true, the form control will be readonly. - is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - variant: "outline" | "filled" | "flushed" | "unstyled" - size: "lg" | "md" | "sm" | "xs" - name: The name of the form field - 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 properties of the component. - - Returns: - The component. - """ - ... diff --git a/reflex/components/chakra/forms/date_time_picker.py b/reflex/components/chakra/forms/date_time_picker.py deleted file mode 100644 index ae245a907a..0000000000 --- a/reflex/components/chakra/forms/date_time_picker.py +++ /dev/null @@ -1,11 +0,0 @@ -"""A datetime-local input component.""" - -from reflex.components.chakra.forms.input import Input -from reflex.vars import Var - - -class DateTimePicker(Input): - """A datetime-local input component.""" - - # The type of input. - type_: Var[str] = "datetime-local" # type: ignore diff --git a/reflex/components/chakra/forms/date_time_picker.pyi b/reflex/components/chakra/forms/date_time_picker.pyi deleted file mode 100644 index 9562c5de3f..0000000000 --- a/reflex/components/chakra/forms/date_time_picker.pyi +++ /dev/null @@ -1,129 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/date_time_picker.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class DateTimePicker(Input): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type_: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DateTimePicker": - """Create an Input component. - - Args: - *children: The children of the component. - type_: The type of input. - value: State var to bind the input. - default_value: The default value of the input. - placeholder: The placeholder text. - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled - is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_read_only: If true, the form control will be readonly. - is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - variant: "outline" | "filled" | "flushed" | "unstyled" - size: "lg" | "md" | "sm" | "xs" - name: The name of the form field - 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 properties of the component. - - Returns: - The component. - """ - ... diff --git a/reflex/components/chakra/forms/editable.py b/reflex/components/chakra/forms/editable.py deleted file mode 100644 index f9932bb657..0000000000 --- a/reflex/components/chakra/forms/editable.py +++ /dev/null @@ -1,67 +0,0 @@ -"""An editable component.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler -from reflex.vars import Var - - -class Editable(ChakraComponent): - """The wrapper component that provides context value.""" - - tag = "Editable" - - # If true, the Editable will be disabled. - is_disabled: Var[bool] - - # If true, the read only view, has a tabIndex set to 0 so it can receive focus via the keyboard or click. - is_preview_focusable: Var[bool] - - # The placeholder text when the value is empty. - placeholder: Var[str] - - # If true, the input's text will be highlighted on focus. - select_all_on_focus: Var[bool] - - # If true, the Editable will start with edit mode by default. - start_with_edit_view: Var[bool] - - # If true, it'll update the value onBlur and turn off the edit mode. - submit_on_blur: Var[bool] - - # The value of the Editable in both edit & preview mode - value: Var[str] - - # The initial value of the Editable in both edit and preview mode. - default_value: Var[str] - - # Fired when the Editable is changed. - on_change: EventHandler[lambda e0: [e0]] - - # Fired when the Editable is in edit mode. - on_edit: EventHandler[lambda e0: [e0]] - - # Fired when the Editable is submitted. - on_submit: EventHandler[lambda e0: [e0]] - - # Fired when the Editable is canceled. - on_cancel: EventHandler[lambda e0: [e0]] - - -class EditableInput(ChakraComponent): - """The edit view of the component. It shows when you click or focus on the text.""" - - tag = "EditableInput" - - -class EditableTextarea(ChakraComponent): - """Use the textarea element to handle multi line text input in an editable context.""" - - tag = "EditableTextarea" - - -class EditablePreview(ChakraComponent): - """The read-only view of the component.""" - - tag = "EditablePreview" diff --git a/reflex/components/chakra/forms/editable.pyi b/reflex/components/chakra/forms/editable.pyi deleted file mode 100644 index c8cbe20e10..0000000000 --- a/reflex/components/chakra/forms/editable.pyi +++ /dev/null @@ -1,343 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/editable.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Editable(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_preview_focusable: Optional[Union[Var[bool], bool]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - select_all_on_focus: Optional[Union[Var[bool], bool]] = None, - start_with_edit_view: Optional[Union[Var[bool], bool]] = None, - submit_on_blur: Optional[Union[Var[bool], bool]] = None, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_cancel: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_edit: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_submit: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Editable": - """Create the component. - - Args: - *children: The children of the component. - is_disabled: If true, the Editable will be disabled. - is_preview_focusable: If true, the read only view, has a tabIndex set to 0 so it can receive focus via the keyboard or click. - placeholder: The placeholder text when the value is empty. - select_all_on_focus: If true, the input's text will be highlighted on focus. - start_with_edit_view: If true, the Editable will start with edit mode by default. - submit_on_blur: If true, it'll update the value onBlur and turn off the edit mode. - value: The value of the Editable in both edit & preview mode - default_value: The initial value of the Editable in both edit and preview mode. - 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 EditableInput(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "EditableInput": - """Create the component. - - Args: - *children: The children of the component. - 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 EditableTextarea(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "EditableTextarea": - """Create the component. - - Args: - *children: The children of the component. - 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 EditablePreview(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "EditablePreview": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/email.py b/reflex/components/chakra/forms/email.py deleted file mode 100644 index 18fadef2d7..0000000000 --- a/reflex/components/chakra/forms/email.py +++ /dev/null @@ -1,11 +0,0 @@ -"""An email input component.""" - -from reflex.components.chakra.forms.input import Input -from reflex.vars import Var - - -class Email(Input): - """An email input component.""" - - # The type of input. - type_: Var[str] = "email" # type: ignore diff --git a/reflex/components/chakra/forms/email.pyi b/reflex/components/chakra/forms/email.pyi deleted file mode 100644 index e8ec4876f4..0000000000 --- a/reflex/components/chakra/forms/email.pyi +++ /dev/null @@ -1,129 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/email.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Email(Input): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type_: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Email": - """Create an Input component. - - Args: - *children: The children of the component. - type_: The type of input. - value: State var to bind the input. - default_value: The default value of the input. - placeholder: The placeholder text. - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled - is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_read_only: If true, the form control will be readonly. - is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - variant: "outline" | "filled" | "flushed" | "unstyled" - size: "lg" | "md" | "sm" | "xs" - name: The name of the form field - 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 properties of the component. - - Returns: - The component. - """ - ... diff --git a/reflex/components/chakra/forms/form.py b/reflex/components/chakra/forms/form.py deleted file mode 100644 index d59faad6ed..0000000000 --- a/reflex/components/chakra/forms/form.py +++ /dev/null @@ -1,103 +0,0 @@ -"""Form components.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.components.el.elements.forms import Form as HTMLForm -from reflex.vars import Var - - -class Form(ChakraComponent, HTMLForm): - """A form component.""" - - tag = "Box" - - # What the form renders to. - as_: Var[str] = "form" # type: ignore - - -class FormControl(ChakraComponent): - """Provide context to form components.""" - - tag = "FormControl" - - # If true, the form control will be disabled. - is_disabled: Var[bool] - - # If true, the form control will be invalid. - is_invalid: Var[bool] - - # If true, the form control will be readonly - is_read_only: Var[bool] - - # If true, the form control will be required. - is_required: Var[bool] - - # The label text used to inform users as to what information is requested for a text field. - label: Var[str] - - @classmethod - def create( - cls, - *children, - label=None, - input=None, - help_text=None, - error_message=None, - **props, - ) -> Component: - """Create a form control component. - - Args: - *children: The children of the form control. - label: The label of the form control. - input: The input of the form control. - help_text: The help text of the form control. - error_message: The error message of the form control. - **props: The properties of the form control. - - Raises: - AttributeError: raise an error if missing required kwargs. - - Returns: - The form control component. - """ - if len(children) == 0: - children = [] - - if label: - children.append(FormLabel.create(*label)) - - if not input: - raise AttributeError("input keyword argument is required") - children.append(input) - - if help_text: - children.append(FormHelperText.create(*help_text)) - - if error_message: - children.append(FormErrorMessage.create(*error_message)) - - return super().create(*children, **props) - - -class FormHelperText(ChakraComponent): - """A form helper text component.""" - - tag = "FormHelperText" - - -class FormLabel(ChakraComponent): - """A form label component.""" - - tag = "FormLabel" - - # Link - html_for: Var[str] - - -class FormErrorMessage(ChakraComponent): - """A form error message component.""" - - tag = "FormErrorMessage" diff --git a/reflex/components/chakra/forms/form.pyi b/reflex/components/chakra/forms/form.pyi deleted file mode 100644 index cae6952c2e..0000000000 --- a/reflex/components/chakra/forms/form.pyi +++ /dev/null @@ -1,484 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/form.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.el.elements.forms import Form as HTMLForm -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Form(ChakraComponent, HTMLForm): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_: Optional[Union[Var[str], str]] = None, - accept: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - accept_charset: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] - ] = None, - action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, - auto_complete: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] - ] = 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, - 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, - auto_capitalize: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] - ] = None, - content_editable: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] - ] = None, - context_menu: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] - ] = 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, - enter_key_hint: Optional[ - Union[Var[Union[bool, int, str]], str, int, bool] - ] = 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, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_submit: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Form": - """Create a form component. - - Args: - *children: The children of the form. - as_: What the form renders to. - accept: MIME types the server accepts for file upload - accept_charset: Character encodings to be used for form submission - action: URL where the form's data should be submitted - auto_complete: Whether the form should have autocomplete enabled - enc_type: Encoding type for the form data when submitted - method: HTTP method to use for form submission - name: Name of the form - no_validate: Indicates that the form should not be validated on submit - target: Where to display the response after submitting the form - reset_on_submit: If true, the form will be cleared after submit. - handle_submit_unique_name: The name used to make this form's submit handler function unique. - 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 properties of the form. - - Returns: - The form component. - """ - ... - -class FormControl(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - label=None, - input=None, - help_text=None, - error_message=None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "FormControl": - """Create a form control component. - - Args: - *children: The children of the form control. - label: The label of the form control. - input: The input of the form control. - help_text: The help text of the form control. - error_message: The error message of the form control. - is_disabled: If true, the form control will be disabled. - is_invalid: If true, the form control will be invalid. - is_read_only: If true, the form control will be readonly - is_required: If true, the form control will be required. - 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 properties of the form control. - - Raises: - AttributeError: raise an error if missing required kwargs. - - Returns: - The form control component. - """ - ... - -class FormHelperText(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "FormHelperText": - """Create the component. - - Args: - *children: The children of the component. - 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 FormLabel(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - html_for: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "FormLabel": - """Create the component. - - Args: - *children: The children of the component. - html_for: Link - 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 FormErrorMessage(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "FormErrorMessage": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/iconbutton.py b/reflex/components/chakra/forms/iconbutton.py deleted file mode 100644 index 10e3d3a6fb..0000000000 --- a/reflex/components/chakra/forms/iconbutton.py +++ /dev/null @@ -1,38 +0,0 @@ -"""An icon button component.""" - -from typing import Optional - -from reflex.components.chakra.typography.text import Text -from reflex.components.component import Component -from reflex.vars import Var - - -class IconButton(Text): - """A button with an icon.""" - - tag = "IconButton" - library = "@chakra-ui/button@2.1.0" - - # The type of button. - type: Var[str] - - # A label that describes the button - aria_label: Var[str] - - # The icon to be used in the button. - icon: Optional[Component] - - # If true, the button will be styled in its active state. - is_active: Var[bool] - - # If true, the button will be disabled. - is_disabled: Var[bool] - - # If true, the button will show a spinner. - is_loading: Var[bool] - - # If true, the button will be perfectly round. Else, it'll be slightly round - is_round: Var[bool] - - # Replace the spinner component when isLoading is set to true - spinner: Var[str] diff --git a/reflex/components/chakra/forms/iconbutton.pyi b/reflex/components/chakra/forms/iconbutton.pyi deleted file mode 100644 index a98d4d23de..0000000000 --- a/reflex/components/chakra/forms/iconbutton.pyi +++ /dev/null @@ -1,108 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/iconbutton.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra.typography.text import Text -from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class IconButton(Text): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type: Optional[Union[Var[str], str]] = None, - aria_label: Optional[Union[Var[str], str]] = None, - icon: Optional[Component] = None, - is_active: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_loading: Optional[Union[Var[bool], bool]] = None, - is_round: Optional[Union[Var[bool], bool]] = None, - spinner: Optional[Union[Var[str], str]] = None, - as_: Optional[Union[Var[str], str]] = None, - no_of_lines: 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "IconButton": - """Create the component. - - Args: - *children: The children of the component. - type: The type of button. - aria_label: A label that describes the button - icon: The icon to be used in the button. - is_active: If true, the button will be styled in its active state. - is_disabled: If true, the button will be disabled. - is_loading: If true, the button will show a spinner. - is_round: If true, the button will be perfectly round. Else, it'll be slightly round - spinner: Replace the spinner component when isLoading is set to true - as_: Override the tag. The default tag is `

`. - no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/input.py b/reflex/components/chakra/forms/input.py deleted file mode 100644 index c162a776f3..0000000000 --- a/reflex/components/chakra/forms/input.py +++ /dev/null @@ -1,130 +0,0 @@ -"""An input component.""" - -from reflex.components.chakra import ( - ChakraComponent, - LiteralButtonSize, - LiteralInputVariant, -) -from reflex.components.component import Component -from reflex.components.core.debounce import DebounceInput -from reflex.components.literals import LiteralInputType -from reflex.constants import MemoizationMode -from reflex.event import EventHandler -from reflex.utils.imports import ImportDict -from reflex.vars import Var - - -class Input(ChakraComponent): - """The Input component is a component that is used to get user input in a text field.""" - - tag = "Input" - - # State var to bind the input. - value: Var[str] - - # The default value of the input. - default_value: Var[str] - - # The placeholder text. - placeholder: Var[str] - - # The type of input. - type_: Var[LiteralInputType] - - # The border color when the input is invalid. - error_border_color: Var[str] - - # The border color when the input is focused. - focus_border_color: Var[str] - - # If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled - is_disabled: Var[bool] - - # If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_invalid: Var[bool] - - # If true, the form control will be readonly. - is_read_only: Var[bool] - - # If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - is_required: Var[bool] - - # "outline" | "filled" | "flushed" | "unstyled" - variant: Var[LiteralInputVariant] - - # "lg" | "md" | "sm" | "xs" - size: Var[LiteralButtonSize] - - # The name of the form field - name: Var[str] - - # Fired when the input value changes. - on_change: EventHandler[lambda e0: [e0.target.value]] - - # Fired when the input is focused. - on_focus: EventHandler[lambda e0: [e0.target.value]] - - # Fired when the input lose focus. - 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]] - - def add_imports(self) -> ImportDict: - """Add imports for the Input component. - - Returns: - The import dict. - """ - return {"/utils/state": "set_val"} - - @classmethod - def create(cls, *children, **props) -> Component: - """Create an Input component. - - Args: - *children: The children of the component. - **props: The properties of the component. - - Returns: - The component. - """ - if props.get("value") is not None and props.get("on_change") is not None: - # create a debounced input if the user requests full control to avoid typing jank - return DebounceInput.create(super().create(*children, **props)) - return super().create(*children, **props) - - -class InputGroup(ChakraComponent): - """The InputGroup component is a component that is used to group a set of inputs.""" - - tag = "InputGroup" - - _memoization_mode = MemoizationMode(recursive=False) - - -class InputLeftAddon(ChakraComponent): - """The InputLeftAddon component is a component that is used to add an addon to the left of an input.""" - - tag = "InputLeftAddon" - - -class InputRightAddon(ChakraComponent): - """The InputRightAddon component is a component that is used to add an addon to the right of an input.""" - - tag = "InputRightAddon" - - -class InputLeftElement(ChakraComponent): - """The InputLeftElement component is a component that is used to add an element to the left of an input.""" - - tag = "InputLeftElement" - - -class InputRightElement(ChakraComponent): - """The InputRightElement component is a component that is used to add an element to the right of an input.""" - - tag = "InputRightElement" diff --git a/reflex/components/chakra/forms/input.pyi b/reflex/components/chakra/forms/input.pyi deleted file mode 100644 index fcf61c8882..0000000000 --- a/reflex/components/chakra/forms/input.pyi +++ /dev/null @@ -1,566 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/input.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.utils.imports import ImportDict -from reflex.vars import BaseVar, Var - -class Input(ChakraComponent): - def add_imports(self) -> ImportDict: ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - type_: Optional[ - Union[ - Var[ - Literal[ - "button", - "checkbox", - "color", - "date", - "datetime-local", - "email", - "file", - "hidden", - "image", - "month", - "number", - "password", - "radio", - "range", - "reset", - "search", - "submit", - "tel", - "text", - "time", - "url", - "week", - ] - ], - Literal[ - "button", - "checkbox", - "color", - "date", - "datetime-local", - "email", - "file", - "hidden", - "image", - "month", - "number", - "password", - "radio", - "range", - "reset", - "search", - "submit", - "tel", - "text", - "time", - "url", - "week", - ], - ] - ] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Input": - """Create an Input component. - - Args: - *children: The children of the component. - value: State var to bind the input. - default_value: The default value of the input. - placeholder: The placeholder text. - type_: The type of input. - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled - is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_read_only: If true, the form control will be readonly. - is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - variant: "outline" | "filled" | "flushed" | "unstyled" - size: "lg" | "md" | "sm" | "xs" - name: The name of the form field - 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 properties of the component. - - Returns: - The component. - """ - ... - -class InputGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "InputGroup": - """Create the component. - - Args: - *children: The children of the component. - 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 InputLeftAddon(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "InputLeftAddon": - """Create the component. - - Args: - *children: The children of the component. - 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 InputRightAddon(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "InputRightAddon": - """Create the component. - - Args: - *children: The children of the component. - 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 InputLeftElement(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "InputLeftElement": - """Create the component. - - Args: - *children: The children of the component. - 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 InputRightElement(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "InputRightElement": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/multiselect.py b/reflex/components/chakra/forms/multiselect.py deleted file mode 100644 index 3d52d4bbe2..0000000000 --- a/reflex/components/chakra/forms/multiselect.py +++ /dev/null @@ -1,355 +0,0 @@ -"""Provides a feature-rich Select and some (not all) related components.""" - -from __future__ import annotations - -from typing import Any, Dict, List, Optional, Set, Union - -from reflex.base import Base -from reflex.components.component import Component -from reflex.constants import EventTriggers -from reflex.vars import Var - - -class Option(Base): - """An option component for the chakra-react-select Select.""" - - # What is displayed to the user - label: str - - # The value of the option, must be serializable - value: Any - - # the variant of the option tag - variant: Optional[str] = None - - # [not working yet] - # Whether the option is disabled - # is_disabled: Optional[bool] = None - - # [not working yet] - # The visual color appearance of the component - # options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | - # "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | - # "purple" | "pink" | "linkedin" | "facebook" | "messenger" | - # "whatsapp" | "twitter" | "telegram" - # default: "gray" - # color_scheme: Optional[str] = None - - # [not working yet] - # The icon of the option tag - # icon: Optional[str] = None - - -class Select(Component): - """The default chakra-react-select Select component. - Not every available prop is listed here, - for a complete overview check the react-select/chakra-react-select docs. - Props added by chakra-react-select are marked with "[chakra]". - """ - - library = "chakra-react-select@4.7.5" - tag = "Select" - alias = "MultiSelect" - - # Focus the control when it is mounted - auto_focus: Var[bool] - - # Remove the currently focused option when the user presses backspace - # when Select isClearable or isMulti - backspace_removes_value: Var[bool] - - # Remove focus from the input when the user selects an option - # (handy for dismissing the keyboard on touch devices) - blur_input_on_select: Var[bool] - - # When the user reaches the top/bottom of the menu, - # prevent scroll on the scroll-parent - capture_menu_scroll: Var[bool] - - # [chakra] - # To use the chakraStyles prop, first, - # check the documentation for the original styles prop from the react-select docs. - # This package offers an identical API for the chakraStyles prop, however, - # the provided and output style objects use Chakra's sx prop - # instead of the default emotion styles the original package offers. - # This allows you to both use the shorthand styling props you'd normally use - # to style Chakra components, as well as tokens from your theme such as named colors. - # All of the style keys offered in the original package can be used in the chakraStyles prop - # except for menuPortal. Along with some other caveats, this is explained below. - # Most of the components rendered by this package use the basic Chakra component with a few exceptions. - # Here are the style keys offered and the corresponding Chakra component that is rendered: - # - clearIndicator - Box (uses theme styles for Chakra's CloseButton) - # - container - Box - # - control - Box (uses theme styles for Chakra's Input) - # - dropdownIndicator - Box (uses theme styles for Chrakra's InputRightAddon) - # - downChevron - Icon - # - crossIcon - Icon - # - group - Box - # - groupHeading - Box (uses theme styles for Chakra's Menu group title) - # - indicatorsContainer - Box - # - indicatorSeparator - Divider - # - input - chakra.input (wrapped in a Box) - # - inputContainer - Box - # - loadingIndicator - Spinner - # - loadingMessage - Box - # - menu - Box - # - menuList - Box (uses theme styles for Chakra's Menu) - # - multiValue - chakra.span (uses theme styles for Chakra's Tag) - # - multiValueLabel - chakra.span (uses theme styles for Chakra's TagLabel) - # - multiValueRemove - Box (uses theme styles for Chakra's TagCloseButton) - # - noOptionsMessage - Box - # - option - Box (uses theme styles for Chakra's MenuItem) - # - placeholder - Box - # - singleValue - Box - # - valueContainer - Box - chakra_styles: Var[str] - - # Close the select menu when the user selects an option - close_menu_on_select: Var[bool] - - # If true, close the select menu when the user scrolls the document/body. - close_menu_on_scroll: Var[bool] - - # [chakra] - # The visual color appearance of the component - # options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | - # "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | - # "purple" | "pink" | "linkedin" | "facebook" | "messenger" | - # "whatsapp" | "twitter" | "telegram" - # default: "gray" - color_scheme: Var[str] - - # This complex object includes all the compositional components - # that are used in react-select. If you wish to overwrite a component, - # pass in an object with the appropriate namespace. - # If you only wish to restyle a component, - # we recommend using the styles prop instead. - components: Var[Dict[str, Component]] - - # Whether the value of the select, e.g. SingleValue, - # should be displayed in the control. - control_should_render_value: Var[bool] - - # Delimiter used to join multiple values into a single HTML Input value - delimiter: Var[str] - - # [chakra] - # Colors the component border with the given chakra color string on error state - # default: "red.500" - error_border_color: Var[str] - - # Clear all values when the user presses escape AND the menu is closed - escape_clears_value: Var[bool] - - # [chakra] - # Colors the component border with the given chakra color string on focus - # default: "blue.500" - focus_border_color: Var[str] - - # Sets the form attribute on the input - form: Var[str] - - # Hide the selected option from the menu - hide_selected_options: Var[bool] - - # The id to set on the SelectContainer component. - # id: Var[str] - - # The value of the search input - input_value: Var[str] - - # The id of the search input - input_id: Var[str] - - # Is the select value clearable - is_clearable: Var[bool] - - # Is the select disabled - is_disabled: Var[bool] - - # [chakra] - # Style component in the chakra invalid style - # default: False - is_invalid: Var[bool] - - # Support multiple selected options - is_multi: Var[bool] - - # [chakra] - # Style component as disabled (chakra style) - # default: False - is_read_only: Var[bool] - - # Is the select direction right-to-left - is_rtl: Var[bool] - - # Whether to enable search functionality - is_searchable: Var[bool] - - # Minimum height of the menu before flipping - min_menu_height: Var[int] - - # Maximum height of the menu before scrolling - max_menu_height: Var[int] - - # Default placement of the menu in relation to the control. - # 'auto' will flip when there isn't enough space below the control. - # options: "bottom" | "auto" | "top" - menu_placement: Var[str] - - # The CSS position value of the menu, - # when "fixed" extra layout management is required - # options: "absolute" | "fixed" - menu_position: Var[str] - - # Whether to block scroll events when the menu is open - menu_should_block_scroll: Var[bool] - - # Whether the menu should be scrolled into view when it opens - menu_should_scroll_into_view: Var[bool] - - # Name of the HTML Input (optional - without this, no input will be rendered) - name: Var[str] - - # Allows control of whether the menu is opened when the Select is focused - open_menu_on_focus: Var[bool] - - # Allows control of whether the menu is opened when the Select is clicked - open_menu_on_click: Var[bool] - - # Array of options that populate the select menu - options: Var[List[Dict]] - - # Number of options to jump in menu when page{up|down} keys are used - page_size: Var[int] - - # Placeholder for the select value - placeholder: Var[Optional[str]] - - # Marks the value-holding input as required for form validation - required: Var[bool] - - # [chakra] - # If you choose to stick with the default selectedOptionStyle="color", - # you have one additional styling option. - # If you do not like the default of blue for the highlight color, - # you can pass the selectedOptionColorScheme prop to change it. - # This prop will accept any named color from your theme's color palette, - # and it will use the 500 value in light mode or the 300 value in dark mode. - # This prop can only be used for named colors from your theme, not arbitrary hex/rgb colors. - # If you would like to use a specific color for the background that's not a part of your theme, - # use the chakraStyles prop to customize it. - # default: "blue" - selected_option_color_scheme: Var[str] - - # [chakra] - # The default option "color" will style a selected option - # similar to how react-select does it, - # by highlighting the selected option in the color blue. - # Alternatively, if you pass "check" for the value, - # the selected option will be styled like the Chakra UI Menu component - # and include a check icon next to the selected option(s). - # If is_multi and selected_option_style="check" are passed, - # space will only be added for the check marks - # if hide_selected_options=False is also passed. - # options: "color" | "check" - # default: "color" - selected_option_style: Var[str] - - # [chakra] - # The size of the component. - # options: "sm" | "md" | "lg" - # default: "md" - size: Var[str] - - # Sets the tabIndex attribute on the input - tab_index: Var[int] - - # Select the currently focused option when the user presses tab - tab_selects_value: Var[bool] - - # [chakra] - # Variant of multi-select tags - # options: "subtle" | "solid" | "outline" - # default: "subtle" - tag_variant: Var[str] - - # Remove all non-essential styles - unstyled: Var[bool] - - # [chakra] - # If this prop is passed, - # the dropdown indicator at the right of the component will be styled - # in the same way the original Chakra Select component is styled, - # instead of being styled as an InputRightAddon. - # The original purpose of styling it as an addon - # was to create a visual separation between the dropdown indicator - # and the button for clearing the selected options. - # However, as this button only appears when isMulti is passed, - # using this style could make more sense for a single select. - # default: False - use_basic_style: Var[bool] - - # [chakra] - # The variant of the Select. If no variant is passed, - # it will default to defaultProps.variant from the theme for Chakra's Input component. - # If your component theme for Input is not modified, it will be outline. - # options: "outline" | "filled" | "flushed" | "unstyled" - # default: "outline" - variant: Var[str] - - # How the options should be displayed in the menu. - menu_position: Var[str] = "fixed" # type: ignore - - 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 { - **super().get_event_triggers(), - EventTriggers.ON_CHANGE: ( - lambda e0: [ - Var.create_safe(f"{e0}.map(e => e.value)", _var_is_local=True) - ] - if self.is_multi.equals(Var.create_safe(True)) - else lambda e0: [e0] - ), - } - - @classmethod - def get_initial_props(cls) -> Set[str]: - """Get the initial props to set for the component. - - Returns: - The initial props to set. - """ - return super().get_initial_props() | {"is_multi"} - - @classmethod - def create( - cls, options: List[Union[Option, str, int, float, bool]], **props - ) -> Component: - """Takes a list of options and additional properties, checks if each option is an - instance of Option, and returns a Select component with the given options and - properties. No children allowed. - - Args: - options (List[Option | str | int | float | bool]): A list of values. - **props: Additional properties to be passed to the Select component. - - Returns: - The `create` method is returning an instance of the `Select` class. - """ - converted_options: List[Option] = [] - if not isinstance(options, Var): - for option in options: - if not isinstance(option, Option): - converted_options.append(Option(label=str(option), value=option)) - else: - converted_options.append(option) - props["options"] = [o.dict() for o in converted_options] - else: - props["options"] = options - return super().create(*[], **props) diff --git a/reflex/components/chakra/forms/numberinput.py b/reflex/components/chakra/forms/numberinput.py deleted file mode 100644 index 39956840d5..0000000000 --- a/reflex/components/chakra/forms/numberinput.py +++ /dev/null @@ -1,128 +0,0 @@ -"""A number input component.""" - -from numbers import Number - -from reflex.components.chakra import ( - ChakraComponent, - LiteralButtonSize, - LiteralInputVariant, -) -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - - -class NumberInput(ChakraComponent): - """The wrapper that provides context and logic to the components.""" - - tag = "NumberInput" - - # State var to bind the input. - value: Var[Number] - - # If true, the input's value will change based on mouse wheel. - allow_mouse_wheel: Var[bool] - - # This controls the value update when you blur out of the input. - If true and the value is greater than max, the value will be reset to max - Else, the value remains the same. - clamped_value_on_blur: Var[bool] - - # The initial value of the counter. Should be less than max and greater than min - default_value: Var[Number] - - # The border color when the input is invalid. - error_border_color: Var[str] - - # The border color when the input is focused. - focus_border_color: Var[str] - - # If true, the input will be focused as you increment or decrement the value with the stepper - focus_input_on_change: Var[bool] - - # Hints at the type of data that might be entered by the user. It also determines the type of keyboard shown to the user on mobile devices ("text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal") - # input_mode: Var[LiteralInputNumberMode] - - # Whether the input should be disabled. - is_disabled: Var[bool] - - # If true, the input will have `aria-invalid` set to true - is_invalid: Var[bool] - - # If true, the input will be in readonly mode - is_read_only: Var[bool] - - # Whether the input is required - is_required: Var[bool] - - # Whether the pressed key should be allowed in the input. The default behavior is to allow DOM floating point characters defined by /^[Ee0-9+\-.]$/ - is_valid_character: Var[str] - - # This controls the value update behavior in general. - If true and you use the stepper or up/down arrow keys, the value will not exceed the max or go lower than min - If false, the value will be allowed to go out of range. - keep_within_range: Var[bool] - - # The maximum value of the counter - max_: Var[Number] - - # The minimum value of the counter - min_: Var[Number] - - # "outline" | "filled" | "flushed" | "unstyled" - variant: Var[LiteralInputVariant] - - # "lg" | "md" | "sm" | "xs" - size: Var[LiteralButtonSize] - - # The name of the form field - name: Var[str] - - # Fired when the input value changes. - on_change: EventHandler[lambda e0: [e0]] - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a number input component. - - If no children are provided, a default stepper will be used. - - Args: - *children: The children of the component. - **props: The props of the component. - - Returns: - The component. - """ - if len(children) == 0: - _id = props.pop("id", None) - children = [ - NumberInputField.create(id=_id) - if _id is not None - else NumberInputField.create(), - NumberInputStepper.create( - NumberIncrementStepper.create(), - NumberDecrementStepper.create(), - ), - ] - return super().create(*children, **props) - - -class NumberInputField(ChakraComponent): - """The input field itself.""" - - tag = "NumberInputField" - - -class NumberInputStepper(ChakraComponent): - """The wrapper for the input's stepper buttons.""" - - tag = "NumberInputStepper" - - -class NumberIncrementStepper(ChakraComponent): - """The button to increment the value of the input.""" - - tag = "NumberIncrementStepper" - - -class NumberDecrementStepper(ChakraComponent): - """The button to decrement the value of the input.""" - - tag = "NumberDecrementStepper" diff --git a/reflex/components/chakra/forms/numberinput.pyi b/reflex/components/chakra/forms/numberinput.pyi deleted file mode 100644 index 521fcdd74a..0000000000 --- a/reflex/components/chakra/forms/numberinput.pyi +++ /dev/null @@ -1,442 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/numberinput.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from numbers import Number -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class NumberInput(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[Number], Number]] = None, - allow_mouse_wheel: Optional[Union[Var[bool], bool]] = None, - clamped_value_on_blur: Optional[Union[Var[bool], bool]] = None, - default_value: Optional[Union[Var[Number], Number]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - focus_input_on_change: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - is_valid_character: Optional[Union[Var[str], str]] = None, - keep_within_range: Optional[Union[Var[bool], bool]] = None, - max_: Optional[Union[Var[Number], Number]] = None, - min_: Optional[Union[Var[Number], Number]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "NumberInput": - """Create a number input component. - - If no children are provided, a default stepper will be used. - - Args: - *children: The children of the component. - value: State var to bind the input. - allow_mouse_wheel: If true, the input's value will change based on mouse wheel. - clamped_value_on_blur: This controls the value update when you blur out of the input. - If true and the value is greater than max, the value will be reset to max - Else, the value remains the same. - default_value: The initial value of the counter. Should be less than max and greater than min - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - focus_input_on_change: If true, the input will be focused as you increment or decrement the value with the stepper - is_disabled: Hints at the type of data that might be entered by the user. It also determines the type of keyboard shown to the user on mobile devices ("text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal") input_mode: Var[LiteralInputNumberMode] Whether the input should be disabled. - is_invalid: If true, the input will have `aria-invalid` set to true - is_read_only: If true, the input will be in readonly mode - is_required: Whether the input is required - is_valid_character: Whether the pressed key should be allowed in the input. The default behavior is to allow DOM floating point characters defined by /^[Ee0-9+\\-.]$/ - keep_within_range: This controls the value update behavior in general. - If true and you use the stepper or up/down arrow keys, the value will not exceed the max or go lower than min - If false, the value will be allowed to go out of range. - max_: The maximum value of the counter - min_: The minimum value of the counter - variant: "outline" | "filled" | "flushed" | "unstyled" - size: "lg" | "md" | "sm" | "xs" - name: The name of the form field - 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 NumberInputField(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "NumberInputField": - """Create the component. - - Args: - *children: The children of the component. - 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 NumberInputStepper(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "NumberInputStepper": - """Create the component. - - Args: - *children: The children of the component. - 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 NumberIncrementStepper(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "NumberIncrementStepper": - """Create the component. - - Args: - *children: The children of the component. - 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 NumberDecrementStepper(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "NumberDecrementStepper": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/password.py b/reflex/components/chakra/forms/password.py deleted file mode 100644 index 100bb6151a..0000000000 --- a/reflex/components/chakra/forms/password.py +++ /dev/null @@ -1,11 +0,0 @@ -"""A password input component.""" - -from reflex.components.chakra.forms.input import Input -from reflex.vars import Var - - -class Password(Input): - """A password input component.""" - - # The type of input. - type_: Var[str] = "password" # type: ignore diff --git a/reflex/components/chakra/forms/password.pyi b/reflex/components/chakra/forms/password.pyi deleted file mode 100644 index 8d2a021096..0000000000 --- a/reflex/components/chakra/forms/password.pyi +++ /dev/null @@ -1,129 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/password.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Password(Input): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type_: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Password": - """Create an Input component. - - Args: - *children: The children of the component. - type_: The type of input. - value: State var to bind the input. - default_value: The default value of the input. - placeholder: The placeholder text. - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled - is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_read_only: If true, the form control will be readonly. - is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - variant: "outline" | "filled" | "flushed" | "unstyled" - size: "lg" | "md" | "sm" | "xs" - name: The name of the form field - 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 properties of the component. - - Returns: - The component. - """ - ... diff --git a/reflex/components/chakra/forms/pininput.py b/reflex/components/chakra/forms/pininput.py deleted file mode 100644 index 7e075887e6..0000000000 --- a/reflex/components/chakra/forms/pininput.py +++ /dev/null @@ -1,201 +0,0 @@ -"""A pin input component.""" - -from __future__ import annotations - -from typing import Optional - -from reflex.components.chakra import ChakraComponent, LiteralInputVariant -from reflex.components.component import Component -from reflex.components.tags.tag import Tag -from reflex.event import EventHandler -from reflex.utils import format -from reflex.utils.imports import ImportDict, merge_imports -from reflex.vars import Var - - -class PinInput(ChakraComponent): - """The component that provides context to all the pin-input fields.""" - - tag = "PinInput" - - # State var to bind the input. - value: Var[str] - - # If true, the pin input receives focus on mount - auto_focus: Var[bool] - - # The default value of the pin input - default_value: Var[str] - - # The border color when the input is invalid. - error_border_color: Var[str] - - # The border color when the input is focused. - focus_border_color: Var[str] - - # The top-level id string that will be applied to the input fields. The index of the input will be appended to this top-level id. - id_: Var[str] - - # The length of the number input. - length: Var[int] - - # If true, the pin input component is put in the disabled state - is_disabled: Var[bool] - - # If true, the pin input component is put in the invalid state - is_invalid: Var[bool] - - # If true, focus will move automatically to the next input once filled - manage_focus: Var[bool] - - # If true, the input's value will be masked just like `type=password` - mask: Var[bool] - - # The placeholder for the pin input - placeholder: Var[str] - - # The type of values the pin-input should allow ("number" | "alphanumeric"). - type_: Var[str] - - # "outline" | "flushed" | "filled" | "unstyled" - variant: Var[LiteralInputVariant] - - # The name of the form field - name: Var[str] - - # Fired when the pin input is changed. - on_change: EventHandler[lambda e0: [e0]] - - # Fired when the pin input is completed. - on_complete: EventHandler[lambda e0: [e0]] - - def _get_imports(self) -> ImportDict: - """Include PinInputField explicitly because it may not be a child component at compile time. - - Returns: - The merged import dict. - """ - range_var = Var.range(0) - return merge_imports( - super()._get_imports(), - PinInputField()._get_all_imports(), # type: ignore - range_var._var_data.imports if range_var._var_data is not None else {}, - ) - - def get_ref(self) -> str | None: - """Override ref handling to handle array refs. - - PinInputFields may be created dynamically, so it's not possible - to compute their ref at compile time, so we return a cheating - guess if the id is specified. - - The `ref` for this outer component will always be stripped off, so what - is returned here only matters for form ref collection purposes. - - Returns: - None. - """ - if any(isinstance(c, PinInputField) for c in self.children): - return None - if self.id: - return format.format_array_ref(self.id, idx=self.length) - return super().get_ref() - - def _get_ref_hook(self) -> Optional[str]: - """Override the base _get_ref_hook to handle array refs. - - Returns: - The overrided hooks. - """ - if self.id: - ref = format.format_array_ref(self.id, None) - refs_declaration = Var.range(self.length).foreach( - lambda: Var.create_safe("useRef(null)", _var_is_string=False), - ) - refs_declaration._var_is_local = True - if ref: - return ( - f"const {ref} = {str(refs_declaration)}; " - f"{str(Var.create_safe(ref, _var_is_string=False).as_ref())} = {ref}" - ) - return super()._get_ref_hook() - - def _render(self) -> Tag: - """Override the base _render to remove the fake get_ref. - - Returns: - The rendered component. - """ - return super()._render().remove_props("ref") - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a pin input component. - - If no children are passed in, the component will create a default pin input - based on the length prop. - - Args: - *children: The children of the component. - **props: The props of the component. - - Returns: - The pin input component. - """ - if children: - props.pop("length", None) - elif "length" in props: - field_props = {} - if "id" in props: - field_props["id"] = props["id"] - if "name" in props: - field_props["name"] = props["name"] - children = [ - PinInputField.for_length(props["length"], **field_props), - ] - return super().create(*children, **props) - - -class PinInputField(ChakraComponent): - """The text field that user types in - must be a direct child of PinInput.""" - - tag = "PinInputField" - - # the position of the PinInputField inside the PinInput. - # Default to None because it is assigned by PinInput when created. - index: Optional[Var[int]] = None - - # The name of the form field - name: Var[str] - - @classmethod - def for_length(cls, length: Var | int, **props) -> Var: - """Create a PinInputField for a PinInput with a given length. - - Args: - length: The length of the PinInput. - props: The props of each PinInputField (name will become indexed). - - Returns: - The PinInputField. - """ - name = props.get("name") - - def _create(i): - if name is not None: - props["name"] = f"{name}-{i}" - return PinInputField.create(**props, index=i, key=i) - - return Var.range(length).foreach(_create) # type: ignore - - def _get_ref_hook(self) -> Optional[str]: - return None - - def get_ref(self): - """Get the array ref for the pin input. - - Returns: - The array ref. - """ - if self.id: - return format.format_array_ref(self.id, self.index) diff --git a/reflex/components/chakra/forms/pininput.pyi b/reflex/components/chakra/forms/pininput.pyi deleted file mode 100644 index c8f5cc878b..0000000000 --- a/reflex/components/chakra/forms/pininput.pyi +++ /dev/null @@ -1,215 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/pininput.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class PinInput(ChakraComponent): - def get_ref(self) -> str | None: ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[str], str]] = None, - auto_focus: Optional[Union[Var[bool], bool]] = None, - default_value: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - id_: Optional[Union[Var[str], str]] = None, - length: Optional[Union[Var[int], int]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - manage_focus: Optional[Union[Var[bool], bool]] = None, - mask: Optional[Union[Var[bool], bool]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - type_: Optional[Union[Var[str], str]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PinInput": - """Create a pin input component. - - If no children are passed in, the component will create a default pin input - based on the length prop. - - Args: - *children: The children of the component. - value: State var to bind the input. - auto_focus: If true, the pin input receives focus on mount - default_value: The default value of the pin input - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - id_: The top-level id string that will be applied to the input fields. The index of the input will be appended to this top-level id. - length: The length of the number input. - is_disabled: If true, the pin input component is put in the disabled state - is_invalid: If true, the pin input component is put in the invalid state - manage_focus: If true, focus will move automatically to the next input once filled - mask: If true, the input's value will be masked just like `type=password` - placeholder: The placeholder for the pin input - type_: The type of values the pin-input should allow ("number" | "alphanumeric"). - variant: "outline" | "flushed" | "filled" | "unstyled" - name: The name of the form field - 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 pin input component. - """ - ... - -class PinInputField(ChakraComponent): - @classmethod - def for_length(cls, length: Var | int, **props) -> Var: ... - def get_ref(self): ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - index: Optional[Union[Var[int], int]] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PinInputField": - """Create the component. - - Args: - *children: The children of the component. - index: the position of the PinInputField inside the PinInput. Default to None because it is assigned by PinInput when created. - name: The name of the form field - 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. - """ - ... diff --git a/reflex/components/chakra/forms/radio.py b/reflex/components/chakra/forms/radio.py deleted file mode 100644 index d43327935d..0000000000 --- a/reflex/components/chakra/forms/radio.py +++ /dev/null @@ -1,101 +0,0 @@ -"""A radio component.""" - -from typing import Any, List - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.typography.text import Text -from reflex.components.component import Component -from reflex.components.core.foreach import Foreach -from reflex.event import EventHandler -from reflex.utils.types import _issubclass -from reflex.vars import Var - - -class RadioGroup(ChakraComponent): - """A grouping of individual radio options.""" - - tag = "RadioGroup" - - # State var to bind the input. - value: Var[Any] - - # The default value. - default_value: Var[Any] - - # The name of the form field - name: Var[str] - - # Fired when the radio group value changes. - on_change: EventHandler[lambda e0: [e0]] - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a radio group component. - - Args: - *children: The children of the component. - **props: The props of the component. - - Returns: - The component. - """ - if len(children) == 1 and isinstance(children[0], list): - children = [Radio.create(child) for child in children[0]] - if ( - len(children) == 1 - and isinstance(children[0], Var) - and _issubclass(children[0]._var_type, List) - ): - children = [Foreach.create(children[0], lambda item: Radio.create(item))] - return super().create(*children, **props) - - -class Radio(Text): - """Radios are used when only one choice may be selected in a series of options.""" - - tag = "Radio" - - # Value of radio. - value: Var[Any] - - # The default value. - default_value: Var[Any] - - # The color scheme. - color_scheme: Var[str] - - # If true, the radio will be initially checked. - default_checked: Var[bool] - - # If true, the radio will be checked. You'll need to pass onChange to update its value (since it is now controlled) - is_checked: Var[bool] - - # If true, the radio will be disabled. - is_disabled: Var[bool] - - # If true, the radio button will be invalid. This also sets `aria-invalid` to true. - is_invalid: Var[bool] - - # If true, the radio will be read-only - is_read_only: Var[bool] - - # If true, the radio button will be required. This also sets `aria-required` to true. - is_required: Var[bool] - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a radio component. - - By default, the value is bound to the first child. - - Args: - *children: The children of the component. - **props: The props of the component. - - Returns: - The radio component. - """ - if "value" not in props: - assert len(children) == 1 - props["value"] = children[0] - return super().create(*children, **props) diff --git a/reflex/components/chakra/forms/radio.pyi b/reflex/components/chakra/forms/radio.pyi deleted file mode 100644 index 9d9eb06a8e..0000000000 --- a/reflex/components/chakra/forms/radio.pyi +++ /dev/null @@ -1,197 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/radio.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.typography.text import Text -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class RadioGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[Any], Any]] = None, - default_value: Optional[Union[Var[Any], Any]] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "RadioGroup": - """Create a radio group component. - - Args: - *children: The children of the component. - value: State var to bind the input. - default_value: The default value. - name: The name of the form field - 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 Radio(Text): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[Any], Any]] = None, - default_value: Optional[Union[Var[Any], Any]] = None, - color_scheme: Optional[Union[Var[str], str]] = None, - default_checked: Optional[Union[Var[bool], bool]] = None, - is_checked: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - as_: Optional[Union[Var[str], str]] = None, - no_of_lines: 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Radio": - """Create a radio component. - - By default, the value is bound to the first child. - - Args: - *children: The children of the component. - value: Value of radio. - default_value: The default value. - color_scheme: The color scheme. - default_checked: If true, the radio will be initially checked. - is_checked: If true, the radio will be checked. You'll need to pass onChange to update its value (since it is now controlled) - is_disabled: If true, the radio will be disabled. - is_invalid: If true, the radio button will be invalid. This also sets `aria-invalid` to true. - is_read_only: If true, the radio will be read-only - is_required: If true, the radio button will be required. This also sets `aria-required` to true. - as_: Override the tag. The default tag is `

`. - no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop. - 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 radio component. - """ - ... diff --git a/reflex/components/chakra/forms/rangeslider.py b/reflex/components/chakra/forms/rangeslider.py deleted file mode 100644 index 9e0c179b84..0000000000 --- a/reflex/components/chakra/forms/rangeslider.py +++ /dev/null @@ -1,149 +0,0 @@ -"""A range slider component.""" - -from __future__ import annotations - -from typing import List, Optional - -from reflex.components.chakra import ChakraComponent, LiteralChakraDirection -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.utils import format -from reflex.vars import Var - - -class RangeSlider(ChakraComponent): - """The RangeSlider is a multi thumb slider used to select a range of related values. A common use-case of this component is a price range picker that allows a user to set the minimum and maximum price.""" - - tag = "RangeSlider" - - # State var to bind the input. - value: Var[List[int]] - - # The default values. - default_value: Var[List[int]] - - # The writing mode ("ltr" | "rtl") - direction: Var[LiteralChakraDirection] - - # If false, the slider handle will not capture focus when value changes. - focus_thumb_on_change: Var[bool] - - # If true, the slider will be disabled - is_disabled: Var[bool] - - # If true, the slider will be in `read-only` state. - is_read_only: Var[bool] - - # If true, the value will be incremented or decremented in reverse. - is_reversed: Var[bool] - - # The minimum value of the slider. - min_: Var[int] - - # The maximum value of the slider. - max_: Var[int] - - # The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together. - min_steps_between_thumbs: Var[int] - - # The name of the form field - name: Var[str] - - # Fired when the value changes. - on_change: EventHandler[lambda e0: [e0]] - - # Fired when the value starts changing. - on_change_start: EventHandler[lambda e0: [e0]] - - # Fired when the value stops changing. - on_change_end: EventHandler[lambda e0: [e0]] - - def get_ref(self): - """Get the ref of the component. - - Returns: - The ref of the component. - """ - return None - - def _get_ref_hook(self) -> Optional[str]: - """Override the base _get_ref_hook to handle array refs. - - Returns: - The overrided hooks. - """ - if self.id: - ref = format.format_array_ref(self.id, None) - if ref: - return ( - f"const {ref} = Array.from({{length:2}}, () => useRef(null)); " - f"{str(Var.create_safe(ref, _var_is_string=False).as_ref())} = {ref}" - ) - return super()._get_ref_hook() - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a RangeSlider component. - - If no children are provided, a default RangeSlider will be created. - - Args: - *children: The children of the component. - **props: The properties of the component. - - Returns: - The RangeSlider component. - """ - if len(children) == 0: - _id = props.get("id", None) - if _id: - children = [ - RangeSliderTrack.create( - RangeSliderFilledTrack.create(), - ), - RangeSliderThumb.create(index=0, id=_id), - RangeSliderThumb.create(index=1, id=_id), - ] - else: - children = [ - RangeSliderTrack.create( - RangeSliderFilledTrack.create(), - ), - RangeSliderThumb.create(index=0), - RangeSliderThumb.create(index=1), - ] - return super().create(*children, **props) - - -class RangeSliderTrack(ChakraComponent): - """A range slider track.""" - - tag = "RangeSliderTrack" - - -class RangeSliderFilledTrack(ChakraComponent): - """A filled range slider track.""" - - tag = "RangeSliderFilledTrack" - - -class RangeSliderThumb(ChakraComponent): - """A range slider thumb.""" - - tag = "RangeSliderThumb" - - # The position of the thumb. - index: Var[int] - - def _get_ref_hook(self) -> Optional[str]: - # hook is None because RangeSlider is handling it. - return None - - def get_ref(self): - """Get an array ref for the range slider thumb. - - Returns: - The array ref. - """ - if self.id: - return format.format_array_ref(self.id, self.index) diff --git a/reflex/components/chakra/forms/rangeslider.pyi b/reflex/components/chakra/forms/rangeslider.pyi deleted file mode 100644 index 38ca43f738..0000000000 --- a/reflex/components/chakra/forms/rangeslider.pyi +++ /dev/null @@ -1,354 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/rangeslider.py""" - -# ------------------- 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 reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class RangeSlider(ChakraComponent): - def get_ref(self): ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[List[int]], List[int]]] = None, - default_value: Optional[Union[Var[List[int]], List[int]]] = None, - direction: Optional[ - Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]] - ] = None, - focus_thumb_on_change: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_reversed: Optional[Union[Var[bool], bool]] = None, - min_: Optional[Union[Var[int], int]] = None, - max_: Optional[Union[Var[int], int]] = None, - min_steps_between_thumbs: Optional[Union[Var[int], int]] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "RangeSlider": - """Create a RangeSlider component. - - If no children are provided, a default RangeSlider will be created. - - Args: - *children: The children of the component. - value: State var to bind the input. - default_value: The default values. - direction: The writing mode ("ltr" | "rtl") - focus_thumb_on_change: If false, the slider handle will not capture focus when value changes. - is_disabled: If true, the slider will be disabled - is_read_only: If true, the slider will be in `read-only` state. - is_reversed: If true, the value will be incremented or decremented in reverse. - min_: The minimum value of the slider. - max_: The maximum value of the slider. - min_steps_between_thumbs: The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together. - name: The name of the form field - 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 properties of the component. - - Returns: - The RangeSlider component. - """ - ... - -class RangeSliderTrack(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "RangeSliderTrack": - """Create the component. - - Args: - *children: The children of the component. - 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 RangeSliderFilledTrack(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "RangeSliderFilledTrack": - """Create the component. - - Args: - *children: The children of the component. - 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 RangeSliderThumb(ChakraComponent): - def get_ref(self): ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "RangeSliderThumb": - """Create the component. - - Args: - *children: The children of the component. - index: The position of the thumb. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/select.py b/reflex/components/chakra/forms/select.py deleted file mode 100644 index 3c25ea8b95..0000000000 --- a/reflex/components/chakra/forms/select.py +++ /dev/null @@ -1,103 +0,0 @@ -"""A select component.""" - -from typing import Any, List - -from reflex.components.chakra import ChakraComponent, LiteralInputVariant -from reflex.components.chakra.typography.text import Text -from reflex.components.component import Component -from reflex.components.core.foreach import Foreach -from reflex.event import EventHandler -from reflex.utils.types import _issubclass -from reflex.vars import Var - - -class Select(ChakraComponent): - """Select component is a component that allows users pick a value from predefined options. Ideally, it should be used when there are more than 5 options, otherwise you might consider using a radio group instead.""" - - tag = "Select" - - # State var to bind the select. - value: Var[str] - - # The default value of the select. - default_value: Var[str] - - # The placeholder text. - placeholder: Var[str] - - # The border color when the select is invalid. - error_border_color: Var[str] - - # The border color when the select is focused. - focus_border_color: Var[str] - - # If true, the select will be disabled. - is_disabled: Var[bool] - - # If true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_invalid: Var[bool] - - # If true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - is_required: Var[bool] - - # "outline" | "filled" | "flushed" | "unstyled" - variant: Var[LiteralInputVariant] - - # The size of the select. - size: Var[str] - - # The name of the form field - name: Var[str] - - # Fired when the value changes. - on_change: EventHandler[lambda e0: [e0.target.value]] - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a select component. - - If a list is provided as the first children, a default component - will be created for each item in the list. - - Args: - *children: The children of the component. - **props: The props of the component. - - Returns: - The component. - """ - if len(children) == 1 and isinstance(children[0], list): - children = [Option.create(child) for child in children[0]] - if ( - len(children) == 1 - and isinstance(children[0], Var) - and _issubclass(children[0]._var_type, List) - ): - children = [Foreach.create(children[0], lambda item: Option.create(item))] - return super().create(*children, **props) - - -class Option(Text): - """A select option.""" - - tag = "option" - - value: Var[Any] - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a select option component. - - By default, the value of the option is the text of the option. - - Args: - *children: The children of the component. - **props: The props of the component. - - Returns: - The component. - """ - if "value" not in props: - assert len(children) == 1 - props["value"] = children[0] - return super().create(*children, **props) diff --git a/reflex/components/chakra/forms/select.pyi b/reflex/components/chakra/forms/select.pyi deleted file mode 100644 index 8835cd5887..0000000000 --- a/reflex/components/chakra/forms/select.pyi +++ /dev/null @@ -1,204 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/select.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.typography.text import Text -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Select(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[Union[Var[str], 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Select": - """Create a select component. - - If a list is provided as the first children, a default component - will be created for each item in the list. - - Args: - *children: The children of the component. - value: State var to bind the select. - default_value: The default value of the select. - placeholder: The placeholder text. - error_border_color: The border color when the select is invalid. - focus_border_color: The border color when the select is focused. - is_disabled: If true, the select will be disabled. - is_invalid: If true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_required: If true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - variant: "outline" | "filled" | "flushed" | "unstyled" - size: The size of the select. - name: The name of the form field - 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 Option(Text): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[Any], Any]] = None, - as_: Optional[Union[Var[str], str]] = None, - no_of_lines: 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Option": - """Create a select option component. - - By default, the value of the option is the text of the option. - - Args: - *children: The children of the component. - as_: Override the tag. The default tag is `

`. - no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/slider.py b/reflex/components/chakra/forms/slider.py deleted file mode 100644 index e773a93e1b..0000000000 --- a/reflex/components/chakra/forms/slider.py +++ /dev/null @@ -1,130 +0,0 @@ -"""A slider component.""" - -from __future__ import annotations - -from typing import Literal - -from reflex.components.chakra import ChakraComponent, LiteralChakraDirection -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - -LiteralLayout = Literal["horizontal", "vertical"] - - -class Slider(ChakraComponent): - """The wrapper that provides context and functionality for all children.""" - - tag = "Slider" - - # State var to bind the input. - value: Var[int] - - # The color scheme. - color_scheme: Var[str] - - # The placeholder text. - default_value: Var[int] - - # The writing mode ("ltr" | "rtl") - direction: Var[LiteralChakraDirection] - - # If false, the slider handle will not capture focus when value changes. - focus_thumb_on_change: Var[bool] - - # If true, the slider will be disabled - is_disabled: Var[bool] - - # If true, the slider will be in `read-only` state. - is_read_only: Var[bool] - - # If true, the value will be incremented or decremented in reverse. - is_reversed: Var[bool] - - # The minimum value of the slider. - min_: Var[int] - - # The maximum value of the slider. - max_: Var[int] - - # The step in which increments/decrements have to be made - step: Var[int] - - # The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together. - min_steps_between_thumbs: Var[int] - - # Oreintation of the slider vertical | horizontal. - orientation: Var[LiteralLayout] - - # Minimum height of the slider. - min_h: Var[str] - - # Minimum width of the slider. - min_w: Var[str] - - # Maximum height of the slider. - max_h: Var[str] - - # Maximum width of the slider. - max_w: Var[str] - - # The name of the form field - name: Var[str] - - # Fired when the value changes. - on_change: EventHandler[lambda e0: [e0]] - - # Fired when the value starts changing. - on_change_start: EventHandler[lambda e0: [e0]] - - # Fired when the value stops changing. - on_change_end: EventHandler[lambda e0: [e0]] - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a slider component. - - If no children are provided, a default slider will be created. - - Args: - *children: The children of the component. - **props: The properties of the component. - - Returns: - The slider component. - """ - if len(children) == 0: - children = [ - SliderTrack.create( - SliderFilledTrack.create(), - ), - SliderThumb.create(), - ] - return super().create(*children, **props) - - -class SliderTrack(ChakraComponent): - """The empty part of the slider that shows the track.""" - - tag = "SliderTrack" - - -class SliderFilledTrack(ChakraComponent): - """The filled part of the slider.""" - - tag = "SliderFilledTrack" - - -class SliderThumb(ChakraComponent): - """The handle that's used to change the slider value.""" - - tag = "SliderThumb" - - # The size of the thumb. - box_size: Var[str] - - -class SliderMark(ChakraComponent): - """The label or mark that shows names for specific slider values.""" - - tag = "SliderMark" diff --git a/reflex/components/chakra/forms/slider.pyi b/reflex/components/chakra/forms/slider.pyi deleted file mode 100644 index 40eec470ba..0000000000 --- a/reflex/components/chakra/forms/slider.pyi +++ /dev/null @@ -1,449 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/slider.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -LiteralLayout = Literal["horizontal", "vertical"] - -class Slider(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[int], int]] = None, - color_scheme: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[int], int]] = None, - direction: Optional[ - Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]] - ] = None, - focus_thumb_on_change: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_reversed: Optional[Union[Var[bool], bool]] = None, - min_: Optional[Union[Var[int], int]] = None, - max_: Optional[Union[Var[int], int]] = None, - step: Optional[Union[Var[int], int]] = None, - min_steps_between_thumbs: Optional[Union[Var[int], int]] = None, - orientation: Optional[ - Union[ - Var[Literal["horizontal", "vertical"]], - Literal["horizontal", "vertical"], - ] - ] = None, - min_h: Optional[Union[Var[str], str]] = None, - min_w: Optional[Union[Var[str], str]] = None, - max_h: Optional[Union[Var[str], str]] = None, - max_w: Optional[Union[Var[str], 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Slider": - """Create a slider component. - - If no children are provided, a default slider will be created. - - Args: - *children: The children of the component. - value: State var to bind the input. - color_scheme: The color scheme. - default_value: The placeholder text. - direction: The writing mode ("ltr" | "rtl") - focus_thumb_on_change: If false, the slider handle will not capture focus when value changes. - is_disabled: If true, the slider will be disabled - is_read_only: If true, the slider will be in `read-only` state. - is_reversed: If true, the value will be incremented or decremented in reverse. - min_: The minimum value of the slider. - max_: The maximum value of the slider. - step: The step in which increments/decrements have to be made - min_steps_between_thumbs: The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together. - orientation: Oreintation of the slider vertical | horizontal. - min_h: Minimum height of the slider. - min_w: Minimum width of the slider. - max_h: Maximum height of the slider. - max_w: Maximum width of the slider. - name: The name of the form field - 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 properties of the component. - - Returns: - The slider component. - """ - ... - -class SliderTrack(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "SliderTrack": - """Create the component. - - Args: - *children: The children of the component. - 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 SliderFilledTrack(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "SliderFilledTrack": - """Create the component. - - Args: - *children: The children of the component. - 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 SliderThumb(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - box_size: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "SliderThumb": - """Create the component. - - Args: - *children: The children of the component. - box_size: The size of the thumb. - 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 SliderMark(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "SliderMark": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/forms/switch.py b/reflex/components/chakra/forms/switch.py deleted file mode 100644 index a52c7c9a53..0000000000 --- a/reflex/components/chakra/forms/switch.py +++ /dev/null @@ -1,49 +0,0 @@ -"""A switch component.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent, LiteralColorScheme -from reflex.event import EventHandler -from reflex.vars import Var - - -class Switch(ChakraComponent): - """Toggleable switch component.""" - - tag = "Switch" - - # If true, the switch will be checked. You'll need to set an on_change event handler to update its value (since it is now controlled) - is_checked: Var[bool] - - # If true, the switch will be disabled - is_disabled: Var[bool] - - # If true and is_disabled prop is set, the switch will remain tabbable but not interactive. - is_focusable: Var[bool] - - # If true, the switch is marked as invalid. Changes style of unchecked state. - is_invalid: Var[bool] - - # If true, the switch will be readonly - is_read_only: Var[bool] - - # If true, the switch will be required - is_required: Var[bool] - - # The name of the input field in a switch (Useful for form submission). - name: Var[str] - - # The value of the input field when checked (use is_checked prop for a bool) - value: Var[str] = Var.create(True) # type: ignore - - # The spacing between the switch and its label text (0.5rem) - spacing: Var[str] - - # The placeholder text. - placeholder: Var[str] - - # The color scheme of the switch (e.g. "blue", "green", "red", etc.) - color_scheme: Var[LiteralColorScheme] - - # Fired when the switch value changes - on_change: EventHandler[lambda e0: [e0.target.checked]] diff --git a/reflex/components/chakra/forms/switch.pyi b/reflex/components/chakra/forms/switch.pyi deleted file mode 100644 index be132e8581..0000000000 --- a/reflex/components/chakra/forms/switch.pyi +++ /dev/null @@ -1,159 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/switch.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Switch(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_checked: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_focusable: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - name: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - spacing: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = 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, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Switch": - """Create the component. - - Args: - *children: The children of the component. - is_checked: If true, the switch will be checked. You'll need to set an on_change event handler to update its value (since it is now controlled) - is_disabled: If true, the switch will be disabled - is_focusable: If true and is_disabled prop is set, the switch will remain tabbable but not interactive. - is_invalid: If true, the switch is marked as invalid. Changes style of unchecked state. - is_read_only: If true, the switch will be readonly - is_required: If true, the switch will be required - name: The name of the input field in a switch (Useful for form submission). - value: The value of the input field when checked (use is_checked prop for a bool) - spacing: The spacing between the switch and its label text (0.5rem) - placeholder: The placeholder text. - color_scheme: The color scheme of the switch (e.g. "blue", "green", "red", etc.) - 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. - """ - ... diff --git a/reflex/components/chakra/forms/textarea.py b/reflex/components/chakra/forms/textarea.py deleted file mode 100644 index a88158feba..0000000000 --- a/reflex/components/chakra/forms/textarea.py +++ /dev/null @@ -1,79 +0,0 @@ -"""A textarea component.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent, LiteralInputVariant -from reflex.components.component import Component -from reflex.components.core.debounce import DebounceInput -from reflex.event import EventHandler -from reflex.vars import Var - - -class TextArea(ChakraComponent): - """A text area component.""" - - tag = "Textarea" - - # State var to bind the input. - value: Var[str] - - # The default value of the textarea. - default_value: Var[str] - - # The placeholder text. - placeholder: Var[str] - - # The border color when the input is invalid. - error_border_color: Var[str] - - # The border color when the input is focused. - focus_border_color: Var[str] - - # If true, the form control will be disabled. - is_disabled: Var[bool] - - # If true, the form control will be invalid. - is_invalid: Var[bool] - - # If true, the form control will be read-only. - is_read_only: Var[bool] - - # If true, the form control will be required. - is_required: Var[bool] - - # "outline" | "filled" | "flushed" | "unstyled" - variant: Var[LiteralInputVariant] - - # The name of the form field - name: Var[str] - - # Fired when the value changes. - on_change: EventHandler[lambda e0: [e0.target.value]] - - # Fired when the textarea gets focus. - on_focus: EventHandler[lambda e0: [e0.target.value]] - - # Fired when the textarea loses focus. - 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. - - Args: - *children: The children of the component. - **props: The properties of the component. - - Returns: - The component. - """ - if props.get("value") is not None and props.get("on_change") is not None: - # create a debounced input if the user requests full control to avoid typing jank - return DebounceInput.create(super().create(*children, **props)) - return super().create(*children, **props) diff --git a/reflex/components/chakra/forms/textarea.pyi b/reflex/components/chakra/forms/textarea.pyi deleted file mode 100644 index b73c6d9075..0000000000 --- a/reflex/components/chakra/forms/textarea.pyi +++ /dev/null @@ -1,123 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/textarea.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class TextArea(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TextArea": - """Create an Input component. - - Args: - *children: The children of the component. - value: State var to bind the input. - default_value: The default value of the textarea. - placeholder: The placeholder text. - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - is_disabled: If true, the form control will be disabled. - is_invalid: If true, the form control will be invalid. - is_read_only: If true, the form control will be read-only. - is_required: If true, the form control will be required. - variant: "outline" | "filled" | "flushed" | "unstyled" - name: The name of the form field - 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 properties of the component. - - Returns: - The component. - """ - ... diff --git a/reflex/components/chakra/forms/time_picker.py b/reflex/components/chakra/forms/time_picker.py deleted file mode 100644 index d778293fd6..0000000000 --- a/reflex/components/chakra/forms/time_picker.py +++ /dev/null @@ -1,11 +0,0 @@ -"""A time input component.""" - -from reflex.components.chakra.forms.input import Input -from reflex.vars import Var - - -class TimePicker(Input): - """A time input component.""" - - # The type of input. - type_: Var[str] = "time" # type: ignore diff --git a/reflex/components/chakra/forms/time_picker.pyi b/reflex/components/chakra/forms/time_picker.pyi deleted file mode 100644 index 1f9e641e81..0000000000 --- a/reflex/components/chakra/forms/time_picker.pyi +++ /dev/null @@ -1,129 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/time_picker.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class TimePicker(Input): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type_: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - default_value: Optional[Union[Var[str], str]] = None, - placeholder: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_required: Optional[Union[Var[bool], bool]] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "flushed", "unstyled"]], - Literal["outline", "filled", "flushed", "unstyled"], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] - ] = 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[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_key_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "TimePicker": - """Create an Input component. - - Args: - *children: The children of the component. - type_: The type of input. - value: State var to bind the input. - default_value: The default value of the input. - placeholder: The placeholder text. - error_border_color: The border color when the input is invalid. - focus_border_color: The border color when the input is focused. - is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled - is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true - is_read_only: If true, the form control will be readonly. - is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true - variant: "outline" | "filled" | "flushed" | "unstyled" - size: "lg" | "md" | "sm" | "xs" - name: The name of the form field - 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 properties of the component. - - Returns: - The component. - """ - ... diff --git a/reflex/components/chakra/layout/__init__.py b/reflex/components/chakra/layout/__init__.py deleted file mode 100644 index 13c28fdd49..0000000000 --- a/reflex/components/chakra/layout/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Convenience functions to define layout components.""" - -from .aspect_ratio import AspectRatio -from .box import Box -from .card import Card, CardBody, CardFooter, CardHeader -from .center import Center, Circle, Square -from .container import Container -from .flex import Flex -from .grid import Grid, GridItem, ResponsiveGrid -from .spacer import Spacer -from .stack import Hstack, Stack, Vstack -from .wrap import Wrap, WrapItem - -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore diff --git a/reflex/components/chakra/layout/aspect_ratio.py b/reflex/components/chakra/layout/aspect_ratio.py deleted file mode 100644 index 5d0328d7e1..0000000000 --- a/reflex/components/chakra/layout/aspect_ratio.py +++ /dev/null @@ -1,13 +0,0 @@ -"""A AspectRatio component.""" - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class AspectRatio(ChakraComponent): - """AspectRatio component is used to embed responsive videos and maps, etc.""" - - tag = "AspectRatio" - - # The aspect ratio of the Box - ratio: Var[float] diff --git a/reflex/components/chakra/layout/aspect_ratio.pyi b/reflex/components/chakra/layout/aspect_ratio.pyi deleted file mode 100644 index da798076f1..0000000000 --- a/reflex/components/chakra/layout/aspect_ratio.pyi +++ /dev/null @@ -1,89 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/aspect_ratio.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class AspectRatio(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - ratio: Optional[Union[Var[float], float]] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AspectRatio": - """Create the component. - - Args: - *children: The children of the component. - ratio: The aspect ratio of the Box - 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. - """ - ... diff --git a/reflex/components/chakra/layout/box.py b/reflex/components/chakra/layout/box.py deleted file mode 100644 index 497e514b87..0000000000 --- a/reflex/components/chakra/layout/box.py +++ /dev/null @@ -1,31 +0,0 @@ -"""A box component that can contain other components.""" - -from reflex.components.chakra import ChakraComponent -from reflex.components.tags import Tag -from reflex.vars import Var - - -class Box(ChakraComponent): - """A generic container component that can contain other components.""" - - tag = "Box" - - # The type element to render. You can specify an image, video, or any other HTML element such as iframe. - element: Var[str] - - # The source of the content. - src: Var[str] - - # The alt text of the content. - alt: Var[str] - - def _render(self) -> Tag: - return ( - super() - ._render() - .add_props( - **{ - "as": self.element, - } - ) - ) diff --git a/reflex/components/chakra/layout/box.pyi b/reflex/components/chakra/layout/box.pyi deleted file mode 100644 index 995cddfb36..0000000000 --- a/reflex/components/chakra/layout/box.pyi +++ /dev/null @@ -1,93 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/box.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Box(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - element: Optional[Union[Var[str], str]] = None, - src: Optional[Union[Var[str], str]] = None, - alt: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Box": - """Create the component. - - Args: - *children: The children of the component. - element: The type element to render. You can specify an image, video, or any other HTML element such as iframe. - src: The source of the content. - alt: The alt text of the content. - 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. - """ - ... diff --git a/reflex/components/chakra/layout/card.py b/reflex/components/chakra/layout/card.py deleted file mode 100644 index 595c5327f1..0000000000 --- a/reflex/components/chakra/layout/card.py +++ /dev/null @@ -1,100 +0,0 @@ -"""Chakra Card component.""" - -from typing import Optional - -from reflex.components.chakra import ( - ChakraComponent, - LiteralCardVariant, - LiteralColorScheme, - LiteralTagSize, -) -from reflex.components.component import Component -from reflex.vars import Var - - -class CardHeader(ChakraComponent): - """The wrapper that contains a card's header.""" - - tag = "CardHeader" - - -class CardBody(ChakraComponent): - """The wrapper that houses the card's main content.""" - - tag = "CardBody" - - -class CardFooter(ChakraComponent): - """The footer that houses the card actions.""" - - tag = "CardFooter" - - -class Card(ChakraComponent): - """The parent wrapper that provides context for its children.""" - - tag = "Card" - - # [required] The flex alignment of the card - align: Var[str] - - # [required] The flex direction of the card - direction: Var[str] - - # [required] The flex distribution of the card - justify: Var[str] - - # The visual color appearance of the component. - # options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | - # "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | - # "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - # default: "gray" - color_scheme: Var[LiteralColorScheme] - - # The size of the Card - # options: "sm" | "md" | "lg" - # default: "md" - size: Var[LiteralTagSize] - - # The variant of the Card - # options: "elevated" | "outline" | "filled" | "unstyled" - # default: "elevated" - variant: Var[LiteralCardVariant] - - @classmethod - def create( - cls, - body: Component, - *, - header: Optional[Component] = None, - footer: Optional[Component] = None, - **props, - ) -> Component: - """Creates a Chakra Card with a body and optionally header and/or footer, and returns it. - If header, body or footer are not already instances of Chead, Cbody or Cfoot respectively, - they will be wrapped as such for layout purposes. If you want to modify their props, - e.g. padding_left, you should wrap them yourself. - - Args: - body (Component): The main content of the Card that will be created. - header (Optional[Component]): The header of the Card. - footer (Optional[Component]): The footer of the Card. - props: The properties to be passed to the component. - - Returns: - The `create()` method returns a Card object. - """ - children = [] - param_to_component_class = ( - (header, CardHeader), - (body, CardBody), - (footer, CardFooter), - ) - - for param, component_class in param_to_component_class: - if isinstance(param, component_class): - children.append(param) - elif param is not None: - children.append(component_class.create(param)) - - return super().create(*children, **props) diff --git a/reflex/components/chakra/layout/card.pyi b/reflex/components/chakra/layout/card.pyi deleted file mode 100644 index 19aa6c57ab..0000000000 --- a/reflex/components/chakra/layout/card.pyi +++ /dev/null @@ -1,379 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/card.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class CardHeader(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "CardHeader": - """Create the component. - - Args: - *children: The children of the component. - 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 CardBody(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "CardBody": - """Create the component. - - Args: - *children: The children of the component. - 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 CardFooter(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "CardFooter": - """Create the component. - - Args: - *children: The children of the component. - 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 Card(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - header: Optional[Component] = None, - footer: Optional[Component] = None, - align: Optional[Union[Var[str], str]] = None, - direction: Optional[Union[Var[str], str]] = None, - justify: Optional[Union[Var[str], str]] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = None, - size: Optional[ - Union[Var[Literal["sm", "md", "lg"]], Literal["sm", "md", "lg"]] - ] = None, - variant: Optional[ - Union[ - Var[Literal["outline", "filled", "elevated", "unstyled"]], - Literal["outline", "filled", "elevated", "unstyled"], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Card": - """Creates a Chakra Card with a body and optionally header and/or footer, and returns it. - If header, body or footer are not already instances of Chead, Cbody or Cfoot respectively, - they will be wrapped as such for layout purposes. If you want to modify their props, - e.g. padding_left, you should wrap them yourself. - - Args: - body (Component): The main content of the Card that will be created. - header (Optional[Component]): The header of the Card. - footer (Optional[Component]): The footer of the Card. - props: The properties to be passed to the component. - - Returns: - The `create()` method returns a Card object. - """ - ... diff --git a/reflex/components/chakra/layout/center.py b/reflex/components/chakra/layout/center.py deleted file mode 100644 index bc3ced1aaa..0000000000 --- a/reflex/components/chakra/layout/center.py +++ /dev/null @@ -1,21 +0,0 @@ -"""A box that centers its contents.""" - -from reflex.components.chakra import ChakraComponent - - -class Center(ChakraComponent): - """A box that centers its contents.""" - - tag = "Center" - - -class Square(ChakraComponent): - """A centered square container.""" - - tag = "Square" - - -class Circle(ChakraComponent): - """A square container with round border-radius.""" - - tag = "Circle" diff --git a/reflex/components/chakra/layout/center.pyi b/reflex/components/chakra/layout/center.pyi deleted file mode 100644 index a78e662f74..0000000000 --- a/reflex/components/chakra/layout/center.pyi +++ /dev/null @@ -1,239 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/center.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Center(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Center": - """Create the component. - - Args: - *children: The children of the component. - 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 Square(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Square": - """Create the component. - - Args: - *children: The children of the component. - 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(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Circle": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/layout/container.py b/reflex/components/chakra/layout/container.py deleted file mode 100644 index 26863d0182..0000000000 --- a/reflex/components/chakra/layout/container.py +++ /dev/null @@ -1,13 +0,0 @@ -"""A flexbox container.""" - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Container(ChakraComponent): - """A flexbox container that centers its children and sets a max width.""" - - tag = "Container" - - # If true, container will center its children regardless of their width. - center_content: Var[bool] diff --git a/reflex/components/chakra/layout/container.pyi b/reflex/components/chakra/layout/container.pyi deleted file mode 100644 index 856dc5fec5..0000000000 --- a/reflex/components/chakra/layout/container.pyi +++ /dev/null @@ -1,89 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/container.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Container(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - center_content: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Container": - """Create the component. - - Args: - *children: The children of the component. - center_content: If true, container will center its children regardless of their width. - 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. - """ - ... diff --git a/reflex/components/chakra/layout/flex.py b/reflex/components/chakra/layout/flex.py deleted file mode 100644 index ff6e5abcec..0000000000 --- a/reflex/components/chakra/layout/flex.py +++ /dev/null @@ -1,33 +0,0 @@ -"""A reflexive container component.""" - -from typing import List, Union - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Flex(ChakraComponent): - """A reflexive container component.""" - - tag = "Flex" - - # How to align items in the flex. - align: Var[str] - - # Shorthand for flexBasis style prop - basis: Var[str] - - # Shorthand for flexDirection style prop - direction: Var[Union[str, List[str]]] - - # Shorthand for flexGrow style prop - grow: Var[str] - - # The way to justify the items. - justify: Var[str] - - # Shorthand for flexWrap style prop - wrap: Var[Union[str, List[str]]] - - # Shorthand for flexShrink style prop - shrink: Var[str] diff --git a/reflex/components/chakra/layout/flex.pyi b/reflex/components/chakra/layout/flex.pyi deleted file mode 100644 index da08f05a60..0000000000 --- a/reflex/components/chakra/layout/flex.pyi +++ /dev/null @@ -1,101 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/flex.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Flex(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - align: Optional[Union[Var[str], str]] = None, - basis: Optional[Union[Var[str], str]] = None, - direction: Optional[Union[Var[Union[List[str], str]], str, List[str]]] = None, - grow: Optional[Union[Var[str], str]] = None, - justify: Optional[Union[Var[str], str]] = None, - wrap: Optional[Union[Var[Union[List[str], str]], str, List[str]]] = None, - shrink: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Flex": - """Create the component. - - Args: - *children: The children of the component. - align: How to align items in the flex. - basis: Shorthand for flexBasis style prop - direction: Shorthand for flexDirection style prop - grow: Shorthand for flexGrow style prop - justify: The way to justify the items. - wrap: Shorthand for flexWrap style prop - shrink: Shorthand for flexShrink style prop - 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. - """ - ... diff --git a/reflex/components/chakra/layout/grid.py b/reflex/components/chakra/layout/grid.py deleted file mode 100644 index ee1d8aa33b..0000000000 --- a/reflex/components/chakra/layout/grid.py +++ /dev/null @@ -1,125 +0,0 @@ -"""Container to stack elements with spacing.""" - -from typing import List - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Grid(ChakraComponent): - """A grid component.""" - - tag = "Grid" - - # Shorthand prop for gridAutoColumns to provide automatic column sizing based on content. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns)_ - auto_columns: Var[str] - - # Shorthand prop for gridAutoFlow to specify exactly how - # auto-placed items get flowed into the grid. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow)_ - auto_flow: Var[str] - - # Shorthand prop for gridAutoRows. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows)_ - auto_rows: Var[str] - - # Shorthand prop for gridColumn. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column)_ - column: Var[str] - - # Shorthand prop for gridRow. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row)_ - row: Var[str] - - # Shorthand prop for gridTemplateColumns. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns)_ - template_columns: Var[str] - - # Shorthand prop for gridTemplateRows. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows)_ - template_rows: Var[str] - - -class GridItem(ChakraComponent): - """Used as a child of Grid to control the span, and start positions within the grid.""" - - tag = "GridItem" - - # Shorthand prop for gridArea - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area)_ - area: Var[str] - - # Shorthand prop for gridColumnEnd - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end)_ - col_end: Var[str] - - # The column number the grid item should start. - col_start: Var[int] - - # The number of columns the grid item should span. - col_span: Var[int] - - # Shorthand prop for gridRowEnd - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end)_ - row_end: Var[str] - - # The row number the grid item should start. - row_start: Var[int] - - # The number of rows the grid item should span. - row_span: Var[int] - - -class ResponsiveGrid(ChakraComponent): - """A responsive grid component.""" - - tag = "SimpleGrid" - - # Shorthand prop for gridAutoColumns to provide automatic column sizing based on content. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns)_ - auto_columns: Var[str] - - # Shorthand prop for gridAutoFlow to specify exactly how - # auto-placed items get flowed into the grid. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow)_ - auto_flow: Var[str] - - # Shorthand prop for gridAutoRows. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows)_ - auto_rows: Var[str] - - # Shorthand prop for gridColumn. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column)_ - column: Var[str] - - # Shorthand prop for gridRow. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row)_ - row: Var[str] - - # A list that defines the number of columns for each breakpoint. - columns: Var[List[int]] - - # The width at which child elements will break into columns. Pass a number for pixel values or a string for any other valid CSS length. - min_child_width: Var[str] - - # The gap between the grid items - spacing: Var[str] - - # The column gap between the grid items - spacing_x: Var[str] - - # The row gap between the grid items - spacing_y: Var[str] - - # Shorthand prop for gridTemplateAreas - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas)_ - template_areas: Var[str] - - # Shorthand prop for gridTemplateColumns. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns)_ - template_columns: Var[str] - - # Shorthand prop for gridTemplateRows. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows)_ - template_rows: Var[str] diff --git a/reflex/components/chakra/layout/grid.pyi b/reflex/components/chakra/layout/grid.pyi deleted file mode 100644 index b70ee344a5..0000000000 --- a/reflex/components/chakra/layout/grid.pyi +++ /dev/null @@ -1,293 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/grid.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Grid(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - auto_columns: Optional[Union[Var[str], str]] = None, - auto_flow: Optional[Union[Var[str], str]] = None, - auto_rows: Optional[Union[Var[str], str]] = None, - column: Optional[Union[Var[str], str]] = None, - row: Optional[Union[Var[str], str]] = None, - template_columns: Optional[Union[Var[str], str]] = None, - template_rows: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Grid": - """Create the component. - - Args: - *children: The children of the component. - auto_columns: Shorthand prop for gridAutoColumns to provide automatic column sizing based on content. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns)_ - auto_flow: Shorthand prop for gridAutoFlow to specify exactly how auto-placed items get flowed into the grid. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow)_ - auto_rows: Shorthand prop for gridAutoRows. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows)_ - column: Shorthand prop for gridColumn. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column)_ - row: Shorthand prop for gridRow. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row)_ - template_columns: Shorthand prop for gridTemplateColumns. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns)_ - template_rows: Shorthand prop for gridTemplateRows. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows)_ - 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 GridItem(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - area: Optional[Union[Var[str], str]] = None, - col_end: Optional[Union[Var[str], str]] = None, - col_start: Optional[Union[Var[int], int]] = None, - col_span: Optional[Union[Var[int], int]] = None, - row_end: Optional[Union[Var[str], str]] = None, - row_start: Optional[Union[Var[int], int]] = None, - row_span: 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "GridItem": - """Create the component. - - Args: - *children: The children of the component. - area: Shorthand prop for gridArea Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area)_ - col_end: Shorthand prop for gridColumnEnd Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end)_ - col_start: The column number the grid item should start. - col_span: The number of columns the grid item should span. - row_end: Shorthand prop for gridRowEnd Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end)_ - row_start: The row number the grid item should start. - row_span: The number of rows the grid item should span. - 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 ResponsiveGrid(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - auto_columns: Optional[Union[Var[str], str]] = None, - auto_flow: Optional[Union[Var[str], str]] = None, - auto_rows: Optional[Union[Var[str], str]] = None, - column: Optional[Union[Var[str], str]] = None, - row: Optional[Union[Var[str], str]] = None, - columns: Optional[Union[Var[List[int]], List[int]]] = None, - min_child_width: Optional[Union[Var[str], str]] = None, - spacing: Optional[Union[Var[str], str]] = None, - spacing_x: Optional[Union[Var[str], str]] = None, - spacing_y: Optional[Union[Var[str], str]] = None, - template_areas: Optional[Union[Var[str], str]] = None, - template_columns: Optional[Union[Var[str], str]] = None, - template_rows: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ResponsiveGrid": - """Create the component. - - Args: - *children: The children of the component. - auto_columns: Shorthand prop for gridAutoColumns to provide automatic column sizing based on content. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns)_ - auto_flow: Shorthand prop for gridAutoFlow to specify exactly how auto-placed items get flowed into the grid. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow)_ - auto_rows: Shorthand prop for gridAutoRows. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows)_ - column: Shorthand prop for gridColumn. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column)_ - row: Shorthand prop for gridRow. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row)_ - columns: A list that defines the number of columns for each breakpoint. - min_child_width: The width at which child elements will break into columns. Pass a number for pixel values or a string for any other valid CSS length. - spacing: The gap between the grid items - spacing_x: The column gap between the grid items - spacing_y: The row gap between the grid items - template_areas: Shorthand prop for gridTemplateAreas Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas)_ - template_columns: Shorthand prop for gridTemplateColumns. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns)_ - template_rows: Shorthand prop for gridTemplateRows. Learn more _[here](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows)_ - 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. - """ - ... diff --git a/reflex/components/chakra/layout/spacer.py b/reflex/components/chakra/layout/spacer.py deleted file mode 100644 index 3888f37265..0000000000 --- a/reflex/components/chakra/layout/spacer.py +++ /dev/null @@ -1,9 +0,0 @@ -"""A flexible space component.""" - -from reflex.components.chakra import ChakraComponent - - -class Spacer(ChakraComponent): - """A flexible space component.""" - - tag = "Spacer" diff --git a/reflex/components/chakra/layout/spacer.pyi b/reflex/components/chakra/layout/spacer.pyi deleted file mode 100644 index 3cfeabc572..0000000000 --- a/reflex/components/chakra/layout/spacer.pyi +++ /dev/null @@ -1,87 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/spacer.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Spacer(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Spacer": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/layout/stack.py b/reflex/components/chakra/layout/stack.py deleted file mode 100644 index 8e2ab34e6c..0000000000 --- a/reflex/components/chakra/layout/stack.py +++ /dev/null @@ -1,48 +0,0 @@ -"""Container to stack elements with spacing.""" - -from typing import List, Union - -from reflex.components.chakra import ChakraComponent, LiteralStackDirection -from reflex.vars import Var - - -class Stack(ChakraComponent): - """Container to stack elements with spacing.""" - - tag = "Stack" - - # Shorthand for alignItems style prop - align_items: Var[str] - - # The direction to stack the items. - direction: Var[Union[LiteralStackDirection, List[str]]] - - # If true the items will be stacked horizontally. - is_inline: Var[bool] - - # Shorthand for justifyContent style prop - justify_content: Var[str] - - # If true, the children will be wrapped in a Box, and the Box will take the spacing props - should_wrap_children: Var[bool] - - # The space between each stack item - spacing: Var[str] - - # Shorthand for flexWrap style prop - wrap: Var[str] - - # Alignment of contents. - justify: Var[str] - - -class Hstack(Stack): - """Stack items horizontally.""" - - tag = "HStack" - - -class Vstack(Stack): - """Stack items vertically.""" - - tag = "VStack" diff --git a/reflex/components/chakra/layout/stack.pyi b/reflex/components/chakra/layout/stack.pyi deleted file mode 100644 index 715624a7ba..0000000000 --- a/reflex/components/chakra/layout/stack.pyi +++ /dev/null @@ -1,305 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/stack.py""" - -# ------------------- 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 reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Stack(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - align_items: Optional[Union[Var[str], str]] = None, - direction: Optional[ - Union[ - Var[Union[List[str], Literal["row", "column"]]], - Literal["row", "column"], - List[str], - ] - ] = None, - is_inline: Optional[Union[Var[bool], bool]] = None, - justify_content: Optional[Union[Var[str], str]] = None, - should_wrap_children: Optional[Union[Var[bool], bool]] = None, - spacing: Optional[Union[Var[str], str]] = None, - wrap: Optional[Union[Var[str], str]] = None, - justify: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Stack": - """Create the component. - - Args: - *children: The children of the component. - align_items: Shorthand for alignItems style prop - direction: The direction to stack the items. - is_inline: If true the items will be stacked horizontally. - justify_content: Shorthand for justifyContent style prop - should_wrap_children: If true, the children will be wrapped in a Box, and the Box will take the spacing props - spacing: The space between each stack item - wrap: Shorthand for flexWrap style prop - justify: Alignment of contents. - 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 Hstack(Stack): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - align_items: Optional[Union[Var[str], str]] = None, - direction: Optional[ - Union[ - Var[Union[List[str], Literal["row", "column"]]], - Literal["row", "column"], - List[str], - ] - ] = None, - is_inline: Optional[Union[Var[bool], bool]] = None, - justify_content: Optional[Union[Var[str], str]] = None, - should_wrap_children: Optional[Union[Var[bool], bool]] = None, - spacing: Optional[Union[Var[str], str]] = None, - wrap: Optional[Union[Var[str], str]] = None, - justify: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Hstack": - """Create the component. - - Args: - *children: The children of the component. - align_items: Shorthand for alignItems style prop - direction: The direction to stack the items. - is_inline: If true the items will be stacked horizontally. - justify_content: Shorthand for justifyContent style prop - should_wrap_children: If true, the children will be wrapped in a Box, and the Box will take the spacing props - spacing: The space between each stack item - wrap: Shorthand for flexWrap style prop - justify: Alignment of contents. - 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 Vstack(Stack): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - align_items: Optional[Union[Var[str], str]] = None, - direction: Optional[ - Union[ - Var[Union[List[str], Literal["row", "column"]]], - Literal["row", "column"], - List[str], - ] - ] = None, - is_inline: Optional[Union[Var[bool], bool]] = None, - justify_content: Optional[Union[Var[str], str]] = None, - should_wrap_children: Optional[Union[Var[bool], bool]] = None, - spacing: Optional[Union[Var[str], str]] = None, - wrap: Optional[Union[Var[str], str]] = None, - justify: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Vstack": - """Create the component. - - Args: - *children: The children of the component. - align_items: Shorthand for alignItems style prop - direction: The direction to stack the items. - is_inline: If true the items will be stacked horizontally. - justify_content: Shorthand for justifyContent style prop - should_wrap_children: If true, the children will be wrapped in a Box, and the Box will take the spacing props - spacing: The space between each stack item - wrap: Shorthand for flexWrap style prop - justify: Alignment of contents. - 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. - """ - ... diff --git a/reflex/components/chakra/layout/wrap.py b/reflex/components/chakra/layout/wrap.py deleted file mode 100644 index 5d436c5b2a..0000000000 --- a/reflex/components/chakra/layout/wrap.py +++ /dev/null @@ -1,57 +0,0 @@ -"""Container to stack elements with spacing.""" - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.vars import Var - - -class Wrap(ChakraComponent): - """Layout component used to add space between elements and wrap automatically if there isn't enough space.""" - - tag = "Wrap" - - # How to align the items. - align: Var[str] - - # The flex direction of the wrap. - direction: Var[str] - - # How to justify the items. - justify: Var[str] - - # Whether to wrap children in `rx.wrap_item`. - should_wrap_children: Var[bool] - - # The spacing between the items. - spacing: Var[str] - - # The horizontal spacing between the items. - spacing_x: Var[str] - - # The vertical spacing between the items. - spacing_y: Var[str] - - @classmethod - def create(cls, *children, items=None, **props) -> Component: - """Return a wrap component. - - Args: - *children: The children of the component. - items (list): The items of the wrap component. - **props: The properties of the component. - - Returns: - The wrap component. - """ - if len(children) == 0: - children = [] - for item in items or []: - children.append(WrapItem.create(*item)) - - return super().create(*children, **props) - - -class WrapItem(ChakraComponent): - """Item of the Wrap component.""" - - tag = "WrapItem" diff --git a/reflex/components/chakra/layout/wrap.pyi b/reflex/components/chakra/layout/wrap.pyi deleted file mode 100644 index 51654ad61b..0000000000 --- a/reflex/components/chakra/layout/wrap.pyi +++ /dev/null @@ -1,179 +0,0 @@ -"""Stub file for reflex/components/chakra/layout/wrap.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Wrap(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items=None, - align: Optional[Union[Var[str], str]] = None, - direction: Optional[Union[Var[str], str]] = None, - justify: Optional[Union[Var[str], str]] = None, - should_wrap_children: Optional[Union[Var[bool], bool]] = None, - spacing: Optional[Union[Var[str], str]] = None, - spacing_x: Optional[Union[Var[str], str]] = None, - spacing_y: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Wrap": - """Return a wrap component. - - Args: - *children: The children of the component. - items (list): The items of the wrap component. - align: How to align the items. - direction: The flex direction of the wrap. - justify: How to justify the items. - should_wrap_children: Whether to wrap children in `rx.wrap_item`. - spacing: The spacing between the items. - spacing_x: The horizontal spacing between the items. - spacing_y: The vertical spacing between the items. - 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 properties of the component. - - Returns: - The wrap component. - """ - ... - -class WrapItem(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "WrapItem": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/media/__init__.py b/reflex/components/chakra/media/__init__.py deleted file mode 100644 index 8346a37a6c..0000000000 --- a/reflex/components/chakra/media/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Media components.""" - -from .avatar import Avatar, AvatarBadge, AvatarGroup -from .icon import Icon -from .image import Image - -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore diff --git a/reflex/components/chakra/media/avatar.py b/reflex/components/chakra/media/avatar.py deleted file mode 100644 index 6152da7309..0000000000 --- a/reflex/components/chakra/media/avatar.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Avatar components.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent, LiteralAvatarSize -from reflex.event import EventHandler -from reflex.vars import Var - - -class Avatar(ChakraComponent): - """The image that represents the user.""" - - tag = "Avatar" - - # The default avatar used as fallback when name, and src is not specified. - icon: Var[str] - - # The label of the icon. - icon_label: Var[str] - - # If true, opt out of the avatar's fallback logic and renders the img at all times. - ignore_fallback: Var[bool] - - # The name of the person in the avatar. - name: Var[str] - - # If true, the Avatar will show a border around it. Best for a group of avatars. - show_border: Var[bool] - - # The image url of the Avatar. - src: Var[str] - - # List of sources to use for different screen resolutions. - src_set: Var[str] - - # "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" - size: Var[LiteralAvatarSize] - - # Fired when the image fails to load. - on_error: EventHandler[lambda: []] - - -class AvatarBadge(ChakraComponent): - """A wrapper that displays its content on the right corner of the avatar.""" - - tag = "AvatarBadge" - - -class AvatarGroup(ChakraComponent): - """A wrapper to stack multiple Avatars together.""" - - tag = "AvatarGroup" - - # The maximum number of visible avatars. - max_: Var[int] - - # The space between the avatars in the group. - spacing: Var[int] diff --git a/reflex/components/chakra/media/avatar.pyi b/reflex/components/chakra/media/avatar.pyi deleted file mode 100644 index c93ad72b7c..0000000000 --- a/reflex/components/chakra/media/avatar.pyi +++ /dev/null @@ -1,267 +0,0 @@ -"""Stub file for reflex/components/chakra/media/avatar.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Avatar(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - icon: Optional[Union[Var[str], str]] = None, - icon_label: Optional[Union[Var[str], str]] = None, - ignore_fallback: Optional[Union[Var[bool], bool]] = None, - name: Optional[Union[Var[str], str]] = None, - show_border: Optional[Union[Var[bool], bool]] = None, - src: Optional[Union[Var[str], str]] = None, - src_set: Optional[Union[Var[str], str]] = None, - size: Optional[ - Union[ - Var[Literal["sm", "md", "lg", "xl", "xs", "2xl", "full", "2xs"]], - Literal["sm", "md", "lg", "xl", "xs", "2xl", "full", "2xs"], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Avatar": - """Create the component. - - Args: - *children: The children of the component. - icon: The default avatar used as fallback when name, and src is not specified. - icon_label: The label of the icon. - ignore_fallback: If true, opt out of the avatar's fallback logic and renders the img at all times. - name: The name of the person in the avatar. - show_border: If true, the Avatar will show a border around it. Best for a group of avatars. - src: The image url of the Avatar. - src_set: List of sources to use for different screen resolutions. - size: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" - 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 AvatarBadge(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AvatarBadge": - """Create the component. - - Args: - *children: The children of the component. - 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 AvatarGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - max_: Optional[Union[Var[int], int]] = None, - spacing: 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AvatarGroup": - """Create the component. - - Args: - *children: The children of the component. - max_: The maximum number of visible avatars. - spacing: The space between the avatars in the group. - 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. - """ - ... diff --git a/reflex/components/chakra/media/icon.py b/reflex/components/chakra/media/icon.py deleted file mode 100644 index 989ddd1119..0000000000 --- a/reflex/components/chakra/media/icon.py +++ /dev/null @@ -1,111 +0,0 @@ -"""An icon component.""" - -from typing import List - -from reflex.components.chakra import ChakraComponent -from reflex.utils import format - - -class ChakraIconComponent(ChakraComponent): - """A component that wraps a Chakra icon component.""" - - library = "@chakra-ui/icons@2.0.19" - - -class Icon(ChakraIconComponent): - """An image icon.""" - - tag = "None" - - @classmethod - def create(cls, *children, **props): - """Initialize the Icon component. - - Run some additional checks on Icon component. - - Args: - *children: The positional arguments - **props: The keyword arguments - - Raises: - AttributeError: The errors tied to bad usage of the Icon component. - ValueError: If the icon tag is invalid. - - Returns: - The created component. - """ - if children: - raise AttributeError( - f"Passing children to Icon component is not allowed: remove positional arguments {children} to fix" - ) - if "tag" not in props: - raise AttributeError("Missing 'tag' keyword-argument for Icon") - if not isinstance(props["tag"], str) or props["tag"].lower() not in ICON_LIST: - raise ValueError( - f"Invalid icon tag: {props['tag']}. Please use one of the following: {sorted(ICON_LIST)}" - ) - props["tag"] = format.to_title_case(props["tag"]) + "Icon" - return super().create(*children, **props) - - -# List of all icons. -ICON_LIST: List[str] = [ - "add", - "arrow_back", - "arrow_down", - "arrow_forward", - "arrow_left", - "arrow_right", - "arrow_up", - "arrow_up_down", - "at_sign", - "attachment", - "bell", - "calendar", - "chat", - "check_circle", - "check", - "chevron_down", - "chevron_left", - "chevron_right", - "chevron_up", - "close", - "copy", - "delete", - "download", - "drag_handle", - "edit", - "email", - "external_link", - "hamburger", - "info", - "info_outline", - "link", - "lock", - "minus", - "moon", - "not_allowed", - "phone", - "plus_square", - "question", - "question_outline", - "repeat", - "repeat_clock", - "search", - "search2", - "settings", - "small_add", - "small_close", - "spinner", - "star", - "sun", - "time", - "triangle_down", - "triangle_up", - "unlock", - "up_down", - "view", - "view_off", - "warning", - "warning_two", -] diff --git a/reflex/components/chakra/media/icon.pyi b/reflex/components/chakra/media/icon.pyi deleted file mode 100644 index bbd20f6732..0000000000 --- a/reflex/components/chakra/media/icon.pyi +++ /dev/null @@ -1,171 +0,0 @@ -"""Stub file for reflex/components/chakra/media/icon.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class ChakraIconComponent(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ChakraIconComponent": - """Create the component. - - Args: - *children: The children of the component. - 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 Icon(ChakraIconComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Icon": - """Initialize the Icon component. - - Run some additional checks on Icon component. - - Args: - *children: The positional arguments - 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 keyword arguments - - Raises: - AttributeError: The errors tied to bad usage of the Icon component. - ValueError: If the icon tag is invalid. - - Returns: - The created component. - """ - ... - -ICON_LIST: List[str] diff --git a/reflex/components/chakra/media/image.py b/reflex/components/chakra/media/image.py deleted file mode 100644 index b68fe8e6a5..0000000000 --- a/reflex/components/chakra/media/image.py +++ /dev/null @@ -1,74 +0,0 @@ -"""An image component.""" - -from __future__ import annotations - -from typing import Any, Optional - -from reflex.components.chakra import ChakraComponent, LiteralImageLoading -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - - -class Image(ChakraComponent): - """Display an image.""" - - tag = "Image" - alias = "ChakraImage" - # How to align the image within its bounds. It maps to css `object-position` property. - align: Var[str] - - # Fallback Reflex component to show if image is loading or image fails. - fallback: Optional[Component] = None - - # Fallback image src to show if image is loading or image fails. - fallback_src: Var[str] - - # How the image to fit within its bounds. It maps to css `object-fit` property. - fit: Var[str] - - # The native HTML height attribute to the passed to the img. - html_height: Var[str] - - # The native HTML width attribute to the passed to the img. - html_width: Var[str] - - # If true, opt out of the fallbackSrc logic and use as img. - ignore_fallback: Var[bool] - - # "eager" | "lazy" - loading: Var[LiteralImageLoading] - - # The path/url to the image or PIL image object. - src: Var[Any] - - # The alt text of the image. - alt: Var[str] - - # Provide multiple sources for an image, allowing the browser - # to select the most appropriate source based on factors like - # screen resolution and device capabilities. - # Learn more _[here](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)_ - src_set: Var[str] - - # Fired when the image fails to load. - on_error: EventHandler[lambda: []] - - # Fired when the image is loaded. - on_load: EventHandler[lambda: []] - - @classmethod - def create(cls, *children, **props) -> Component: - """Create an Image component. - - Args: - *children: The children of the image. - **props: The props of the image. - - Returns: - The Image component. - """ - src = props.get("src", None) - if src is not None and not isinstance(src, (Var)): - props["src"] = Var.create(value=src, _var_is_string=True) - return super().create(*children, **props) diff --git a/reflex/components/chakra/media/image.pyi b/reflex/components/chakra/media/image.pyi deleted file mode 100644 index 9e659e8562..0000000000 --- a/reflex/components/chakra/media/image.pyi +++ /dev/null @@ -1,118 +0,0 @@ -"""Stub file for reflex/components/chakra/media/image.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Image(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - align: Optional[Union[Var[str], str]] = None, - fallback: Optional[Component] = None, - fallback_src: Optional[Union[Var[str], str]] = None, - fit: Optional[Union[Var[str], str]] = None, - html_height: Optional[Union[Var[str], str]] = None, - html_width: Optional[Union[Var[str], str]] = None, - ignore_fallback: Optional[Union[Var[bool], bool]] = None, - loading: Optional[ - Union[Var[Literal["eager", "lazy"]], Literal["eager", "lazy"]] - ] = None, - src: Optional[Union[Var[Any], Any]] = None, - alt: Optional[Union[Var[str], str]] = None, - src_set: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_error: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_load: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Image": - """Create an Image component. - - Args: - *children: The children of the image. - align: How to align the image within its bounds. It maps to css `object-position` property. - fallback: Fallback Reflex component to show if image is loading or image fails. - fallback_src: Fallback image src to show if image is loading or image fails. - fit: How the image to fit within its bounds. It maps to css `object-fit` property. - html_height: The native HTML height attribute to the passed to the img. - html_width: The native HTML width attribute to the passed to the img. - ignore_fallback: If true, opt out of the fallbackSrc logic and use as img. - loading: "eager" | "lazy" - src: The path/url to the image or PIL image object. - alt: The alt text of the image. - src_set: Provide multiple sources for an image, allowing the browser to select the most appropriate source based on factors like screen resolution and device capabilities. Learn more _[here](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)_ - 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 image. - - Returns: - The Image component. - """ - ... diff --git a/reflex/components/chakra/navigation/__init__.py b/reflex/components/chakra/navigation/__init__.py deleted file mode 100644 index 4b61ad8db3..0000000000 --- a/reflex/components/chakra/navigation/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Navigation components.""" - -from .breadcrumb import Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator -from .link import Link -from .linkoverlay import LinkBox, LinkOverlay -from .stepper import ( - Step, - StepDescription, - StepIcon, - StepIndicator, - StepNumber, - Stepper, - StepSeparator, - StepStatus, - StepTitle, -) - -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore diff --git a/reflex/components/chakra/navigation/breadcrumb.py b/reflex/components/chakra/navigation/breadcrumb.py deleted file mode 100644 index 7c902bf1ae..0000000000 --- a/reflex/components/chakra/navigation/breadcrumb.py +++ /dev/null @@ -1,98 +0,0 @@ -"""Breadcrumb components.""" - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.navigation.link import Link -from reflex.components.component import Component -from reflex.components.core.foreach import Foreach -from reflex.vars import Var - - -class Breadcrumb(ChakraComponent): - """The parent container for breadcrumbs.""" - - tag = "Breadcrumb" - - # The visual separator between each breadcrumb item - separator: Var[str] - - # The left and right margin applied to the separator - separator_margin: Var[str] - - @classmethod - def create(cls, *children, items=None, **props) -> Component: - """Create a breadcrumb component. - - If the kw-args `items` is provided and is a list, they will be added as children. - - Args: - *children: The children of the component. - items (list): The items of the breadcrumb: (label, link) - **props: The properties of the component. - - Returns: - The breadcrumb component. - """ - if len(children) == 0: - if isinstance(items, Var): - children = [ - Foreach.create( - items, - lambda item: BreadcrumbItem.create(label=item[0], href=item[1]), - ), - ] - - else: - children = [] - for label, link in items or []: - children.append(BreadcrumbItem.create(label=label, href=link)) - return super().create(*children, **props) - - -class BreadcrumbItem(ChakraComponent): - """Individual breadcrumb element containing a link and a divider.""" - - tag = "BreadcrumbItem" - - # Is the current page of the breadcrumb. - is_current_page: Var[bool] - - # Is the last child of the breadcrumb. - is_last_child: Var[bool] - - # The visual separator between each breadcrumb item - separator: Var[str] - - # The left and right margin applied to the separator - spacing: Var[str] - - @classmethod - def create(cls, *children, label=None, href=None, **props): - """Create a Breadcrumb Item component. - - Args: - *children: The children of the component. - label: The label used in the link. Defaults to None. - href: The URL of the link. Defaults to None. - **props: The properties of the component. - - Returns: - The BreadcrumbItem component - """ - if len(children) == 0: - children = [BreadcrumbLink.create(label or "", href=href or "")] # type: ignore - return super().create(*children, **props) - - -class BreadcrumbSeparator(ChakraComponent): - """The visual separator between each breadcrumb.""" - - tag = "BreadcrumbSeparator" - - -class BreadcrumbLink(Link): - """The breadcrumb link.""" - - tag = "BreadcrumbLink" - - # Is the current page of the breadcrumb. - is_current_page: Var[bool] diff --git a/reflex/components/chakra/navigation/breadcrumb.pyi b/reflex/components/chakra/navigation/breadcrumb.pyi deleted file mode 100644 index 3593f41289..0000000000 --- a/reflex/components/chakra/navigation/breadcrumb.pyi +++ /dev/null @@ -1,351 +0,0 @@ -"""Stub file for reflex/components/chakra/navigation/breadcrumb.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.navigation.link import Link -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Breadcrumb(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items=None, - separator: Optional[Union[Var[str], str]] = None, - separator_margin: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Breadcrumb": - """Create a breadcrumb component. - - If the kw-args `items` is provided and is a list, they will be added as children. - - Args: - *children: The children of the component. - items (list): The items of the breadcrumb: (label, link) - separator: The visual separator between each breadcrumb item - separator_margin: The left and right margin applied to the separator - 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 properties of the component. - - Returns: - The breadcrumb component. - """ - ... - -class BreadcrumbItem(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - label=None, - href=None, - is_current_page: Optional[Union[Var[bool], bool]] = None, - is_last_child: Optional[Union[Var[bool], bool]] = None, - separator: Optional[Union[Var[str], str]] = None, - spacing: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "BreadcrumbItem": - """Create a Breadcrumb Item component. - - Args: - *children: The children of the component. - label: The label used in the link. Defaults to None. - href: The URL of the link. Defaults to None. - is_current_page: Is the current page of the breadcrumb. - is_last_child: Is the last child of the breadcrumb. - separator: The visual separator between each breadcrumb item - spacing: The left and right margin applied to the separator - 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 properties of the component. - - Returns: - The BreadcrumbItem component - """ - ... - -class BreadcrumbSeparator(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "BreadcrumbSeparator": - """Create the component. - - Args: - *children: The children of the component. - 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 BreadcrumbLink(Link): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_current_page: Optional[Union[Var[bool], bool]] = None, - rel: Optional[Union[Var[str], str]] = None, - href: Optional[Union[Var[str], str]] = None, - text: Optional[Union[Var[str], str]] = None, - as_: Optional[Union[Var[str], str]] = None, - is_external: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "BreadcrumbLink": - """Create a Link component. - - Args: - *children: The children of the component. - is_current_page: Is the current page of the breadcrumb. - rel: The rel. - href: The page to link to. - text: The text to display. - as_: What the link renders to. - is_external: If true, the link will open in new tab. - 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. - - Raises: - ValueError: in case of missing children - - Returns: - Component: The link component - """ - ... diff --git a/reflex/components/chakra/navigation/link.py b/reflex/components/chakra/navigation/link.py deleted file mode 100644 index e30644acd2..0000000000 --- a/reflex/components/chakra/navigation/link.py +++ /dev/null @@ -1,62 +0,0 @@ -"""A link component.""" - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.components.next.link import NextLink -from reflex.utils.imports import ImportDict -from reflex.vars import BaseVar, Var - -next_link = NextLink.create() - - -class Link(ChakraComponent): - """Link to another page.""" - - tag = "Link" - - # The rel. - rel: Var[str] - - # The page to link to. - href: Var[str] - - # The text to display. - text: Var[str] - - # What the link renders to. - as_: Var[str] = BaseVar.create( - value="{NextLink}", _var_is_local=False, _var_is_string=False - ) # type: ignore - - # If true, the link will open in new tab. - is_external: Var[bool] - - def add_imports(self) -> ImportDict: - """Add imports for the link component. - - Returns: - The import dict. - """ - return next_link._get_imports() # type: ignore - - @classmethod - def create(cls, *children, **props) -> Component: - """Create a Link component. - - Args: - *children: The children of the component. - **props: The props of the component. - - Raises: - ValueError: in case of missing children - - Returns: - Component: The link component - """ - if props.get("href") is not None: - if not len(children): - raise ValueError("Link without a child will not display") - else: - # Don't use a NextLink if there is no href. - props["as_"] = "" - return super().create(*children, **props) diff --git a/reflex/components/chakra/navigation/link.pyi b/reflex/components/chakra/navigation/link.pyi deleted file mode 100644 index be8f53fece..0000000000 --- a/reflex/components/chakra/navigation/link.pyi +++ /dev/null @@ -1,105 +0,0 @@ -"""Stub file for reflex/components/chakra/navigation/link.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.next.link import NextLink -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.utils.imports import ImportDict -from reflex.vars import BaseVar, Var - -next_link = NextLink.create() - -class Link(ChakraComponent): - def add_imports(self) -> ImportDict: ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - rel: Optional[Union[Var[str], str]] = None, - href: Optional[Union[Var[str], str]] = None, - text: Optional[Union[Var[str], str]] = None, - as_: Optional[Union[Var[str], str]] = None, - is_external: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Link": - """Create a Link component. - - Args: - *children: The children of the component. - rel: The rel. - href: The page to link to. - text: The text to display. - as_: What the link renders to. - is_external: If true, the link will open in new tab. - 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. - - Raises: - ValueError: in case of missing children - - Returns: - Component: The link component - """ - ... diff --git a/reflex/components/chakra/navigation/linkoverlay.py b/reflex/components/chakra/navigation/linkoverlay.py deleted file mode 100644 index 370e3df48d..0000000000 --- a/reflex/components/chakra/navigation/linkoverlay.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Link overlay components.""" - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class LinkOverlay(ChakraComponent): - """Wraps child component in a link.""" - - tag = "LinkOverlay" - - # If true, the link will open in new tab - is_external: Var[bool] - - # Href of the link overlay. - href: Var[str] - - -class LinkBox(ChakraComponent): - """The LinkBox lifts any nested links to the top using z-index to ensure proper keyboard navigation between links.""" - - tag = "LinkBox" diff --git a/reflex/components/chakra/navigation/linkoverlay.pyi b/reflex/components/chakra/navigation/linkoverlay.pyi deleted file mode 100644 index bac747c2bc..0000000000 --- a/reflex/components/chakra/navigation/linkoverlay.pyi +++ /dev/null @@ -1,167 +0,0 @@ -"""Stub file for reflex/components/chakra/navigation/linkoverlay.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class LinkOverlay(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - is_external: Optional[Union[Var[bool], bool]] = None, - href: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "LinkOverlay": - """Create the component. - - Args: - *children: The children of the component. - is_external: If true, the link will open in new tab - href: Href of the link overlay. - 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 LinkBox(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "LinkBox": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/navigation/stepper.py b/reflex/components/chakra/navigation/stepper.py deleted file mode 100644 index 7c47760e56..0000000000 --- a/reflex/components/chakra/navigation/stepper.py +++ /dev/null @@ -1,113 +0,0 @@ -"""A component to indicate progress through a multi-step process.""" - -from typing import List, Literal, Optional, Tuple - -from reflex.components.chakra import ChakraComponent, LiteralColorScheme -from reflex.components.component import Component -from reflex.vars import Var - - -class Stepper(ChakraComponent): - """The parent container for a stepper.""" - - tag = "Stepper" - - orientation: Var[Literal["vertical", "horizontal"]] - - # The color scheme to use for the stepper; default is blue. - colorScheme: Var[LiteralColorScheme] - - # Chakra provides a useSteps hook to control the stepper. - # Instead, use an integer state value to set progress in the stepper. - - # The index of the current step. - index: Var[int] - - # The size of the steps in the stepper. - size: Var[str] - - @classmethod - def create( - cls, *children, items: Optional[List[Tuple]] = None, **props - ) -> Component: - """Create a Stepper component. - - If the kw-args `items` is provided and is a list, they will be added as children. - - Args: - *children: The children of the component. - items (list): The child components for each step. - **props: The properties of the component. - - Returns: - The stepper component. - """ - if len(children) == 0: - children = [] - for indicator, layout, separator in items or []: - children.append( - Step.create( - StepIndicator.create(indicator), - layout, - StepSeparator.create(separator), - ) - ) - return super().create(*children, **props) - - -class Step(ChakraComponent): - """A component for an individual step in the stepper.""" - - tag = "Step" - - -class StepDescription(ChakraComponent): - """The description text for a step component.""" - - tag = "StepDescription" - - -class StepIcon(ChakraComponent): - """The icon displayed in a step indicator component.""" - - tag = "StepIcon" - - -class StepIndicator(ChakraComponent): - """The component displaying the status of a step.""" - - tag = "StepIndicator" - - -class StepNumber(ChakraComponent): - """The number of a step displayed in a step indicator component.""" - - tag = "StepNumber" - - -class StepSeparator(ChakraComponent): - """The component separting steps.""" - - tag = "StepSeparator" - - -class StepStatus(ChakraComponent): - """A component that displays a number or icon based on the status of a step.""" - - # [not working yet] - # active, complete, and incomplete should also be able to accept StepIcon or StepNumber components - # currently, these props only support strings - - active: Var[str] - - complete: Var[str] - - incomplete: Var[str] - - tag = "StepStatus" - - -class StepTitle(ChakraComponent): - """The title text for a step component.""" - - tag = "StepTitle" diff --git a/reflex/components/chakra/navigation/stepper.pyi b/reflex/components/chakra/navigation/stepper.pyi deleted file mode 100644 index ce365f994b..0000000000 --- a/reflex/components/chakra/navigation/stepper.pyi +++ /dev/null @@ -1,762 +0,0 @@ -"""Stub file for reflex/components/chakra/navigation/stepper.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Stepper(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items: Optional[List[Tuple]] = None, - orientation: Optional[ - Union[ - Var[Literal["vertical", "horizontal"]], - Literal["vertical", "horizontal"], - ] - ] = None, - colorScheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = None, - index: Optional[Union[Var[int], int]] = None, - size: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Stepper": - """Create a Stepper component. - - If the kw-args `items` is provided and is a list, they will be added as children. - - Args: - *children: The children of the component. - items (list): The child components for each step. - colorScheme: The color scheme to use for the stepper; default is blue. - index: Chakra provides a useSteps hook to control the stepper. Instead, use an integer state value to set progress in the stepper. The index of the current step. - size: The size of the steps in the stepper. - 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 properties of the component. - - Returns: - The stepper component. - """ - ... - -class Step(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Step": - """Create the component. - - Args: - *children: The children of the component. - 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 StepDescription(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StepDescription": - """Create the component. - - Args: - *children: The children of the component. - 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 StepIcon(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StepIcon": - """Create the component. - - Args: - *children: The children of the component. - 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 StepIndicator(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StepIndicator": - """Create the component. - - Args: - *children: The children of the component. - 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 StepNumber(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StepNumber": - """Create the component. - - Args: - *children: The children of the component. - 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 StepSeparator(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StepSeparator": - """Create the component. - - Args: - *children: The children of the component. - 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 StepStatus(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - active: Optional[Union[Var[str], str]] = None, - complete: Optional[Union[Var[str], str]] = None, - incomplete: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StepStatus": - """Create the component. - - Args: - *children: The children of the component. - active: [not working yet] active, complete, and incomplete should also be able to accept StepIcon or StepNumber components currently, these props only support strings - 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 StepTitle(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "StepTitle": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/overlay/__init__.py b/reflex/components/chakra/overlay/__init__.py deleted file mode 100644 index 322d09318c..0000000000 --- a/reflex/components/chakra/overlay/__init__.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Overlay components.""" - -from .alertdialog import ( - AlertDialog, - AlertDialogBody, - AlertDialogContent, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogOverlay, -) -from .drawer import ( - Drawer, - DrawerBody, - DrawerCloseButton, - DrawerContent, - DrawerFooter, - DrawerHeader, - DrawerOverlay, -) -from .menu import ( - Menu, - MenuButton, - MenuDivider, - MenuGroup, - MenuItem, - MenuItemOption, - MenuList, - MenuOptionGroup, -) -from .modal import ( - Modal, - ModalBody, - ModalCloseButton, - ModalContent, - ModalFooter, - ModalHeader, - ModalOverlay, -) -from .popover import ( - Popover, - PopoverAnchor, - PopoverArrow, - PopoverBody, - PopoverCloseButton, - PopoverContent, - PopoverFooter, - PopoverHeader, - PopoverTrigger, -) -from .tooltip import Tooltip diff --git a/reflex/components/chakra/overlay/alertdialog.py b/reflex/components/chakra/overlay/alertdialog.py deleted file mode 100644 index 72f3ad6429..0000000000 --- a/reflex/components/chakra/overlay/alertdialog.py +++ /dev/null @@ -1,153 +0,0 @@ -"""Alert dialog components.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent, LiteralAlertDialogSize -from reflex.components.chakra.media.icon import Icon -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - - -class AlertDialog(ChakraComponent): - """Provides context and state for the dialog.""" - - tag = "AlertDialog" - - # If true, the modal will be open. - is_open: Var[bool] - - # The least destructive element to focus when the dialog opens. - least_destructive_ref: Var[str] - - # Handle zoom/pinch gestures on iOS devices when scroll locking is enabled. Defaults to false. - allow_pinch_zoom: Var[bool] - - # If true, the modal will autofocus the first enabled and interactive element within the ModalContent - auto_focus: Var[bool] - - # If true, scrolling will be disabled on the body when the modal opens. - block_scroll_on_mount: Var[bool] - - # If true, the modal will close when the Esc key is pressed - close_on_esc: Var[bool] - - # If true, the modal will close when the overlay is clicked - close_on_overlay_click: Var[bool] - - # If true, the modal will be centered on screen. - is_centered: Var[bool] - - # Enables aggressive focus capturing within iframes. If true, keep focus in the lock, no matter where lock is active. If false, allows focus to move outside of iframe. - lock_focus_across_frames: Var[bool] - - # If true, a `padding-right` will be applied to the body element that's equal to the width of the scrollbar. This can help prevent some unpleasant flickering effect and content adjustment when the modal opens - preserve_scroll_bar_gap: Var[bool] - - # If true, the modal will return focus to the element that triggered it when it closes. - return_focus_on_close: Var[bool] - - # "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full" - size: Var[LiteralAlertDialogSize] - - # If true, the siblings of the modal will have `aria-hidden` set to true so that screen readers can only see the modal. This is commonly known as making the other elements **inert** - use_inert: Var[bool] - - # Fired when the modal is closing. - on_close: EventHandler[lambda: []] - - # Fired when the modal is closed and the exit animation is complete. - on_close_complete: EventHandler[lambda: []] - - # Fired when the Esc key is pressed. - on_esc: EventHandler[lambda: []] - - # Fired when the overlay is clicked. - on_overlay_click: EventHandler[lambda: []] - - @classmethod - def create( - cls, *children, header=None, body=None, footer=None, close_button=None, **props - ) -> Component: - """Create an alert dialog component. - - Args: - *children: The children of the alert dialog component. - header: The header of the alert dialog. - body: The body of the alert dialog. - footer: The footer of the alert dialog. - close_button: The close button of the alert dialog. - **props: The properties of the alert dialog component. - - Raises: - AttributeError: if there is a conflict between the props used. - - Returns: - The alert dialog component. - """ - if len(children) == 0: - contents = [] - - if header: - contents.append(AlertDialogHeader.create(header)) - - if body: - contents.append(AlertDialogBody.create(body)) - - if footer: - contents.append(AlertDialogFooter.create(footer)) - - # add AlertDialogCloseButton if either a prop for one was passed, or if on_close callback is present - if props.get("on_close"): - # get user defined close button or use default one - if not close_button: - close_button = Icon.create(tag="close") - contents.append(AlertDialogCloseButton.create(close_button)) - elif close_button: - raise AttributeError( - "Close button can not be used if on_close event handler is not defined" - ) - - children = [ - AlertDialogOverlay.create( - AlertDialogContent.create(*contents), - ) - ] - - return super().create(*children, **props) - - -class AlertDialogBody(ChakraComponent): - """Should contain the description announced by screen readers.""" - - tag = "AlertDialogBody" - - -class AlertDialogHeader(ChakraComponent): - """Should contain the title announced by screen readers.""" - - tag = "AlertDialogHeader" - - -class AlertDialogFooter(ChakraComponent): - """Should contain the events of the dialog.""" - - tag = "AlertDialogFooter" - - -class AlertDialogContent(ChakraComponent): - """The wrapper for the alert dialog's content.""" - - tag = "AlertDialogContent" - - -class AlertDialogOverlay(ChakraComponent): - """The dimmed overlay behind the dialog.""" - - tag = "AlertDialogOverlay" - - -class AlertDialogCloseButton(ChakraComponent): - """The button that closes the dialog.""" - - tag = "AlertDialogCloseButton" diff --git a/reflex/components/chakra/overlay/alertdialog.pyi b/reflex/components/chakra/overlay/alertdialog.pyi deleted file mode 100644 index 490684ce4c..0000000000 --- a/reflex/components/chakra/overlay/alertdialog.pyi +++ /dev/null @@ -1,612 +0,0 @@ -"""Stub file for reflex/components/chakra/overlay/alertdialog.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class AlertDialog(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - header=None, - body=None, - footer=None, - close_button=None, - is_open: Optional[Union[Var[bool], bool]] = None, - least_destructive_ref: Optional[Union[Var[str], str]] = None, - allow_pinch_zoom: Optional[Union[Var[bool], bool]] = None, - auto_focus: Optional[Union[Var[bool], bool]] = None, - block_scroll_on_mount: Optional[Union[Var[bool], bool]] = None, - close_on_esc: Optional[Union[Var[bool], bool]] = None, - close_on_overlay_click: Optional[Union[Var[bool], bool]] = None, - is_centered: Optional[Union[Var[bool], bool]] = None, - lock_focus_across_frames: Optional[Union[Var[bool], bool]] = None, - preserve_scroll_bar_gap: Optional[Union[Var[bool], bool]] = None, - return_focus_on_close: Optional[Union[Var[bool], bool]] = None, - size: Optional[ - Union[ - Var[ - Literal[ - "sm", - "md", - "lg", - "xs", - "2xl", - "full", - "3xl", - "4xl", - "5xl", - "6xl", - ] - ], - Literal[ - "sm", "md", "lg", "xs", "2xl", "full", "3xl", "4xl", "5xl", "6xl" - ], - ] - ] = None, - use_inert: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_esc: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_overlay_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDialog": - """Create an alert dialog component. - - Args: - *children: The children of the alert dialog component. - header: The header of the alert dialog. - body: The body of the alert dialog. - footer: The footer of the alert dialog. - close_button: The close button of the alert dialog. - is_open: If true, the modal will be open. - least_destructive_ref: The least destructive element to focus when the dialog opens. - allow_pinch_zoom: Handle zoom/pinch gestures on iOS devices when scroll locking is enabled. Defaults to false. - auto_focus: If true, the modal will autofocus the first enabled and interactive element within the ModalContent - block_scroll_on_mount: If true, scrolling will be disabled on the body when the modal opens. - close_on_esc: If true, the modal will close when the Esc key is pressed - close_on_overlay_click: If true, the modal will close when the overlay is clicked - is_centered: If true, the modal will be centered on screen. - lock_focus_across_frames: Enables aggressive focus capturing within iframes. If true, keep focus in the lock, no matter where lock is active. If false, allows focus to move outside of iframe. - preserve_scroll_bar_gap: If true, a `padding-right` will be applied to the body element that's equal to the width of the scrollbar. This can help prevent some unpleasant flickering effect and content adjustment when the modal opens - return_focus_on_close: If true, the modal will return focus to the element that triggered it when it closes. - size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full" - use_inert: If true, the siblings of the modal will have `aria-hidden` set to true so that screen readers can only see the modal. This is commonly known as making the other elements **inert** - 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 properties of the alert dialog component. - - Raises: - AttributeError: if there is a conflict between the props used. - - Returns: - The alert dialog component. - """ - ... - -class AlertDialogBody(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDialogBody": - """Create the component. - - Args: - *children: The children of the component. - 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 AlertDialogHeader(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDialogHeader": - """Create the component. - - Args: - *children: The children of the component. - 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 AlertDialogFooter(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDialogFooter": - """Create the component. - - Args: - *children: The children of the component. - 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 AlertDialogContent(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDialogContent": - """Create the component. - - Args: - *children: The children of the component. - 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 AlertDialogOverlay(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDialogOverlay": - """Create the component. - - Args: - *children: The children of the component. - 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 AlertDialogCloseButton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "AlertDialogCloseButton": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/overlay/drawer.py b/reflex/components/chakra/overlay/drawer.py deleted file mode 100644 index b8f2868554..0000000000 --- a/reflex/components/chakra/overlay/drawer.py +++ /dev/null @@ -1,168 +0,0 @@ -"""Container to stack elements with spacing.""" - -from __future__ import annotations - -from reflex.components.chakra import ( - ChakraComponent, - LiteralColorScheme, - LiteralDrawerSize, -) -from reflex.components.chakra.media.icon import Icon -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - - -class Drawer(ChakraComponent): - """A drawer component.""" - - tag = "Drawer" - - # If true, the modal will be open. - is_open: Var[bool] - - # Handle zoom/pinch gestures on iOS devices when scroll locking is enabled. Defaults to false. - allow_pinch_zoom: Var[bool] - - # If true, the modal will autofocus the first enabled and interactive element within the ModalContent - auto_focus: Var[bool] - - # If true, scrolling will be disabled on the body when the modal opens. - block_scroll_on_mount: Var[bool] - - # If true, the modal will close when the Esc key is pressed - close_on_esc: Var[bool] - - # If true, the modal will close when the overlay is clicked - close_on_overlay_click: Var[bool] - - # If true, the modal will be centered on screen. - is_centered: Var[bool] - - # If true and drawer's placement is top or bottom, the drawer will occupy the viewport height (100vh) - is_full_height: Var[bool] - - # Enables aggressive focus capturing within iframes. - If true: keep focus in the lock, no matter where lock is active - If false: allows focus to move outside of iframe - lock_focus_across_frames: Var[bool] - - # The placement of the drawer - placement: Var[str] - - # If true, a `padding-right` will be applied to the body element that's equal to the width of the scrollbar. This can help prevent some unpleasant flickering effect and content adjustment when the modal opens - preserve_scroll_bar_gap: Var[bool] - - # If true, the modal will return focus to the element that triggered it when it closes. - return_focus_on_close: Var[bool] - - # "xs" | "sm" | "md" | "lg" | "xl" | "full" - size: Var[LiteralDrawerSize] - - # A11y: If true, the siblings of the modal will have `aria-hidden` set to true so that screen readers can only see the modal. This is commonly known as making the other elements **inert** - use_inert: Var[bool] - - # Variant of drawer - variant: Var[str] - - # Color scheme of the Drawer - # Options: - # "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" - # | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - color_scheme: Var[LiteralColorScheme] - - # Fired when the modal is closing. - on_close: EventHandler[lambda: []] - - # Fired when the modal is closed and the exit animation is complete. - on_close_complete: EventHandler[lambda: []] - - # Fired when the Esc key is pressed. - on_esc: EventHandler[lambda: []] - - # Fired when the overlay is clicked. - on_overlay_click: EventHandler[lambda: []] - - @classmethod - def create( - cls, *children, header=None, body=None, footer=None, close_button=None, **props - ) -> Component: - """Create a drawer component. - - Args: - *children: The children of the drawer component. - header: The header of the drawer. - body: The body of the drawer. - footer: The footer of the drawer. - close_button: The close button of the drawer. - **props: The properties of the drawer component. - - Raises: - AttributeError: error that occurs if conflicting props are passed - - Returns: - The drawer component. - """ - if len(children) == 0: - contents = [] - - if header: - contents.append(DrawerHeader.create(header)) - - if body: - contents.append(DrawerBody.create(body)) - - if footer: - contents.append(DrawerFooter.create(footer)) - - if props.get("on_close"): - # use default close button if undefined - if not close_button: - close_button = Icon.create(tag="close") - contents.append(DrawerCloseButton.create(close_button)) - elif close_button: - raise AttributeError( - "Close button can not be used if on_close event handler is not defined" - ) - - children = [ - DrawerOverlay.create( - DrawerContent.create(*contents), - ) - ] - - return super().create(*children, **props) - - -class DrawerBody(ChakraComponent): - """Drawer body.""" - - tag = "DrawerBody" - - -class DrawerHeader(ChakraComponent): - """Drawer header.""" - - tag = "DrawerHeader" - - -class DrawerFooter(ChakraComponent): - """Drawer footer.""" - - tag = "DrawerFooter" - - -class DrawerOverlay(ChakraComponent): - """Drawer overlay.""" - - tag = "DrawerOverlay" - - -class DrawerContent(ChakraComponent): - """Drawer content.""" - - tag = "DrawerContent" - - -class DrawerCloseButton(ChakraComponent): - """Drawer close button.""" - - tag = "DrawerCloseButton" diff --git a/reflex/components/chakra/overlay/drawer.pyi b/reflex/components/chakra/overlay/drawer.pyi deleted file mode 100644 index 1adc43f3e5..0000000000 --- a/reflex/components/chakra/overlay/drawer.pyi +++ /dev/null @@ -1,652 +0,0 @@ -"""Stub file for reflex/components/chakra/overlay/drawer.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Drawer(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - header=None, - body=None, - footer=None, - close_button=None, - is_open: Optional[Union[Var[bool], bool]] = None, - allow_pinch_zoom: Optional[Union[Var[bool], bool]] = None, - auto_focus: Optional[Union[Var[bool], bool]] = None, - block_scroll_on_mount: Optional[Union[Var[bool], bool]] = None, - close_on_esc: Optional[Union[Var[bool], bool]] = None, - close_on_overlay_click: Optional[Union[Var[bool], bool]] = None, - is_centered: Optional[Union[Var[bool], bool]] = None, - is_full_height: Optional[Union[Var[bool], bool]] = None, - lock_focus_across_frames: Optional[Union[Var[bool], bool]] = None, - placement: Optional[Union[Var[str], str]] = None, - preserve_scroll_bar_gap: Optional[Union[Var[bool], bool]] = None, - return_focus_on_close: Optional[Union[Var[bool], bool]] = None, - size: Optional[ - Union[ - Var[Literal["sm", "md", "lg", "xs", "xl", "full"]], - Literal["sm", "md", "lg", "xs", "xl", "full"], - ] - ] = None, - use_inert: Optional[Union[Var[bool], bool]] = None, - variant: Optional[Union[Var[str], str]] = None, - color_scheme: Optional[ - Union[ - Var[ - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ] - ], - Literal[ - "none", - "gray", - "red", - "orange", - "yellow", - "green", - "teal", - "blue", - "cyan", - "purple", - "pink", - "whiteAlpha", - "blackAlpha", - "linkedin", - "facebook", - "messenger", - "whatsapp", - "twitter", - "telegram", - ], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_esc: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_overlay_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Drawer": - """Create a drawer component. - - Args: - *children: The children of the drawer component. - header: The header of the drawer. - body: The body of the drawer. - footer: The footer of the drawer. - close_button: The close button of the drawer. - is_open: If true, the modal will be open. - allow_pinch_zoom: Handle zoom/pinch gestures on iOS devices when scroll locking is enabled. Defaults to false. - auto_focus: If true, the modal will autofocus the first enabled and interactive element within the ModalContent - block_scroll_on_mount: If true, scrolling will be disabled on the body when the modal opens. - close_on_esc: If true, the modal will close when the Esc key is pressed - close_on_overlay_click: If true, the modal will close when the overlay is clicked - is_centered: If true, the modal will be centered on screen. - is_full_height: If true and drawer's placement is top or bottom, the drawer will occupy the viewport height (100vh) - lock_focus_across_frames: Enables aggressive focus capturing within iframes. - If true: keep focus in the lock, no matter where lock is active - If false: allows focus to move outside of iframe - placement: The placement of the drawer - preserve_scroll_bar_gap: If true, a `padding-right` will be applied to the body element that's equal to the width of the scrollbar. This can help prevent some unpleasant flickering effect and content adjustment when the modal opens - return_focus_on_close: If true, the modal will return focus to the element that triggered it when it closes. - size: "xs" | "sm" | "md" | "lg" | "xl" | "full" - use_inert: A11y: If true, the siblings of the modal will have `aria-hidden` set to true so that screen readers can only see the modal. This is commonly known as making the other elements **inert** - variant: Variant of drawer - color_scheme: Color scheme of the Drawer Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" - 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 properties of the drawer component. - - Raises: - AttributeError: error that occurs if conflicting props are passed - - Returns: - The drawer component. - """ - ... - -class DrawerBody(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DrawerBody": - """Create the component. - - Args: - *children: The children of the component. - 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 DrawerHeader(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DrawerHeader": - """Create the component. - - Args: - *children: The children of the component. - 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 DrawerFooter(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DrawerFooter": - """Create the component. - - Args: - *children: The children of the component. - 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 DrawerOverlay(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DrawerOverlay": - """Create the component. - - Args: - *children: The children of the component. - 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 DrawerContent(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DrawerContent": - """Create the component. - - Args: - *children: The children of the component. - 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 DrawerCloseButton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "DrawerCloseButton": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/overlay/menu.py b/reflex/components/chakra/overlay/menu.py deleted file mode 100644 index 88ccf8a352..0000000000 --- a/reflex/components/chakra/overlay/menu.py +++ /dev/null @@ -1,225 +0,0 @@ -"""Menu components.""" - -from __future__ import annotations - -from typing import List, Optional - -from reflex.components.chakra import ( - ChakraComponent, - LiteralChakraDirection, - LiteralMenuOption, - LiteralMenuStrategy, -) -from reflex.components.chakra.forms.button import Button -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - - -class Menu(ChakraComponent): - """The wrapper component provides context, state, and focus management.""" - - tag = "Menu" - - # The padding required to prevent the arrow from reaching the very edge of the popper. - arrow_padding: Var[int] - - # If true, the first enabled menu item will receive focus and be selected when the menu opens. - auto_select: Var[bool] - - # The boundary area for the popper. Used within the preventOverflow modifier - boundary: Var[str] - - # If true, the menu will close when you click outside the menu list - close_on_blur: Var[bool] - - # If true, the menu will close when a menu item is clicked - close_on_select: Var[bool] - - # If by default the menu is open. - default_is_open: Var[bool] - - # If rtl, popper placement positions will be flipped i.e. 'top-right' will become 'top-left' and vice-verse ("ltr" | "rtl") - direction: Var[LiteralChakraDirection] - - # If true, the popper will change its placement and flip when it's about to overflow its boundary area. - flip: Var[bool] - - # The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter. - gutter: Var[int] - - # Performance 🚀: If true, the MenuItem rendering will be deferred until the menu is open. - is_lazy: Var[bool] - - # Performance 🚀: The lazy behavior of menu's content when not visible. Only works when `isLazy={true}` - "unmount": The menu's content is always unmounted when not open. - "keepMounted": The menu's content initially unmounted, but stays mounted when menu is open. - lazy_behavior: Var[str] - - # Determines if the menu is open or not. - is_open: Var[bool] - - # If true, the popper will match the width of the reference at all times. It's useful for autocomplete, `date-picker` and select patterns. - match_width: Var[bool] - - # The placement of the popper relative to its reference. - placement: Var[str] - - # If true, will prevent the popper from being cut off and ensure it's visible within the boundary area. - prevent_overflow: Var[bool] - - # The CSS positioning strategy to use. ("fixed" | "absolute") - strategy: Var[LiteralMenuStrategy] - - # Fired when the menu is closed. - on_close: EventHandler[lambda: []] - - # Fired when the menu is opened. - on_open: EventHandler[lambda: []] - - @classmethod - def create( - cls, - *children, - button: Optional[Component] = None, - items: Optional[List] = None, - **props, - ) -> Component: - """Create a menu component. - - Args: - *children: The children of the component. - button: the button that open the menu. - items (list): The items of the menu. - **props: The properties of the component. - - Returns: - The menu component. - """ - if len(children) == 0: - children = [] - - if button: - if not isinstance(button, (MenuButton, Button)): - children.append(MenuButton.create(button)) - else: - children.append(button) - if not items: - items = [] - children.append(MenuList.create(items=items)) - return super().create(*children, **props) - - -class MenuButton(ChakraComponent): - """The trigger for the menu list. Must be a direct child of Menu.""" - - tag = "MenuButton" - - # The variant of the menu button. - variant: Var[str] - - # Components that are not allowed as children. - _invalid_children: List[str] = ["Button", "MenuButton"] - - # The tag to use for the menu button. - as_: Var[str] - - -class MenuList(ChakraComponent): - """The wrapper for the menu items. Must be a direct child of Menu.""" - - tag = "MenuList" - - @classmethod - def create(cls, *children, items: Optional[list] = None, **props) -> Component: - """Create a MenuList component, and automatically wrap in MenuItem if not already one. - - Args: - *children: The children of the component. - items: A list of item to add as child of the component. - **props: The properties of the component. - - Returns: - The MenuList component. - """ - if len(children) == 0: - if items is None: - items = [] - children = [ - child if isinstance(child, MenuItem) else MenuItem.create(child) - for child in items - ] - return super().create(*children, **props) - - -class MenuItem(ChakraComponent): - """The trigger that handles menu selection. Must be a direct child of a MenuList.""" - - tag = "MenuItem" - - # Overrides the parent menu's closeOnSelect prop. - close_on_select: Var[bool] - - # Right-aligned label text content, useful for displaying hotkeys. - command: Var[str] - - # The spacing between the command and menu item's label. - command_spacing: Var[int] - - # If true, the menuitem will be disabled. - is_disabled: Var[bool] - - # If true and the menuitem is disabled, it'll remain keyboard-focusable - is_focusable: Var[bool] - - -class MenuItemOption(ChakraComponent): - """The checkable menu item, to be used with MenuOptionGroup.""" - - tag = "MenuItemOption" - - # Overrides the parent menu's closeOnSelect prop. - close_on_select: Var[bool] - - # Right-aligned label text content, useful for displaying hotkeys. - command: Var[str] - - # The spacing between the command and menu item's label. - command_spacing: Var[int] - - # Determines if menu item is checked. - is_checked: Var[bool] - - # If true, the menuitem will be disabled. - is_disabled: Var[bool] - - # If true and the menuitem is disabled, it'll remain keyboard-focusable - is_focusable: Var[bool] - - # "checkbox" | "radio" - type_: Var[LiteralMenuOption] - - # Value of the menu item. - value: Var[str] - - -class MenuGroup(ChakraComponent): - """A wrapper to group related menu items.""" - - tag = "MenuGroup" - - -class MenuOptionGroup(ChakraComponent): - """A wrapper for checkable menu items (radio and checkbox).""" - - tag = "MenuOptionGroup" - - # "checkbox" | "radio" - type_: Var[LiteralMenuOption] - - # Value of the option group. - value: Var[str] - - -class MenuDivider(ChakraComponent): - """A visual separator for menu items and groups.""" - - tag = "MenuDivider" diff --git a/reflex/components/chakra/overlay/menu.pyi b/reflex/components/chakra/overlay/menu.pyi deleted file mode 100644 index 5288251e06..0000000000 --- a/reflex/components/chakra/overlay/menu.pyi +++ /dev/null @@ -1,708 +0,0 @@ -"""Stub file for reflex/components/chakra/overlay/menu.py""" - -# ------------------- 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 reflex.components.chakra import ( - ChakraComponent, -) -from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Menu(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - button: Optional[Component] = None, - items: Optional[List] = None, - arrow_padding: Optional[Union[Var[int], int]] = None, - auto_select: Optional[Union[Var[bool], bool]] = None, - boundary: Optional[Union[Var[str], str]] = None, - close_on_blur: Optional[Union[Var[bool], bool]] = None, - close_on_select: Optional[Union[Var[bool], bool]] = None, - default_is_open: Optional[Union[Var[bool], bool]] = None, - direction: Optional[ - Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]] - ] = None, - flip: Optional[Union[Var[bool], bool]] = None, - gutter: Optional[Union[Var[int], int]] = None, - is_lazy: Optional[Union[Var[bool], bool]] = None, - lazy_behavior: Optional[Union[Var[str], str]] = None, - is_open: Optional[Union[Var[bool], bool]] = None, - match_width: Optional[Union[Var[bool], bool]] = None, - placement: Optional[Union[Var[str], str]] = None, - prevent_overflow: Optional[Union[Var[bool], bool]] = None, - strategy: Optional[ - Union[Var[Literal["fixed", "absolute"]], Literal["fixed", "absolute"]] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_open: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Menu": - """Create a menu component. - - Args: - *children: The children of the component. - button: the button that open the menu. - items (list): The items of the menu. - arrow_padding: The padding required to prevent the arrow from reaching the very edge of the popper. - auto_select: If true, the first enabled menu item will receive focus and be selected when the menu opens. - boundary: The boundary area for the popper. Used within the preventOverflow modifier - close_on_blur: If true, the menu will close when you click outside the menu list - close_on_select: If true, the menu will close when a menu item is clicked - default_is_open: If by default the menu is open. - direction: If rtl, popper placement positions will be flipped i.e. 'top-right' will become 'top-left' and vice-verse ("ltr" | "rtl") - flip: If true, the popper will change its placement and flip when it's about to overflow its boundary area. - gutter: The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter. - is_lazy: Performance 🚀: If true, the MenuItem rendering will be deferred until the menu is open. - lazy_behavior: Performance 🚀: The lazy behavior of menu's content when not visible. Only works when `isLazy={true}` - "unmount": The menu's content is always unmounted when not open. - "keepMounted": The menu's content initially unmounted, but stays mounted when menu is open. - is_open: Determines if the menu is open or not. - match_width: If true, the popper will match the width of the reference at all times. It's useful for autocomplete, `date-picker` and select patterns. - placement: The placement of the popper relative to its reference. - prevent_overflow: If true, will prevent the popper from being cut off and ensure it's visible within the boundary area. - strategy: The CSS positioning strategy to use. ("fixed" | "absolute") - 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 properties of the component. - - Returns: - The menu component. - """ - ... - -class MenuButton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - variant: Optional[Union[Var[str], str]] = None, - as_: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "MenuButton": - """Create the component. - - Args: - *children: The children of the component. - variant: The variant of the menu button. - as_: The tag to use for the menu button. - 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 MenuList(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - items: Optional[list] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "MenuList": - """Create a MenuList component, and automatically wrap in MenuItem if not already one. - - Args: - *children: The children of the component. - items: A list of item to add as child of the component. - 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 properties of the component. - - Returns: - The MenuList component. - """ - ... - -class MenuItem(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - close_on_select: Optional[Union[Var[bool], bool]] = None, - command: Optional[Union[Var[str], str]] = None, - command_spacing: Optional[Union[Var[int], int]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_focusable: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "MenuItem": - """Create the component. - - Args: - *children: The children of the component. - close_on_select: Overrides the parent menu's closeOnSelect prop. - command: Right-aligned label text content, useful for displaying hotkeys. - command_spacing: The spacing between the command and menu item's label. - is_disabled: If true, the menuitem will be disabled. - is_focusable: If true and the menuitem is disabled, it'll remain keyboard-focusable - 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 MenuItemOption(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - close_on_select: Optional[Union[Var[bool], bool]] = None, - command: Optional[Union[Var[str], str]] = None, - command_spacing: Optional[Union[Var[int], int]] = None, - is_checked: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_focusable: Optional[Union[Var[bool], bool]] = None, - type_: Optional[ - Union[Var[Literal["checkbox", "radio"]], Literal["checkbox", "radio"]] - ] = None, - value: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "MenuItemOption": - """Create the component. - - Args: - *children: The children of the component. - close_on_select: Overrides the parent menu's closeOnSelect prop. - command: Right-aligned label text content, useful for displaying hotkeys. - command_spacing: The spacing between the command and menu item's label. - is_checked: Determines if menu item is checked. - is_disabled: If true, the menuitem will be disabled. - is_focusable: If true and the menuitem is disabled, it'll remain keyboard-focusable - type_: "checkbox" | "radio" - value: Value of the menu item. - 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 MenuGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "MenuGroup": - """Create the component. - - Args: - *children: The children of the component. - 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 MenuOptionGroup(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - type_: Optional[ - Union[Var[Literal["checkbox", "radio"]], Literal["checkbox", "radio"]] - ] = None, - value: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "MenuOptionGroup": - """Create the component. - - Args: - *children: The children of the component. - type_: "checkbox" | "radio" - value: Value of the option group. - 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 MenuDivider(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "MenuDivider": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/overlay/modal.py b/reflex/components/chakra/overlay/modal.py deleted file mode 100644 index 5223270580..0000000000 --- a/reflex/components/chakra/overlay/modal.py +++ /dev/null @@ -1,166 +0,0 @@ -"""Modal components.""" - -from __future__ import annotations - -from typing import Literal, Optional, Union - -from reflex.components.chakra import ChakraComponent -from reflex.components.chakra.media import Icon -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - -ModalSizes = Literal["xs", "sm", "md", "lg", "xl", "full"] - - -class Modal(ChakraComponent): - """The wrapper that provides context for its children.""" - - tag = "Modal" - - # If true, the modal will be open. - is_open: Var[bool] - - # Handle zoom/pinch gestures on iOS devices when scroll locking is enabled. Defaults to false. - allow_pinch_zoom: Var[bool] - - # If true, the modal will autofocus the first enabled and interactive element within the ModalContent - auto_focus: Var[bool] - - # If true, scrolling will be disabled on the body when the modal opens. - block_scroll_on_mount: Var[bool] - - # If true, the modal will close when the Esc key is pressed - close_on_esc: Var[bool] - - # If true, the modal will close when the overlay is clicked - close_on_overlay_click: Var[bool] - - # If true, the modal will be centered on screen. - is_centered: Var[bool] - - # Enables aggressive focus capturing within iframes. - If true: keep focus in the lock, no matter where lock is active - If false: allows focus to move outside of iframe - lock_focus_across_frames: Var[bool] - - # The transition that should be used for the modal - motion_preset: Var[str] - - # If true, a `padding-right` will be applied to the body element that's equal to the width of the scrollbar. This can help prevent some unpleasant flickering effect and content adjustment when the modal opens - preserve_scroll_bar_gap: Var[bool] - - # If true, the modal will return focus to the element that triggered it when it closes. - return_focus_on_close: Var[bool] - - # "xs" | "sm" | "md" | "lg" | "xl" | "full" - size: Var[ModalSizes] - - # A11y: If true, the siblings of the modal will have `aria-hidden` set to true so that screen readers can only see the modal. This is commonly known as making the other elements **inert** - use_inert: Var[bool] - - # Fired when the modal is closing. - on_close: EventHandler[lambda: []] - - # Fired when the modal is closed and the exit animation is complete. - on_close_complete: EventHandler[lambda: []] - - # Fired when the Esc key is pressed. - on_esc: EventHandler[lambda: []] - - # Fired when the overlay is clicked. - on_overlay_click: EventHandler[lambda: []] - - @classmethod - def create( - cls, - *children, - header: Optional[Union[Component, str]] = None, - body: Optional[Union[Component, str]] = None, - footer: Optional[Union[Component, str]] = None, - close_button: Optional[Component] = None, - **props, - ) -> Component: - """Create a modal component. - - Args: - *children: The children of the component. - header: The header of the modal. - body: The body of the modal. - footer: The footer of the modal. - close_button: The close button of the modal. - **props: The properties of the component. - - Raises: - AttributeError: error that occurs if conflicting props are passed - - Returns: - The modal component. - """ - if len(children) == 0: - contents = [] - - # add header if present in props - if header: - contents.append(ModalHeader.create(header)) - - # add ModalBody if present in props - if body: - contents.append(ModalBody.create(body)) - - # add ModalFooter if present in props - if footer: - contents.append(ModalFooter.create(footer)) - - # add ModalCloseButton if either a prop for one was passed, or if - if props.get("on_close"): - # get user defined close button or use default one - if not close_button: - close_button = Icon.create(tag="close") - contents.append(ModalCloseButton.create(close_button)) - elif close_button: - raise AttributeError( - "Close button can not be used if on_close event handler is not defined" - ) - - children = [ - ModalOverlay.create( - ModalContent.create(*contents), - ) - ] - - return super().create(*children, **props) - - -class ModalOverlay(ChakraComponent): - """The dimmed overlay behind the modal dialog.""" - - tag = "ModalOverlay" - - -class ModalHeader(ChakraComponent): - """The header that labels the modal dialog.""" - - tag = "ModalHeader" - - -class ModalFooter(ChakraComponent): - """The footer that houses the modal events.""" - - tag = "ModalFooter" - - -class ModalContent(ChakraComponent): - """The container for the modal dialog's content.""" - - tag = "ModalContent" - - -class ModalBody(ChakraComponent): - """The wrapper that houses the modal's main content.""" - - tag = "ModalBody" - - -class ModalCloseButton(ChakraComponent): - """The button that closes the modal.""" - - tag = "ModalCloseButton" diff --git a/reflex/components/chakra/overlay/modal.pyi b/reflex/components/chakra/overlay/modal.pyi deleted file mode 100644 index 396c4a7a72..0000000000 --- a/reflex/components/chakra/overlay/modal.pyi +++ /dev/null @@ -1,600 +0,0 @@ -"""Stub file for reflex/components/chakra/overlay/modal.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -ModalSizes = Literal["xs", "sm", "md", "lg", "xl", "full"] - -class Modal(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - header: Optional[Union[Component, str]] = None, - body: Optional[Union[Component, str]] = None, - footer: Optional[Union[Component, str]] = None, - close_button: Optional[Component] = None, - is_open: Optional[Union[Var[bool], bool]] = None, - allow_pinch_zoom: Optional[Union[Var[bool], bool]] = None, - auto_focus: Optional[Union[Var[bool], bool]] = None, - block_scroll_on_mount: Optional[Union[Var[bool], bool]] = None, - close_on_esc: Optional[Union[Var[bool], bool]] = None, - close_on_overlay_click: Optional[Union[Var[bool], bool]] = None, - is_centered: Optional[Union[Var[bool], bool]] = None, - lock_focus_across_frames: Optional[Union[Var[bool], bool]] = None, - motion_preset: Optional[Union[Var[str], str]] = None, - preserve_scroll_bar_gap: Optional[Union[Var[bool], bool]] = None, - return_focus_on_close: Optional[Union[Var[bool], bool]] = None, - size: Optional[ - Union[ - Var[Literal["xs", "sm", "md", "lg", "xl", "full"]], - Literal["xs", "sm", "md", "lg", "xl", "full"], - ] - ] = None, - use_inert: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_esc: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_overlay_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Modal": - """Create a modal component. - - Args: - *children: The children of the component. - header: The header of the modal. - body: The body of the modal. - footer: The footer of the modal. - close_button: The close button of the modal. - is_open: If true, the modal will be open. - allow_pinch_zoom: Handle zoom/pinch gestures on iOS devices when scroll locking is enabled. Defaults to false. - auto_focus: If true, the modal will autofocus the first enabled and interactive element within the ModalContent - block_scroll_on_mount: If true, scrolling will be disabled on the body when the modal opens. - close_on_esc: If true, the modal will close when the Esc key is pressed - close_on_overlay_click: If true, the modal will close when the overlay is clicked - is_centered: If true, the modal will be centered on screen. - lock_focus_across_frames: Enables aggressive focus capturing within iframes. - If true: keep focus in the lock, no matter where lock is active - If false: allows focus to move outside of iframe - motion_preset: The transition that should be used for the modal - preserve_scroll_bar_gap: If true, a `padding-right` will be applied to the body element that's equal to the width of the scrollbar. This can help prevent some unpleasant flickering effect and content adjustment when the modal opens - return_focus_on_close: If true, the modal will return focus to the element that triggered it when it closes. - size: "xs" | "sm" | "md" | "lg" | "xl" | "full" - use_inert: A11y: If true, the siblings of the modal will have `aria-hidden` set to true so that screen readers can only see the modal. This is commonly known as making the other elements **inert** - 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 properties of the component. - - Raises: - AttributeError: error that occurs if conflicting props are passed - - Returns: - The modal component. - """ - ... - -class ModalOverlay(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ModalOverlay": - """Create the component. - - Args: - *children: The children of the component. - 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 ModalHeader(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ModalHeader": - """Create the component. - - Args: - *children: The children of the component. - 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 ModalFooter(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ModalFooter": - """Create the component. - - Args: - *children: The children of the component. - 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 ModalContent(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ModalContent": - """Create the component. - - Args: - *children: The children of the component. - 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 ModalBody(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ModalBody": - """Create the component. - - Args: - *children: The children of the component. - 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 ModalCloseButton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "ModalCloseButton": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/overlay/popover.py b/reflex/components/chakra/overlay/popover.py deleted file mode 100644 index 76b74600cf..0000000000 --- a/reflex/components/chakra/overlay/popover.py +++ /dev/null @@ -1,183 +0,0 @@ -"""Popover components.""" - -from __future__ import annotations - -from reflex.components.chakra import ( - ChakraComponent, - LiteralChakraDirection, - LiteralMenuStrategy, - LiteralPopOverTrigger, -) -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars import Var - - -class Popover(ChakraComponent): - """The wrapper that provides props, state, and context to its children.""" - - tag = "Popover" - - # The padding required to prevent the arrow from reaching the very edge of the popper. - arrow_padding: Var[int] - - # The `box-shadow` of the popover arrow - arrow_shadow_color: Var[str] - - # The size of the popover arrow - arrow_size: Var[int] - - # If true, focus will be transferred to the first interactive element when the popover opens - auto_focus: Var[bool] - - # The boundary area for the popper. Used within the preventOverflow modifier - boundary: Var[str] - - # If true, the popover will close when you blur out it by clicking outside or tabbing out - close_on_blur: Var[bool] - - # If true, the popover will close when you hit the Esc key - close_on_esc: Var[bool] - - # If true, the popover will be initially opened. - default_is_open: Var[bool] - - # Theme direction ltr or rtl. Popper's placement will be set accordingly - direction: Var[LiteralChakraDirection] - - # If true, the popper will change its placement and flip when it's about to overflow its boundary area. - flip: Var[bool] - - # The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter. - gutter: Var[int] - - # The html id attribute of the popover. If not provided, we generate a unique id. This id is also used to auto-generate the `aria-labelledby` and `aria-describedby` attributes that points to the PopoverHeader and PopoverBody - id_: Var[str] - - # Performance 🚀: If true, the PopoverContent rendering will be deferred until the popover is open. - is_lazy: Var[bool] - - # Performance 🚀: The lazy behavior of popover's content when not visible. Only works when `isLazy={true}` - "unmount": The popover's content is always unmounted when not open. - "keepMounted": The popover's content initially unmounted, but stays mounted when popover is open. - lazy_behavior: Var[str] - - # If true, the popover will be opened in controlled mode. - is_open: Var[bool] - - # If true, the popper will match the width of the reference at all times. It's useful for autocomplete, `date-picker` and select patterns. - match_width: Var[bool] - - # The placement of the popover. It's used internally by Popper.js. - placement: Var[str] - - # If true, will prevent the popper from being cut off and ensure it's visible within the boundary area. - prevent_overflow: Var[bool] - - # If true, focus will be returned to the element that triggers the popover when it closes - return_focus_on_close: Var[bool] - - # The CSS positioning strategy to use. ("fixed" | "absolute") - strategy: Var[LiteralMenuStrategy] - - # The interaction that triggers the popover. hover - means the popover will open when you hover with mouse or focus with keyboard on the popover trigger click - means the popover will open on click or press Enter to Space on keyboard ("click" | "hover") - trigger: Var[LiteralPopOverTrigger] - - # Fired when the popover is closed. - on_close: EventHandler[lambda: []] - - # Fired when the popover is opened. - on_open: EventHandler[lambda: []] - - @classmethod - def create( - cls, - *children, - trigger=None, - header=None, - body=None, - footer=None, - use_close_button=False, - **props, - ) -> Component: - """Create a popover component. - - Args: - *children: The children of the component. - trigger: The trigger that opens the popover. - header: The header of the popover. - body: The body of the popover. - footer: The footer of the popover. - use_close_button: Whether to add a close button on the popover. - **props: The properties of the component. - - Returns: - The popover component. - """ - if len(children) == 0: - contents = [] - - trigger = PopoverTrigger.create(trigger) - - # add header if present in props - if header: - contents.append(PopoverHeader.create(header)) - - if body: - contents.append(PopoverBody.create(body)) - - if footer: - contents.append(PopoverFooter.create(footer)) - - if use_close_button: - contents.append(PopoverCloseButton.create()) - - children = [trigger, PopoverContent.create(*contents)] - - return super().create(*children, **props) - - -class PopoverContent(ChakraComponent): - """The popover itself.""" - - tag = "PopoverContent" - - -class PopoverHeader(ChakraComponent): - """The header of the popover.""" - - tag = "PopoverHeader" - - -class PopoverFooter(ChakraComponent): - """Display a popover footer.""" - - tag = "PopoverFooter" - - -class PopoverBody(ChakraComponent): - """The body of the popover.""" - - tag = "PopoverBody" - - -class PopoverArrow(ChakraComponent): - """A visual arrow that points to the reference (or trigger).""" - - tag = "PopoverArrow" - - -class PopoverCloseButton(ChakraComponent): - """A button to close the popover.""" - - tag = "PopoverCloseButton" - - -class PopoverAnchor(ChakraComponent): - """Used to wrap the position-reference element.""" - - tag = "PopoverAnchor" - - -class PopoverTrigger(ChakraComponent): - """Used to wrap the reference (or trigger) element.""" - - tag = "PopoverTrigger" diff --git a/reflex/components/chakra/overlay/popover.pyi b/reflex/components/chakra/overlay/popover.pyi deleted file mode 100644 index eacf541973..0000000000 --- a/reflex/components/chakra/overlay/popover.pyi +++ /dev/null @@ -1,757 +0,0 @@ -"""Stub file for reflex/components/chakra/overlay/popover.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ( - ChakraComponent, -) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Popover(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - trigger=None, - header=None, - body=None, - footer=None, - use_close_button=False, - arrow_padding: Optional[Union[Var[int], int]] = None, - arrow_shadow_color: Optional[Union[Var[str], str]] = None, - arrow_size: Optional[Union[Var[int], int]] = None, - auto_focus: Optional[Union[Var[bool], bool]] = None, - boundary: Optional[Union[Var[str], str]] = None, - close_on_blur: Optional[Union[Var[bool], bool]] = None, - close_on_esc: Optional[Union[Var[bool], bool]] = None, - default_is_open: Optional[Union[Var[bool], bool]] = None, - direction: Optional[ - Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]] - ] = None, - flip: Optional[Union[Var[bool], bool]] = None, - gutter: Optional[Union[Var[int], int]] = None, - id_: Optional[Union[Var[str], str]] = None, - is_lazy: Optional[Union[Var[bool], bool]] = None, - lazy_behavior: Optional[Union[Var[str], str]] = None, - is_open: Optional[Union[Var[bool], bool]] = None, - match_width: Optional[Union[Var[bool], bool]] = None, - placement: Optional[Union[Var[str], str]] = None, - prevent_overflow: Optional[Union[Var[bool], bool]] = None, - return_focus_on_close: Optional[Union[Var[bool], bool]] = None, - strategy: Optional[ - Union[Var[Literal["fixed", "absolute"]], Literal["fixed", "absolute"]] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_open: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Popover": - """Create a popover component. - - Args: - *children: The children of the component. - trigger: The trigger that opens the popover. - header: The header of the popover. - body: The body of the popover. - footer: The footer of the popover. - use_close_button: Whether to add a close button on the popover. - arrow_padding: The padding required to prevent the arrow from reaching the very edge of the popper. - arrow_shadow_color: The `box-shadow` of the popover arrow - arrow_size: The size of the popover arrow - auto_focus: If true, focus will be transferred to the first interactive element when the popover opens - boundary: The boundary area for the popper. Used within the preventOverflow modifier - close_on_blur: If true, the popover will close when you blur out it by clicking outside or tabbing out - close_on_esc: If true, the popover will close when you hit the Esc key - default_is_open: If true, the popover will be initially opened. - direction: Theme direction ltr or rtl. Popper's placement will be set accordingly - flip: If true, the popper will change its placement and flip when it's about to overflow its boundary area. - gutter: The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter. - id_: The html id attribute of the popover. If not provided, we generate a unique id. This id is also used to auto-generate the `aria-labelledby` and `aria-describedby` attributes that points to the PopoverHeader and PopoverBody - is_lazy: Performance 🚀: If true, the PopoverContent rendering will be deferred until the popover is open. - lazy_behavior: Performance 🚀: The lazy behavior of popover's content when not visible. Only works when `isLazy={true}` - "unmount": The popover's content is always unmounted when not open. - "keepMounted": The popover's content initially unmounted, but stays mounted when popover is open. - is_open: If true, the popover will be opened in controlled mode. - match_width: If true, the popper will match the width of the reference at all times. It's useful for autocomplete, `date-picker` and select patterns. - placement: The placement of the popover. It's used internally by Popper.js. - prevent_overflow: If true, will prevent the popper from being cut off and ensure it's visible within the boundary area. - return_focus_on_close: If true, focus will be returned to the element that triggers the popover when it closes - strategy: The CSS positioning strategy to use. ("fixed" | "absolute") - 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 properties of the component. - - Returns: - The popover component. - """ - ... - -class PopoverContent(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverContent": - """Create the component. - - Args: - *children: The children of the component. - 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 PopoverHeader(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverHeader": - """Create the component. - - Args: - *children: The children of the component. - 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 PopoverFooter(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverFooter": - """Create the component. - - Args: - *children: The children of the component. - 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 PopoverBody(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverBody": - """Create the component. - - Args: - *children: The children of the component. - 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 PopoverArrow(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverArrow": - """Create the component. - - Args: - *children: The children of the component. - 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 PopoverCloseButton(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverCloseButton": - """Create the component. - - Args: - *children: The children of the component. - 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 PopoverAnchor(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverAnchor": - """Create the component. - - Args: - *children: The children of the component. - 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 PopoverTrigger(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "PopoverTrigger": - """Create the component. - - Args: - *children: The children of the component. - 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. - """ - ... diff --git a/reflex/components/chakra/overlay/tooltip.py b/reflex/components/chakra/overlay/tooltip.py deleted file mode 100644 index e0734251f4..0000000000 --- a/reflex/components/chakra/overlay/tooltip.py +++ /dev/null @@ -1,70 +0,0 @@ -"""Tooltip components.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent, LiteralChakraDirection -from reflex.event import EventHandler -from reflex.vars import Var - - -class Tooltip(ChakraComponent): - """A tooltip message to appear.""" - - tag = "Tooltip" - - # The padding required to prevent the arrow from reaching the very edge of the popper. - arrow_padding: Var[int] - - # The color of the arrow shadow. - arrow_shadow_color: Var[str] - - # Size of the arrow. - arrow_size: Var[int] - - # Delay (in ms) before hiding the tooltip - delay: Var[int] - - # If true, the tooltip will hide on click - close_on_click: Var[bool] - - # If true, the tooltip will hide on pressing Esc key - close_on_esc: Var[bool] - - # If true, the tooltip will hide while the mouse is down - close_on_mouse_down: Var[bool] - - # If true, the tooltip will be initially shown - default_is_open: Var[bool] - - # Theme direction ltr or rtl. Popper's placement will be set accordingly - direction: Var[LiteralChakraDirection] - - # The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter. - gutter: Var[int] - - # If true, the tooltip will show an arrow tip - has_arrow: Var[bool] - - # If true, the tooltip with be disabled. - is_disabled: Var[bool] - - # If true, the tooltip will be open. - is_open: Var[bool] - - # The label of the tooltip - label: Var[str] - - # Delay (in ms) before showing the tooltip - open_delay: Var[int] - - # The placement of the popper relative to its reference. - placement: Var[str] - - # If true, the tooltip will wrap its children in a `` with `tabIndex=0` - should_wrap_children: Var[bool] - - # Fired when the tooltip is closing. - on_close: EventHandler[lambda: []] - - # Fired when the tooltip is opened. - on_open: EventHandler[lambda: []] diff --git a/reflex/components/chakra/overlay/tooltip.pyi b/reflex/components/chakra/overlay/tooltip.pyi deleted file mode 100644 index 76e144d3f9..0000000000 --- a/reflex/components/chakra/overlay/tooltip.pyi +++ /dev/null @@ -1,129 +0,0 @@ -"""Stub file for reflex/components/chakra/overlay/tooltip.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Tooltip(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - arrow_padding: Optional[Union[Var[int], int]] = None, - arrow_shadow_color: Optional[Union[Var[str], str]] = None, - arrow_size: Optional[Union[Var[int], int]] = None, - delay: Optional[Union[Var[int], int]] = None, - close_on_click: Optional[Union[Var[bool], bool]] = None, - close_on_esc: Optional[Union[Var[bool], bool]] = None, - close_on_mouse_down: Optional[Union[Var[bool], bool]] = None, - default_is_open: Optional[Union[Var[bool], bool]] = None, - direction: Optional[ - Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]] - ] = None, - gutter: Optional[Union[Var[int], int]] = None, - has_arrow: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_open: Optional[Union[Var[bool], bool]] = None, - label: Optional[Union[Var[str], str]] = None, - open_delay: Optional[Union[Var[int], int]] = None, - placement: Optional[Union[Var[str], str]] = None, - should_wrap_children: Optional[Union[Var[bool], bool]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_close: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_open: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Tooltip": - """Create the component. - - Args: - *children: The children of the component. - arrow_padding: The padding required to prevent the arrow from reaching the very edge of the popper. - arrow_shadow_color: The color of the arrow shadow. - arrow_size: Size of the arrow. - delay: Delay (in ms) before hiding the tooltip - close_on_click: If true, the tooltip will hide on click - close_on_esc: If true, the tooltip will hide on pressing Esc key - close_on_mouse_down: If true, the tooltip will hide while the mouse is down - default_is_open: If true, the tooltip will be initially shown - direction: Theme direction ltr or rtl. Popper's placement will be set accordingly - gutter: The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter. - has_arrow: If true, the tooltip will show an arrow tip - is_disabled: If true, the tooltip with be disabled. - is_open: If true, the tooltip will be open. - label: The label of the tooltip - open_delay: Delay (in ms) before showing the tooltip - placement: The placement of the popper relative to its reference. - should_wrap_children: If true, the tooltip will wrap its children in a `` with `tabIndex=0` - 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. - """ - ... diff --git a/reflex/components/chakra/typography/__init__.py b/reflex/components/chakra/typography/__init__.py deleted file mode 100644 index be06b137b8..0000000000 --- a/reflex/components/chakra/typography/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Typography components.""" - -from reflex.components.component import Component - -from .heading import Heading -from .highlight import Highlight -from .span import Span -from .text import Text - -__all__ = [f for f in dir() if f[0].isupper() or f in ("span",)] # type: ignore diff --git a/reflex/components/chakra/typography/heading.py b/reflex/components/chakra/typography/heading.py deleted file mode 100644 index 29ddd7de22..0000000000 --- a/reflex/components/chakra/typography/heading.py +++ /dev/null @@ -1,16 +0,0 @@ -"""A heading component.""" - -from reflex.components.chakra import ChakraComponent, LiteralHeadingSize -from reflex.vars import Var - - -class Heading(ChakraComponent): - """A page heading.""" - - tag = "Heading" - - # Override the tag. The default tag is `

`. - as_: Var[str] - - # "4xl" | "3xl" | "2xl" | "xl" | "lg" | "md" | "sm" | "xs" - size: Var[LiteralHeadingSize] diff --git a/reflex/components/chakra/typography/heading.pyi b/reflex/components/chakra/typography/heading.pyi deleted file mode 100644 index 5f4300d9a0..0000000000 --- a/reflex/components/chakra/typography/heading.pyi +++ /dev/null @@ -1,96 +0,0 @@ -"""Stub file for reflex/components/chakra/typography/heading.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Heading(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_: Optional[Union[Var[str], str]] = None, - size: Optional[ - Union[ - Var[Literal["lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl"]], - Literal["lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl"], - ] - ] = 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, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Heading": - """Create the component. - - Args: - *children: The children of the component. - as_: Override the tag. The default tag is `

`. - size: "4xl" | "3xl" | "2xl" | "xl" | "lg" | "md" | "sm" | "xs" - 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. - """ - ... diff --git a/reflex/components/chakra/typography/highlight.py b/reflex/components/chakra/typography/highlight.py deleted file mode 100644 index 0308c091e3..0000000000 --- a/reflex/components/chakra/typography/highlight.py +++ /dev/null @@ -1,23 +0,0 @@ -"""A highlight component.""" - -from typing import Dict, List - -from reflex.components.chakra import ChakraComponent -from reflex.components.tags import Tag -from reflex.vars import Var - - -class Highlight(ChakraComponent): - """Highlights a specific part of a string.""" - - tag = "Highlight" - - # A query for the text to highlight. Can be a string or a list of strings. - query: Var[List[str]] - - # The style of the content. - # Note: styles and style are different prop. - styles: Var[Dict] = {"px": "2", "py": "1", "rounded": "full", "bg": "teal.100"} # type: ignore - - def _render(self) -> Tag: - return super()._render().add_props(styles=self.style) diff --git a/reflex/components/chakra/typography/highlight.pyi b/reflex/components/chakra/typography/highlight.pyi deleted file mode 100644 index 8d768cb5e9..0000000000 --- a/reflex/components/chakra/typography/highlight.pyi +++ /dev/null @@ -1,91 +0,0 @@ -"""Stub file for reflex/components/chakra/typography/highlight.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, List, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Highlight(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - query: Optional[Union[Var[List[str]], List[str]]] = None, - styles: Optional[Union[Var[Dict], Dict]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Highlight": - """Create the component. - - Args: - *children: The children of the component. - query: A query for the text to highlight. Can be a string or a list of strings. - styles: The style of the content. Note: styles and style are different prop. - 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. - """ - ... diff --git a/reflex/components/chakra/typography/span.py b/reflex/components/chakra/typography/span.py deleted file mode 100644 index 247be14478..0000000000 --- a/reflex/components/chakra/typography/span.py +++ /dev/null @@ -1,15 +0,0 @@ -"""A span component.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Span(ChakraComponent): - """Render an inline span of text.""" - - tag = "Text" - - # Override the tag. The default tag is ``. - as_: Var[str] = "span" # type: ignore diff --git a/reflex/components/chakra/typography/span.pyi b/reflex/components/chakra/typography/span.pyi deleted file mode 100644 index 1e9d065ad3..0000000000 --- a/reflex/components/chakra/typography/span.pyi +++ /dev/null @@ -1,89 +0,0 @@ -"""Stub file for reflex/components/chakra/typography/span.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Span(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_: Optional[Union[Var[str], str]] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Span": - """Create the component. - - Args: - *children: The children of the component. - as_: Override the tag. The default tag is ``. - 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. - """ - ... diff --git a/reflex/components/chakra/typography/text.py b/reflex/components/chakra/typography/text.py deleted file mode 100644 index b2cd2356f0..0000000000 --- a/reflex/components/chakra/typography/text.py +++ /dev/null @@ -1,18 +0,0 @@ -"""A text component.""" - -from __future__ import annotations - -from reflex.components.chakra import ChakraComponent -from reflex.vars import Var - - -class Text(ChakraComponent): - """Render a paragraph of text.""" - - tag = "Text" - - # Override the tag. The default tag is `

`. - as_: Var[str] - - # Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop. - no_of_lines: Var[int] diff --git a/reflex/components/chakra/typography/text.pyi b/reflex/components/chakra/typography/text.pyi deleted file mode 100644 index f707bae360..0000000000 --- a/reflex/components/chakra/typography/text.pyi +++ /dev/null @@ -1,91 +0,0 @@ -"""Stub file for reflex/components/chakra/typography/text.py""" - -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `reflex/utils/pyi_generator.py`! -# ------------------------------------------------------ -from typing import Any, Callable, Dict, Optional, Union, overload - -from reflex.components.chakra import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import BaseVar, Var - -class Text(ChakraComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_: Optional[Union[Var[str], str]] = None, - no_of_lines: 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_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, BaseVar] - ] = None, - **props, - ) -> "Text": - """Create the component. - - Args: - *children: The children of the component. - as_: Override the tag. The default tag is `

`. - no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop. - 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. - """ - ... diff --git a/reflex/components/media/__init__.py b/reflex/components/media/__init__.py deleted file mode 100644 index ee11c77e05..0000000000 --- a/reflex/components/media/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Temporary shim for Chakra icon class.""" diff --git a/reflex/components/media/icon.py b/reflex/components/media/icon.py deleted file mode 100644 index eaca071e7b..0000000000 --- a/reflex/components/media/icon.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Shim for reflex.components.chakra.media.icon.""" - -from reflex.components.chakra.media.icon import * diff --git a/reflex/reflex.py b/reflex/reflex.py index 224bace471..741873f4ec 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -85,10 +85,6 @@ def _init( prerequisites.initialize_reflex_user_directory() prerequisites.ensure_reflex_installation_id() - # When upgrading to 0.4, show migration instructions. - if prerequisites.should_show_rx_chakra_migration_instructions(): - prerequisites.show_rx_chakra_migration_instructions() - # Set up the web project. prerequisites.initialize_frontend_dependencies() @@ -458,17 +454,6 @@ def makemigrations( ) -@script_cli.command( - name="keep-chakra", - help="Change all rx. references to rx.chakra., to preserve Chakra UI usage.", -) -def keep_chakra(): - """Change all rx. references to rx.chakra., to preserve Chakra UI usage.""" - from reflex.utils import prerequisites - - prerequisites.migrate_to_rx_chakra() - - @cli.command() def deploy( key: Optional[str] = typer.Option( diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index a80bcd8146..f71f707eec 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -6,7 +6,6 @@ import glob import importlib import importlib.metadata -import inspect import json import os import platform @@ -31,7 +30,6 @@ from redis import Redis as RedisSync from redis.asyncio import Redis -import reflex from reflex import constants, model from reflex.base import Base from reflex.compiler import templates @@ -1169,114 +1167,6 @@ def prompt_for_template(templates: list[Template]) -> str: return templates[int(template)].name -def should_show_rx_chakra_migration_instructions() -> bool: - """Should we show the migration instructions for rx.chakra.* => rx.*?. - - Returns: - bool: True if we should show the migration instructions. - """ - if os.getenv("REFLEX_PROMPT_MIGRATE_TO_RX_CHAKRA") == "yes": - return True - - if not Path(constants.Config.FILE).exists(): - # They are running reflex init for the first time. - return False - - existing_init_reflex_version = None - reflex_json = get_web_dir() / constants.Dirs.REFLEX_JSON - if reflex_json.exists(): - with reflex_json.open("r") as f: - data = json.load(f) - existing_init_reflex_version = data.get("version", None) - - if existing_init_reflex_version is None: - # They clone a reflex app from git for the first time. - # That app may or may not be 0.4 compatible. - # So let's just show these instructions THIS TIME. - return True - - if constants.Reflex.VERSION < "0.4": - return False - else: - return existing_init_reflex_version < "0.4" - - -def show_rx_chakra_migration_instructions(): - """Show the migration instructions for rx.chakra.* => rx.*.""" - console.log( - "Prior to reflex 0.4.0, rx.* components are based on Chakra UI. They are now based on Radix UI. To stick to Chakra UI, use rx.chakra.*." - ) - console.log("") - console.log( - "[bold]Run `reflex script keep-chakra` to automatically update your app." - ) - console.log("") - console.log( - "For more details, please see https://reflex.dev/blog/2024-02-16-reflex-v0.4.0/" - ) - - -def migrate_to_rx_chakra(): - """Migrate rx.button => r.chakra.button, etc.""" - file_pattern = os.path.join(get_config().app_name, "**/*.py") - file_list = glob.glob(file_pattern, recursive=True) - - # Populate with all rx. components that have been moved to rx.chakra. - patterns = { - rf"\brx\.{name}\b": f"rx.chakra.{name}" - for name in _get_rx_chakra_component_to_migrate() - } - - for file_path in file_list: - with FileInput(file_path, inplace=True) as file: - for _line_num, line in enumerate(file): - for old, new in patterns.items(): - line = re.sub(old, new, line) - print(line, end="") - - -def _get_rx_chakra_component_to_migrate() -> set[str]: - from reflex.components.chakra import ChakraComponent - - rx_chakra_names = set(dir(reflex.chakra)) - - names_to_migrate = set() - - # whitelist names will always be rewritten as rx.chakra. - whitelist = { - "ColorModeIcon", - "MultiSelect", - "MultiSelectOption", - "color_mode_icon", - "multi_select", - "multi_select_option", - } - - for rx_chakra_name in sorted(rx_chakra_names): - if rx_chakra_name.startswith("_"): - continue - - rx_chakra_object = getattr(reflex.chakra, rx_chakra_name) - try: - if ( - ( - inspect.ismethod(rx_chakra_object) - and inspect.isclass(rx_chakra_object.__self__) - and issubclass(rx_chakra_object.__self__, ChakraComponent) - ) - or ( - inspect.isclass(rx_chakra_object) - and issubclass(rx_chakra_object, ChakraComponent) - ) - or rx_chakra_name in whitelist - ): - names_to_migrate.add(rx_chakra_name) - - except Exception: - raise - return names_to_migrate - - def migrate_to_reflex(): """Migration from Pynecone to Reflex.""" # Check if the old config file exists. diff --git a/scripts/migrate_project_to_rx_chakra.py b/scripts/migrate_project_to_rx_chakra.py deleted file mode 100644 index b13cccafd4..0000000000 --- a/scripts/migrate_project_to_rx_chakra.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Migrate project to rx.chakra. I.e. switch usage of rx. to rx.chakra..""" - -import argparse - -if __name__ == "__main__": - # parse args just for the help message (-h, etc) - parser = argparse.ArgumentParser( - description="Migrate project to rx.chakra. I.e. switch usage of rx. to rx.chakra.." - ) - args = parser.parse_args() - from reflex.utils.prerequisites import migrate_to_rx_chakra - - migrate_to_rx_chakra() diff --git a/tests/components/datadisplay/test_table.py b/tests/components/datadisplay/test_table.py index 1cec624e9c..8740d4b8c9 100644 --- a/tests/components/datadisplay/test_table.py +++ b/tests/components/datadisplay/test_table.py @@ -2,8 +2,8 @@ from typing import List, Tuple import pytest +from reflex_chakra.components.datadisplay.table import Tbody, Tfoot, Thead -from reflex.components.chakra.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 diff --git a/tests/components/forms/test_form.py b/tests/components/forms/test_form.py index b9eff2daf8..b979d261a8 100644 --- a/tests/components/forms/test_form.py +++ b/tests/components/forms/test_form.py @@ -1,4 +1,5 @@ -from reflex.components.chakra.forms.form import Form +from reflex_chakra.components.forms.form import Form + from reflex.event import EventChain from reflex.vars import BaseVar diff --git a/tests/components/media/test_icon.py b/tests/components/media/test_icon.py index 95dc8de28f..6a152c5874 100644 --- a/tests/components/media/test_icon.py +++ b/tests/components/media/test_icon.py @@ -1,6 +1,6 @@ import pytest +from reflex_chakra.components.media.icon import ICON_LIST, Icon -from reflex.components.chakra.media.icon import ICON_LIST, Icon from reflex.utils import format diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 78c42f1779..3d32a53d7a 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -2,13 +2,14 @@ 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 from reflex.compiler.compiler import compile_components from reflex.components.base.bare import Bare from reflex.components.base.fragment import Fragment -from reflex.components.chakra.layout.box import Box from reflex.components.component import ( Component, CustomComponent, @@ -1004,7 +1005,7 @@ def test_component_with_only_valid_children(fixture, request): [ (rx.text("hi"), "\n {`hi`}\n"), ( - rx.box(rx.chakra.heading("test", size="md")), + rx.box(rc.heading("test", size="md")), "\n \n {`test`}\n\n", ), ], diff --git a/tests/components/typography/test_markdown.py b/tests/components/typography/test_markdown.py index 8033ec6061..2ef6fbce4d 100644 --- a/tests/components/typography/test_markdown.py +++ b/tests/components/typography/test_markdown.py @@ -1,4 +1,5 @@ import pytest +import reflex_chakra as rc import reflex as rx from reflex.components.markdown import Markdown @@ -37,7 +38,7 @@ def test_set_component_map(): """Test setting the component map.""" component_map = { "h1": lambda value: rx.box( - rx.chakra.heading(value, as_="h1", size="2xl"), padding="1em" + rc.heading(value, as_="h1", size="2xl"), padding="1em" ), "p": lambda value: rx.box(rx.text(value), padding="1em"), } diff --git a/tests/test_app.py b/tests/test_app.py index 489ace5110..17afd2bb73 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -13,6 +13,7 @@ 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 @@ -1274,13 +1275,13 @@ class Fragment1(Component): tag = "Fragment1" def _get_app_wrap_components(self) -> dict[tuple[int, str], Component]: - return {(99, "Box"): rx.chakra.box()} + return {(99, "Box"): rc.box()} class Fragment2(Component): tag = "Fragment2" def _get_app_wrap_components(self) -> dict[tuple[int, str], Component]: - return {(50, "Text"): rx.chakra.text()} + return {(50, "Text"): rc.text()} class Fragment3(Component): tag = "Fragment3" From 9c70971dc6f90f5ba03bd81b02e7d79078f495b3 Mon Sep 17 00:00:00 2001 From: Shubhankar Dimri Date: Tue, 20 Aug 2024 22:55:37 +0530 Subject: [PATCH 08/10] fix get_uuid_string_var (#3795) --- reflex/vars.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reflex/vars.py b/reflex/vars.py index ffaf164552..795ab4759b 100644 --- a/reflex/vars.py +++ b/reflex/vars.py @@ -2588,15 +2588,17 @@ def get_uuid_string_var() -> Var: """ 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 BaseVar( - _var_name="useMemo(generateUUID, [])", + _var_name=unique_uuid_var, _var_type=str, _var_data=unique_uuid_var_data, ) From 2d9380a6fd4f5b81fcb26ba65e3cb187458213c4 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:10:13 +0200 Subject: [PATCH 09/10] minor State cleanup (#3768) --- reflex/state.py | 44 +++++++++++++++++++++---------------------- reflex/utils/types.py | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index b0c6646ce9..228530fdac 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -55,6 +55,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 BaseVar, ComputedVar, Var, computed_var if TYPE_CHECKING: @@ -1232,6 +1233,17 @@ def _get_parent_states(self) -> list[tuple[str, BaseState]]: parent_states_with_name.append((parent_state.get_full_name(), parent_state)) return parent_states_with_name + def _get_root_state(self) -> BaseState: + """Get the root state of the state tree. + + Returns: + The root state of the state tree. + """ + parent_state = self + while parent_state.parent_state is not None: + parent_state = parent_state.parent_state + return parent_state + async def _populate_parent_states(self, target_state_cls: Type[BaseState]): """Populate substates in the tree between the target_state_cls and common ancestor of this state. @@ -1291,10 +1303,7 @@ def _get_state_from_cache(self, state_cls: Type[BaseState]) -> BaseState: Returns: The instance of state_cls associated with this state's client_token. """ - if self.parent_state is None: - root_state = self - else: - root_state = self._get_parent_states()[-1][1] + root_state = self._get_root_state() return root_state.get_substate(state_cls.get_full_name().split(".")) async def _get_state_from_redis(self, state_cls: Type[BaseState]) -> BaseState: @@ -1445,9 +1454,7 @@ def _as_state_update( The valid StateUpdate containing the events and final flag. """ # get the delta from the root of the state tree - state = self - while state.parent_state is not None: - state = state.parent_state + state = self._get_root_state() token = self.router.session.client_token @@ -2368,6 +2375,7 @@ class Config: "_states_locks": {"exclude": True}, } + @override async def get_state(self, token: str) -> BaseState: """Get the state for a token. @@ -2383,6 +2391,7 @@ async def get_state(self, token: str) -> BaseState: self.states[token] = self.state(_reflex_internal_init=True) return self.states[token] + @override async def set_state(self, token: str, state: BaseState): """Set the state for a token. @@ -2392,6 +2401,7 @@ async def set_state(self, token: str, state: BaseState): """ pass + @override @contextlib.asynccontextmanager async def modify_state(self, token: str) -> AsyncIterator[BaseState]: """Modify the state for a token while holding exclusive lock. @@ -2483,19 +2493,6 @@ class StateManagerRedis(StateManager): # Only warn about each state class size once. _warned_about_state_size: ClassVar[Set[str]] = set() - def _get_root_state(self, state: BaseState) -> BaseState: - """Chase parent_state pointers to find an instance of the top-level state. - - Args: - state: The state to start from. - - Returns: - An instance of the top-level state (self.state). - """ - while type(state) != self.state and state.parent_state is not None: - state = state.parent_state - return state - async def _get_parent_state(self, token: str) -> BaseState | None: """Get the parent state for the state requested in the token. @@ -2558,6 +2555,7 @@ async def _populate_substates( for substate_name, substate_task in tasks.items(): state.substates[substate_name] = await substate_task + @override async def get_state( self, token: str, @@ -2609,7 +2607,7 @@ async def get_state( # 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 self._get_root_state(state) + return state._get_root_state() return state # TODO: dedupe the following logic with the above block @@ -2631,7 +2629,7 @@ async def get_state( # 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 self._get_root_state(state) + return state._get_root_state() return state def _warn_if_too_large( @@ -2657,6 +2655,7 @@ def _warn_if_too_large( ) self._warned_about_state_size.add(state_full_name) + @override async def set_state( self, token: str, @@ -2717,6 +2716,7 @@ async def set_state( for t in tasks: await t + @override @contextlib.asynccontextmanager async def modify_state(self, token: str) -> AsyncIterator[BaseState]: """Modify the state for a token while holding exclusive lock. diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 3bb5eae355..32438b9e68 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -49,7 +49,7 @@ from reflex.utils import console if sys.version_info >= (3, 12): - from typing import override + from typing import override as override else: def override(func: Callable) -> Callable: From 13a6d538a93856a181b63c3fe356d866317044ba Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Tue, 20 Aug 2024 12:11:39 -0700 Subject: [PATCH 10/10] Fix code wrap in markdown (#3755) --- reflex/components/markdown/markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index e62c85af32..db38e7d0e4 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -70,7 +70,7 @@ def get_base_component_map() -> dict[str, Callable]: "a": lambda value: Link.create(value), "code": lambda value: Code.create(value), "codeblock": lambda value, **props: CodeBlock.create( - value, margin_y="1em", **props + value, margin_y="1em", wrap_long_lines=True, **props ), }