From 0ca59eff55182a2c71b9435fb533886e41910f3e Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 14:40:52 -0700 Subject: [PATCH 01/15] regenerate pyi files and bring chakra to full 0.8.0 compat --- docs/rcweb/rcweb/rcweb.py | 2 +- docs/rcweb/rcweb/utils/docpage.py | 5 +- docs/rcweb/rcweb/utils/flexdown.py | 2 +- docs/rcweb/rcweb/utils/sidebar.py | 65 +- docs/rcweb/requirements.txt | 2 +- pyproject.toml | 7 +- reflex_chakra/__init__.py | 2 +- reflex_chakra/components/__init__.py | 6 +- reflex_chakra/components/base.py | 23 +- reflex_chakra/components/base.pyi | 254 ++--- .../components/datadisplay/__init__.py | 31 + reflex_chakra/components/datadisplay/badge.py | 2 +- .../components/datadisplay/badge.pyi | 118 +-- reflex_chakra/components/datadisplay/code.pyi | 104 +- .../components/datadisplay/divider.py | 2 +- .../components/datadisplay/divider.pyi | 122 +-- .../components/datadisplay/keyboard_key.pyi | 104 +- reflex_chakra/components/datadisplay/list.py | 2 +- reflex_chakra/components/datadisplay/list.pyi | 350 +++---- reflex_chakra/components/datadisplay/stat.py | 2 +- reflex_chakra/components/datadisplay/stat.pyi | 525 ++++------ reflex_chakra/components/datadisplay/table.py | 19 +- .../components/datadisplay/table.pyi | 749 ++++++--------- reflex_chakra/components/datadisplay/tag.py | 10 +- reflex_chakra/components/datadisplay/tag.pyi | 510 ++++------ .../components/disclosure/__init__.py | 19 +- .../components/disclosure/accordion.py | 12 +- .../components/disclosure/accordion.pyi | 455 ++++----- reflex_chakra/components/disclosure/tabs.py | 15 +- reflex_chakra/components/disclosure/tabs.pyi | 604 +++++------- .../components/disclosure/transition.py | 10 +- .../components/disclosure/transition.pyi | 597 ++++-------- .../components/disclosure/visuallyhidden.pyi | 104 +- reflex_chakra/components/feedback/__init__.py | 14 + reflex_chakra/components/feedback/alert.py | 2 +- reflex_chakra/components/feedback/alert.pyi | 369 +++---- .../components/feedback/circularprogress.py | 6 +- .../components/feedback/circularprogress.pyi | 198 ++-- reflex_chakra/components/feedback/progress.py | 6 +- .../components/feedback/progress.pyi | 125 +-- reflex_chakra/components/feedback/skeleton.py | 2 +- .../components/feedback/skeleton.pyi | 324 +++---- reflex_chakra/components/feedback/spinner.py | 2 +- reflex_chakra/components/feedback/spinner.pyi | 127 +-- reflex_chakra/components/forms/__init__.py | 56 +- reflex_chakra/components/forms/button.py | 7 +- reflex_chakra/components/forms/button.pyi | 357 +++---- reflex_chakra/components/forms/checkbox.py | 2 +- reflex_chakra/components/forms/checkbox.pyi | 332 +++---- .../components/forms/colormodeswitch.pyi | 512 +++++----- reflex_chakra/components/forms/date_picker.py | 2 +- .../components/forms/date_picker.pyi | 143 ++- .../components/forms/date_time_picker.py | 2 +- .../components/forms/date_time_picker.pyi | 143 ++- reflex_chakra/components/forms/editable.py | 2 +- reflex_chakra/components/forms/editable.pyi | 394 +++----- reflex_chakra/components/forms/email.py | 2 +- reflex_chakra/components/forms/email.pyi | 143 ++- reflex_chakra/components/forms/form.py | 2 +- reflex_chakra/components/forms/form.pyi | 711 +++++++------- reflex_chakra/components/forms/iconbutton.py | 6 +- reflex_chakra/components/forms/iconbutton.pyi | 134 +-- reflex_chakra/components/forms/input.py | 2 +- reflex_chakra/components/forms/input.pyi | 674 +++++-------- reflex_chakra/components/forms/multiselect.py | 353 ------- .../components/forms/multiselect.pyi | 199 ---- reflex_chakra/components/forms/numberinput.py | 2 +- .../components/forms/numberinput.pyi | 489 ++++------ reflex_chakra/components/forms/password.py | 2 +- reflex_chakra/components/forms/password.pyi | 143 ++- reflex_chakra/components/forms/pininput.py | 20 +- reflex_chakra/components/forms/pininput.pyi | 230 ++--- reflex_chakra/components/forms/radio.py | 6 +- reflex_chakra/components/forms/radio.pyi | 197 ++-- reflex_chakra/components/forms/rangeslider.py | 15 +- .../components/forms/rangeslider.pyi | 391 +++----- reflex_chakra/components/forms/select.py | 2 +- reflex_chakra/components/forms/select.pyi | 200 ++-- reflex_chakra/components/forms/slider.py | 2 +- reflex_chakra/components/forms/slider.pyi | 498 ++++------ reflex_chakra/components/forms/switch.py | 2 +- reflex_chakra/components/forms/switch.pyi | 229 ++--- reflex_chakra/components/forms/textarea.py | 2 +- reflex_chakra/components/forms/textarea.pyi | 135 ++- reflex_chakra/components/forms/time_picker.py | 2 +- .../components/forms/time_picker.pyi | 143 ++- reflex_chakra/components/layout/__init__.py | 23 +- .../components/layout/aspect_ratio.py | 2 +- .../components/layout/aspect_ratio.pyi | 107 +-- reflex_chakra/components/layout/box.py | 4 +- reflex_chakra/components/layout/box.pyi | 113 +-- reflex_chakra/components/layout/card.py | 8 +- reflex_chakra/components/layout/card.pyi | 464 ++++----- reflex_chakra/components/layout/center.pyi | 276 ++---- reflex_chakra/components/layout/container.py | 2 +- reflex_chakra/components/layout/container.pyi | 107 +-- reflex_chakra/components/layout/flex.py | 8 +- reflex_chakra/components/layout/flex.pyi | 125 +-- reflex_chakra/components/layout/grid.py | 6 +- reflex_chakra/components/layout/grid.pyi | 357 +++---- reflex_chakra/components/layout/spacer.pyi | 104 +- reflex_chakra/components/layout/stack.py | 6 +- reflex_chakra/components/layout/stack.pyi | 376 +++----- reflex_chakra/components/layout/wrap.py | 2 +- reflex_chakra/components/layout/wrap.pyi | 192 ++-- reflex_chakra/components/media/__init__.py | 8 +- reflex_chakra/components/media/avatar.py | 2 +- reflex_chakra/components/media/avatar.pyi | 316 +++--- reflex_chakra/components/media/icon.py | 4 +- reflex_chakra/components/media/icon.pyi | 182 ++-- reflex_chakra/components/media/image.py | 19 +- reflex_chakra/components/media/image.pyi | 146 ++- .../components/navigation/__init__.py | 19 +- .../components/navigation/breadcrumb.py | 2 +- .../components/navigation/breadcrumb.pyi | 350 +++---- reflex_chakra/components/navigation/link.py | 2 +- reflex_chakra/components/navigation/link.pyi | 105 +- .../components/navigation/linkoverlay.py | 2 +- .../components/navigation/linkoverlay.pyi | 196 ++-- .../components/navigation/stepper.py | 9 +- .../components/navigation/stepper.pyi | 897 +++++++----------- reflex_chakra/components/overlay/__init__.py | 42 + .../components/overlay/alertdialog.py | 2 +- .../components/overlay/alertdialog.pyi | 675 +++++-------- reflex_chakra/components/overlay/drawer.py | 2 +- reflex_chakra/components/overlay/drawer.pyi | 753 ++++++--------- reflex_chakra/components/overlay/menu.py | 12 +- reflex_chakra/components/overlay/menu.pyi | 792 ++++++---------- reflex_chakra/components/overlay/modal.py | 12 +- reflex_chakra/components/overlay/modal.pyi | 666 +++++-------- reflex_chakra/components/overlay/popover.py | 2 +- reflex_chakra/components/overlay/popover.pyi | 833 ++++++---------- reflex_chakra/components/overlay/tooltip.py | 2 +- reflex_chakra/components/overlay/tooltip.pyi | 162 ++-- .../components/typography/__init__.py | 4 +- .../components/typography/heading.py | 2 +- .../components/typography/heading.pyi | 118 +-- .../components/typography/highlight.py | 10 +- .../components/typography/highlight.pyi | 110 +-- reflex_chakra/components/typography/span.py | 2 +- reflex_chakra/components/typography/span.pyi | 107 +-- reflex_chakra/components/typography/text.py | 2 +- reflex_chakra/components/typography/text.pyi | 110 +-- 143 files changed, 8386 insertions(+), 13472 deletions(-) delete mode 100644 reflex_chakra/components/forms/multiselect.py delete mode 100644 reflex_chakra/components/forms/multiselect.pyi diff --git a/docs/rcweb/rcweb/rcweb.py b/docs/rcweb/rcweb/rcweb.py index 32cc27e..bbfdf40 100644 --- a/docs/rcweb/rcweb/rcweb.py +++ b/docs/rcweb/rcweb/rcweb.py @@ -6,7 +6,7 @@ from types import SimpleNamespace import reflex as rx -import reflex_chakra as rc +import reflex_chakra as rc # noqa: F401 import flexdown from .utils.flexdown import xd diff --git a/docs/rcweb/rcweb/utils/docpage.py b/docs/rcweb/rcweb/utils/docpage.py index fde63a4..f0dceff 100644 --- a/docs/rcweb/rcweb/utils/docpage.py +++ b/docs/rcweb/rcweb/utils/docpage.py @@ -9,13 +9,12 @@ from types import UnionType from typing import ( Any, - Sequence, - Type, Literal, Union, get_args, get_origin, ) +from collections.abc import Sequence import mistletoe from ..utils.flexdown import xd, markdown, docdemobox from ..utils.sidebar import sidebar as sb @@ -676,7 +675,7 @@ class Source(Base): """Parse the source code of a component.""" # The component to parse. - component: Type[Component] + component: type[Component] # The source code. code: list[str] = [] diff --git a/docs/rcweb/rcweb/utils/flexdown.py b/docs/rcweb/rcweb/utils/flexdown.py index eb31d68..102db69 100644 --- a/docs/rcweb/rcweb/utils/flexdown.py +++ b/docs/rcweb/rcweb/utils/flexdown.py @@ -1,6 +1,6 @@ import flexdown import reflex as rx -import reflex_chakra as rc +import reflex_chakra as rc # noqa: F401 import black import textwrap from typing import Any diff --git a/docs/rcweb/rcweb/utils/sidebar.py b/docs/rcweb/rcweb/utils/sidebar.py index b27c41b..4622c05 100644 --- a/docs/rcweb/rcweb/utils/sidebar.py +++ b/docs/rcweb/rcweb/utils/sidebar.py @@ -53,23 +53,29 @@ def get_component_link(category: str | None, clist, prefix="") -> str: component_name = rx.utils.format.to_kebab_case(clist[0]) # construct the component link. The component name points to the name of the md file. return "/".join( - [prefix, category.lower().replace(' ', '-') if category else '', component_name.lower()]).replace("//", "/") + [ + prefix, + category.lower().replace(" ", "-") if category else "", + component_name.lower(), + ] + ).replace("//", "/") -def get_category_children(category, category_list, prefix="") -> SidebarItem | list[SidebarItem]: +def get_category_children( + category, category_list, prefix="" +) -> SidebarItem | list[SidebarItem]: category = category.replace("-", " ") if isinstance(category_list, dict): category_children = [] for c in category_list: category_child = get_category_children(c, category_list[c]) - category_children.extend(category_child) if isinstance(category_child, list) else category_children.append( - category_child) + category_children.extend(category_child) if isinstance( + category_child, list + ) else category_children.append(category_child) return SidebarItem( names=category, - children=[ - category_children - ], + children=[category_children], ) category_item_children = [] for c in category_list: @@ -77,11 +83,16 @@ def get_category_children(category, category_list, prefix="") -> SidebarItem | l name = rx.utils.format.to_title_case(component_name) item = SidebarItem( names=name, - link=get_component_link(category, c) if not category == "Markdowns" else get_component_link(None, c), + link=get_component_link(category, c) + if not category == "Markdowns" + else get_component_link(None, c), ) category_item_children.append(item) - return SidebarItem(names=category, - children=category_item_children) if not category == "Markdowns" else category_item_children + return ( + SidebarItem(names=category, children=category_item_children) + if not category == "Markdowns" + else category_item_children + ) def get_sidebar_items_other_libraries(chakra_components): @@ -91,8 +102,9 @@ def get_sidebar_items_other_libraries(chakra_components): category, chakra_components[category], ) - chakra_children.extend(category_item) if isinstance(category_item, list) else chakra_children.append( - category_item) + chakra_children.extend(category_item) if isinstance( + category_item, list + ) else chakra_children.append(category_item) return chakra_children @@ -143,8 +155,8 @@ def format_sidebar_route(route: str) -> str: def sidebar_leaf( - item: SidebarItem, - url: str, + item: SidebarItem, + url: str, ) -> rx.Component: """Get the leaf node of the sidebar.""" item.link = item.link.replace("_", "-") @@ -240,14 +252,14 @@ def sidebar_icon(name): def sidebar_item_comp( - item: SidebarItem, - index: list[int], - url: str, + item: SidebarItem, + index: list[int], + url: str, ): return rx.cond( len(item.children) == 0, sidebar_leaf(item=item, url=url) - if not item.names in ("Introduction",) + if item.names not in ("Introduction",) else rc.accordion_item( rc.accordion_button( sidebar_icon(item.names), @@ -265,9 +277,8 @@ def sidebar_item_comp( "text_decoration": "none", }, ), - href=format_sidebar_route(item.link) + href=format_sidebar_route(item.link), ), - rx.box( flex_grow=1, ), @@ -346,7 +357,6 @@ def sidebar_item_comp( def create_sidebar_section(items, index, url): - nested = False return rx.list_item( rc.accordion( *[ @@ -375,9 +385,9 @@ def create_sidebar_section(items, index, url): @rx.memo def sidebar_comp( - url: str, - other_libs_index: list[int], - width: str = "100%", + url: str, + other_libs_index: list[int], + width: str = "100%", ): ul_style = { "display": "flex", @@ -458,10 +468,9 @@ def sidebar_on_mobile_and_tablet(component): ), size="full", is_open=MobileAndTabletSidebarState.drawer_is_open, - width="100vw" + width="100vw", ), on_unmount=MobileAndTabletSidebarState.set_drawer_is_open(False), - ) @@ -480,7 +489,9 @@ def sidebar(chakra_components, url=None, width: str = "100%") -> rx.Component: """Render the sidebar.""" return rx.flex( - sidebar_on_mobile_and_tablet(get_sidebar_content(chakra_components, url, "100%")), + sidebar_on_mobile_and_tablet( + get_sidebar_content(chakra_components, url, "100%") + ), get_sidebar_content(chakra_components, url, width), width="100%", height="100%", diff --git a/docs/rcweb/requirements.txt b/docs/rcweb/requirements.txt index f3647e8..ce46e9a 100644 --- a/docs/rcweb/requirements.txt +++ b/docs/rcweb/requirements.txt @@ -1,4 +1,4 @@ -reflex>=0.7.11 +reflex>=0.8.0a4 reflex-chakra mistletoe==1.4.0 flexdown==0.1.5a12 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 79ed16f..6c35b11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "reflex-chakra" -version = "0.8.0" +version = "0.8.1" description = "reflex using chakra components" authors = [{ name = "Elijah Ahianyo", email = "elijahahianyo@gmail.com" }] maintainers = [ @@ -11,7 +11,7 @@ maintainers = [ readme = "README.md" requires-python = ">=3.10" license.text = "Apache-2.0" -dependencies = ["reflex >=0.8.0a"] +dependencies = ["reflex >=0.8.0dev"] [build-system] @@ -23,5 +23,8 @@ include = ["reflex_chakra"] [tool.ruff] target-version = "py310" +lint.extend-select = ["UP", "RUF022"] +lint.ignore = ["F403", "F405", "UP038"] [tool.pyright] +reportIncompatibleMethodOverride = false diff --git a/reflex_chakra/__init__.py b/reflex_chakra/__init__.py index bd16084..dfc3c94 100644 --- a/reflex_chakra/__init__.py +++ b/reflex_chakra/__init__.py @@ -1 +1 @@ -from .components import * \ No newline at end of file +from .components import * diff --git a/reflex_chakra/components/__init__.py b/reflex_chakra/components/__init__.py index c0104bb..41785c7 100644 --- a/reflex_chakra/components/__init__.py +++ b/reflex_chakra/components/__init__.py @@ -1,5 +1,7 @@ """Chakra components.""" -from . import media + +from reflex.components.component import Component + from .base import * from .datadisplay import * from .disclosure import * @@ -111,8 +113,6 @@ 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 diff --git a/reflex_chakra/components/base.py b/reflex_chakra/components/base.py index 3e72328..f334897 100644 --- a/reflex_chakra/components/base.py +++ b/reflex_chakra/components/base.py @@ -3,9 +3,8 @@ from __future__ import annotations import shutil -from functools import lru_cache from pathlib import Path -from typing import List, Literal +from typing import Literal from reflex.components.component import Component from reflex.utils.imports import ImportDict, ImportVar @@ -18,13 +17,12 @@ class ChakraComponent(Component): """A component that wraps a Chakra component.""" library: str = "@chakra-ui/react@2.6.1" # type: ignore - lib_dependencies: List[str] = [ + 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, @@ -38,22 +36,6 @@ def _get_style(self) -> dict: """ 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", - ] - } - @classmethod def create(cls, *children, **props) -> Component: # copy color mode provider file to client's asset dir if it doesnt exist. @@ -119,7 +101,6 @@ def add_imports(self) -> ImportDict: } @staticmethod - @lru_cache(maxsize=None) def _get_app_wrap_components() -> dict[tuple[int, str], Component]: return { (50, "ChakraColorModeProvider"): chakra_color_mode_provider, diff --git a/reflex_chakra/components/base.pyi b/reflex_chakra/components/base.pyi index baa3bc7..9b1b796 100644 --- a/reflex_chakra/components/base.pyi +++ b/reflex_chakra/components/base.pyi @@ -1,15 +1,22 @@ -"""Stub file for reflex/components/chakra/base.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var 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 Var class ChakraComponent(Component): @overload @@ -17,64 +24,36 @@ class ChakraComponent(Component): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ChakraComponent: + """""" ... class ChakraProvider(ChakraComponent): @@ -83,55 +62,40 @@ class ChakraProvider(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + theme: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "ChakraProvider": + ) -> ChakraProvider: """Create a new ChakraProvider component. Returns: - A new ChakraProvider component. - """ + A new ChakraProvider component.""" ... def add_imports(self) -> ImportDict: ... @@ -144,49 +108,35 @@ class ChakraColorModeProvider(Component): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "ChakraColorModeProvider": + ) -> ChakraColorModeProvider: """Create the component. Args: @@ -194,14 +144,14 @@ class ChakraColorModeProvider(Component): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... chakra_color_mode_provider = ChakraColorModeProvider.create() diff --git a/reflex_chakra/components/datadisplay/__init__.py b/reflex_chakra/components/datadisplay/__init__.py index b20d172..71919fc 100644 --- a/reflex_chakra/components/datadisplay/__init__.py +++ b/reflex_chakra/components/datadisplay/__init__.py @@ -8,3 +8,34 @@ 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 + +__all__ = [ + "Badge", + "Code", + "Divider", + "Kbd", + "List", + "ListItem", + "OrderedList", + "Stat", + "StatArrow", + "StatGroup", + "StatHelpText", + "StatLabel", + "StatNumber", + "Table", + "TableCaption", + "TableContainer", + "Tag", + "TagCloseButton", + "TagLabel", + "TagLeftIcon", + "TagRightIcon", + "Tbody", + "Td", + "Tfoot", + "Th", + "Thead", + "Tr", + "UnorderedList", +] diff --git a/reflex_chakra/components/datadisplay/badge.py b/reflex_chakra/components/datadisplay/badge.py index 8e95320..d6d932a 100644 --- a/reflex_chakra/components/datadisplay/badge.py +++ b/reflex_chakra/components/datadisplay/badge.py @@ -1,7 +1,7 @@ """Badge component.""" from reflex_chakra.components import ChakraComponent, LiteralVariant -from reflex.vars import Var +from reflex.vars.base import Var class Badge(ChakraComponent): diff --git a/reflex_chakra/components/datadisplay/badge.pyi b/reflex_chakra/components/datadisplay/badge.pyi index 2462cf6..cafb62e 100644 --- a/reflex_chakra/components/datadisplay/badge.pyi +++ b/reflex_chakra/components/datadisplay/badge.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/datadisplay/badge.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Badge(ChakraComponent): @overload @@ -16,71 +23,38 @@ class Badge(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + variant: Literal["outline", "solid", "subtle"] + | Var[Literal["outline", "solid", "subtle"]] + | None = None, + color_scheme: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Badge: + """""" ... diff --git a/reflex_chakra/components/datadisplay/code.pyi b/reflex_chakra/components/datadisplay/code.pyi index 0a8003e..9a991aa 100644 --- a/reflex_chakra/components/datadisplay/code.pyi +++ b/reflex_chakra/components/datadisplay/code.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/datadisplay/code.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Code(ChakraComponent): @overload @@ -16,62 +22,34 @@ class Code(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Code: + """""" ... diff --git a/reflex_chakra/components/datadisplay/divider.py b/reflex_chakra/components/datadisplay/divider.py index 4a45d24..e5b4163 100644 --- a/reflex_chakra/components/datadisplay/divider.py +++ b/reflex_chakra/components/datadisplay/divider.py @@ -3,7 +3,7 @@ from typing import Literal from reflex_chakra.components import ChakraComponent, LiteralDividerVariant -from reflex.vars import Var +from reflex.vars.base import Var LiteralLayout = Literal["horizontal", "vertical"] diff --git a/reflex_chakra/components/datadisplay/divider.pyi b/reflex_chakra/components/datadisplay/divider.pyi index 7afda15..536fc08 100644 --- a/reflex_chakra/components/datadisplay/divider.pyi +++ b/reflex_chakra/components/datadisplay/divider.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/datadisplay/divider.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var LiteralLayout = Literal["horizontal", "vertical"] @@ -18,73 +25,40 @@ class Divider(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + orientation: Literal["horizontal", "vertical"] + | Var[Literal["horizontal", "vertical"]] + | None = None, + variant: Literal["dashed", "solid"] + | Var[Literal["dashed", "solid"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Divider: + """""" ... diff --git a/reflex_chakra/components/datadisplay/keyboard_key.pyi b/reflex_chakra/components/datadisplay/keyboard_key.pyi index c5d4756..97aaa70 100644 --- a/reflex_chakra/components/datadisplay/keyboard_key.pyi +++ b/reflex_chakra/components/datadisplay/keyboard_key.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/datadisplay/keyboard_key.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class KeyboardKey(ChakraComponent): @overload @@ -16,62 +22,34 @@ class KeyboardKey(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> KeyboardKey: + """""" ... diff --git a/reflex_chakra/components/datadisplay/list.py b/reflex_chakra/components/datadisplay/list.py index f60befe..4352c63 100644 --- a/reflex_chakra/components/datadisplay/list.py +++ b/reflex_chakra/components/datadisplay/list.py @@ -5,7 +5,7 @@ from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.components.core.foreach import Foreach -from reflex.vars import Var +from reflex.vars.base import Var class List(ChakraComponent): diff --git a/reflex_chakra/components/datadisplay/list.pyi b/reflex_chakra/components/datadisplay/list.pyi index 3d0120a..1c0bb2e 100644 --- a/reflex_chakra/components/datadisplay/list.pyi +++ b/reflex_chakra/components/datadisplay/list.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/datadisplay/list.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class List(ChakraComponent): @overload @@ -16,53 +22,39 @@ class List(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + items: Var[list] | list | None = None, + spacing: Var[str] | str | None = None, + style_position: Var[str] | str | None = None, + style_type: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "List": + ) -> List: """Create a list component. Args: @@ -74,14 +66,14 @@ class List(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The list component.""" ... class ListItem(ChakraComponent): @@ -90,64 +82,36 @@ class ListItem(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ListItem: + """""" ... class OrderedList(List): @@ -156,53 +120,39 @@ class OrderedList(List): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + items: Var[list] | list | None = None, + spacing: Var[str] | str | None = None, + style_position: Var[str] | str | None = None, + style_type: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "OrderedList": + ) -> OrderedList: """Create a list component. Args: @@ -214,14 +164,14 @@ class OrderedList(List): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The list component.""" ... class UnorderedList(List): @@ -230,53 +180,39 @@ class UnorderedList(List): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + items: Var[list] | list | None = None, + spacing: Var[str] | str | None = None, + style_position: Var[str] | str | None = None, + style_type: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "UnorderedList": + ) -> UnorderedList: """Create a list component. Args: @@ -288,12 +224,12 @@ class UnorderedList(List): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The list component.""" ... diff --git a/reflex_chakra/components/datadisplay/stat.py b/reflex_chakra/components/datadisplay/stat.py index 841f282..a43c735 100644 --- a/reflex_chakra/components/datadisplay/stat.py +++ b/reflex_chakra/components/datadisplay/stat.py @@ -2,7 +2,7 @@ from reflex_chakra.components import ChakraComponent from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class Stat(ChakraComponent): diff --git a/reflex_chakra/components/datadisplay/stat.pyi b/reflex_chakra/components/datadisplay/stat.pyi index 8a4da36..36206af 100644 --- a/reflex_chakra/components/datadisplay/stat.pyi +++ b/reflex_chakra/components/datadisplay/stat.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/datadisplay/stat.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Stat(ChakraComponent): @overload @@ -20,49 +26,35 @@ class Stat(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Stat": + ) -> Stat: """Create a stat component. Args: @@ -74,14 +66,14 @@ class Stat(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The stat component.""" ... class StatLabel(ChakraComponent): @@ -90,64 +82,36 @@ class StatLabel(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StatLabel: + """""" ... class StatNumber(ChakraComponent): @@ -156,64 +120,36 @@ class StatNumber(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StatNumber: + """""" ... class StatHelpText(ChakraComponent): @@ -222,64 +158,36 @@ class StatHelpText(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StatHelpText: + """""" ... class StatArrow(ChakraComponent): @@ -288,66 +196,37 @@ class StatArrow(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type_: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StatArrow: + """""" ... class StatGroup(ChakraComponent): @@ -356,62 +235,34 @@ class StatGroup(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StatGroup: + """""" ... diff --git a/reflex_chakra/components/datadisplay/table.py b/reflex_chakra/components/datadisplay/table.py index e3102e6..c055f88 100644 --- a/reflex_chakra/components/datadisplay/table.py +++ b/reflex_chakra/components/datadisplay/table.py @@ -1,12 +1,11 @@ """Table components.""" -from typing import List, Tuple - +from typing import ClassVar from reflex_chakra.components 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 +from reflex.vars.base import Var class Table(ChakraComponent): @@ -66,7 +65,7 @@ class Thead(ChakraComponent): tag = "Thead" # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tfoot"] + _invalid_children: ClassVar[list[str]] = ["Tbody", "Thead", "Tfoot"] @classmethod def create(cls, *children, headers=None, **props) -> Component: @@ -118,7 +117,7 @@ class Tbody(ChakraComponent): tag = "Tbody" # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tfoot", "Td", "Th"] + _invalid_children: ClassVar[list[str]] = ["Tbody", "Thead", "Tfoot", "Td", "Th"] @classmethod def create(cls, *children, rows=None, **props) -> Component: @@ -157,7 +156,7 @@ def validate_rows(rows): Raises: TypeError: If rows are not lists or tuples containing inner lists or tuples. """ - allowed_subclasses = (List, Tuple) + allowed_subclasses = (list, tuple) if isinstance(rows, Var): outer_type = rows._var_type inner_type = ( @@ -192,7 +191,7 @@ class Tfoot(ChakraComponent): tag = "Tfoot" # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Td", "Th", "Tfoot"] + _invalid_children: ClassVar[list[str]] = ["Tbody", "Thead", "Td", "Th", "Tfoot"] @classmethod def create(cls, *children, footers=None, **props) -> Component: @@ -241,7 +240,7 @@ class Tr(ChakraComponent): tag = "Tr" # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tfoot", "Tr"] + _invalid_children: ClassVar[list[str]] = ["Tbody", "Thead", "Tfoot", "Tr"] @classmethod def create(cls, *children, cell_type: str = "", cells=None, **props) -> Component: @@ -272,7 +271,7 @@ class Th(ChakraComponent): tag = "Th" # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead", "Tr", "Td", "Th"] + _invalid_children: ClassVar[list[str]] = ["Tbody", "Thead", "Tr", "Td", "Th"] # Aligns the cell content to the right. is_numeric: Var[bool] @@ -284,7 +283,7 @@ class Td(ChakraComponent): tag = "Td" # invalid children components - _invalid_children: List[str] = ["Tbody", "Thead"] + _invalid_children: ClassVar[list[str]] = ["Tbody", "Thead"] # Aligns the cell content to the right. is_numeric: Var[bool] diff --git a/reflex_chakra/components/datadisplay/table.pyi b/reflex_chakra/components/datadisplay/table.pyi index 48b47fd..f4b1dfa 100644 --- a/reflex_chakra/components/datadisplay/table.pyi +++ b/reflex_chakra/components/datadisplay/table.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/datadisplay/table.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Table(ChakraComponent): @overload @@ -20,53 +26,39 @@ class Table(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + color_scheme: Var[str] | str | None = None, + variant: Var[str] | str | None = None, + size: Var[str] | str | None = None, + placement: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Table": + ) -> Table: """Create a table component. Args: @@ -82,14 +74,14 @@ class Table(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The table component.""" ... class Thead(ChakraComponent): @@ -99,49 +91,35 @@ class Thead(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Thead": + ) -> Thead: """Create a table header component. Args: @@ -150,6 +128,7 @@ class Thead(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -157,7 +136,6 @@ class Thead(ChakraComponent): Returns: The table header component. - """ ... @@ -171,49 +149,35 @@ class Tbody(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Tbody": + ) -> Tbody: """Create a table body component. Args: @@ -222,14 +186,14 @@ class Tbody(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 - """ + Component: The table body component""" ... @staticmethod @@ -242,49 +206,35 @@ class Tfoot(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Tfoot": + ) -> Tfoot: """Create a table footer component. Args: @@ -293,14 +243,14 @@ class Tfoot(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The table footer component.""" ... @staticmethod @@ -312,51 +262,37 @@ class Tr(ChakraComponent): def create( # type: ignore cls, *children, - cell_type: Optional[str] = "", + cell_type: str | None = "", 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Tr": + ) -> Tr: """Create a table row component. Args: @@ -366,14 +302,14 @@ class Tr(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 - """ + The table row component""" ... class Th(ChakraComponent): @@ -382,66 +318,37 @@ class Th(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_numeric: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Th: + """""" ... class Td(ChakraComponent): @@ -450,66 +357,37 @@ class Td(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_numeric: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Td: + """""" ... class TableCaption(ChakraComponent): @@ -518,66 +396,37 @@ class TableCaption(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + placement: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TableCaption: + """""" ... class TableContainer(ChakraComponent): @@ -586,62 +435,34 @@ class TableContainer(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TableContainer: + """""" ... diff --git a/reflex_chakra/components/datadisplay/tag.py b/reflex_chakra/components/datadisplay/tag.py index ef8f5eb..c1d9fe0 100644 --- a/reflex_chakra/components/datadisplay/tag.py +++ b/reflex_chakra/components/datadisplay/tag.py @@ -1,7 +1,5 @@ """Chakra Tag Component.""" -from typing import Optional - from reflex_chakra.components import ( ChakraComponent, LiteralTagColorScheme, @@ -9,7 +7,7 @@ LiteralVariant, ) from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class TagLabel(ChakraComponent): @@ -62,9 +60,9 @@ def create( cls, label: Component, *, - left_icon: Optional[Component] = None, - right_icon: Optional[Component] = None, - close_button: Optional[Component] = None, + left_icon: Component | None = None, + right_icon: Component | None = None, + close_button: Component | None = None, **props, ) -> Component: """Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it. diff --git a/reflex_chakra/components/datadisplay/tag.pyi b/reflex_chakra/components/datadisplay/tag.pyi index e194ecd..7dc8745 100644 --- a/reflex_chakra/components/datadisplay/tag.pyi +++ b/reflex_chakra/components/datadisplay/tag.pyi @@ -1,17 +1,24 @@ -"""Stub file for reflex/components/chakra/datadisplay/tag.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class TagLabel(ChakraComponent): @overload @@ -19,64 +26,36 @@ class TagLabel(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TagLabel: + """""" ... class TagLeftIcon(ChakraComponent): @@ -85,64 +64,36 @@ class TagLeftIcon(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TagLeftIcon: + """""" ... class TagRightIcon(ChakraComponent): @@ -151,64 +102,36 @@ class TagRightIcon(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TagRightIcon: + """""" ... class TagCloseButton(ChakraComponent): @@ -217,64 +140,36 @@ class TagCloseButton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TagCloseButton: + """""" ... class Tag(ChakraComponent): @@ -283,91 +178,69 @@ class Tag(ChakraComponent): 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"], + left_icon: Component | None = None, + right_icon: Component | None = None, + close_button: Component | None = None, + color_scheme: Literal[ + "blue", + "cyan", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "teal", + "yellow", + ] + | Var[ + Literal[ + "blue", + "cyan", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "teal", + "yellow", ] - ] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + size: Literal["lg", "md", "sm"] | Var[Literal["lg", "md", "sm"]] | None = None, + variant: Literal["outline", "solid", "subtle"] + | Var[Literal["outline", "solid", "subtle"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Tag": + ) -> Tag: """Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it. Args: @@ -378,6 +251,5 @@ class Tag(ChakraComponent): props: The properties to be passed to the component. Returns: - The `create()` method returns a Tag object. - """ + The `create()` method returns a Tag object.""" ... diff --git a/reflex_chakra/components/disclosure/__init__.py b/reflex_chakra/components/disclosure/__init__.py index 7a756c6..5505899 100644 --- a/reflex_chakra/components/disclosure/__init__.py +++ b/reflex_chakra/components/disclosure/__init__.py @@ -11,4 +11,21 @@ from .transition import Collapse, Fade, ScaleFade, Slide, SlideFade from .visuallyhidden import VisuallyHidden -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore +__all__ = [ + "Accordion", + "AccordionButton", + "AccordionIcon", + "AccordionItem", + "AccordionPanel", + "Collapse", + "Fade", + "ScaleFade", + "Slide", + "SlideFade", + "Tab", + "TabList", + "TabPanel", + "TabPanels", + "Tabs", + "VisuallyHidden", +] diff --git a/reflex_chakra/components/disclosure/accordion.py b/reflex_chakra/components/disclosure/accordion.py index c01933b..809d2b5 100644 --- a/reflex_chakra/components/disclosure/accordion.py +++ b/reflex_chakra/components/disclosure/accordion.py @@ -1,10 +1,8 @@ """Container to stack elements with spacing.""" -from typing import List, Optional, Union - from reflex_chakra.components import ChakraComponent from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class Accordion(ChakraComponent): @@ -19,10 +17,10 @@ class Accordion(ChakraComponent): allow_toggle: Var[bool] # The initial index(es) of the expanded accordion item(s). - default_index: Var[Optional[List[int]]] + default_index: Var[list[int] | None] # The index(es) of the expanded accordion item - index: Var[Union[int, List[int]]] + index: Var[int | list[int]] # If true, height animation and transitions will be disabled. reduce_motion: Var[bool] @@ -33,8 +31,8 @@ def create( *children, items=None, icon_pos="right", - allow_multiple: Optional[Var[bool]] = None, - allow_toggle: Optional[Var[bool]] = None, + allow_multiple: Var[bool] | None = None, + allow_toggle: Var[bool] | None = None, **props, ) -> Component: """Create an accordion component. diff --git a/reflex_chakra/components/disclosure/accordion.pyi b/reflex_chakra/components/disclosure/accordion.pyi index 0b9c016..7ba8877 100644 --- a/reflex_chakra/components/disclosure/accordion.pyi +++ b/reflex_chakra/components/disclosure/accordion.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/disclosure/accordion.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Accordion(ChakraComponent): @overload @@ -18,54 +24,40 @@ class Accordion(ChakraComponent): *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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + allow_multiple: Var[bool] | bool | None = None, + allow_toggle: Var[bool] | bool | None = None, + default_index: list[int] | Var[list[int] | None] | None = None, + index: list[int] | Var[list[int] | int] | int | None = None, + reduce_motion: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Accordion": + ) -> Accordion: """Create an accordion component. Args: @@ -80,14 +72,14 @@ class Accordion(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 - """ + The accordion component""" ... class AccordionItem(ChakraComponent): @@ -96,70 +88,39 @@ class AccordionItem(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + id_: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_focusable: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AccordionItem: + """""" ... class AccordionButton(ChakraComponent): @@ -168,64 +129,36 @@ class AccordionButton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AccordionButton: + """""" ... class AccordionPanel(ChakraComponent): @@ -234,64 +167,36 @@ class AccordionPanel(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AccordionPanel: + """""" ... class AccordionIcon(ChakraComponent): @@ -300,62 +205,34 @@ class AccordionIcon(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AccordionIcon: + """""" ... diff --git a/reflex_chakra/components/disclosure/tabs.py b/reflex_chakra/components/disclosure/tabs.py index 3d49cc4..5299e3e 100644 --- a/reflex_chakra/components/disclosure/tabs.py +++ b/reflex_chakra/components/disclosure/tabs.py @@ -1,7 +1,6 @@ """Tab components.""" -from typing import List, Optional, Tuple - +from typing import ClassVar from reflex_chakra.components import ( ChakraComponent, LiteralColorScheme, @@ -9,7 +8,7 @@ LiteralTagAlign, ) from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class Tabs(ChakraComponent): @@ -49,7 +48,7 @@ class Tabs(ChakraComponent): @classmethod def create( - cls, *children, items: Optional[List[Tuple[str, str]]] = None, **props + cls, *children, items: list[tuple[str, str]] | None = None, **props ) -> Component: """Create a tab component. @@ -90,7 +89,7 @@ class Tab(ChakraComponent): # The id of the panel. panel_id: Var[str] - _valid_parents: List[str] = ["TabList"] + _valid_parents: ClassVar[list[str]] = ["TabList"] class TabList(ChakraComponent): @@ -98,7 +97,7 @@ class TabList(ChakraComponent): tag = "TabList" - _valid_parents: List[str] = ["Tabs"] + _valid_parents: ClassVar[list[str]] = ["Tabs"] class TabPanels(ChakraComponent): @@ -106,7 +105,7 @@ class TabPanels(ChakraComponent): tag = "TabPanels" - _valid_parents: List[str] = ["Tabs"] + _valid_parents: ClassVar[list[str]] = ["Tabs"] class TabPanel(ChakraComponent): @@ -114,4 +113,4 @@ class TabPanel(ChakraComponent): tag = "TabPanel" - _valid_parents: List[str] = ["TabPanels"] + _valid_parents: ClassVar[list[str]] = ["TabPanels"] diff --git a/reflex_chakra/components/disclosure/tabs.pyi b/reflex_chakra/components/disclosure/tabs.pyi index c84c7b1..44fcb0e 100644 --- a/reflex_chakra/components/disclosure/tabs.pyi +++ b/reflex_chakra/components/disclosure/tabs.pyi @@ -1,16 +1,23 @@ -"""Stub file for reflex/components/chakra/disclosure/tabs.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Tabs(ChakraComponent): @overload @@ -18,133 +25,110 @@ class Tabs(ChakraComponent): 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", - ], + items: list[tuple[str, str]] | None = None, + align: Literal["center", "end", "start"] + | Var[Literal["center", "end", "start"]] + | None = None, + default_index: Var[int] | int | None = None, + id_: Var[str] | str | None = None, + is_fitted: Var[bool] | bool | None = None, + is_lazy: Var[bool] | bool | None = None, + is_manual: Var[bool] | bool | None = None, + orientation: Var[str] | str | None = None, + variant: Literal[ + "enclosed", + "enclosed-colored", + "line", + "soft-rounded", + "solid-rounded", + "unstyled", + ] + | Var[ + Literal[ + "enclosed", + "enclosed-colored", + "line", + "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 = None, + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + index: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Tabs": + ) -> Tabs: """Create a tab component. Args: @@ -163,14 +147,14 @@ class Tabs(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 - """ + The tab component""" ... class Tab(ChakraComponent): @@ -179,72 +163,40 @@ class Tab(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_disabled: Var[bool] | bool | None = None, + is_selected: Var[bool] | bool | None = None, + id_: Var[str] | str | None = None, + panel_id: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Tab: + """""" ... class TabList(ChakraComponent): @@ -253,64 +205,36 @@ class TabList(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TabList: + """""" ... class TabPanels(ChakraComponent): @@ -319,64 +243,36 @@ class TabPanels(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TabPanels: + """""" ... class TabPanel(ChakraComponent): @@ -385,62 +281,34 @@ class TabPanel(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> TabPanel: + """""" ... diff --git a/reflex_chakra/components/disclosure/transition.py b/reflex_chakra/components/disclosure/transition.py index abad0d5..a85e788 100644 --- a/reflex_chakra/components/disclosure/transition.py +++ b/reflex_chakra/components/disclosure/transition.py @@ -1,9 +1,7 @@ """A transition Component.""" -from typing import Union - from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Transition(ChakraComponent): @@ -49,10 +47,10 @@ class SlideFade(Transition): tag = "SlideFade" # The offset on the horizontal or x axis - offsetX: Var[Union[str, int]] + offsetX: Var[str | int] # The offset on the vertical or y axis - offsetY: Var[Union[str, int]] + offsetY: Var[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] @@ -70,4 +68,4 @@ class Collapse(Transition): endingHeight: Var[str] # The height you want the content in its collapsed state. - startingHeight: Var[Union[str, int]] + startingHeight: Var[str | int] diff --git a/reflex_chakra/components/disclosure/transition.pyi b/reflex_chakra/components/disclosure/transition.pyi index b83ce95..ea4caa6 100644 --- a/reflex_chakra/components/disclosure/transition.pyi +++ b/reflex_chakra/components/disclosure/transition.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/disclosure/transition.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Transition(ChakraComponent): @overload @@ -16,68 +22,38 @@ class Transition(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + in_: Var[bool] | bool | None = None, + unmount_on_exit: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Transition: + """""" ... class Fade(Transition): @@ -86,68 +62,38 @@ class Fade(Transition): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + in_: Var[bool] | bool | None = None, + unmount_on_exit: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Fade: + """""" ... class ScaleFade(Transition): @@ -156,72 +102,40 @@ class ScaleFade(Transition): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + initial_scale: Var[float] | float | None = None, + reverse: Var[bool] | bool | None = None, + in_: Var[bool] | bool | None = None, + unmount_on_exit: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ScaleFade: + """""" ... class Slide(Transition): @@ -230,70 +144,39 @@ class Slide(Transition): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + direction: Var[str] | str | None = None, + in_: Var[bool] | bool | None = None, + unmount_on_exit: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Slide: + """""" ... class SlideFade(Transition): @@ -302,74 +185,41 @@ class SlideFade(Transition): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + offsetX: Var[int | str] | int | str | None = None, + offsetY: Var[int | str] | int | str | None = None, + reverse: Var[bool] | bool | None = None, + in_: Var[bool] | bool | None = None, + unmount_on_exit: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> SlideFade: + """""" ... class Collapse(Transition): @@ -378,72 +228,39 @@ class Collapse(Transition): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + animateOpacity: Var[bool] | bool | None = None, + endingHeight: Var[str] | str | None = None, + startingHeight: Var[int | str] | int | str | None = None, + in_: Var[bool] | bool | None = None, + unmount_on_exit: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Collapse: + """""" ... diff --git a/reflex_chakra/components/disclosure/visuallyhidden.pyi b/reflex_chakra/components/disclosure/visuallyhidden.pyi index 1a99bb6..bc08ba0 100644 --- a/reflex_chakra/components/disclosure/visuallyhidden.pyi +++ b/reflex_chakra/components/disclosure/visuallyhidden.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/disclosure/visuallyhidden.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class VisuallyHidden(ChakraComponent): @overload @@ -16,62 +22,34 @@ class VisuallyHidden(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> VisuallyHidden: + """""" ... diff --git a/reflex_chakra/components/feedback/__init__.py b/reflex_chakra/components/feedback/__init__.py index 8037e36..8cad6a9 100644 --- a/reflex_chakra/components/feedback/__init__.py +++ b/reflex_chakra/components/feedback/__init__.py @@ -5,3 +5,17 @@ from .progress import Progress from .skeleton import Skeleton, SkeletonCircle, SkeletonText from .spinner import Spinner + +__all__ = [ + "Alert", + "AlertDescription", + "AlertIcon", + "AlertTitle", + "CircularProgress", + "CircularProgressLabel", + "Progress", + "Skeleton", + "SkeletonCircle", + "SkeletonText", + "Spinner", +] diff --git a/reflex_chakra/components/feedback/alert.py b/reflex_chakra/components/feedback/alert.py index 82f5301..f03db02 100644 --- a/reflex_chakra/components/feedback/alert.py +++ b/reflex_chakra/components/feedback/alert.py @@ -6,7 +6,7 @@ LiteralStatus, ) from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class Alert(ChakraComponent): diff --git a/reflex_chakra/components/feedback/alert.pyi b/reflex_chakra/components/feedback/alert.pyi index 7a2e827..b159644 100644 --- a/reflex_chakra/components/feedback/alert.pyi +++ b/reflex_chakra/components/feedback/alert.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/feedback/alert.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Alert(ChakraComponent): @overload @@ -19,61 +26,41 @@ class Alert(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + status: Literal["error", "info", "success", "warning"] + | Var[Literal["error", "info", "success", "warning"]] + | None = None, + variant: Literal["left-accent", "solid", "subtle", "top-accent"] + | Var[Literal["left-accent", "solid", "subtle", "top-accent"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Alert": + ) -> Alert: """Create an alert component. Args: @@ -86,14 +73,14 @@ class Alert(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The alert component.""" ... class AlertIcon(ChakraComponent): @@ -102,64 +89,36 @@ class AlertIcon(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertIcon: + """""" ... class AlertTitle(ChakraComponent): @@ -168,64 +127,36 @@ class AlertTitle(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertTitle: + """""" ... class AlertDescription(ChakraComponent): @@ -234,62 +165,34 @@ class AlertDescription(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertDescription: + """""" ... diff --git a/reflex_chakra/components/feedback/circularprogress.py b/reflex_chakra/components/feedback/circularprogress.py index 8847dc7..1b3fc0e 100644 --- a/reflex_chakra/components/feedback/circularprogress.py +++ b/reflex_chakra/components/feedback/circularprogress.py @@ -1,10 +1,8 @@ """Container to stack elements with spacing.""" -from typing import Union - from reflex_chakra.components import ChakraComponent from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class CircularProgress(ChakraComponent): @@ -25,7 +23,7 @@ class CircularProgress(ChakraComponent): min_: Var[int] # This defines the stroke width of the svg circle. - thickness: Var[Union[str, int]] + thickness: Var[str | int] # The color name of the progress track. Use a color key in the theme object track_color: Var[str] diff --git a/reflex_chakra/components/feedback/circularprogress.pyi b/reflex_chakra/components/feedback/circularprogress.pyi index 8bf368c..ae1aa27 100644 --- a/reflex_chakra/components/feedback/circularprogress.pyi +++ b/reflex_chakra/components/feedback/circularprogress.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/feedback/circularprogress.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class CircularProgress(ChakraComponent): @overload @@ -17,59 +23,45 @@ class CircularProgress(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + cap_is_round: Var[bool] | bool | None = None, + is_indeterminate: Var[bool] | bool | None = None, + max_: Var[int] | int | None = None, + min_: Var[int] | int | None = None, + thickness: Var[int | str] | int | str | None = None, + track_color: Var[str] | str | None = None, + value: Var[int] | int | None = None, + value_text: Var[str] | str | None = None, + color: Var[str] | str | None = None, + size: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "CircularProgress": + ) -> CircularProgress: """Create a circular progress component. Args: @@ -88,14 +80,14 @@ class CircularProgress(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The circular progress component.""" ... class CircularProgressLabel(ChakraComponent): @@ -104,62 +96,34 @@ class CircularProgressLabel(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> CircularProgressLabel: + """""" ... diff --git a/reflex_chakra/components/feedback/progress.py b/reflex_chakra/components/feedback/progress.py index 63fda11..8c4e496 100644 --- a/reflex_chakra/components/feedback/progress.py +++ b/reflex_chakra/components/feedback/progress.py @@ -1,9 +1,7 @@ """Container to stack elements with spacing.""" -from typing import Union - from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Progress(ChakraComponent): @@ -27,7 +25,7 @@ class Progress(ChakraComponent): min_: Var[int] # The value of the progress indicator. If undefined the progress bar will be in indeterminate state - value: Var[Union[int, float]] + value: Var[int | float] # The color scheme of the progress bar. color_scheme: Var[str] diff --git a/reflex_chakra/components/feedback/progress.pyi b/reflex_chakra/components/feedback/progress.pyi index 6ba5c5d..c71d59b 100644 --- a/reflex_chakra/components/feedback/progress.pyi +++ b/reflex_chakra/components/feedback/progress.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/feedback/progress.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Progress(ChakraComponent): @overload @@ -16,76 +22,41 @@ class Progress(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + has_stripe: Var[bool] | bool | None = None, + is_animated: Var[bool] | bool | None = None, + is_indeterminate: Var[bool] | bool | None = None, + max_: Var[int] | int | None = None, + min_: Var[int] | int | None = None, + value: Var[float | int] | float | int | None = None, + color_scheme: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Progress: + """""" ... diff --git a/reflex_chakra/components/feedback/skeleton.py b/reflex_chakra/components/feedback/skeleton.py index 8e97e17..39182ae 100644 --- a/reflex_chakra/components/feedback/skeleton.py +++ b/reflex_chakra/components/feedback/skeleton.py @@ -1,7 +1,7 @@ """Container to stack elements with spacing.""" from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Skeleton(ChakraComponent): diff --git a/reflex_chakra/components/feedback/skeleton.pyi b/reflex_chakra/components/feedback/skeleton.pyi index fd95c41..74d7c73 100644 --- a/reflex_chakra/components/feedback/skeleton.pyi +++ b/reflex_chakra/components/feedback/skeleton.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/feedback/skeleton.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Skeleton(ChakraComponent): @overload @@ -16,74 +22,41 @@ class Skeleton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + end_color: Var[str] | str | None = None, + fade_duration: Var[float] | float | None = None, + is_loaded: Var[bool] | bool | None = None, + speed: Var[float] | float | None = None, + start_color: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Skeleton: + """""" ... class SkeletonCircle(ChakraComponent): @@ -92,74 +65,41 @@ class SkeletonCircle(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + end_color: Var[str] | str | None = None, + fade_duration: Var[float] | float | None = None, + is_loaded: Var[bool] | bool | None = None, + speed: Var[float] | float | None = None, + start_color: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> SkeletonCircle: + """""" ... class SkeletonText(ChakraComponent): @@ -168,74 +108,40 @@ class SkeletonText(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + end_color: Var[str] | str | None = None, + fade_duration: Var[float] | float | None = None, + is_loaded: Var[bool] | bool | None = None, + speed: Var[float] | float | None = None, + start_color: Var[str] | str | None = None, + no_of_lines: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> SkeletonText: + """""" ... diff --git a/reflex_chakra/components/feedback/spinner.py b/reflex_chakra/components/feedback/spinner.py index 1096668..66460c4 100644 --- a/reflex_chakra/components/feedback/spinner.py +++ b/reflex_chakra/components/feedback/spinner.py @@ -1,7 +1,7 @@ """Container to stack elements with spacing.""" from reflex_chakra.components import ChakraComponent, LiteralSpinnerSize -from reflex.vars import Var +from reflex.vars.base import Var class Spinner(ChakraComponent): diff --git a/reflex_chakra/components/feedback/spinner.pyi b/reflex_chakra/components/feedback/spinner.pyi index 5c06019..c862cb8 100644 --- a/reflex_chakra/components/feedback/spinner.pyi +++ b/reflex_chakra/components/feedback/spinner.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/feedback/spinner.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Spinner(ChakraComponent): @overload @@ -16,77 +23,41 @@ class Spinner(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + empty_color: Var[str] | str | None = None, + label: Var[str] | str | None = None, + speed: Var[str] | str | None = None, + thickness: Var[int] | int | None = None, + size: Literal["lg", "md", "sm", "xl", "xs"] + | Var[Literal["lg", "md", "sm", "xl", "xs"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Spinner: + """""" ... diff --git a/reflex_chakra/components/forms/__init__.py b/reflex_chakra/components/forms/__init__.py index b3a4b1b..96015ab 100644 --- a/reflex_chakra/components/forms/__init__.py +++ b/reflex_chakra/components/forms/__init__.py @@ -4,7 +4,6 @@ from .checkbox import Checkbox, CheckboxGroup from .colormodeswitch import ( ColorModeButton, - color_mode_icon, ColorModeScript, ColorModeSwitch, ) @@ -22,8 +21,6 @@ InputRightAddon, InputRightElement, ) -from .multiselect import Option as MultiSelectOption -from .multiselect import Select as MultiSelect from .numberinput import ( NumberDecrementStepper, NumberIncrementStepper, @@ -46,4 +43,55 @@ from .textarea import TextArea from .time_picker import TimePicker -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore +__all__ = [ + "Button", + "ButtonGroup", + "Checkbox", + "CheckboxGroup", + "ColorModeButton", + "ColorModeScript", + "ColorModeSwitch", + "DatePicker", + "DateTimePicker", + "Editable", + "EditableInput", + "EditablePreview", + "EditableTextarea", + "Email", + "Form", + "FormControl", + "FormErrorMessage", + "FormHelperText", + "FormLabel", + "IconButton", + "Input", + "InputGroup", + "InputLeftAddon", + "InputLeftElement", + "InputRightAddon", + "InputRightElement", + "NumberDecrementStepper", + "NumberIncrementStepper", + "NumberInput", + "NumberInputField", + "NumberInputStepper", + "Option", + "Password", + "PinInput", + "PinInputField", + "Radio", + "RadioGroup", + "RangeSlider", + "RangeSliderFilledTrack", + "RangeSliderThumb", + "RangeSliderTrack", + "Select", + "Slider", + "SliderFilledTrack", + "SliderMark", + "SliderThumb", + "SliderTrack", + "Switch", + "TextArea", + "TimePicker", +] diff --git a/reflex_chakra/components/forms/button.py b/reflex_chakra/components/forms/button.py index 1ed9345..0d51307 100644 --- a/reflex_chakra/components/forms/button.py +++ b/reflex_chakra/components/forms/button.py @@ -1,7 +1,6 @@ """A button component.""" -from typing import List - +from typing import ClassVar from reflex_chakra.components import ( ChakraComponent, LiteralButtonSize, @@ -9,7 +8,7 @@ LiteralColorScheme, LiteralSpinnerPlacement, ) -from reflex.vars import Var +from reflex.vars.base import Var class Button(ChakraComponent): @@ -56,7 +55,7 @@ class Button(ChakraComponent): type_: Var[str] # Components that are not allowed as children. - _invalid_children: List[str] = ["Button", "MenuButton"] + _invalid_children: ClassVar[list[str]] = ["Button", "MenuButton"] # The name of the form field name: Var[str] diff --git a/reflex_chakra/components/forms/button.pyi b/reflex_chakra/components/forms/button.pyi index 3c1816e..316860a 100644 --- a/reflex_chakra/components/forms/button.pyi +++ b/reflex_chakra/components/forms/button.pyi @@ -1,16 +1,23 @@ -"""Stub file for reflex/components/chakra/forms/button.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Button(ChakraComponent): @overload @@ -18,144 +25,98 @@ class Button(ChakraComponent): 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"], + icon_spacing: Var[int] | int | None = None, + is_active: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_full_width: Var[bool] | bool | None = None, + is_loading: Var[bool] | bool | None = None, + loading_text: Var[str] | str | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + variant: Literal["ghost", "link", "outline", "solid", "unstyled"] + | Var[Literal["ghost", "link", "outline", "solid", "unstyled"]] + | None = None, + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + spinner_placement: Literal["end", "start"] + | Var[Literal["end", "start"]] + | None = None, + type_: Var[str] | str | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Button: + """""" ... class ButtonGroup(ChakraComponent): @@ -164,79 +125,43 @@ class ButtonGroup(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_attached: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + spacing: Var[int] | int | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + variant: Literal["ghost", "link", "outline", "solid", "unstyled"] + | Var[Literal["ghost", "link", "outline", "solid", "unstyled"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ButtonGroup: + """""" ... diff --git a/reflex_chakra/components/forms/checkbox.py b/reflex_chakra/components/forms/checkbox.py index 8c06a0d..9574046 100644 --- a/reflex_chakra/components/forms/checkbox.py +++ b/reflex_chakra/components/forms/checkbox.py @@ -8,7 +8,7 @@ LiteralTagSize, ) from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Checkbox(ChakraComponent): diff --git a/reflex_chakra/components/forms/checkbox.pyi b/reflex_chakra/components/forms/checkbox.pyi index 20c0ab0..93110e0 100644 --- a/reflex_chakra/components/forms/checkbox.pyi +++ b/reflex_chakra/components/forms/checkbox.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/checkbox.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Checkbox(ChakraComponent): @overload @@ -16,138 +23,93 @@ class Checkbox(ChakraComponent): 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", - ], + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + size: Literal["lg", "md", "sm"] | Var[Literal["lg", "md", "sm"]] | None = None, + is_checked: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_focusable: Var[bool] | bool | None = None, + is_indeterminate: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + name: Var[str] | str | None = None, + value: Var[str] | str | None = None, + spacing: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Checkbox: + """""" ... class CheckboxGroup(ChakraComponent): @@ -156,70 +118,38 @@ class CheckboxGroup(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_native: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> CheckboxGroup: + """""" ... diff --git a/reflex_chakra/components/forms/colormodeswitch.pyi b/reflex_chakra/components/forms/colormodeswitch.pyi index 9ff616c..25b929b 100644 --- a/reflex_chakra/components/forms/colormodeswitch.pyi +++ b/reflex_chakra/components/forms/colormodeswitch.pyi @@ -1,17 +1,23 @@ -"""Stub file for reflex/components/chakra/forms/colormodeswitch.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent from reflex_chakra.components.media.icon import Icon from reflex.components.component import BaseComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var - from .button import Button from .switch import Switch @@ -19,19 +25,9 @@ DEFAULT_LIGHT_ICON: Icon DEFAULT_DARK_ICON: Icon def color_mode_icon( - light_component: Optional[Union[BaseComponent, None]] = None, - dark_component: Optional[Union[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 - """ - ... + light_component: BaseComponent | None = None, + dark_component: BaseComponent | None = None, +): ... class ColorModeSwitch(Switch): @overload @@ -39,108 +35,91 @@ class ColorModeSwitch(Switch): 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", - ], + is_checked: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_focusable: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + name: Var[str] | str | None = None, + value: Var[str] | str | None = None, + spacing: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "ColorModeSwitch": + ) -> ColorModeSwitch: """Create a switch component bound to color_mode. Args: @@ -156,17 +135,18 @@ class ColorModeSwitch(Switch): 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.) + on_change: Fired when the switch value changes style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The switch component.""" ... class ColorModeButton(Button): @@ -175,117 +155,97 @@ class ColorModeButton(Button): 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"], + icon_spacing: Var[int] | int | None = None, + is_active: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_full_width: Var[bool] | bool | None = None, + is_loading: Var[bool] | bool | None = None, + loading_text: Var[str] | str | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + variant: Literal["ghost", "link", "outline", "solid", "unstyled"] + | Var[Literal["ghost", "link", "outline", "solid", "unstyled"]] + | None = None, + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + spinner_placement: Literal["end", "start"] + | Var[Literal["end", "start"]] + | None = None, + type_: Var[str] | str | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "ColorModeButton": + ) -> ColorModeButton: """Create a button component that calls toggle_color_mode on click. Args: @@ -305,14 +265,14 @@ class ColorModeButton(Button): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The switch component.""" ... class ColorModeScript(ChakraComponent): @@ -321,62 +281,34 @@ class ColorModeScript(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ColorModeScript: + """""" ... diff --git a/reflex_chakra/components/forms/date_picker.py b/reflex_chakra/components/forms/date_picker.py index 9aed7ff..2344623 100644 --- a/reflex_chakra/components/forms/date_picker.py +++ b/reflex_chakra/components/forms/date_picker.py @@ -1,7 +1,7 @@ """A date input component.""" from reflex_chakra.components.forms.input import Input -from reflex.vars import Var +from reflex.vars.base import Var class DatePicker(Input): diff --git a/reflex_chakra/components/forms/date_picker.pyi b/reflex_chakra/components/forms/date_picker.pyi index 7f3923e..3b5b1e5 100644 --- a/reflex_chakra/components/forms/date_picker.pyi +++ b/reflex_chakra/components/forms/date_picker.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/date_picker.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class DatePicker(Input): @overload @@ -16,74 +23,55 @@ class DatePicker(Input): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type_: Var[str] | str | None = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[Any] | None = None, + on_key_down: EventType[Any] | None = None, + on_key_up: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "DatePicker": + ) -> DatePicker: """Create an Input component. Args: @@ -101,15 +89,20 @@ class DatePicker(Input): variant: "outline" | "filled" | "flushed" | "unstyled" size: "lg" | "md" | "sm" | "xs" name: The name of the form field + on_change: Fired when the input value changes. + on_focus: Fired when the input is focused. + on_blur: Fired when the input lose focus. + on_key_down: Fired when a key is pressed down. + on_key_up: Fired when a key is released. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... diff --git a/reflex_chakra/components/forms/date_time_picker.py b/reflex_chakra/components/forms/date_time_picker.py index 3d45b49..b93e226 100644 --- a/reflex_chakra/components/forms/date_time_picker.py +++ b/reflex_chakra/components/forms/date_time_picker.py @@ -1,7 +1,7 @@ """A datetime-local input component.""" from reflex_chakra.components.forms.input import Input -from reflex.vars import Var +from reflex.vars.base import Var class DateTimePicker(Input): diff --git a/reflex_chakra/components/forms/date_time_picker.pyi b/reflex_chakra/components/forms/date_time_picker.pyi index b8c6972..05dc13d 100644 --- a/reflex_chakra/components/forms/date_time_picker.pyi +++ b/reflex_chakra/components/forms/date_time_picker.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/date_time_picker.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class DateTimePicker(Input): @overload @@ -16,74 +23,55 @@ class DateTimePicker(Input): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type_: Var[str] | str | None = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[Any] | None = None, + on_key_down: EventType[Any] | None = None, + on_key_up: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "DateTimePicker": + ) -> DateTimePicker: """Create an Input component. Args: @@ -101,15 +89,20 @@ class DateTimePicker(Input): variant: "outline" | "filled" | "flushed" | "unstyled" size: "lg" | "md" | "sm" | "xs" name: The name of the form field + on_change: Fired when the input value changes. + on_focus: Fired when the input is focused. + on_blur: Fired when the input lose focus. + on_key_down: Fired when a key is pressed down. + on_key_up: Fired when a key is released. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... diff --git a/reflex_chakra/components/forms/editable.py b/reflex_chakra/components/forms/editable.py index 5f5032f..dcac25e 100644 --- a/reflex_chakra/components/forms/editable.py +++ b/reflex_chakra/components/forms/editable.py @@ -4,7 +4,7 @@ from reflex_chakra.components import ChakraComponent from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Editable(ChakraComponent): diff --git a/reflex_chakra/components/forms/editable.pyi b/reflex_chakra/components/forms/editable.pyi index d4e079f..10af2fe 100644 --- a/reflex_chakra/components/forms/editable.pyi +++ b/reflex_chakra/components/forms/editable.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/forms/editable.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Editable(ChakraComponent): @overload @@ -16,84 +22,48 @@ class Editable(ChakraComponent): 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, Var]] = None, - on_cancel: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_edit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_disabled: Var[bool] | bool | None = None, + is_preview_focusable: Var[bool] | bool | None = None, + placeholder: Var[str] | str | None = None, + select_all_on_focus: Var[bool] | bool | None = None, + start_with_edit_view: Var[bool] | bool | None = None, + submit_on_blur: Var[bool] | bool | None = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_cancel: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_edit: EventType[Any] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_submit: EventType[Any] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Editable: + """""" ... class EditableInput(ChakraComponent): @@ -102,64 +72,36 @@ class EditableInput(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> EditableInput: + """""" ... class EditableTextarea(ChakraComponent): @@ -168,64 +110,36 @@ class EditableTextarea(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> EditableTextarea: + """""" ... class EditablePreview(ChakraComponent): @@ -234,62 +148,34 @@ class EditablePreview(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> EditablePreview: + """""" ... diff --git a/reflex_chakra/components/forms/email.py b/reflex_chakra/components/forms/email.py index bd0e9f2..e1181cd 100644 --- a/reflex_chakra/components/forms/email.py +++ b/reflex_chakra/components/forms/email.py @@ -1,7 +1,7 @@ """An email input component.""" from reflex_chakra.components.forms.input import Input -from reflex.vars import Var +from reflex.vars.base import Var class Email(Input): diff --git a/reflex_chakra/components/forms/email.pyi b/reflex_chakra/components/forms/email.pyi index 4c6e6fa..c59dd6a 100644 --- a/reflex_chakra/components/forms/email.pyi +++ b/reflex_chakra/components/forms/email.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/email.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Email(Input): @overload @@ -16,74 +23,55 @@ class Email(Input): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type_: Var[str] | str | None = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[Any] | None = None, + on_key_down: EventType[Any] | None = None, + on_key_up: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Email": + ) -> Email: """Create an Input component. Args: @@ -101,15 +89,20 @@ class Email(Input): variant: "outline" | "filled" | "flushed" | "unstyled" size: "lg" | "md" | "sm" | "xs" name: The name of the form field + on_change: Fired when the input value changes. + on_focus: Fired when the input is focused. + on_blur: Fired when the input lose focus. + on_key_down: Fired when a key is pressed down. + on_key_up: Fired when a key is released. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... diff --git a/reflex_chakra/components/forms/form.py b/reflex_chakra/components/forms/form.py index bb0a1fc..969254d 100644 --- a/reflex_chakra/components/forms/form.py +++ b/reflex_chakra/components/forms/form.py @@ -5,7 +5,7 @@ from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.components.el.elements.forms import Form as HTMLForm -from reflex.vars import Var +from reflex.vars.base import Var class Form(ChakraComponent, HTMLForm): diff --git a/reflex_chakra/components/forms/form.pyi b/reflex_chakra/components/forms/form.pyi index 52465bd..3ee0254 100644 --- a/reflex_chakra/components/forms/form.pyi +++ b/reflex_chakra/components/forms/form.pyi @@ -1,15 +1,22 @@ -"""Stub file for reflex/components/chakra/forms/form.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components 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 Var class Form(ChakraComponent, HTMLForm): @overload @@ -17,133 +24,230 @@ class Form(ChakraComponent, HTMLForm): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + as_: Var[str] | str | None = None, + accept: Var[str] | str | None = None, + accept_charset: Var[str] | str | None = None, + action: Var[str] | str | None = None, + auto_complete: Var[str] | str | None = None, + enc_type: Var[str] | str | None = None, + method: Var[str] | str | None = None, + name: Var[str] | str | None = None, + no_validate: Var[bool] | bool | None = None, + target: Var[str] | str | None = None, + reset_on_submit: Var[bool] | bool | None = None, + handle_submit_unique_name: Var[str] | str | None = None, + access_key: Var[str] | str | None = None, + auto_capitalize: Literal[ + "characters", "none", "off", "on", "sentences", "words" + ] + | Var[Literal["characters", "none", "off", "on", "sentences", "words"]] + | None = None, + content_editable: Literal["inherit", "plaintext-only", False, True] + | Var[Literal["inherit", "plaintext-only", False, True]] + | None = None, + context_menu: Var[str] | str | None = None, + dir: Var[str] | str | None = None, + draggable: Var[bool] | bool | None = None, + enter_key_hint: Literal[ + "done", "enter", "go", "next", "previous", "search", "send" + ] + | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]] + | None = None, + hidden: Var[bool] | bool | None = None, + input_mode: Literal[ + "decimal", "email", "none", "numeric", "search", "tel", "text", "url" + ] + | Var[ + Literal[ + "decimal", "email", "none", "numeric", "search", "tel", "text", "url" + ] + ] + | None = None, + item_prop: Var[str] | str | None = None, + lang: Var[str] | str | None = None, + role: Literal[ + "alert", + "alertdialog", + "application", + "article", + "banner", + "button", + "cell", + "checkbox", + "columnheader", + "combobox", + "complementary", + "contentinfo", + "definition", + "dialog", + "directory", + "document", + "feed", + "figure", + "form", + "grid", + "gridcell", + "group", + "heading", + "img", + "link", + "list", + "listbox", + "listitem", + "log", + "main", + "marquee", + "math", + "menu", + "menubar", + "menuitem", + "menuitemcheckbox", + "menuitemradio", + "navigation", + "none", + "note", + "option", + "presentation", + "progressbar", + "radio", + "radiogroup", + "region", + "row", + "rowgroup", + "rowheader", + "scrollbar", + "search", + "searchbox", + "separator", + "slider", + "spinbutton", + "status", + "switch", + "tab", + "table", + "tablist", + "tabpanel", + "term", + "textbox", + "timer", + "toolbar", + "tooltip", + "tree", + "treegrid", + "treeitem", + ] + | Var[ + Literal[ + "alert", + "alertdialog", + "application", + "article", + "banner", + "button", + "cell", + "checkbox", + "columnheader", + "combobox", + "complementary", + "contentinfo", + "definition", + "dialog", + "directory", + "document", + "feed", + "figure", + "form", + "grid", + "gridcell", + "group", + "heading", + "img", + "link", + "list", + "listbox", + "listitem", + "log", + "main", + "marquee", + "math", + "menu", + "menubar", + "menuitem", + "menuitemcheckbox", + "menuitemradio", + "navigation", + "none", + "note", + "option", + "presentation", + "progressbar", + "radio", + "radiogroup", + "region", + "row", + "rowgroup", + "rowheader", + "scrollbar", + "search", + "searchbox", + "separator", + "slider", + "spinbutton", + "status", + "switch", + "tab", + "table", + "tablist", + "tabpanel", + "term", + "textbox", + "timer", + "toolbar", + "tooltip", + "tree", + "treegrid", + "treeitem", + ] + ] + | None = None, + slot: Var[str] | str | None = None, + spell_check: Var[bool] | bool | None = None, + tab_index: Var[int] | int | None = None, + title: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_submit: EventType[()] + | EventType[dict[str, Any]] + | (EventType[()] | EventType[dict[str, str]]) + | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Form: + """""" ... class FormControl(ChakraComponent): @@ -156,53 +260,39 @@ class FormControl(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "FormControl": + ) -> FormControl: """Create a form control component. Args: @@ -218,6 +308,7 @@ class FormControl(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -227,8 +318,7 @@ class FormControl(ChakraComponent): AttributeError: raise an error if missing required kwargs. Returns: - The form control component. - """ + The form control component.""" ... class FormHelperText(ChakraComponent): @@ -237,64 +327,36 @@ class FormHelperText(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> FormHelperText: + """""" ... class FormLabel(ChakraComponent): @@ -303,66 +365,37 @@ class FormLabel(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + html_for: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> FormLabel: + """""" ... class FormErrorMessage(ChakraComponent): @@ -371,62 +404,34 @@ class FormErrorMessage(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> FormErrorMessage: + """""" ... diff --git a/reflex_chakra/components/forms/iconbutton.py b/reflex_chakra/components/forms/iconbutton.py index 42dcd2f..da062f6 100644 --- a/reflex_chakra/components/forms/iconbutton.py +++ b/reflex_chakra/components/forms/iconbutton.py @@ -1,10 +1,8 @@ """An icon button component.""" -from typing import Optional - from reflex_chakra.components.typography.text import Text from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class IconButton(Text): @@ -20,7 +18,7 @@ class IconButton(Text): aria_label: Var[str] # The icon to be used in the button. - icon: Optional[Component] + icon: Var[Component] # If true, the button will be styled in its active state. is_active: Var[bool] diff --git a/reflex_chakra/components/forms/iconbutton.pyi b/reflex_chakra/components/forms/iconbutton.pyi index 60329e7..1ff3970 100644 --- a/reflex_chakra/components/forms/iconbutton.pyi +++ b/reflex_chakra/components/forms/iconbutton.pyi @@ -1,15 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/iconbutton.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components.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 Var class IconButton(Text): @overload @@ -17,82 +23,44 @@ class IconButton(Text): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type: Var[str] | str | None = None, + aria_label: Var[str] | str | None = None, + icon: Component | Var[Component] | None = None, + is_active: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_loading: Var[bool] | bool | None = None, + is_round: Var[bool] | bool | None = None, + spinner: Var[str] | str | None = None, + as_: Var[str] | str | None = None, + no_of_lines: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> IconButton: + """""" ... diff --git a/reflex_chakra/components/forms/input.py b/reflex_chakra/components/forms/input.py index 4b9ae31..0ac41ef 100644 --- a/reflex_chakra/components/forms/input.py +++ b/reflex_chakra/components/forms/input.py @@ -11,7 +11,7 @@ from reflex.constants import MemoizationMode from reflex.event import EventHandler from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var class Input(ChakraComponent): diff --git a/reflex_chakra/components/forms/input.pyi b/reflex_chakra/components/forms/input.pyi index 4b86092..725c13c 100644 --- a/reflex_chakra/components/forms/input.pyi +++ b/reflex_chakra/components/forms/input.pyi @@ -1,17 +1,24 @@ -"""Stub file for reflex/components/chakra/forms/input.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var class Input(ChakraComponent): def add_imports(self) -> ImportDict: ... @@ -20,127 +27,105 @@ class Input(ChakraComponent): 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"], + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + type_: Literal[ + "button", + "checkbox", + "color", + "date", + "datetime-local", + "email", + "file", + "hidden", + "image", + "month", + "number", + "password", + "radio", + "range", + "reset", + "search", + "submit", + "tel", + "text", + "time", + "url", + "week", + ] + | 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", ] - ] = 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[Any] | None = None, + on_key_down: EventType[Any] | None = None, + on_key_up: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Input": + ) -> Input: """Create an Input component. Args: @@ -158,17 +143,22 @@ class Input(ChakraComponent): variant: "outline" | "filled" | "flushed" | "unstyled" size: "lg" | "md" | "sm" | "xs" name: The name of the form field + on_change: Fired when the input value changes. + on_focus: Fired when the input is focused. + on_blur: Fired when the input lose focus. + on_key_down: Fired when a key is pressed down. + on_key_up: Fired when a key is released. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... class InputGroup(ChakraComponent): @@ -177,64 +167,36 @@ class InputGroup(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> InputGroup: + """""" ... class InputLeftAddon(ChakraComponent): @@ -243,64 +205,36 @@ class InputLeftAddon(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> InputLeftAddon: + """""" ... class InputRightAddon(ChakraComponent): @@ -309,64 +243,36 @@ class InputRightAddon(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> InputRightAddon: + """""" ... class InputLeftElement(ChakraComponent): @@ -375,64 +281,36 @@ class InputLeftElement(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> InputLeftElement: + """""" ... class InputRightElement(ChakraComponent): @@ -441,62 +319,34 @@ class InputRightElement(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> InputRightElement: + """""" ... diff --git a/reflex_chakra/components/forms/multiselect.py b/reflex_chakra/components/forms/multiselect.py deleted file mode 100644 index 08315fa..0000000 --- a/reflex_chakra/components/forms/multiselect.py +++ /dev/null @@ -1,353 +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(f"{e0}.map(e => e.value)", _var_is_string=False)] - if self.is_multi.equals(Var.create(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_chakra/components/forms/multiselect.pyi b/reflex_chakra/components/forms/multiselect.pyi deleted file mode 100644 index a108865..0000000 --- a/reflex_chakra/components/forms/multiselect.pyi +++ /dev/null @@ -1,199 +0,0 @@ -"""Stub file for reflex/components/chakra/forms/multiselect.py""" -# ------------------- DO NOT EDIT ---------------------- -# This file was generated by `scripts/pyi_generator.py`! -# ------------------------------------------------------ - -from typing import Any, Dict, Literal, Optional, Union, overload -from reflex.vars import Var, BaseVar, ComputedVar -from reflex.event import EventChain, EventHandler, EventSpec -from reflex.style import Style -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): - label: str - value: Any - variant: Optional[str] - -class Select(Component): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... - @classmethod - def get_initial_props(cls) -> Set[str]: ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - auto_focus: Optional[Union[Var[bool], bool]] = None, - backspace_removes_value: Optional[Union[Var[bool], bool]] = None, - blur_input_on_select: Optional[Union[Var[bool], bool]] = None, - capture_menu_scroll: Optional[Union[Var[bool], bool]] = None, - chakra_styles: Optional[Union[Var[str], str]] = None, - close_menu_on_select: Optional[Union[Var[bool], bool]] = None, - close_menu_on_scroll: Optional[Union[Var[bool], bool]] = None, - color_scheme: Optional[Union[Var[str], str]] = None, - components: Optional[ - Union[Var[Dict[str, Component]], Dict[str, Component]] - ] = None, - control_should_render_value: Optional[Union[Var[bool], bool]] = None, - delimiter: Optional[Union[Var[str], str]] = None, - error_border_color: Optional[Union[Var[str], str]] = None, - escape_clears_value: Optional[Union[Var[bool], bool]] = None, - focus_border_color: Optional[Union[Var[str], str]] = None, - form: Optional[Union[Var[str], str]] = None, - hide_selected_options: Optional[Union[Var[bool], bool]] = None, - input_value: Optional[Union[Var[str], str]] = None, - input_id: Optional[Union[Var[str], str]] = None, - is_clearable: Optional[Union[Var[bool], bool]] = None, - is_disabled: Optional[Union[Var[bool], bool]] = None, - is_invalid: Optional[Union[Var[bool], bool]] = None, - is_multi: Optional[Union[Var[bool], bool]] = None, - is_read_only: Optional[Union[Var[bool], bool]] = None, - is_rtl: Optional[Union[Var[bool], bool]] = None, - is_searchable: Optional[Union[Var[bool], bool]] = None, - min_menu_height: Optional[Union[Var[int], int]] = None, - max_menu_height: Optional[Union[Var[int], int]] = None, - menu_placement: Optional[Union[Var[str], str]] = None, - menu_position: Optional[Union[Var[str], str]] = None, - menu_should_block_scroll: Optional[Union[Var[bool], bool]] = None, - menu_should_scroll_into_view: Optional[Union[Var[bool], bool]] = None, - name: Optional[Union[Var[str], str]] = None, - open_menu_on_focus: Optional[Union[Var[bool], bool]] = None, - open_menu_on_click: Optional[Union[Var[bool], bool]] = None, - options: Optional[Union[Var[List[Dict]], List[Dict]]] = None, - page_size: Optional[Union[Var[int], int]] = None, - placeholder: Optional[Union[Var[Optional[str]], Optional[str]]] = None, - required: Optional[Union[Var[bool], bool]] = None, - selected_option_color_scheme: Optional[Union[Var[str], str]] = None, - selected_option_style: Optional[Union[Var[str], str]] = None, - size: Optional[Union[Var[str], str]] = None, - tab_index: Optional[Union[Var[int], int]] = None, - tab_selects_value: Optional[Union[Var[bool], bool]] = None, - tag_variant: Optional[Union[Var[str], str]] = None, - unstyled: Optional[Union[Var[bool], bool]] = None, - use_basic_style: Optional[Union[Var[bool], bool]] = None, - variant: 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, function, BaseVar] - ] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props, - ) -> "Select": - """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. - auto_focus: Focus the control when it is mounted - backspace_removes_value: Remove the currently focused option when the user presses backspace when Select isClearable or isMulti - blur_input_on_select: Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) - capture_menu_scroll: When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent - chakra_styles: [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 - close_menu_on_select: Close the select menu when the user selects an option - close_menu_on_scroll: If true, close the select menu when the user scrolls the document/body. - color_scheme: [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" - components: 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. - control_should_render_value: Whether the value of the select, e.g. SingleValue, should be displayed in the control. - delimiter: Delimiter used to join multiple values into a single HTML Input value - error_border_color: [chakra] Colors the component border with the given chakra color string on error state default: "red.500" - escape_clears_value: Clear all values when the user presses escape AND the menu is closed - focus_border_color: [chakra] Colors the component border with the given chakra color string on focus default: "blue.500" - form: Sets the form attribute on the input - hide_selected_options: Hide the selected option from the menu - input_value: The id to set on the SelectContainer component. id: Var[str] The value of the search input - input_id: The id of the search input - is_clearable: Is the select value clearable - is_disabled: Is the select disabled - is_invalid: [chakra] Style component in the chakra invalid style default: False - is_multi: Support multiple selected options - is_read_only: [chakra] Style component as disabled (chakra style) default: False - is_rtl: Is the select direction right-to-left - is_searchable: Whether to enable search functionality - min_menu_height: Minimum height of the menu before flipping - max_menu_height: Maximum height of the menu before scrolling - menu_placement: 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_position: How the options should be displayed in the menu. - menu_should_block_scroll: Whether to block scroll events when the menu is open - menu_should_scroll_into_view: Whether the menu should be scrolled into view when it opens - name: Name of the HTML Input (optional - without this, no input will be rendered) - open_menu_on_focus: Allows control of whether the menu is opened when the Select is focused - open_menu_on_click: Allows control of whether the menu is opened when the Select is clicked - options: Array of options that populate the select menu - page_size: Number of options to jump in menu when page{up|down} keys are used - placeholder: Placeholder for the select value - required: Marks the value-holding input as required for form validation - selected_option_color_scheme: [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_style: [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" - size: [chakra] The size of the component. options: "sm" | "md" | "lg" default: "md" - tab_index: Sets the tabIndex attribute on the input - tab_selects_value: Select the currently focused option when the user presses tab - tag_variant: [chakra] Variant of multi-select tags options: "subtle" | "solid" | "outline" default: "subtle" - unstyled: Remove all non-essential styles - use_basic_style: [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 - variant: [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" - 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: Additional properties to be passed to the Select component. - - Returns: - The `create` method is returning an instance of the `Select` class. - """ - ... diff --git a/reflex_chakra/components/forms/numberinput.py b/reflex_chakra/components/forms/numberinput.py index b29d967..65e3e0d 100644 --- a/reflex_chakra/components/forms/numberinput.py +++ b/reflex_chakra/components/forms/numberinput.py @@ -9,7 +9,7 @@ ) from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class NumberInput(ChakraComponent): diff --git a/reflex_chakra/components/forms/numberinput.pyi b/reflex_chakra/components/forms/numberinput.pyi index 2456851..07f269b 100644 --- a/reflex_chakra/components/forms/numberinput.pyi +++ b/reflex_chakra/components/forms/numberinput.pyi @@ -1,17 +1,24 @@ -"""Stub file for reflex/components/chakra/forms/numberinput.py""" +"""Stub file for reflex_chakra/components/forms/numberinput.py""" # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from numbers import Number -from typing import Any, Callable, Dict, Literal, Optional, Union, overload - from reflex_chakra.components import ( ChakraComponent, ) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class NumberInput(ChakraComponent): @overload @@ -19,75 +26,58 @@ class NumberInput(ChakraComponent): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Number | Var[Number] | None = None, + allow_mouse_wheel: Var[bool] | bool | None = None, + clamped_value_on_blur: Var[bool] | bool | None = None, + default_value: Number | Var[Number] | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + focus_input_on_change: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + is_valid_character: Var[str] | str | None = None, + keep_within_range: Var[bool] | bool | None = None, + max_: Number | Var[Number] | None = None, + min_: Number | Var[Number] | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "NumberInput": + ) -> NumberInput: """Create a number input component. If no children are provided, a default stepper will be used. @@ -101,7 +91,7 @@ class NumberInput(ChakraComponent): 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_disabled: 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 @@ -112,17 +102,18 @@ class NumberInput(ChakraComponent): variant: "outline" | "filled" | "flushed" | "unstyled" size: "lg" | "md" | "sm" | "xs" name: The name of the form field + on_change: Fired when the input value changes. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... class NumberInputField(ChakraComponent): @@ -131,64 +122,36 @@ class NumberInputField(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> NumberInputField: + """""" ... class NumberInputStepper(ChakraComponent): @@ -197,64 +160,36 @@ class NumberInputStepper(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> NumberInputStepper: + """""" ... class NumberIncrementStepper(ChakraComponent): @@ -263,64 +198,36 @@ class NumberIncrementStepper(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> NumberIncrementStepper: + """""" ... class NumberDecrementStepper(ChakraComponent): @@ -329,62 +236,34 @@ class NumberDecrementStepper(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> NumberDecrementStepper: + """""" ... diff --git a/reflex_chakra/components/forms/password.py b/reflex_chakra/components/forms/password.py index 5ddbc52..847b8ca 100644 --- a/reflex_chakra/components/forms/password.py +++ b/reflex_chakra/components/forms/password.py @@ -1,7 +1,7 @@ """A password input component.""" from reflex_chakra.components.forms.input import Input -from reflex.vars import Var +from reflex.vars.base import Var class Password(Input): diff --git a/reflex_chakra/components/forms/password.pyi b/reflex_chakra/components/forms/password.pyi index cfe48ce..6bc9c63 100644 --- a/reflex_chakra/components/forms/password.pyi +++ b/reflex_chakra/components/forms/password.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/password.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Password(Input): @overload @@ -16,74 +23,55 @@ class Password(Input): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type_: Var[str] | str | None = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[Any] | None = None, + on_key_down: EventType[Any] | None = None, + on_key_up: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Password": + ) -> Password: """Create an Input component. Args: @@ -101,15 +89,20 @@ class Password(Input): variant: "outline" | "filled" | "flushed" | "unstyled" size: "lg" | "md" | "sm" | "xs" name: The name of the form field + on_change: Fired when the input value changes. + on_focus: Fired when the input is focused. + on_blur: Fired when the input lose focus. + on_key_down: Fired when a key is pressed down. + on_key_up: Fired when a key is released. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... diff --git a/reflex_chakra/components/forms/pininput.py b/reflex_chakra/components/forms/pininput.py index fcf95d4..19cb008 100644 --- a/reflex_chakra/components/forms/pininput.py +++ b/reflex_chakra/components/forms/pininput.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Optional import reflex as rx from reflex_chakra.components import ChakraComponent, LiteralInputVariant @@ -10,8 +9,8 @@ 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 +from reflex.utils.imports import ParsedImportDict, merge_imports +from reflex.vars.base import Var class PinInput(ChakraComponent): @@ -70,7 +69,7 @@ class PinInput(ChakraComponent): # Fired when the pin input is completed. on_complete: EventHandler[lambda e0: [e0]] - def _get_imports(self) -> ImportDict: + def _get_imports(self) -> ParsedImportDict: """Include PinInputField explicitly because it may not be a child component at compile time. Returns: @@ -102,7 +101,7 @@ def get_ref(self) -> str | None: return format.format_array_ref(self.id, idx=self.length) return super().get_ref() - def _get_ref_hook(self) -> Optional[str]: + def _get_ref_hook(self): """Override the base _get_ref_hook to handle array refs. Returns: @@ -110,14 +109,13 @@ def _get_ref_hook(self) -> Optional[str]: """ if self.id: ref = format.format_array_ref(self.id, None) - refs_declaration = Var.create( - f"{str(Var.range(self.length))}.map(() => useRef(null))", - _var_is_string=False, + refs_declaration = Var.range(self.length.to(int)).foreach( + lambda _: Var("useRef(null)") ) if ref: - return ( + return Var( f"const {ref} = {str(refs_declaration)}; " - f"{str(Var.create(ref, _var_is_string=False).as_ref())} = {ref}" + f"{Var(ref)._as_ref()!s} = {ref}" ) return super()._get_ref_hook() @@ -192,7 +190,7 @@ def _create(i): _create, ) - def _get_ref_hook(self) -> Optional[str]: + def _get_ref_hook(self) -> None: return None def get_ref(self): diff --git a/reflex_chakra/components/forms/pininput.pyi b/reflex_chakra/components/forms/pininput.pyi index 99f0e85..4c890ad 100644 --- a/reflex_chakra/components/forms/pininput.pyi +++ b/reflex_chakra/components/forms/pininput.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/pininput.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class PinInput(ChakraComponent): def get_ref(self) -> str | None: ... @@ -17,73 +24,54 @@ class PinInput(ChakraComponent): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Var[str] | str | None = None, + auto_focus: Var[bool] | bool | None = None, + default_value: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + id_: Var[str] | str | None = None, + length: Var[int] | int | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + manage_focus: Var[bool] | bool | None = None, + mask: Var[bool] | bool | None = None, + placeholder: Var[str] | str | None = None, + type_: Var[str] | str | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_complete: EventType[Any] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "PinInput": + ) -> PinInput: """Create a pin input component. If no children are passed in, the component will create a default pin input @@ -106,17 +94,19 @@ class PinInput(ChakraComponent): type_: The type of values the pin-input should allow ("number" | "alphanumeric"). variant: "outline" | "flushed" | "filled" | "unstyled" name: The name of the form field + on_change: Fired when the pin input is changed. + on_complete: Fired when the pin input is completed. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The pin input component.""" ... class PinInputField(ChakraComponent): @@ -128,66 +118,36 @@ class PinInputField(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + index: Var[int | None] | int | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PinInputField: + """""" ... diff --git a/reflex_chakra/components/forms/radio.py b/reflex_chakra/components/forms/radio.py index f5ec24b..995c76b 100644 --- a/reflex_chakra/components/forms/radio.py +++ b/reflex_chakra/components/forms/radio.py @@ -1,6 +1,6 @@ """A radio component.""" -from typing import Any, List +from typing import Any from reflex_chakra.components import ChakraComponent from reflex_chakra.components.typography.text import Text @@ -8,7 +8,7 @@ from reflex.components.core.foreach import Foreach from reflex.event import EventHandler from reflex.utils.types import _issubclass -from reflex.vars import Var +from reflex.vars.base import Var class RadioGroup(ChakraComponent): @@ -44,7 +44,7 @@ def create(cls, *children, **props) -> Component: if ( len(children) == 1 and isinstance(children[0], Var) - and _issubclass(children[0]._var_type, List) + and _issubclass(children[0]._var_type, list) ): children = [Foreach.create(children[0], lambda item: Radio.create(item))] return super().create(*children, **props) diff --git a/reflex_chakra/components/forms/radio.pyi b/reflex_chakra/components/forms/radio.pyi index 6e07a97..5ce633f 100644 --- a/reflex_chakra/components/forms/radio.pyi +++ b/reflex_chakra/components/forms/radio.pyi @@ -1,15 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/radio.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent from reflex_chakra.components.typography.text import Text -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class RadioGroup(ChakraComponent): @overload @@ -17,53 +23,39 @@ class RadioGroup(ChakraComponent): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Any | Var[Any] | None = None, + default_value: Any | Var[Any] | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "RadioGroup": + ) -> RadioGroup: """Create a radio group component. Args: @@ -71,17 +63,18 @@ class RadioGroup(ChakraComponent): value: State var to bind the input. default_value: The default value. name: The name of the form field + on_change: Fired when the radio group value changes. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... class Radio(Text): @@ -90,60 +83,46 @@ class Radio(Text): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Any | Var[Any] | None = None, + default_value: Any | Var[Any] | None = None, + color_scheme: Var[str] | str | None = None, + default_checked: Var[bool] | bool | None = None, + is_checked: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + as_: Var[str] | str | None = None, + no_of_lines: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Radio": + ) -> Radio: """Create a radio component. By default, the value is bound to the first child. @@ -164,12 +143,12 @@ class Radio(Text): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The radio component.""" ... diff --git a/reflex_chakra/components/forms/rangeslider.py b/reflex_chakra/components/forms/rangeslider.py index 7144fe6..c4f64fd 100644 --- a/reflex_chakra/components/forms/rangeslider.py +++ b/reflex_chakra/components/forms/rangeslider.py @@ -2,13 +2,12 @@ from __future__ import annotations -from typing import List, Optional from reflex_chakra.components import ChakraComponent, LiteralChakraDirection from reflex.components.component import Component from reflex.event import EventHandler from reflex.utils import format -from reflex.vars import Var +from reflex.vars.base import Var class RangeSlider(ChakraComponent): @@ -17,10 +16,10 @@ class RangeSlider(ChakraComponent): tag = "RangeSlider" # State var to bind the input. - value: Var[List[int]] + value: Var[list[int]] # The default values. - default_value: Var[List[int]] + default_value: Var[list[int]] # The writing mode ("ltr" | "rtl") direction: Var[LiteralChakraDirection] @@ -66,7 +65,7 @@ def get_ref(self): """ return None - def _get_ref_hook(self) -> Optional[str]: + def _get_ref_hook(self): """Override the base _get_ref_hook to handle array refs. Returns: @@ -75,9 +74,9 @@ def _get_ref_hook(self) -> Optional[str]: if self.id: ref = format.format_array_ref(self.id, None) if ref: - return ( + return Var( f"const {ref} = Array.from({{length:2}}, () => useRef(null)); " - f"{str(Var.create(ref, _var_is_string=False).as_ref())} = {ref}" + f"{Var(_js_expr=ref)._as_ref()!s} = {ref}", ) return super()._get_ref_hook() @@ -135,7 +134,7 @@ class RangeSliderThumb(ChakraComponent): # The position of the thumb. index: Var[int] - def _get_ref_hook(self) -> Optional[str]: + def _get_ref_hook(self) -> None: # hook is None because RangeSlider is handling it. return None diff --git a/reflex_chakra/components/forms/rangeslider.pyi b/reflex_chakra/components/forms/rangeslider.pyi index d451d1e..d229d0e 100644 --- a/reflex_chakra/components/forms/rangeslider.pyi +++ b/reflex_chakra/components/forms/rangeslider.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/rangeslider.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class RangeSlider(ChakraComponent): def get_ref(self): ... @@ -17,69 +24,49 @@ class RangeSlider(ChakraComponent): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_change_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: list[int] | Var[list[int]] | None = None, + default_value: list[int] | Var[list[int]] | None = None, + direction: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None, + focus_thumb_on_change: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_reversed: Var[bool] | bool | None = None, + min_: Var[int] | int | None = None, + max_: Var[int] | int | None = None, + min_steps_between_thumbs: Var[int] | int | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_change_end: EventType[Any] | None = None, + on_change_start: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "RangeSlider": + ) -> RangeSlider: """Create a RangeSlider component. If no children are provided, a default RangeSlider will be created. @@ -97,17 +84,20 @@ class RangeSlider(ChakraComponent): 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 + on_change: Fired when the value changes. + on_change_start: Fired when the value starts changing. + on_change_end: Fired when the value stops changing. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The RangeSlider component.""" ... class RangeSliderTrack(ChakraComponent): @@ -116,64 +106,36 @@ class RangeSliderTrack(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> RangeSliderTrack: + """""" ... class RangeSliderFilledTrack(ChakraComponent): @@ -182,64 +144,36 @@ class RangeSliderFilledTrack(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> RangeSliderFilledTrack: + """""" ... class RangeSliderThumb(ChakraComponent): @@ -249,64 +183,35 @@ class RangeSliderThumb(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + index: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> RangeSliderThumb: + """""" ... diff --git a/reflex_chakra/components/forms/select.py b/reflex_chakra/components/forms/select.py index 623e162..c6b6341 100644 --- a/reflex_chakra/components/forms/select.py +++ b/reflex_chakra/components/forms/select.py @@ -5,7 +5,7 @@ from reflex.components.core.foreach import Foreach from reflex.event import EventHandler from reflex.utils.types import _issubclass -from reflex.vars import Var +from reflex.vars.base import Var from reflex.components.el import Option as Option diff --git a/reflex_chakra/components/forms/select.pyi b/reflex_chakra/components/forms/select.pyi index 9ecd6f7..ae307cf 100644 --- a/reflex_chakra/components/forms/select.pyi +++ b/reflex_chakra/components/forms/select.pyi @@ -1,15 +1,22 @@ -"""Stub file for reflex/components/chakra/forms/select.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex_chakra.components.typography.text import Text -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var +from reflex.components.el import Option as Option class Select(ChakraComponent): @overload @@ -17,66 +24,49 @@ class Select(ChakraComponent): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Var[str] | str | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Select": + ) -> Select: """Create a select component. If a list is provided as the first children, a default component @@ -95,88 +85,16 @@ class Select(ChakraComponent): variant: "outline" | "filled" | "flushed" | "unstyled" size: The size of the select. name: The name of the form field + on_change: Fired when the value changes. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - **props, - ) -> "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. - """ + The component.""" ... diff --git a/reflex_chakra/components/forms/slider.py b/reflex_chakra/components/forms/slider.py index ac010e3..1530c66 100644 --- a/reflex_chakra/components/forms/slider.py +++ b/reflex_chakra/components/forms/slider.py @@ -7,7 +7,7 @@ from reflex_chakra.components import ChakraComponent, LiteralChakraDirection from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var LiteralLayout = Literal["horizontal", "vertical"] diff --git a/reflex_chakra/components/forms/slider.pyi b/reflex_chakra/components/forms/slider.pyi index 3ec03e0..0e38b78 100644 --- a/reflex_chakra/components/forms/slider.pyi +++ b/reflex_chakra/components/forms/slider.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/slider.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var LiteralLayout = Literal["horizontal", "vertical"] @@ -18,81 +25,58 @@ class Slider(ChakraComponent): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_change_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Var[int] | int | None = None, + color_scheme: Var[str] | str | None = None, + default_value: Var[int] | int | None = None, + direction: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None, + focus_thumb_on_change: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_reversed: Var[bool] | bool | None = None, + min_: Var[int] | int | None = None, + max_: Var[int] | int | None = None, + step: Var[int] | int | None = None, + min_steps_between_thumbs: Var[int] | int | None = None, + orientation: Literal["horizontal", "vertical"] + | Var[Literal["horizontal", "vertical"]] + | None = None, + min_h: Var[str] | str | None = None, + min_w: Var[str] | str | None = None, + max_h: Var[str] | str | None = None, + max_w: Var[str] | str | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_change_end: EventType[Any] | None = None, + on_change_start: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Slider": + ) -> Slider: """Create a slider component. If no children are provided, a default slider will be created. @@ -117,17 +101,20 @@ class Slider(ChakraComponent): max_h: Maximum height of the slider. max_w: Maximum width of the slider. name: The name of the form field + on_change: Fired when the value changes. + on_change_start: Fired when the value starts changing. + on_change_end: Fired when the value stops changing. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The slider component.""" ... class SliderTrack(ChakraComponent): @@ -136,64 +123,36 @@ class SliderTrack(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> SliderTrack: + """""" ... class SliderFilledTrack(ChakraComponent): @@ -202,64 +161,36 @@ class SliderFilledTrack(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> SliderFilledTrack: + """""" ... class SliderThumb(ChakraComponent): @@ -268,66 +199,37 @@ class SliderThumb(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + box_size: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> SliderThumb: + """""" ... class SliderMark(ChakraComponent): @@ -336,62 +238,34 @@ class SliderMark(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> SliderMark: + """""" ... diff --git a/reflex_chakra/components/forms/switch.py b/reflex_chakra/components/forms/switch.py index a4e333f..18477ee 100644 --- a/reflex_chakra/components/forms/switch.py +++ b/reflex_chakra/components/forms/switch.py @@ -4,7 +4,7 @@ from reflex_chakra.components import ChakraComponent, LiteralColorScheme from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Switch(ChakraComponent): diff --git a/reflex_chakra/components/forms/switch.pyi b/reflex_chakra/components/forms/switch.pyi index 21cf08b..64d5609 100644 --- a/reflex_chakra/components/forms/switch.pyi +++ b/reflex_chakra/components/forms/switch.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/switch.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Switch(ChakraComponent): @overload @@ -16,132 +23,90 @@ class Switch(ChakraComponent): 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", - ], + is_checked: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_focusable: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + name: Var[str] | str | None = None, + value: Var[str] | str | None = None, + spacing: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Switch: + """""" ... diff --git a/reflex_chakra/components/forms/textarea.py b/reflex_chakra/components/forms/textarea.py index 421c1b6..e575878 100644 --- a/reflex_chakra/components/forms/textarea.py +++ b/reflex_chakra/components/forms/textarea.py @@ -6,7 +6,7 @@ from reflex.components.component import Component from reflex.components.core.debounce import DebounceInput from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class TextArea(ChakraComponent): diff --git a/reflex_chakra/components/forms/textarea.pyi b/reflex_chakra/components/forms/textarea.pyi index 3b5fab0..22a17b1 100644 --- a/reflex_chakra/components/forms/textarea.pyi +++ b/reflex_chakra/components/forms/textarea.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/textarea.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class TextArea(ChakraComponent): @overload @@ -16,70 +23,51 @@ class TextArea(ChakraComponent): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[Any] | None = None, + on_key_down: EventType[Any] | None = None, + on_key_up: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "TextArea": + ) -> TextArea: """Create an Input component. Args: @@ -95,15 +83,20 @@ class TextArea(ChakraComponent): is_required: If true, the form control will be required. variant: "outline" | "filled" | "flushed" | "unstyled" name: The name of the form field + on_change: Fired when the value changes. + on_focus: Fired when the textarea gets focus. + on_blur: Fired when the textarea loses focus. + on_key_down: Fired when a key is pressed down. + on_key_up: Fired when a key is released. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... diff --git a/reflex_chakra/components/forms/time_picker.py b/reflex_chakra/components/forms/time_picker.py index 3028b12..73b009b 100644 --- a/reflex_chakra/components/forms/time_picker.py +++ b/reflex_chakra/components/forms/time_picker.py @@ -1,7 +1,7 @@ """A time input component.""" from reflex_chakra.components.forms.input import Input -from reflex.vars import Var +from reflex.vars.base import Var class TimePicker(Input): diff --git a/reflex_chakra/components/forms/time_picker.pyi b/reflex_chakra/components/forms/time_picker.pyi index 7278eb9..9e8acf6 100644 --- a/reflex_chakra/components/forms/time_picker.pyi +++ b/reflex_chakra/components/forms/time_picker.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/forms/time_picker.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components.forms.input import Input -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class TimePicker(Input): @overload @@ -16,74 +23,55 @@ class TimePicker(Input): 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, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type_: Var[str] | str | None = None, + value: Var[str] | str | None = None, + default_value: Var[str] | str | None = None, + placeholder: Var[str] | str | None = None, + error_border_color: Var[str] | str | None = None, + focus_border_color: Var[str] | str | None = None, + is_disabled: Var[bool] | bool | None = None, + is_invalid: Var[bool] | bool | None = None, + is_read_only: Var[bool] | bool | None = None, + is_required: Var[bool] | bool | None = None, + variant: Literal["filled", "flushed", "outline", "unstyled"] + | Var[Literal["filled", "flushed", "outline", "unstyled"]] + | None = None, + size: Literal["lg", "md", "sm", "xs"] + | Var[Literal["lg", "md", "sm", "xs"]] + | None = None, + name: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[Any] | None = None, + on_change: EventType[Any] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[Any] | None = None, + on_key_down: EventType[Any] | None = None, + on_key_up: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "TimePicker": + ) -> TimePicker: """Create an Input component. Args: @@ -101,15 +89,20 @@ class TimePicker(Input): variant: "outline" | "filled" | "flushed" | "unstyled" size: "lg" | "md" | "sm" | "xs" name: The name of the form field + on_change: Fired when the input value changes. + on_focus: Fired when the input is focused. + on_blur: Fired when the input lose focus. + on_key_down: Fired when a key is pressed down. + on_key_up: Fired when a key is released. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The component.""" ... diff --git a/reflex_chakra/components/layout/__init__.py b/reflex_chakra/components/layout/__init__.py index 13c28fd..409e71b 100644 --- a/reflex_chakra/components/layout/__init__.py +++ b/reflex_chakra/components/layout/__init__.py @@ -11,4 +11,25 @@ from .stack import Hstack, Stack, Vstack from .wrap import Wrap, WrapItem -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore +__all__ = [ + "AspectRatio", + "Box", + "Card", + "CardBody", + "CardFooter", + "CardHeader", + "Center", + "Circle", + "Container", + "Flex", + "Grid", + "GridItem", + "Hstack", + "ResponsiveGrid", + "Spacer", + "Square", + "Stack", + "Vstack", + "Wrap", + "WrapItem", +] diff --git a/reflex_chakra/components/layout/aspect_ratio.py b/reflex_chakra/components/layout/aspect_ratio.py index 4dc0422..c8054ff 100644 --- a/reflex_chakra/components/layout/aspect_ratio.py +++ b/reflex_chakra/components/layout/aspect_ratio.py @@ -1,7 +1,7 @@ """A AspectRatio component.""" from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class AspectRatio(ChakraComponent): diff --git a/reflex_chakra/components/layout/aspect_ratio.pyi b/reflex_chakra/components/layout/aspect_ratio.pyi index 8b72701..9e298cf 100644 --- a/reflex_chakra/components/layout/aspect_ratio.pyi +++ b/reflex_chakra/components/layout/aspect_ratio.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/aspect_ratio.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class AspectRatio(ChakraComponent): @overload @@ -16,64 +22,35 @@ class AspectRatio(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ratio: Var[float] | float | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AspectRatio: + """""" ... diff --git a/reflex_chakra/components/layout/box.py b/reflex_chakra/components/layout/box.py index ab9860e..c7240dc 100644 --- a/reflex_chakra/components/layout/box.py +++ b/reflex_chakra/components/layout/box.py @@ -1,8 +1,8 @@ """A box component that can contain other components.""" from reflex_chakra.components import ChakraComponent -from reflex.components.tags import Tag -from reflex.vars import Var +from reflex.components.tags.tag import Tag +from reflex.vars.base import Var class Box(ChakraComponent): diff --git a/reflex_chakra/components/layout/box.pyi b/reflex_chakra/components/layout/box.pyi index b401e48..60088f4 100644 --- a/reflex_chakra/components/layout/box.pyi +++ b/reflex_chakra/components/layout/box.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/box.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Box(ChakraComponent): @overload @@ -16,68 +22,37 @@ class Box(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + element: Var[str] | str | None = None, + src: Var[str] | str | None = None, + alt: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Box: + """""" ... diff --git a/reflex_chakra/components/layout/card.py b/reflex_chakra/components/layout/card.py index 81990e1..1ac401e 100644 --- a/reflex_chakra/components/layout/card.py +++ b/reflex_chakra/components/layout/card.py @@ -1,7 +1,5 @@ """Chakra Card component.""" -from typing import Optional - from reflex_chakra.components import ( ChakraComponent, LiteralCardVariant, @@ -9,7 +7,7 @@ LiteralTagSize, ) from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class CardHeader(ChakraComponent): @@ -66,8 +64,8 @@ def create( cls, body: Component, *, - header: Optional[Component] = None, - footer: Optional[Component] = None, + header: Component | None = None, + footer: Component | None = None, **props, ) -> Component: """Creates a Chakra Card with a body and optionally header and/or footer, and returns it. diff --git a/reflex_chakra/components/layout/card.pyi b/reflex_chakra/components/layout/card.pyi index 12f5d78..8eab452 100644 --- a/reflex_chakra/components/layout/card.pyi +++ b/reflex_chakra/components/layout/card.pyi @@ -1,17 +1,24 @@ -"""Stub file for reflex/components/chakra/layout/card.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class CardHeader(ChakraComponent): @overload @@ -19,64 +26,36 @@ class CardHeader(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> CardHeader: + """""" ... class CardBody(ChakraComponent): @@ -85,64 +64,36 @@ class CardBody(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> CardBody: + """""" ... class CardFooter(ChakraComponent): @@ -151,64 +102,36 @@ class CardFooter(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> CardFooter: + """""" ... class Card(ChakraComponent): @@ -217,111 +140,89 @@ class Card(ChakraComponent): 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"], + header: Component | None = None, + footer: Component | None = None, + align: Var[str] | str | None = None, + direction: Var[str] | str | None = None, + justify: Var[str] | str | None = None, + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + size: Literal["lg", "md", "sm"] | Var[Literal["lg", "md", "sm"]] | None = None, + variant: Literal["elevated", "filled", "outline", "unstyled"] + | Var[Literal["elevated", "filled", "outline", "unstyled"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Card": + ) -> 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, @@ -334,6 +235,5 @@ class Card(ChakraComponent): props: The properties to be passed to the component. Returns: - The `create()` method returns a Card object. - """ + The `create()` method returns a Card object.""" ... diff --git a/reflex_chakra/components/layout/center.pyi b/reflex_chakra/components/layout/center.pyi index 40fce3d..4ed0e58 100644 --- a/reflex_chakra/components/layout/center.pyi +++ b/reflex_chakra/components/layout/center.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/center.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Center(ChakraComponent): @overload @@ -16,64 +22,36 @@ class Center(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Center: + """""" ... class Square(ChakraComponent): @@ -82,64 +60,36 @@ class Square(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Square: + """""" ... class Circle(ChakraComponent): @@ -148,62 +98,34 @@ class Circle(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Circle: + """""" ... diff --git a/reflex_chakra/components/layout/container.py b/reflex_chakra/components/layout/container.py index 1abd94d..f0d8eb6 100644 --- a/reflex_chakra/components/layout/container.py +++ b/reflex_chakra/components/layout/container.py @@ -1,7 +1,7 @@ """A flexbox container.""" from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Container(ChakraComponent): diff --git a/reflex_chakra/components/layout/container.pyi b/reflex_chakra/components/layout/container.pyi index 52256a9..e7aafd6 100644 --- a/reflex_chakra/components/layout/container.pyi +++ b/reflex_chakra/components/layout/container.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/container.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Container(ChakraComponent): @overload @@ -16,64 +22,35 @@ class Container(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + center_content: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Container: + """""" ... diff --git a/reflex_chakra/components/layout/flex.py b/reflex_chakra/components/layout/flex.py index 33b2a0f..0d12dfc 100644 --- a/reflex_chakra/components/layout/flex.py +++ b/reflex_chakra/components/layout/flex.py @@ -1,9 +1,7 @@ """A reflexive container component.""" -from typing import List, Union - from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Flex(ChakraComponent): @@ -18,7 +16,7 @@ class Flex(ChakraComponent): basis: Var[str] # Shorthand for flexDirection style prop - direction: Var[Union[str, List[str]]] + direction: Var[str | list[str]] # Shorthand for flexGrow style prop grow: Var[str] @@ -27,7 +25,7 @@ class Flex(ChakraComponent): justify: Var[str] # Shorthand for flexWrap style prop - wrap: Var[Union[str, List[str]]] + wrap: Var[str | list[str]] # Shorthand for flexShrink style prop shrink: Var[str] diff --git a/reflex_chakra/components/layout/flex.pyi b/reflex_chakra/components/layout/flex.pyi index bab1339..d476766 100644 --- a/reflex_chakra/components/layout/flex.pyi +++ b/reflex_chakra/components/layout/flex.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/flex.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Flex(ChakraComponent): @overload @@ -16,76 +22,41 @@ class Flex(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + align: Var[str] | str | None = None, + basis: Var[str] | str | None = None, + direction: list[str] | Var[list[str] | str] | str | None = None, + grow: Var[str] | str | None = None, + justify: Var[str] | str | None = None, + wrap: list[str] | Var[list[str] | str] | str | None = None, + shrink: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Flex: + """""" ... diff --git a/reflex_chakra/components/layout/grid.py b/reflex_chakra/components/layout/grid.py index 9c5f284..075395c 100644 --- a/reflex_chakra/components/layout/grid.py +++ b/reflex_chakra/components/layout/grid.py @@ -1,9 +1,7 @@ """Container to stack elements with spacing.""" -from typing import List - from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Grid(ChakraComponent): @@ -98,7 +96,7 @@ class ResponsiveGrid(ChakraComponent): row: Var[str] # A list that defines the number of columns for each breakpoint. - columns: Var[List[int]] + 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] diff --git a/reflex_chakra/components/layout/grid.pyi b/reflex_chakra/components/layout/grid.pyi index 09e7560..c831b69 100644 --- a/reflex_chakra/components/layout/grid.pyi +++ b/reflex_chakra/components/layout/grid.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/grid.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Grid(ChakraComponent): @overload @@ -16,78 +22,43 @@ class Grid(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + auto_columns: Var[str] | str | None = None, + auto_flow: Var[str] | str | None = None, + auto_rows: Var[str] | str | None = None, + column: Var[str] | str | None = None, + row: Var[str] | str | None = None, + template_columns: Var[str] | str | None = None, + template_rows: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Grid: + """""" ... class GridItem(ChakraComponent): @@ -96,78 +67,43 @@ class GridItem(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + area: Var[str] | str | None = None, + col_end: Var[str] | str | None = None, + col_start: Var[int] | int | None = None, + col_span: Var[int] | int | None = None, + row_end: Var[str] | str | None = None, + row_start: Var[int] | int | None = None, + row_span: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> GridItem: + """""" ... class ResponsiveGrid(ChakraComponent): @@ -176,88 +112,47 @@ class ResponsiveGrid(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + auto_columns: Var[str] | str | None = None, + auto_flow: Var[str] | str | None = None, + auto_rows: Var[str] | str | None = None, + column: Var[str] | str | None = None, + row: Var[str] | str | None = None, + columns: list[int] | Var[list[int]] | None = None, + min_child_width: Var[str] | str | None = None, + spacing: Var[str] | str | None = None, + spacing_x: Var[str] | str | None = None, + spacing_y: Var[str] | str | None = None, + template_areas: Var[str] | str | None = None, + template_columns: Var[str] | str | None = None, + template_rows: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ResponsiveGrid: + """""" ... diff --git a/reflex_chakra/components/layout/spacer.pyi b/reflex_chakra/components/layout/spacer.pyi index 6d125ab..17c8847 100644 --- a/reflex_chakra/components/layout/spacer.pyi +++ b/reflex_chakra/components/layout/spacer.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/spacer.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Spacer(ChakraComponent): @overload @@ -16,62 +22,34 @@ class Spacer(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Spacer: + """""" ... diff --git a/reflex_chakra/components/layout/stack.py b/reflex_chakra/components/layout/stack.py index f8ed96b..17e9280 100644 --- a/reflex_chakra/components/layout/stack.py +++ b/reflex_chakra/components/layout/stack.py @@ -1,9 +1,7 @@ """Container to stack elements with spacing.""" -from typing import List, Union - from reflex_chakra.components import ChakraComponent, LiteralStackDirection -from reflex.vars import Var +from reflex.vars.base import Var class Stack(ChakraComponent): @@ -15,7 +13,7 @@ class Stack(ChakraComponent): align_items: Var[str] # The direction to stack the items. - direction: Var[Union[LiteralStackDirection, List[str]]] + direction: Var[LiteralStackDirection | list[str]] # If true the items will be stacked horizontally. is_inline: Var[bool] diff --git a/reflex_chakra/components/layout/stack.pyi b/reflex_chakra/components/layout/stack.pyi index 37cff85..36abe32 100644 --- a/reflex_chakra/components/layout/stack.pyi +++ b/reflex_chakra/components/layout/stack.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/layout/stack.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Stack(ChakraComponent): @overload @@ -16,86 +23,47 @@ class Stack(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + align_items: Var[str] | str | None = None, + direction: list[str] + | Literal["column", "row"] + | Var[list[str] | Literal["column", "row"]] + | None = None, + is_inline: Var[bool] | bool | None = None, + justify_content: Var[str] | str | None = None, + should_wrap_children: Var[bool] | bool | None = None, + spacing: Var[str] | str | None = None, + wrap: Var[str] | str | None = None, + justify: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Stack: + """""" ... class Hstack(Stack): @@ -104,86 +72,47 @@ class Hstack(Stack): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + align_items: Var[str] | str | None = None, + direction: list[str] + | Literal["column", "row"] + | Var[list[str] | Literal["column", "row"]] + | None = None, + is_inline: Var[bool] | bool | None = None, + justify_content: Var[str] | str | None = None, + should_wrap_children: Var[bool] | bool | None = None, + spacing: Var[str] | str | None = None, + wrap: Var[str] | str | None = None, + justify: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Hstack: + """""" ... class Vstack(Stack): @@ -192,84 +121,45 @@ class Vstack(Stack): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + align_items: Var[str] | str | None = None, + direction: list[str] + | Literal["column", "row"] + | Var[list[str] | Literal["column", "row"]] + | None = None, + is_inline: Var[bool] | bool | None = None, + justify_content: Var[str] | str | None = None, + should_wrap_children: Var[bool] | bool | None = None, + spacing: Var[str] | str | None = None, + wrap: Var[str] | str | None = None, + justify: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Vstack: + """""" ... diff --git a/reflex_chakra/components/layout/wrap.py b/reflex_chakra/components/layout/wrap.py index c6a4694..ca92b8d 100644 --- a/reflex_chakra/components/layout/wrap.py +++ b/reflex_chakra/components/layout/wrap.py @@ -2,7 +2,7 @@ from reflex_chakra.components import ChakraComponent from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class Wrap(ChakraComponent): diff --git a/reflex_chakra/components/layout/wrap.pyi b/reflex_chakra/components/layout/wrap.pyi index 0b64330..12cf1bf 100644 --- a/reflex_chakra/components/layout/wrap.pyi +++ b/reflex_chakra/components/layout/wrap.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/layout/wrap.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Wrap(ChakraComponent): @overload @@ -17,56 +23,42 @@ class Wrap(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + align: Var[str] | str | None = None, + direction: Var[str] | str | None = None, + justify: Var[str] | str | None = None, + should_wrap_children: Var[bool] | bool | None = None, + spacing: Var[str] | str | None = None, + spacing_x: Var[str] | str | None = None, + spacing_y: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Wrap": + ) -> Wrap: """Return a wrap component. Args: @@ -82,14 +74,14 @@ class Wrap(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The wrap component.""" ... class WrapItem(ChakraComponent): @@ -98,62 +90,34 @@ class WrapItem(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> WrapItem: + """""" ... diff --git a/reflex_chakra/components/media/__init__.py b/reflex_chakra/components/media/__init__.py index 8346a37..80442c0 100644 --- a/reflex_chakra/components/media/__init__.py +++ b/reflex_chakra/components/media/__init__.py @@ -4,4 +4,10 @@ from .icon import Icon from .image import Image -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore +__all__ = [ + "Avatar", + "AvatarBadge", + "AvatarGroup", + "Icon", + "Image", +] diff --git a/reflex_chakra/components/media/avatar.py b/reflex_chakra/components/media/avatar.py index 8f688fa..1e26c14 100644 --- a/reflex_chakra/components/media/avatar.py +++ b/reflex_chakra/components/media/avatar.py @@ -4,7 +4,7 @@ from reflex_chakra.components.base import ChakraComponent, LiteralAvatarSize from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Avatar(ChakraComponent): diff --git a/reflex_chakra/components/media/avatar.pyi b/reflex_chakra/components/media/avatar.pyi index 83cba88..e92dca4 100644 --- a/reflex_chakra/components/media/avatar.pyi +++ b/reflex_chakra/components/media/avatar.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/media/avatar.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components.base import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Avatar(ChakraComponent): @overload @@ -16,86 +23,47 @@ class Avatar(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + icon: Var[str] | str | None = None, + icon_label: Var[str] | str | None = None, + ignore_fallback: Var[bool] | bool | None = None, + name: Var[str] | str | None = None, + show_border: Var[bool] | bool | None = None, + src: Var[str] | str | None = None, + src_set: Var[str] | str | None = None, + size: Literal["2xl", "2xs", "full", "lg", "md", "sm", "xl", "xs"] + | Var[Literal["2xl", "2xs", "full", "lg", "md", "sm", "xl", "xs"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_error: EventType[Any] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Avatar: + """""" ... class AvatarBadge(ChakraComponent): @@ -104,64 +72,36 @@ class AvatarBadge(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AvatarBadge: + """""" ... class AvatarGroup(ChakraComponent): @@ -170,66 +110,36 @@ class AvatarGroup(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + max_: Var[int] | int | None = None, + spacing: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AvatarGroup: + """""" ... diff --git a/reflex_chakra/components/media/icon.py b/reflex_chakra/components/media/icon.py index a76dd0f..34cd1e7 100644 --- a/reflex_chakra/components/media/icon.py +++ b/reflex_chakra/components/media/icon.py @@ -1,7 +1,5 @@ """An icon component.""" -from typing import List - from reflex_chakra.components.base import ChakraComponent from reflex.utils import format @@ -49,7 +47,7 @@ def create(cls, *children, **props): # List of all icons. -ICON_LIST: List[str] = [ +ICON_LIST: list[str] = [ "add", "arrow_back", "arrow_down", diff --git a/reflex_chakra/components/media/icon.pyi b/reflex_chakra/components/media/icon.pyi index c737b08..1bc16ee 100644 --- a/reflex_chakra/components/media/icon.pyi +++ b/reflex_chakra/components/media/icon.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/media/icon.py""" +"""Stub file for reflex_chakra/components/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_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var +from typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var +from reflex_chakra.components.base import ChakraComponent class ChakraIconComponent(ChakraComponent): @overload @@ -16,64 +22,36 @@ class ChakraIconComponent(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ChakraIconComponent: + """""" ... class Icon(ChakraIconComponent): @@ -82,49 +60,35 @@ class Icon(ChakraIconComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Icon": + ) -> Icon: """Initialize the Icon component. Run some additional checks on Icon component. @@ -134,6 +98,7 @@ class Icon(ChakraIconComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -144,8 +109,7 @@ class Icon(ChakraIconComponent): ValueError: If the icon tag is invalid. Returns: - The created component. - """ + The created component.""" ... -ICON_LIST: List[str] +ICON_LIST: list[str] diff --git a/reflex_chakra/components/media/image.py b/reflex_chakra/components/media/image.py index 6b899a4..48daece 100644 --- a/reflex_chakra/components/media/image.py +++ b/reflex_chakra/components/media/image.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Any, Optional +from typing import Any from reflex_chakra.components.base import ChakraComponent, LiteralImageLoading from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Image(ChakraComponent): @@ -19,7 +19,7 @@ class Image(ChakraComponent): align: Var[str] # Fallback Reflex component to show if image is loading or image fails. - fallback: Optional[Component] = None + fallback: Var[Component] # Fallback image src to show if image is loading or image fails. fallback_src: Var[str] @@ -56,16 +56,3 @@ class Image(ChakraComponent): # 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. - """ - return super().create(*children, **props) diff --git a/reflex_chakra/components/media/image.pyi b/reflex_chakra/components/media/image.pyi index dee9790..e0ec7aa 100644 --- a/reflex_chakra/components/media/image.pyi +++ b/reflex_chakra/components/media/image.pyi @@ -1,15 +1,22 @@ -"""Stub file for reflex/components/chakra/media/image.py""" +"""Stub file for reflex_chakra/components/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_chakra.components import ChakraComponent +from typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var +from reflex_chakra.components.base import ChakraComponent from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Image(ChakraComponent): @overload @@ -17,88 +24,47 @@ class Image(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + align: Var[str] | str | None = None, + fallback: Component | Var[Component] | None = None, + fallback_src: Var[str] | str | None = None, + fit: Var[str] | str | None = None, + html_height: Var[str] | str | None = None, + html_width: Var[str] | str | None = None, + ignore_fallback: Var[bool] | bool | None = None, + loading: Literal["eager", "lazy"] | Var[Literal["eager", "lazy"]] | None = None, + src: Any | Var[Any] | None = None, + alt: Var[str] | str | None = None, + src_set: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_error: EventType[Any] | None = None, + on_focus: EventType[()] | None = None, + on_load: EventType[Any] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Image: + """""" ... diff --git a/reflex_chakra/components/navigation/__init__.py b/reflex_chakra/components/navigation/__init__.py index 4b61ad8..6ff2525 100644 --- a/reflex_chakra/components/navigation/__init__.py +++ b/reflex_chakra/components/navigation/__init__.py @@ -15,4 +15,21 @@ StepTitle, ) -__all__ = [f for f in dir() if f[0].isupper()] # type: ignore +__all__ = [ + "Breadcrumb", + "BreadcrumbItem", + "BreadcrumbLink", + "BreadcrumbSeparator", + "Link", + "LinkBox", + "LinkOverlay", + "Step", + "StepDescription", + "StepIcon", + "StepIndicator", + "StepNumber", + "StepSeparator", + "StepStatus", + "StepTitle", + "Stepper", +] diff --git a/reflex_chakra/components/navigation/breadcrumb.py b/reflex_chakra/components/navigation/breadcrumb.py index 1144d01..e48e51b 100644 --- a/reflex_chakra/components/navigation/breadcrumb.py +++ b/reflex_chakra/components/navigation/breadcrumb.py @@ -4,7 +4,7 @@ from reflex_chakra.components.navigation.link import Link from reflex.components.component import Component from reflex.components.core.foreach import Foreach -from reflex.vars import Var +from reflex.vars.base import Var class Breadcrumb(ChakraComponent): diff --git a/reflex_chakra/components/navigation/breadcrumb.pyi b/reflex_chakra/components/navigation/breadcrumb.pyi index f992584..6a08a17 100644 --- a/reflex_chakra/components/navigation/breadcrumb.pyi +++ b/reflex_chakra/components/navigation/breadcrumb.pyi @@ -1,16 +1,22 @@ -"""Stub file for reflex/components/chakra/navigation/breadcrumb.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent from reflex_chakra.components.navigation.link import Link from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Breadcrumb(ChakraComponent): @overload @@ -19,51 +25,37 @@ class Breadcrumb(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + separator: Var[str] | str | None = None, + separator_margin: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Breadcrumb": + ) -> Breadcrumb: """Create a breadcrumb component. If the kw-args `items` is provided and is a list, they will be added as children. @@ -76,14 +68,14 @@ class Breadcrumb(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The breadcrumb component.""" ... class BreadcrumbItem(ChakraComponent): @@ -94,53 +86,39 @@ class BreadcrumbItem(ChakraComponent): *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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_current_page: Var[bool] | bool | None = None, + is_last_child: Var[bool] | bool | None = None, + separator: Var[str] | str | None = None, + spacing: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "BreadcrumbItem": + ) -> BreadcrumbItem: """Create a Breadcrumb Item component. Args: @@ -154,14 +132,14 @@ class BreadcrumbItem(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 - """ + The BreadcrumbItem component""" ... class BreadcrumbSeparator(ChakraComponent): @@ -170,64 +148,36 @@ class BreadcrumbSeparator(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> BreadcrumbSeparator: + """""" ... class BreadcrumbLink(Link): @@ -236,55 +186,41 @@ class BreadcrumbLink(Link): 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[Component], Component]] = 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_current_page: Var[bool] | bool | None = None, + rel: Var[str] | str | None = None, + href: Var[str] | str | None = None, + text: Var[str] | str | None = None, + as_: Component | Var[Component] | None = None, + is_external: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "BreadcrumbLink": + ) -> BreadcrumbLink: """Create a Link component. Args: @@ -298,6 +234,7 @@ class BreadcrumbLink(Link): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -307,6 +244,5 @@ class BreadcrumbLink(Link): ValueError: in case of missing children Returns: - Component: The link component - """ + Component: The link component""" ... diff --git a/reflex_chakra/components/navigation/link.py b/reflex_chakra/components/navigation/link.py index 847e4e8..6d7dbee 100644 --- a/reflex_chakra/components/navigation/link.py +++ b/reflex_chakra/components/navigation/link.py @@ -4,7 +4,7 @@ from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.utils.imports import ImportDict -from reflex.vars import Var +from reflex.vars.base import Var class Link(ChakraComponent): diff --git a/reflex_chakra/components/navigation/link.pyi b/reflex_chakra/components/navigation/link.pyi index c81ecd9..c2194f9 100644 --- a/reflex_chakra/components/navigation/link.pyi +++ b/reflex_chakra/components/navigation/link.pyi @@ -1,19 +1,22 @@ -"""Stub file for reflex/components/chakra/navigation/link.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent from reflex.components.component import Component -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 Var - -next_link = NextLink.create() class Link(ChakraComponent): def add_imports(self) -> ImportDict: ... @@ -22,54 +25,40 @@ class Link(ChakraComponent): 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[Component], Component]] = 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + rel: Var[str] | str | None = None, + href: Var[str] | str | None = None, + text: Var[str] | str | None = None, + as_: Component | Var[Component] | None = None, + is_external: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Link": + ) -> Link: """Create a Link component. Args: @@ -82,6 +71,7 @@ class Link(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -91,6 +81,5 @@ class Link(ChakraComponent): ValueError: in case of missing children Returns: - Component: The link component - """ + Component: The link component""" ... diff --git a/reflex_chakra/components/navigation/linkoverlay.py b/reflex_chakra/components/navigation/linkoverlay.py index d0ab726..b31c953 100644 --- a/reflex_chakra/components/navigation/linkoverlay.py +++ b/reflex_chakra/components/navigation/linkoverlay.py @@ -1,7 +1,7 @@ """Link overlay components.""" from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class LinkOverlay(ChakraComponent): diff --git a/reflex_chakra/components/navigation/linkoverlay.pyi b/reflex_chakra/components/navigation/linkoverlay.pyi index 53c163a..68b2669 100644 --- a/reflex_chakra/components/navigation/linkoverlay.pyi +++ b/reflex_chakra/components/navigation/linkoverlay.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/navigation/linkoverlay.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class LinkOverlay(ChakraComponent): @overload @@ -16,68 +22,38 @@ class LinkOverlay(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_external: Var[bool] | bool | None = None, + href: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> LinkOverlay: + """""" ... class LinkBox(ChakraComponent): @@ -86,62 +62,34 @@ class LinkBox(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> LinkBox: + """""" ... diff --git a/reflex_chakra/components/navigation/stepper.py b/reflex_chakra/components/navigation/stepper.py index f85a777..e37c32d 100644 --- a/reflex_chakra/components/navigation/stepper.py +++ b/reflex_chakra/components/navigation/stepper.py @@ -1,10 +1,10 @@ """A component to indicate progress through a multi-step process.""" -from typing import List, Literal, Optional, Tuple +from typing import Literal from reflex_chakra.components import ChakraComponent, LiteralColorScheme from reflex.components.component import Component -from reflex.vars import Var +from reflex.vars.base import Var class Stepper(ChakraComponent): @@ -28,9 +28,7 @@ class Stepper(ChakraComponent): size: Var[str] @classmethod - def create( - cls, *children, items: Optional[List[Tuple]] = None, **props - ) -> Component: + def create(cls, *children, items: list[tuple] | None = None, **props) -> Component: """Create a Stepper component. If the kw-args `items` is provided and is a list, they will be added as children. @@ -107,7 +105,6 @@ class StepStatus(ChakraComponent): incomplete: Var[str] - class StepTitle(ChakraComponent): """The title text for a step component.""" diff --git a/reflex_chakra/components/navigation/stepper.pyi b/reflex_chakra/components/navigation/stepper.pyi index 82fa389..7cc48de 100644 --- a/reflex_chakra/components/navigation/stepper.pyi +++ b/reflex_chakra/components/navigation/stepper.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/navigation/stepper.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Stepper(ChakraComponent): @overload @@ -16,106 +23,86 @@ class Stepper(ChakraComponent): 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", - ], + items: list[tuple] | None = None, + orientation: Literal["horizontal", "vertical"] + | Var[Literal["horizontal", "vertical"]] + | None = None, + colorScheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + index: Var[int] | int | None = None, + size: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Stepper": + ) -> Stepper: """Create a Stepper component. If the kw-args `items` is provided and is a list, they will be added as children. @@ -123,20 +110,21 @@ class Stepper(ChakraComponent): Args: *children: The children of the component. items (list): The child components for each step. + orientation: The orientation of Stepper: 'vertical' | 'horizontal'. Default: 'horizontal' 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. + index: 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. + ref: The Var to pass as the ref to 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. - """ + The stepper component.""" ... class Step(ChakraComponent): @@ -145,64 +133,36 @@ class Step(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Step: + """""" ... class StepDescription(ChakraComponent): @@ -211,64 +171,36 @@ class StepDescription(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StepDescription: + """""" ... class StepIcon(ChakraComponent): @@ -277,64 +209,36 @@ class StepIcon(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StepIcon: + """""" ... class StepIndicator(ChakraComponent): @@ -343,64 +247,36 @@ class StepIndicator(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StepIndicator: + """""" ... class StepNumber(ChakraComponent): @@ -409,64 +285,36 @@ class StepNumber(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StepNumber: + """""" ... class StepSeparator(ChakraComponent): @@ -475,64 +323,36 @@ class StepSeparator(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StepSeparator: + """""" ... class StepStatus(ChakraComponent): @@ -541,68 +361,39 @@ class StepStatus(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + active: Var[str] | str | None = None, + complete: Var[str] | str | None = None, + incomplete: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StepStatus: + """""" ... class StepTitle(ChakraComponent): @@ -611,62 +402,34 @@ class StepTitle(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> StepTitle: + """""" ... diff --git a/reflex_chakra/components/overlay/__init__.py b/reflex_chakra/components/overlay/__init__.py index 322d093..c5137fc 100644 --- a/reflex_chakra/components/overlay/__init__.py +++ b/reflex_chakra/components/overlay/__init__.py @@ -48,3 +48,45 @@ PopoverTrigger, ) from .tooltip import Tooltip + + +__all__ = [ + "AlertDialog", + "AlertDialogBody", + "AlertDialogContent", + "AlertDialogFooter", + "AlertDialogHeader", + "AlertDialogOverlay", + "Drawer", + "DrawerBody", + "DrawerCloseButton", + "DrawerContent", + "DrawerFooter", + "DrawerHeader", + "DrawerOverlay", + "Menu", + "MenuButton", + "MenuDivider", + "MenuGroup", + "MenuItem", + "MenuItemOption", + "MenuList", + "MenuOptionGroup", + "Modal", + "ModalBody", + "ModalCloseButton", + "ModalContent", + "ModalFooter", + "ModalHeader", + "ModalOverlay", + "Popover", + "PopoverAnchor", + "PopoverArrow", + "PopoverBody", + "PopoverCloseButton", + "PopoverContent", + "PopoverFooter", + "PopoverHeader", + "PopoverTrigger", + "Tooltip", +] diff --git a/reflex_chakra/components/overlay/alertdialog.py b/reflex_chakra/components/overlay/alertdialog.py index a237db4..11f716a 100644 --- a/reflex_chakra/components/overlay/alertdialog.py +++ b/reflex_chakra/components/overlay/alertdialog.py @@ -6,7 +6,7 @@ from reflex_chakra.components.media.icon import Icon from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class AlertDialog(ChakraComponent): diff --git a/reflex_chakra/components/overlay/alertdialog.pyi b/reflex_chakra/components/overlay/alertdialog.pyi index f1646b8..a485b94 100644 --- a/reflex_chakra/components/overlay/alertdialog.pyi +++ b/reflex_chakra/components/overlay/alertdialog.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/overlay/alertdialog.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class AlertDialog(ChakraComponent): @overload @@ -20,90 +27,56 @@ class AlertDialog(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_esc: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_overlay_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + is_open: Var[bool] | bool | None = None, + least_destructive_ref: Var[str] | str | None = None, + allow_pinch_zoom: Var[bool] | bool | None = None, + auto_focus: Var[bool] | bool | None = None, + block_scroll_on_mount: Var[bool] | bool | None = None, + close_on_esc: Var[bool] | bool | None = None, + close_on_overlay_click: Var[bool] | bool | None = None, + is_centered: Var[bool] | bool | None = None, + lock_focus_across_frames: Var[bool] | bool | None = None, + preserve_scroll_bar_gap: Var[bool] | bool | None = None, + return_focus_on_close: Var[bool] | bool | None = None, + size: Literal["2xl", "3xl", "4xl", "5xl", "6xl", "full", "lg", "md", "sm", "xs"] + | Var[ + Literal["2xl", "3xl", "4xl", "5xl", "6xl", "full", "lg", "md", "sm", "xs"] + ] + | None = None, + use_inert: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_close: EventType[Any] | None = None, + on_close_complete: EventType[Any] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_esc: EventType[Any] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_overlay_click: EventType[Any] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "AlertDialog": + ) -> AlertDialog: """Create an alert dialog component. Args: @@ -125,9 +98,14 @@ class AlertDialog(ChakraComponent): 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** + on_close: Fired when the modal is closing. + on_close_complete: Fired when the modal is closed and the exit animation is complete. + on_esc: Fired when the Esc key is pressed. + on_overlay_click: Fired when the overlay is clicked. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -137,8 +115,7 @@ class AlertDialog(ChakraComponent): AttributeError: if there is a conflict between the props used. Returns: - The alert dialog component. - """ + The alert dialog component.""" ... class AlertDialogBody(ChakraComponent): @@ -147,64 +124,36 @@ class AlertDialogBody(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertDialogBody: + """""" ... class AlertDialogHeader(ChakraComponent): @@ -213,64 +162,36 @@ class AlertDialogHeader(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertDialogHeader: + """""" ... class AlertDialogFooter(ChakraComponent): @@ -279,64 +200,36 @@ class AlertDialogFooter(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertDialogFooter: + """""" ... class AlertDialogContent(ChakraComponent): @@ -345,64 +238,36 @@ class AlertDialogContent(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertDialogContent: + """""" ... class AlertDialogOverlay(ChakraComponent): @@ -411,64 +276,36 @@ class AlertDialogOverlay(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertDialogOverlay: + """""" ... class AlertDialogCloseButton(ChakraComponent): @@ -477,62 +314,34 @@ class AlertDialogCloseButton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> AlertDialogCloseButton: + """""" ... diff --git a/reflex_chakra/components/overlay/drawer.py b/reflex_chakra/components/overlay/drawer.py index c4ddb2e..b866f02 100644 --- a/reflex_chakra/components/overlay/drawer.py +++ b/reflex_chakra/components/overlay/drawer.py @@ -10,7 +10,7 @@ from reflex_chakra.components.media.icon import Icon from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Drawer(ChakraComponent): diff --git a/reflex_chakra/components/overlay/drawer.pyi b/reflex_chakra/components/overlay/drawer.pyi index 20b70e3..7e31316 100644 --- a/reflex_chakra/components/overlay/drawer.pyi +++ b/reflex_chakra/components/overlay/drawer.pyi @@ -1,16 +1,23 @@ -"""Stub file for reflex/components/chakra/overlay/drawer.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Drawer(ChakraComponent): @overload @@ -22,125 +29,101 @@ class Drawer(ChakraComponent): 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", - ], + is_open: Var[bool] | bool | None = None, + allow_pinch_zoom: Var[bool] | bool | None = None, + auto_focus: Var[bool] | bool | None = None, + block_scroll_on_mount: Var[bool] | bool | None = None, + close_on_esc: Var[bool] | bool | None = None, + close_on_overlay_click: Var[bool] | bool | None = None, + is_centered: Var[bool] | bool | None = None, + is_full_height: Var[bool] | bool | None = None, + lock_focus_across_frames: Var[bool] | bool | None = None, + placement: Var[str] | str | None = None, + preserve_scroll_bar_gap: Var[bool] | bool | None = None, + return_focus_on_close: Var[bool] | bool | None = None, + size: Literal["full", "lg", "md", "sm", "xl", "xs"] + | Var[Literal["full", "lg", "md", "sm", "xl", "xs"]] + | None = None, + use_inert: Var[bool] | bool | None = None, + variant: Var[str] | str | None = None, + color_scheme: Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", + ] + | Var[ + Literal[ + "blackAlpha", + "blue", + "cyan", + "facebook", + "gray", + "green", + "linkedin", + "messenger", + "none", + "orange", + "pink", + "purple", + "red", + "teal", + "telegram", + "twitter", + "whatsapp", + "whiteAlpha", + "yellow", ] - ] = None, - style: Optional[Style] = None, - key: Optional[Any] = None, - id: Optional[Any] = None, - class_name: Optional[Any] = None, - autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_esc: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_overlay_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + ] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_close: EventType[Any] | None = None, + on_close_complete: EventType[Any] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_esc: EventType[Any] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_overlay_click: EventType[Any] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Drawer": + ) -> Drawer: """Create a drawer component. Args: @@ -165,9 +148,14 @@ class Drawer(ChakraComponent): 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" + on_close: Fired when the modal is closing. + on_close_complete: Fired when the modal is closed and the exit animation is complete. + on_esc: Fired when the Esc key is pressed. + on_overlay_click: Fired when the overlay is clicked. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -177,8 +165,7 @@ class Drawer(ChakraComponent): AttributeError: error that occurs if conflicting props are passed Returns: - The drawer component. - """ + The drawer component.""" ... class DrawerBody(ChakraComponent): @@ -187,64 +174,36 @@ class DrawerBody(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> DrawerBody: + """""" ... class DrawerHeader(ChakraComponent): @@ -253,64 +212,36 @@ class DrawerHeader(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> DrawerHeader: + """""" ... class DrawerFooter(ChakraComponent): @@ -319,64 +250,36 @@ class DrawerFooter(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> DrawerFooter: + """""" ... class DrawerOverlay(ChakraComponent): @@ -385,64 +288,36 @@ class DrawerOverlay(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> DrawerOverlay: + """""" ... class DrawerContent(ChakraComponent): @@ -451,64 +326,36 @@ class DrawerContent(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> DrawerContent: + """""" ... class DrawerCloseButton(ChakraComponent): @@ -517,62 +364,34 @@ class DrawerCloseButton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> DrawerCloseButton: + """""" ... diff --git a/reflex_chakra/components/overlay/menu.py b/reflex_chakra/components/overlay/menu.py index 5c85b1e..7063780 100644 --- a/reflex_chakra/components/overlay/menu.py +++ b/reflex_chakra/components/overlay/menu.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import ClassVar from reflex_chakra.components import ( ChakraComponent, @@ -13,7 +13,7 @@ from reflex_chakra.components.forms.button import Button from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Menu(ChakraComponent): @@ -79,8 +79,8 @@ class Menu(ChakraComponent): def create( cls, *children, - button: Optional[Component] = None, - items: Optional[List] = None, + button: Component | None = None, + items: list | None = None, **props, ) -> Component: """Create a menu component. @@ -117,7 +117,7 @@ class MenuButton(ChakraComponent): variant: Var[str] # Components that are not allowed as children. - _invalid_children: List[str] = ["Button", "MenuButton"] + _invalid_children: ClassVar[list[str]] = ["Button", "MenuButton"] # The tag to use for the menu button. as_: Var[str] @@ -129,7 +129,7 @@ class MenuList(ChakraComponent): tag = "MenuList" @classmethod - def create(cls, *children, items: Optional[list] = None, **props) -> Component: + def create(cls, *children, items: list | None = None, **props) -> Component: """Create a MenuList component, and automatically wrap in MenuItem if not already one. Args: diff --git a/reflex_chakra/components/overlay/menu.pyi b/reflex_chakra/components/overlay/menu.pyi index 7fe0dbb..32a6b62 100644 --- a/reflex_chakra/components/overlay/menu.pyi +++ b/reflex_chakra/components/overlay/menu.pyi @@ -1,17 +1,24 @@ -"""Stub file for reflex/components/chakra/overlay/menu.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Menu(ChakraComponent): @overload @@ -19,73 +26,57 @@ class Menu(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + button: Component | None = None, + items: list | None = None, + arrow_padding: Var[int] | int | None = None, + auto_select: Var[bool] | bool | None = None, + boundary: Var[str] | str | None = None, + close_on_blur: Var[bool] | bool | None = None, + close_on_select: Var[bool] | bool | None = None, + default_is_open: Var[bool] | bool | None = None, + direction: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None, + flip: Var[bool] | bool | None = None, + gutter: Var[int] | int | None = None, + is_lazy: Var[bool] | bool | None = None, + lazy_behavior: Var[str] | str | None = None, + is_open: Var[bool] | bool | None = None, + match_width: Var[bool] | bool | None = None, + placement: Var[str] | str | None = None, + prevent_overflow: Var[bool] | bool | None = None, + strategy: Literal["absolute", "fixed"] + | Var[Literal["absolute", "fixed"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_close: EventType[Any] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_open: EventType[Any] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Menu": + ) -> Menu: """Create a menu component. Args: @@ -108,17 +99,19 @@ class Menu(ChakraComponent): 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") + on_close: Fired when the menu is closed. + on_open: Fired when the menu is opened. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The menu component.""" ... class MenuButton(ChakraComponent): @@ -127,68 +120,38 @@ class MenuButton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + variant: Var[str] | str | None = None, + as_: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> MenuButton: + """""" ... class MenuList(ChakraComponent): @@ -197,50 +160,36 @@ class MenuList(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + items: list | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "MenuList": + ) -> MenuList: """Create a MenuList component, and automatically wrap in MenuItem if not already one. Args: @@ -249,14 +198,14 @@ class MenuList(ChakraComponent): style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The MenuList component.""" ... class MenuItem(ChakraComponent): @@ -265,74 +214,41 @@ class MenuItem(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + close_on_select: Var[bool] | bool | None = None, + command: Var[str] | str | None = None, + command_spacing: Var[int] | int | None = None, + is_disabled: Var[bool] | bool | None = None, + is_focusable: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> MenuItem: + """""" ... class MenuItemOption(ChakraComponent): @@ -341,82 +257,46 @@ class MenuItemOption(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + close_on_select: Var[bool] | bool | None = None, + command: Var[str] | str | None = None, + command_spacing: Var[int] | int | None = None, + is_checked: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_focusable: Var[bool] | bool | None = None, + type_: Literal["checkbox", "radio"] + | Var[Literal["checkbox", "radio"]] + | None = None, + value: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> MenuItemOption: + """""" ... class MenuGroup(ChakraComponent): @@ -425,64 +305,36 @@ class MenuGroup(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> MenuGroup: + """""" ... class MenuOptionGroup(ChakraComponent): @@ -491,70 +343,40 @@ class MenuOptionGroup(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + type_: Literal["checkbox", "radio"] + | Var[Literal["checkbox", "radio"]] + | None = None, + value: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> MenuOptionGroup: + """""" ... class MenuDivider(ChakraComponent): @@ -563,62 +385,34 @@ class MenuDivider(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> MenuDivider: + """""" ... diff --git a/reflex_chakra/components/overlay/modal.py b/reflex_chakra/components/overlay/modal.py index eba0b3b..4450f2c 100644 --- a/reflex_chakra/components/overlay/modal.py +++ b/reflex_chakra/components/overlay/modal.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Literal, Optional, Union +from typing import Literal from reflex_chakra.components import ChakraComponent from reflex_chakra.components.media import Icon from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var ModalSizes = Literal["xs", "sm", "md", "lg", "xl", "full"] @@ -73,10 +73,10 @@ class Modal(ChakraComponent): 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, + header: Component | str | None = None, + body: Component | str | None = None, + footer: Component | str | None = None, + close_button: Component | None = None, **props, ) -> Component: """Create a modal component. diff --git a/reflex_chakra/components/overlay/modal.pyi b/reflex_chakra/components/overlay/modal.pyi index 0b2cb26..88970cf 100644 --- a/reflex_chakra/components/overlay/modal.pyi +++ b/reflex_chakra/components/overlay/modal.pyi @@ -1,15 +1,22 @@ -"""Stub file for reflex/components/chakra/overlay/modal.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent from reflex.components.component import Component -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var ModalSizes = Literal["xs", "sm", "md", "lg", "xl", "full"] @@ -19,79 +26,58 @@ class Modal(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close_complete: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_esc: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_overlay_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + header: Component | str | None = None, + body: Component | str | None = None, + footer: Component | str | None = None, + close_button: Component | None = None, + is_open: Var[bool] | bool | None = None, + allow_pinch_zoom: Var[bool] | bool | None = None, + auto_focus: Var[bool] | bool | None = None, + block_scroll_on_mount: Var[bool] | bool | None = None, + close_on_esc: Var[bool] | bool | None = None, + close_on_overlay_click: Var[bool] | bool | None = None, + is_centered: Var[bool] | bool | None = None, + lock_focus_across_frames: Var[bool] | bool | None = None, + motion_preset: Var[str] | str | None = None, + preserve_scroll_bar_gap: Var[bool] | bool | None = None, + return_focus_on_close: Var[bool] | bool | None = None, + size: Literal["full", "lg", "md", "sm", "xl", "xs"] + | Var[Literal["full", "lg", "md", "sm", "xl", "xs"]] + | None = None, + use_inert: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_close: EventType[Any] | None = None, + on_close_complete: EventType[Any] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_esc: EventType[Any] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_overlay_click: EventType[Any] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Modal": + ) -> Modal: """Create a modal component. Args: @@ -113,9 +99,14 @@ class Modal(ChakraComponent): 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** + on_close: Fired when the modal is closing. + on_close_complete: Fired when the modal is closed and the exit animation is complete. + on_esc: Fired when the Esc key is pressed. + on_overlay_click: Fired when the overlay is clicked. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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 @@ -125,8 +116,7 @@ class Modal(ChakraComponent): AttributeError: error that occurs if conflicting props are passed Returns: - The modal component. - """ + The modal component.""" ... class ModalOverlay(ChakraComponent): @@ -135,64 +125,36 @@ class ModalOverlay(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ModalOverlay: + """""" ... class ModalHeader(ChakraComponent): @@ -201,64 +163,36 @@ class ModalHeader(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ModalHeader: + """""" ... class ModalFooter(ChakraComponent): @@ -267,64 +201,36 @@ class ModalFooter(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ModalFooter: + """""" ... class ModalContent(ChakraComponent): @@ -333,64 +239,36 @@ class ModalContent(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ModalContent: + """""" ... class ModalBody(ChakraComponent): @@ -399,64 +277,36 @@ class ModalBody(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ModalBody: + """""" ... class ModalCloseButton(ChakraComponent): @@ -465,62 +315,34 @@ class ModalCloseButton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> ModalCloseButton: + """""" ... diff --git a/reflex_chakra/components/overlay/popover.py b/reflex_chakra/components/overlay/popover.py index 535e475..acb737f 100644 --- a/reflex_chakra/components/overlay/popover.py +++ b/reflex_chakra/components/overlay/popover.py @@ -10,7 +10,7 @@ ) from reflex.components.component import Component from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Popover(ChakraComponent): diff --git a/reflex_chakra/components/overlay/popover.pyi b/reflex_chakra/components/overlay/popover.pyi index f842800..7919bef 100644 --- a/reflex_chakra/components/overlay/popover.pyi +++ b/reflex_chakra/components/overlay/popover.pyi @@ -1,16 +1,23 @@ -"""Stub file for reflex/components/chakra/overlay/popover.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ( ChakraComponent, ) -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Popover(ChakraComponent): @overload @@ -23,75 +30,59 @@ class Popover(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + arrow_padding: Var[int] | int | None = None, + arrow_shadow_color: Var[str] | str | None = None, + arrow_size: Var[int] | int | None = None, + auto_focus: Var[bool] | bool | None = None, + boundary: Var[str] | str | None = None, + close_on_blur: Var[bool] | bool | None = None, + close_on_esc: Var[bool] | bool | None = None, + default_is_open: Var[bool] | bool | None = None, + direction: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None, + flip: Var[bool] | bool | None = None, + gutter: Var[int] | int | None = None, + id_: Var[str] | str | None = None, + is_lazy: Var[bool] | bool | None = None, + lazy_behavior: Var[str] | str | None = None, + is_open: Var[bool] | bool | None = None, + match_width: Var[bool] | bool | None = None, + placement: Var[str] | str | None = None, + prevent_overflow: Var[bool] | bool | None = None, + return_focus_on_close: Var[bool] | bool | None = None, + strategy: Literal["absolute", "fixed"] + | Var[Literal["absolute", "fixed"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_close: EventType[Any] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_open: EventType[Any] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = None, **props, - ) -> "Popover": + ) -> Popover: """Create a popover component. Args: @@ -121,17 +112,19 @@ class Popover(ChakraComponent): 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") + on_close: Fired when the popover is closed. + on_open: Fired when the popover is opened. style: The style of the component. key: A unique key for the component. id: The id for the component. + ref: The Var to pass as the ref to 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. - """ + The popover component.""" ... class PopoverContent(ChakraComponent): @@ -140,64 +133,36 @@ class PopoverContent(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverContent: + """""" ... class PopoverHeader(ChakraComponent): @@ -206,64 +171,36 @@ class PopoverHeader(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverHeader: + """""" ... class PopoverFooter(ChakraComponent): @@ -272,64 +209,36 @@ class PopoverFooter(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverFooter: + """""" ... class PopoverBody(ChakraComponent): @@ -338,64 +247,36 @@ class PopoverBody(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverBody: + """""" ... class PopoverArrow(ChakraComponent): @@ -404,64 +285,36 @@ class PopoverArrow(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverArrow: + """""" ... class PopoverCloseButton(ChakraComponent): @@ -470,64 +323,36 @@ class PopoverCloseButton(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverCloseButton: + """""" ... class PopoverAnchor(ChakraComponent): @@ -536,64 +361,36 @@ class PopoverAnchor(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverAnchor: + """""" ... class PopoverTrigger(ChakraComponent): @@ -602,62 +399,34 @@ class PopoverTrigger(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> PopoverTrigger: + """""" ... diff --git a/reflex_chakra/components/overlay/tooltip.py b/reflex_chakra/components/overlay/tooltip.py index a4368fc..6aa4ba6 100644 --- a/reflex_chakra/components/overlay/tooltip.py +++ b/reflex_chakra/components/overlay/tooltip.py @@ -4,7 +4,7 @@ from reflex_chakra.components import ChakraComponent, LiteralChakraDirection from reflex.event import EventHandler -from reflex.vars import Var +from reflex.vars.base import Var class Tooltip(ChakraComponent): diff --git a/reflex_chakra/components/overlay/tooltip.pyi b/reflex_chakra/components/overlay/tooltip.pyi index b60c5b4..cd50abf 100644 --- a/reflex_chakra/components/overlay/tooltip.pyi +++ b/reflex_chakra/components/overlay/tooltip.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/overlay/tooltip.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Tooltip(ChakraComponent): @overload @@ -16,100 +23,53 @@ class Tooltip(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_close: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_open: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + arrow_padding: Var[int] | int | None = None, + arrow_shadow_color: Var[str] | str | None = None, + arrow_size: Var[int] | int | None = None, + delay: Var[int] | int | None = None, + close_on_click: Var[bool] | bool | None = None, + close_on_esc: Var[bool] | bool | None = None, + close_on_mouse_down: Var[bool] | bool | None = None, + default_is_open: Var[bool] | bool | None = None, + direction: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None, + gutter: Var[int] | int | None = None, + has_arrow: Var[bool] | bool | None = None, + is_disabled: Var[bool] | bool | None = None, + is_open: Var[bool] | bool | None = None, + label: Var[str] | str | None = None, + open_delay: Var[int] | int | None = None, + placement: Var[str] | str | None = None, + should_wrap_children: Var[bool] | bool | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_close: EventType[Any] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_open: EventType[Any] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Tooltip: + """""" ... diff --git a/reflex_chakra/components/typography/__init__.py b/reflex_chakra/components/typography/__init__.py index be06b13..64022d3 100644 --- a/reflex_chakra/components/typography/__init__.py +++ b/reflex_chakra/components/typography/__init__.py @@ -1,10 +1,8 @@ """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 +__all__ = ["Heading", "Highlight", "Span", "Text"] diff --git a/reflex_chakra/components/typography/heading.py b/reflex_chakra/components/typography/heading.py index f1ce0d3..01da7b5 100644 --- a/reflex_chakra/components/typography/heading.py +++ b/reflex_chakra/components/typography/heading.py @@ -1,7 +1,7 @@ """A heading component.""" from reflex_chakra.components import ChakraComponent, LiteralHeadingSize -from reflex.vars import Var +from reflex.vars.base import Var class Heading(ChakraComponent): diff --git a/reflex_chakra/components/typography/heading.pyi b/reflex_chakra/components/typography/heading.pyi index 01eea6b..b1934ae 100644 --- a/reflex_chakra/components/typography/heading.pyi +++ b/reflex_chakra/components/typography/heading.pyi @@ -1,14 +1,21 @@ -"""Stub file for reflex/components/chakra/typography/heading.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + Literal, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Heading(ChakraComponent): @overload @@ -16,71 +23,38 @@ class Heading(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + as_: Var[str] | str | None = None, + size: Literal["2xl", "3xl", "4xl", "lg", "md", "sm", "xl", "xs"] + | Var[Literal["2xl", "3xl", "4xl", "lg", "md", "sm", "xl", "xs"]] + | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Heading: + """""" ... diff --git a/reflex_chakra/components/typography/highlight.py b/reflex_chakra/components/typography/highlight.py index 55c1a8f..fb264db 100644 --- a/reflex_chakra/components/typography/highlight.py +++ b/reflex_chakra/components/typography/highlight.py @@ -1,10 +1,8 @@ """A highlight component.""" -from typing import Dict, List - from reflex_chakra.components import ChakraComponent -from reflex.components.tags import Tag -from reflex.vars import Var +from reflex.components.tags.tag import Tag +from reflex.vars.base import Var class Highlight(ChakraComponent): @@ -13,11 +11,11 @@ class Highlight(ChakraComponent): tag = "Highlight" # A query for the text to highlight. Can be a string or a list of strings. - query: Var[List[str]] + 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 + 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_chakra/components/typography/highlight.pyi b/reflex_chakra/components/typography/highlight.pyi index 9f2f637..4a4192a 100644 --- a/reflex_chakra/components/typography/highlight.pyi +++ b/reflex_chakra/components/typography/highlight.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/typography/highlight.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Highlight(ChakraComponent): @overload @@ -16,66 +22,36 @@ class Highlight(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + query: list[str] | Var[list[str]] | None = None, + styles: dict | Var[dict] | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Highlight: + """""" ... diff --git a/reflex_chakra/components/typography/span.py b/reflex_chakra/components/typography/span.py index 4ca3832..839a4c2 100644 --- a/reflex_chakra/components/typography/span.py +++ b/reflex_chakra/components/typography/span.py @@ -3,7 +3,7 @@ from __future__ import annotations from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Span(ChakraComponent): diff --git a/reflex_chakra/components/typography/span.pyi b/reflex_chakra/components/typography/span.pyi index 7c9272a..db996a0 100644 --- a/reflex_chakra/components/typography/span.pyi +++ b/reflex_chakra/components/typography/span.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/typography/span.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Span(ChakraComponent): @overload @@ -16,64 +22,35 @@ class Span(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + as_: Var[str] | str | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Span: + """""" ... diff --git a/reflex_chakra/components/typography/text.py b/reflex_chakra/components/typography/text.py index 2923f0c..0f3b05a 100644 --- a/reflex_chakra/components/typography/text.py +++ b/reflex_chakra/components/typography/text.py @@ -3,7 +3,7 @@ from __future__ import annotations from reflex_chakra.components import ChakraComponent -from reflex.vars import Var +from reflex.vars.base import Var class Text(ChakraComponent): diff --git a/reflex_chakra/components/typography/text.pyi b/reflex_chakra/components/typography/text.pyi index 11a6328..f93b732 100644 --- a/reflex_chakra/components/typography/text.pyi +++ b/reflex_chakra/components/typography/text.pyi @@ -1,14 +1,20 @@ -"""Stub file for reflex/components/chakra/typography/text.py""" +"""Stub file for reflex_chakra/components/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 typing import ( + Any, + overload, +) +from collections.abc import Mapping, Sequence +from reflex.components.core.breakpoints import Breakpoints +from reflex.event import ( + EventType, + PointerEventInfo, +) +from reflex.vars.base import Var from reflex_chakra.components import ChakraComponent -from reflex.event import EventHandler, EventSpec -from reflex.style import Style -from reflex.vars import Var class Text(ChakraComponent): @overload @@ -16,66 +22,36 @@ class Text(ChakraComponent): 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, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] - ] = None, + as_: Var[str] | str | None = None, + no_of_lines: Var[int] | int | None = None, + style: Sequence[Mapping[str, Any]] + | Mapping[str, Any] + | Var[Mapping[str, Any]] + | Breakpoints + | None = None, + key: Any | None = None, + id: Any | None = None, + ref: Var | None = None, + class_name: Any | None = None, + autofocus: bool | None = None, + custom_attrs: dict[str, Var | Any] | None = None, + on_blur: EventType[()] | None = None, + on_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, + on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, + on_focus: EventType[()] | None = None, + on_mount: EventType[()] | None = None, + on_mouse_down: EventType[()] | None = None, + on_mouse_enter: EventType[()] | None = None, + on_mouse_leave: EventType[()] | None = None, + on_mouse_move: EventType[()] | None = None, + on_mouse_out: EventType[()] | None = None, + on_mouse_over: EventType[()] | None = None, + on_mouse_up: EventType[()] | None = None, + on_scroll: EventType[()] | None = None, + on_scroll_end: EventType[()] | None = None, + on_unmount: EventType[()] | None = 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. - """ + ) -> Text: + """""" ... From 9c448e616e51576e7a937f48f1c297599ec4e80c Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 14:49:53 -0700 Subject: [PATCH 02/15] add ruff ci --- .github/workflows/{export_docs.yml => ci.yml} | 16 ++++++++++++++++ pyproject.toml | 3 +++ 2 files changed, 19 insertions(+) rename .github/workflows/{export_docs.yml => ci.yml} (59%) diff --git a/.github/workflows/export_docs.yml b/.github/workflows/ci.yml similarity index 59% rename from .github/workflows/export_docs.yml rename to .github/workflows/ci.yml index 24b0c17..7a768fb 100644 --- a/.github/workflows/export_docs.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,22 @@ on: branches: [main] jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install UV + uses: astral-sh/setup-uv@v6 + with: + python-version: "3.10" + enable-cache: true + activate-environment: true + - name: Install dependencies + run: uv sync + - name: Run Ruff Linter + run: ruff check --output-format=github reflex_chakra + - name: Run Ruff Formatter + run: ruff format --check --diff reflex_chakra check-export: runs-on: ubuntu-latest steps: diff --git a/pyproject.toml b/pyproject.toml index 6c35b11..a2fed0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,9 @@ build-backend = "hatchling.build" [tool.hatch.build] include = ["reflex_chakra"] +[dependency-groups] +dev = ["ruff", "pyright"] + [tool.ruff] target-version = "py310" lint.extend-select = ["UP", "RUF022"] From bbb1f307f763dd2f36e5669d35d069352374eb17 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 14:53:11 -0700 Subject: [PATCH 03/15] run pyright --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a768fb..22732ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,22 @@ on: branches: [main] jobs: + type-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install UV + uses: astral-sh/setup-uv@v6 + with: + python-version: "3.10" + enable-cache: true + activate-environment: true + - name: Install dependencies + run: uv sync + - name: Run Type Checking + uses: jakebailey/pyright-action@v2 + with: + version: PATH lint: runs-on: ubuntu-latest steps: From 503fac4ed58f0c460c2032c4a2220f294772bb59 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 14:54:16 -0700 Subject: [PATCH 04/15] add working dir --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22732ad..355b2e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: - name: Run Type Checking uses: jakebailey/pyright-action@v2 with: + working-directory: reflex_chakra version: PATH lint: runs-on: ubuntu-latest From 5a0e5db1b85b6eff0c2df1405fdb93075caf3e61 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 14:56:41 -0700 Subject: [PATCH 05/15] do it through extra args --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 355b2e4..7da3657 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Run Type Checking uses: jakebailey/pyright-action@v2 with: - working-directory: reflex_chakra + extra-args: reflex_chakra version: PATH lint: runs-on: ubuntu-latest From 28445f0eb100760712c3df341ba9c0d26adb4c5a Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 15:08:02 -0700 Subject: [PATCH 06/15] run pyi again and uv lock --- .python-version | 1 + .../components/disclosure/accordion.pyi | 4 +- .../components/forms/rangeslider.pyi | 4 +- reflex_chakra/components/layout/flex.pyi | 4 +- reflex_chakra/components/layout/grid.pyi | 2 +- reflex_chakra/components/layout/stack.pyi | 18 +++--- .../components/typography/highlight.pyi | 4 +- uv.lock | 63 ++++++++++++++++++- 8 files changed, 80 insertions(+), 20 deletions(-) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..3a4f41e --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 \ No newline at end of file diff --git a/reflex_chakra/components/disclosure/accordion.pyi b/reflex_chakra/components/disclosure/accordion.pyi index 7ba8877..c283ddd 100644 --- a/reflex_chakra/components/disclosure/accordion.pyi +++ b/reflex_chakra/components/disclosure/accordion.pyi @@ -26,8 +26,8 @@ class Accordion(ChakraComponent): icon_pos="right", allow_multiple: Var[bool] | bool | None = None, allow_toggle: Var[bool] | bool | None = None, - default_index: list[int] | Var[list[int] | None] | None = None, - index: list[int] | Var[list[int] | int] | int | None = None, + default_index: Var[list[int] | None] | list[int] | None = None, + index: Var[int | list[int]] | int | list[int] | None = None, reduce_motion: Var[bool] | bool | None = None, style: Sequence[Mapping[str, Any]] | Mapping[str, Any] diff --git a/reflex_chakra/components/forms/rangeslider.pyi b/reflex_chakra/components/forms/rangeslider.pyi index d229d0e..7afffdf 100644 --- a/reflex_chakra/components/forms/rangeslider.pyi +++ b/reflex_chakra/components/forms/rangeslider.pyi @@ -24,8 +24,8 @@ class RangeSlider(ChakraComponent): def create( # type: ignore cls, *children, - value: list[int] | Var[list[int]] | None = None, - default_value: list[int] | Var[list[int]] | None = None, + value: Var[list[int]] | list[int] | None = None, + default_value: Var[list[int]] | list[int] | None = None, direction: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None, focus_thumb_on_change: Var[bool] | bool | None = None, is_disabled: Var[bool] | bool | None = None, diff --git a/reflex_chakra/components/layout/flex.pyi b/reflex_chakra/components/layout/flex.pyi index d476766..20a6ea5 100644 --- a/reflex_chakra/components/layout/flex.pyi +++ b/reflex_chakra/components/layout/flex.pyi @@ -24,10 +24,10 @@ class Flex(ChakraComponent): *children, align: Var[str] | str | None = None, basis: Var[str] | str | None = None, - direction: list[str] | Var[list[str] | str] | str | None = None, + direction: Var[list[str] | str] | list[str] | str | None = None, grow: Var[str] | str | None = None, justify: Var[str] | str | None = None, - wrap: list[str] | Var[list[str] | str] | str | None = None, + wrap: Var[list[str] | str] | list[str] | str | None = None, shrink: Var[str] | str | None = None, style: Sequence[Mapping[str, Any]] | Mapping[str, Any] diff --git a/reflex_chakra/components/layout/grid.pyi b/reflex_chakra/components/layout/grid.pyi index c831b69..9ef6a8d 100644 --- a/reflex_chakra/components/layout/grid.pyi +++ b/reflex_chakra/components/layout/grid.pyi @@ -117,7 +117,7 @@ class ResponsiveGrid(ChakraComponent): auto_rows: Var[str] | str | None = None, column: Var[str] | str | None = None, row: Var[str] | str | None = None, - columns: list[int] | Var[list[int]] | None = None, + columns: Var[list[int]] | list[int] | None = None, min_child_width: Var[str] | str | None = None, spacing: Var[str] | str | None = None, spacing_x: Var[str] | str | None = None, diff --git a/reflex_chakra/components/layout/stack.pyi b/reflex_chakra/components/layout/stack.pyi index 36abe32..840df18 100644 --- a/reflex_chakra/components/layout/stack.pyi +++ b/reflex_chakra/components/layout/stack.pyi @@ -24,9 +24,9 @@ class Stack(ChakraComponent): cls, *children, align_items: Var[str] | str | None = None, - direction: list[str] - | Literal["column", "row"] - | Var[list[str] | Literal["column", "row"]] + direction: Literal["column", "row"] + | Var[Literal["column", "row"] | list[str]] + | list[str] | None = None, is_inline: Var[bool] | bool | None = None, justify_content: Var[str] | str | None = None, @@ -73,9 +73,9 @@ class Hstack(Stack): cls, *children, align_items: Var[str] | str | None = None, - direction: list[str] - | Literal["column", "row"] - | Var[list[str] | Literal["column", "row"]] + direction: Literal["column", "row"] + | Var[Literal["column", "row"] | list[str]] + | list[str] | None = None, is_inline: Var[bool] | bool | None = None, justify_content: Var[str] | str | None = None, @@ -122,9 +122,9 @@ class Vstack(Stack): cls, *children, align_items: Var[str] | str | None = None, - direction: list[str] - | Literal["column", "row"] - | Var[list[str] | Literal["column", "row"]] + direction: Literal["column", "row"] + | Var[Literal["column", "row"] | list[str]] + | list[str] | None = None, is_inline: Var[bool] | bool | None = None, justify_content: Var[str] | str | None = None, diff --git a/reflex_chakra/components/typography/highlight.pyi b/reflex_chakra/components/typography/highlight.pyi index 4a4192a..992fcc9 100644 --- a/reflex_chakra/components/typography/highlight.pyi +++ b/reflex_chakra/components/typography/highlight.pyi @@ -22,8 +22,8 @@ class Highlight(ChakraComponent): def create( # type: ignore cls, *children, - query: list[str] | Var[list[str]] | None = None, - styles: dict | Var[dict] | None = None, + query: Var[list[str]] | list[str] | None = None, + styles: Var[dict] | dict | None = None, style: Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] diff --git a/uv.lock b/uv.lock index 6886df7..9c2490c 100644 --- a/uv.lock +++ b/uv.lock @@ -395,6 +395,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, ] +[[package]] +name = "nodeenv" +version = "1.9.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f", size = 47437, upload-time = "2024-06-04T18:44:11.171Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314, upload-time = "2024-06-04T18:44:08.352Z" }, +] + [[package]] name = "packaging" version = "25.0" @@ -539,6 +548,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" }, ] +[[package]] +name = "pyright" +version = "1.1.402" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodeenv" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/aa/04/ce0c132d00e20f2d2fb3b3e7c125264ca8b909e693841210534b1ea1752f/pyright-1.1.402.tar.gz", hash = "sha256:85a33c2d40cd4439c66aa946fd4ce71ab2f3f5b8c22ce36a623f59ac22937683", size = 3888207, upload-time = "2025-06-11T08:48:35.759Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fe/37/1a1c62d955e82adae588be8e374c7f77b165b6cb4203f7d581269959abbc/pyright-1.1.402-py3-none-any.whl", hash = "sha256:2c721f11869baac1884e846232800fe021c33f1b4acb3929cff321f7ea4e2982", size = 5624004, upload-time = "2025-06-11T08:48:33.998Z" }, +] + [[package]] name = "python-engineio" version = "4.12.2" @@ -660,14 +682,26 @@ wheels = [ [[package]] name = "reflex-chakra" -version = "0.7.1" +version = "0.8.1" source = { editable = "." } dependencies = [ { name = "reflex" }, ] +[package.dev-dependencies] +dev = [ + { name = "pyright" }, + { name = "ruff" }, +] + [package.metadata] -requires-dist = [{ name = "reflex", specifier = ">=0.8.0a0" }] +requires-dist = [{ name = "reflex", specifier = ">=0.8.0.dev0" }] + +[package.metadata.requires-dev] +dev = [ + { name = "pyright" }, + { name = "ruff" }, +] [[package]] name = "reflex-hosting-cli" @@ -701,6 +735,31 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0d/9b/63f4c7ebc259242c89b3acafdb37b41d1185c07ff0011164674e9076b491/rich-14.0.0-py3-none-any.whl", hash = "sha256:1c9491e1951aac09caffd42f448ee3d04e58923ffe14993f6e83068dc395d7e0", size = 243229, upload-time = "2025-03-30T14:15:12.283Z" }, ] +[[package]] +name = "ruff" +version = "0.12.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/90/5255432602c0b196a0da6720f6f76b93eb50baef46d3c9b0025e2f9acbf3/ruff-0.12.0.tar.gz", hash = "sha256:4d047db3662418d4a848a3fdbfaf17488b34b62f527ed6f10cb8afd78135bc5c", size = 4376101, upload-time = "2025-06-17T15:19:26.217Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e6/fd/b46bb20e14b11ff49dbc74c61de352e0dc07fb650189513631f6fb5fc69f/ruff-0.12.0-py3-none-linux_armv6l.whl", hash = "sha256:5652a9ecdb308a1754d96a68827755f28d5dfb416b06f60fd9e13f26191a8848", size = 10311554, upload-time = "2025-06-17T15:18:45.792Z" }, + { url = "https://files.pythonhosted.org/packages/e7/d3/021dde5a988fa3e25d2468d1dadeea0ae89dc4bc67d0140c6e68818a12a1/ruff-0.12.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:05ed0c914fabc602fc1f3b42c53aa219e5736cb030cdd85640c32dbc73da74a6", size = 11118435, upload-time = "2025-06-17T15:18:49.064Z" }, + { url = "https://files.pythonhosted.org/packages/07/a2/01a5acf495265c667686ec418f19fd5c32bcc326d4c79ac28824aecd6a32/ruff-0.12.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:07a7aa9b69ac3fcfda3c507916d5d1bca10821fe3797d46bad10f2c6de1edda0", size = 10466010, upload-time = "2025-06-17T15:18:51.341Z" }, + { url = "https://files.pythonhosted.org/packages/4c/57/7caf31dd947d72e7aa06c60ecb19c135cad871a0a8a251723088132ce801/ruff-0.12.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e7731c3eec50af71597243bace7ec6104616ca56dda2b99c89935fe926bdcd48", size = 10661366, upload-time = "2025-06-17T15:18:53.29Z" }, + { url = "https://files.pythonhosted.org/packages/e9/ba/aa393b972a782b4bc9ea121e0e358a18981980856190d7d2b6187f63e03a/ruff-0.12.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:952d0630eae628250ab1c70a7fffb641b03e6b4a2d3f3ec6c1d19b4ab6c6c807", size = 10173492, upload-time = "2025-06-17T15:18:55.262Z" }, + { url = "https://files.pythonhosted.org/packages/d7/50/9349ee777614bc3062fc6b038503a59b2034d09dd259daf8192f56c06720/ruff-0.12.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c021f04ea06966b02614d442e94071781c424ab8e02ec7af2f037b4c1e01cc82", size = 11761739, upload-time = "2025-06-17T15:18:58.906Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/ad459de67c70ec112e2ba7206841c8f4eb340a03ee6a5cabc159fe558b8e/ruff-0.12.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:7d235618283718ee2fe14db07f954f9b2423700919dc688eacf3f8797a11315c", size = 12537098, upload-time = "2025-06-17T15:19:01.316Z" }, + { url = "https://files.pythonhosted.org/packages/ed/50/15ad9c80ebd3c4819f5bd8883e57329f538704ed57bac680d95cb6627527/ruff-0.12.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0c0758038f81beec8cc52ca22de9685b8ae7f7cc18c013ec2050012862cc9165", size = 12154122, upload-time = "2025-06-17T15:19:03.727Z" }, + { url = "https://files.pythonhosted.org/packages/76/e6/79b91e41bc8cc3e78ee95c87093c6cacfa275c786e53c9b11b9358026b3d/ruff-0.12.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:139b3d28027987b78fc8d6cfb61165447bdf3740e650b7c480744873688808c2", size = 11363374, upload-time = "2025-06-17T15:19:05.875Z" }, + { url = "https://files.pythonhosted.org/packages/db/c3/82b292ff8a561850934549aa9dc39e2c4e783ab3c21debe55a495ddf7827/ruff-0.12.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:68853e8517b17bba004152aebd9dd77d5213e503a5f2789395b25f26acac0da4", size = 11587647, upload-time = "2025-06-17T15:19:08.246Z" }, + { url = "https://files.pythonhosted.org/packages/2b/42/d5760d742669f285909de1bbf50289baccb647b53e99b8a3b4f7ce1b2001/ruff-0.12.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3a9512af224b9ac4757f7010843771da6b2b0935a9e5e76bb407caa901a1a514", size = 10527284, upload-time = "2025-06-17T15:19:10.37Z" }, + { url = "https://files.pythonhosted.org/packages/19/f6/fcee9935f25a8a8bba4adbae62495c39ef281256693962c2159e8b284c5f/ruff-0.12.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b08df3d96db798e5beb488d4df03011874aff919a97dcc2dd8539bb2be5d6a88", size = 10158609, upload-time = "2025-06-17T15:19:12.286Z" }, + { url = "https://files.pythonhosted.org/packages/37/fb/057febf0eea07b9384787bfe197e8b3384aa05faa0d6bd844b94ceb29945/ruff-0.12.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6a315992297a7435a66259073681bb0d8647a826b7a6de45c6934b2ca3a9ed51", size = 11141462, upload-time = "2025-06-17T15:19:15.195Z" }, + { url = "https://files.pythonhosted.org/packages/10/7c/1be8571011585914b9d23c95b15d07eec2d2303e94a03df58294bc9274d4/ruff-0.12.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1e55e44e770e061f55a7dbc6e9aed47feea07731d809a3710feda2262d2d4d8a", size = 11641616, upload-time = "2025-06-17T15:19:17.6Z" }, + { url = "https://files.pythonhosted.org/packages/6a/ef/b960ab4818f90ff59e571d03c3f992828d4683561095e80f9ef31f3d58b7/ruff-0.12.0-py3-none-win32.whl", hash = "sha256:7162a4c816f8d1555eb195c46ae0bd819834d2a3f18f98cc63819a7b46f474fb", size = 10525289, upload-time = "2025-06-17T15:19:19.688Z" }, + { url = "https://files.pythonhosted.org/packages/34/93/8b16034d493ef958a500f17cda3496c63a537ce9d5a6479feec9558f1695/ruff-0.12.0-py3-none-win_amd64.whl", hash = "sha256:d00b7a157b8fb6d3827b49d3324da34a1e3f93492c1f97b08e222ad7e9b291e0", size = 11598311, upload-time = "2025-06-17T15:19:21.785Z" }, + { url = "https://files.pythonhosted.org/packages/d0/33/4d3e79e4a84533d6cd526bfb42c020a23256ae5e4265d858bd1287831f7d/ruff-0.12.0-py3-none-win_arm64.whl", hash = "sha256:8cd24580405ad8c1cc64d61725bca091d6b6da7eb3d36f72cc605467069d7e8b", size = 10724946, upload-time = "2025-06-17T15:19:23.952Z" }, +] + [[package]] name = "simple-websocket" version = "1.1.0" From 9215c972b59aa15171aa7ebd338e55fe71ffa3c2 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 15:09:13 -0700 Subject: [PATCH 07/15] ignore that file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 82f9275..0d898f6 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,5 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +assets/chakra_color_mode_provider.js \ No newline at end of file From 7f727a802d81d756197dabb5b9c652697bb397f6 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 15:14:37 -0700 Subject: [PATCH 08/15] add check for pyi files --- .github/workflows/ci.yml | 16 ++++++++++++++++ regenerate_pyi.py | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 regenerate_pyi.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7da3657..e9df70b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,22 @@ jobs: run: ruff check --output-format=github reflex_chakra - name: Run Ruff Formatter run: ruff format --check --diff reflex_chakra + check-pyi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install UV + uses: astral-sh/setup-uv@v6 + with: + python-version: "3.10" + enable-cache: true + activate-environment: true + - name: Install dependencies + run: uv sync + - name: Run PYI generation + run: python regenerate_pyi.py + - name: Check if there are any changes + run: git diff --exit-code -- "*.pyi" || (echo "PYI files have changed. Please commit the changes." && exit 1) check-export: runs-on: ubuntu-latest steps: diff --git a/regenerate_pyi.py b/regenerate_pyi.py new file mode 100644 index 0000000..5247fff --- /dev/null +++ b/regenerate_pyi.py @@ -0,0 +1,3 @@ +from reflex.utils.pyi_generator import PyiGenerator + +PyiGenerator().scan_all(["reflex_chakra"]) From d31c1ae72451e825ecf047ec31f37a3e80a3371e Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 15:15:54 -0700 Subject: [PATCH 09/15] use 3.13 for check pyi --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9df70b..5c417e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: - name: Install UV uses: astral-sh/setup-uv@v6 with: - python-version: "3.10" + python-version: "3.13" enable-cache: true activate-environment: true - name: Install dependencies From 95dc47efe442ee464e3641832c348fe95f8219f4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 16:37:25 -0700 Subject: [PATCH 10/15] basically do DCE --- docs/rcweb/rcweb/rcweb.py | 43 ++--- docs/rcweb/rcweb/utils/docpage.py | 160 ++++++------------ docs/rcweb/rcweb/utils/sidebar.py | 145 ++++------------ pyproject.toml | 3 +- reflex_chakra/components/base.py | 19 ++- reflex_chakra/components/base.pyi | 6 +- reflex_chakra/components/datadisplay/table.py | 22 +-- reflex_chakra/components/forms/pininput.py | 2 +- .../components/typography/highlight.py | 4 +- 9 files changed, 133 insertions(+), 271 deletions(-) diff --git a/docs/rcweb/rcweb/rcweb.py b/docs/rcweb/rcweb/rcweb.py index bbfdf40..0c0f90f 100644 --- a/docs/rcweb/rcweb/rcweb.py +++ b/docs/rcweb/rcweb/rcweb.py @@ -6,30 +6,15 @@ from types import SimpleNamespace import reflex as rx +from reflex.utils.format import to_kebab_case, to_snake_case import reflex_chakra as rc # noqa: F401 import flexdown from .utils.flexdown import xd -from .utils.docpage import multi_docs +from .utils.docpage import Route, multi_docs from .constants import css -def should_skip_compile(doc: flexdown.Document): - """Skip compilation if the markdown file has not been modified since the last compilation.""" - if not os.environ.get("REFLEX_PERSIST_WEB_DIR", False): - return False - - # Check if the doc has been compiled already. - compiled_output = f".web/pages/{doc.replace('.md', '.js')}" - # Get the timestamp of the compiled file. - compiled_time = ( - os.path.getmtime(compiled_output) if os.path.exists(compiled_output) else 0 - ) - # Get the timestamp of the source file. - source_time = os.path.getmtime(doc) - return compiled_time > source_time - - def find_flexdown_files(directory: str) -> list[str]: """Recursively find all Flexdown (.md) files in the given directory. @@ -47,7 +32,9 @@ def find_flexdown_files(directory: str) -> list[str]: ] -def extract_components_from_metadata(document) -> list: +def extract_components_from_metadata( + document: flexdown.Document, +) -> list[tuple[type, str]]: """Extract components from the document metadata. Args: @@ -56,7 +43,7 @@ def extract_components_from_metadata(document) -> list: Returns: A list of tuples containing component instances and their string representation. """ - components = [] + components: list[tuple[type, str]] = [] for comp_str in document.metadata.get("components", []): component = eval(comp_str) if isinstance(component, type): @@ -99,8 +86,10 @@ def convert_to_title_case(text: str) -> str: def create_doc_component( - doc_path: str, base_dir: str, component_registry: defaultdict -) -> rx.Component: + doc_path: str, + base_dir: str, + component_registry: defaultdict[str, list[tuple[str, list[tuple[type, str]]]]], +) -> Route: """Create a document component for a given file path. Args: @@ -112,13 +101,13 @@ def create_doc_component( A component object representing the document page. """ doc_path = doc_path.replace("\\", "/") - route_path = rx.utils.format.to_kebab_case( + route_path = to_kebab_case( f"/{doc_path.removeprefix(base_dir).replace('.md', '/')}" ).replace("//", "/") category = os.path.basename(os.path.dirname(doc_path)).title() document = flexdown.parse_file(doc_path) - title = rx.utils.format.to_snake_case(os.path.basename(doc_path).replace(".md", "")) - component_list = [title, *extract_components_from_metadata(document)] + title = to_snake_case(os.path.basename(doc_path).replace(".md", "")) + component_list = (title, extract_components_from_metadata(document)) component_registry[category].append(component_list) return multi_docs( path=route_path, @@ -129,7 +118,7 @@ def create_doc_component( ) -def generate_document_routes(doc_paths: list[str], base_dir: str) -> list[rx.Component]: +def generate_document_routes(doc_paths: list[str], base_dir: str) -> list[Route]: """Generate document components and routes from Flexdown file paths. Args: @@ -146,9 +135,7 @@ def generate_document_routes(doc_paths: list[str], base_dir: str) -> list[rx.Com ] -def setup_application_routes( - app: rx.App, doc_routes: list[rx.Component], base_path: str -): +def setup_application_routes(app: rx.App, doc_routes: list[Route], base_path: str): """Set up application routes based on document components. Args: diff --git a/docs/rcweb/rcweb/utils/docpage.py b/docs/rcweb/rcweb/utils/docpage.py index f0dceff..efc84dc 100644 --- a/docs/rcweb/rcweb/utils/docpage.py +++ b/docs/rcweb/rcweb/utils/docpage.py @@ -1,10 +1,10 @@ """Utility functions for the component docs page.""" from collections.abc import Callable +import dataclasses import functools import inspect import reflex_chakra as rc -import os import re from types import UnionType from typing import ( @@ -14,6 +14,7 @@ get_args, get_origin, ) +from reflex.constants.colors import ColorType from collections.abc import Sequence import mistletoe from ..utils.flexdown import xd, markdown, docdemobox @@ -22,8 +23,10 @@ from ..utils.blocks.headings import h2_comp, h1_comp import reflex as rx import flexdown +import flexdown.blocks import textwrap -from reflex.base import Base +import mistletoe.block_token +import mistletoe.token from reflex.components.component import Component from reflex.components.base.fragment import Fragment from reflex.components.el.elements.base import BaseHTML @@ -32,7 +35,7 @@ flat_items = [] # Mapping from types to colors. -TYPE_COLORS = { +TYPE_COLORS: dict[str, ColorType] = { "int": "red", "float": "orange", "str": "yellow", @@ -345,7 +348,8 @@ def process_var_create_safe(match): return value.strip() -class Prop(Base): +@dataclasses.dataclass +class Prop: """Hold information about a prop.""" # The name of the prop. @@ -361,7 +365,8 @@ class Prop(Base): default_value: str -class Route(Base): +@dataclasses.dataclass(kw_only=True) +class Route: """A page route.""" # The path of the route. @@ -402,6 +407,9 @@ def get_path(component_fn: Callable): """ module = inspect.getmodule(component_fn) + if module is None: + raise ValueError(f"Could not find module for {component_fn}") + # Create a path based on the module name. return ( module.__name__.replace(".", "/").replace("_", "-").split("pcweb/pages")[1] @@ -415,7 +423,7 @@ def docpage( right_sidebar: bool = True, page_title: str | None = None, pseudo_right_bar: bool = False, - chakra_components={}, + chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]] = {}, ): """A template that most pages on the reflex.dev site should use. @@ -429,7 +437,10 @@ def docpage( A wrapper function that returns the full webpage. """ - def docpage(contents: Callable[[], Route]) -> Route: + def docpage( + contents: Callable[[], Component] + | Callable[[], tuple[list[tuple[int, str]], Component]], + ) -> Route: """Wrap a component in a docpage template. Args: @@ -510,16 +521,16 @@ def wrapper(*args, **kwargs) -> rx.Component: else: links.append(rx.fragment()) - toc = [] + table_of_contents = [] if not isinstance(contents, rx.Component): comp = contents(*args, **kwargs) else: comp = contents if isinstance(comp, tuple): - toc, comp = comp + table_of_contents, comp = comp - show_right_sidebar = right_sidebar and len(toc) >= 2 + show_right_sidebar = right_sidebar and len(table_of_contents) >= 2 main_content_width = " lg:w-[60%]" if show_right_sidebar else " lg:w-full" @@ -625,7 +636,7 @@ def wrapper(*args, **kwargs) -> rx.Component: ) ) ) - for level, text in toc + for level, text in table_of_contents ], class_name="flex flex-col gap-4 list-none", ), @@ -671,18 +682,19 @@ def wrapper(*args, **kwargs) -> rx.Component: return docpage -class Source(Base): +@dataclasses.dataclass(init=False) +class Source: """Parse the source code of a component.""" # The component to parse. component: type[Component] # The source code. - code: list[str] = [] + code: list[str] = dataclasses.field(default_factory=list) - def __init__(self, *args, **kwargs): + def __init__(self, component: type[Component]): """Initialize the source code parser.""" - super().__init__(*args, **kwargs) + self.component = component # Get the source code. self.code = [ @@ -697,7 +709,7 @@ def get_docs(self) -> str: Returns: The docstring of the component. """ - return self.component.__doc__ + return self.component.__doc__ or "" def get_props(self) -> list[Prop]: """Get a dictionary of the props and their descriptions. @@ -776,7 +788,7 @@ def get_comment(comments: list[str]): return "".join([comment.strip().strip("#") for comment in comments]) -def get_code_style(color: str): +def get_code_style(color: ColorType): return { "color": rx.color(color, 11), "border_radius": "0.25rem", @@ -839,9 +851,9 @@ def prop_docs(prop: Prop) -> list[rx.Component]: """Generate the docs for a prop.""" # Get the type of the prop. type_ = prop.type_ - if rx.utils.types._issubclass(prop.type_, rx.Var): + if get_origin(type_) is rx.Var: # For vars, get the type of the var. - type_ = rx.utils.types.get_args(type_)[0] + type_ = get_args(type_)[0] origin = get_origin(type_) args = get_args(type_) @@ -1213,12 +1225,12 @@ def component_docs(component_tuple, comp): ) -def get_headings(comp): +def get_headings( + comp: mistletoe.Document | mistletoe.token.Token, +) -> list[tuple[int, str]]: """Get the strings from markdown component.""" if isinstance(comp, mistletoe.block_token.Heading): - heading_text = "".join( - token.content for token in comp.children if hasattr(token, "content") - ) + heading_text = comp.content return [(comp.level, heading_text)] # Recursively get the strings from the children. @@ -1231,9 +1243,12 @@ def get_headings(comp): return headings -def get_toc(source, href, component_list=None): +def get_table_of_contents( + source: flexdown.Document, + href: str, + component_list: list[tuple[type, str]] | None = None, +): component_list = component_list or [] - component_list = component_list[1:] # Generate the TOC # The environment used for execing and evaling code. @@ -1241,11 +1256,11 @@ def get_toc(source, href, component_list=None): env["__xd"] = xd # Get the content of the document. - source = source.content + source_str = source.content # Get the blocks in the source code. # Note: we must use reflex-web's special flexdown instance xd here - it knows about all custom block types (like DemoBlock) - blocks = xd.get_blocks(source, href) + blocks = xd.get_blocks(source_str, href) content_pieces = [] for block in blocks: @@ -1267,96 +1282,31 @@ def get_toc(source, href, component_list=None): if len(component_list): headings.append((1, "API Reference")) - for component_tuple in component_list: - headings.append((2, component_tuple[1])) + for _, component_name in component_list: + headings.append((2, component_name)) return headings -def multi_docs(path, comp, component_list, title, chakra_components): +def multi_docs( + path: str, + comp: flexdown.Document, + component_list: tuple[str, list[tuple[type, str]]], + title: str, + chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]], +): components = [ - component_docs(component_tuple, comp) for component_tuple in component_list[1:] + component_docs(component_tuple, comp) for component_tuple in component_list[1] ] fname = path.strip("/") + ".md" - ll_doc_exists = os.path.exists(fname.replace(".md", "-ll.md")) - - active_class_name = "font-small bg-slate-2 p-2 text-slate-11 rounded-xl shadow-large w-28 cursor-default border border-slate-4 text-center" - - non_active_class_name = "font-small w-28 transition-color hover:text-slate-11 text-slate-9 p-2 text-center" - - def links(current_page, ll_doc_exists, path): - path = str(path).rstrip("/") - if ll_doc_exists: - if current_page == "hl": - return rx.box( - rx.box(class_name="flex-grow"), - rx.box( - rx.link( - rx.box(rx.text("High Level"), class_name=active_class_name), - underline="none", - ), - rx.link( - rx.box( - rx.text("Low Level"), class_name=non_active_class_name - ), - href=path + "/low", - underline="none", - ), - class_name="bg-slate-3 rounded-[1.125rem] p-2 gap-2 flex items-center justify-center", - ), - class_name="flex mb-2", - ) - else: - return rx.box( - rx.box(class_name="flex-grow"), - rx.flex( - rx.link( - rx.box( - rx.text("High Level"), class_name=non_active_class_name - ), - href=path, - underline="none", - ), - rx.link( - rx.box(rx.text("Low Level"), class_name=active_class_name), - href=path + "/low", - underline="none", - ), - class_name="bg-slate-3 rounded-[1.125rem] p-2 gap-2 flex items-center justify-center", - ), - class_name="flex mb-2", - ) - return rx.fragment() @docpage(set_path=path, t=title, chakra_components=chakra_components) def out(): - toc = get_toc(comp, fname, component_list) - return toc, rx.box( - links("hl", ll_doc_exists, path), + table_of_contents = get_table_of_contents(comp, fname, component_list[1]) + return table_of_contents, rx.box( xd.render(comp, filename=fname), h1_comp(text="API Reference"), rx.box(*components, class_name="flex flex-col"), class_name="flex flex-col w-full", ) - @docpage( - set_path=path + "low", - t=title + " (Low Level)", - chakra_components=chakra_components, - ) - def ll(): - nonlocal fname - fname = fname.replace(".md", "-ll.md") - d2 = flexdown.parse_file(fname) - toc = get_toc(d2, fname, component_list) - return toc, rx.box( - links("ll", ll_doc_exists, path), - xd.render_file(fname), - h1_comp(text="API Reference"), - rx.box(*components, class_name="flex flex-col"), - class_name="flex flex-col w-full", - ) - - if ll_doc_exists: - return (out, ll) - else: - return out + return out diff --git a/docs/rcweb/rcweb/utils/sidebar.py b/docs/rcweb/rcweb/utils/sidebar.py index 4622c05..3e26b32 100644 --- a/docs/rcweb/rcweb/utils/sidebar.py +++ b/docs/rcweb/rcweb/utils/sidebar.py @@ -1,13 +1,17 @@ from __future__ import annotations +import dataclasses import reflex as rx import reflex_chakra as rc from ..constants import fonts +from reflex.utils.format import to_snake_case, to_title_case, to_kebab_case + chakra_lib_items = [] -class SidebarItem(rx.Base): +@dataclasses.dataclass +class SidebarItem: """A single item in the sidebar.""" # The name to display in the sidebar. @@ -19,42 +23,17 @@ class SidebarItem(rx.Base): link: str = "" # The children items. - children: list[SidebarItem] = [] + children: list[SidebarItem] = dataclasses.field(default_factory=list) # Whether the item is a category. Occurs if a single item is at the top level of the sidebar for asthetics. outer = False -def calculate_index(sidebar_items, url: str): - if isinstance(sidebar_items, list): - return None - if not isinstance(sidebar_items, list): - sidebar_items = [sidebar_items] - if url is None: - return None - for item in sidebar_items: - if not item.link.endswith("/"): - item.link = item.link + "/" - if not url.endswith("/"): - url = url + "/" - sub = 0 - for i, item in enumerate(sidebar_items): - if len(item.children) == 0: - sub += 1 - if item.link == url: - return [i - sub] - index = calculate_index(item.children, url) - if index is not None: - return [i - sub] + index - return None - - -def get_component_link(category: str | None, clist, prefix="") -> str: - component_name = rx.utils.format.to_kebab_case(clist[0]) +def get_component_link(category: str | None, category_title: str): + component_name = to_kebab_case(category_title) # construct the component link. The component name points to the name of the md file. return "/".join( [ - prefix, category.lower().replace(" ", "-") if category else "", component_name.lower(), ] @@ -62,30 +41,18 @@ def get_component_link(category: str | None, clist, prefix="") -> str: def get_category_children( - category, category_list, prefix="" + category: str, category_list: list[tuple[str, list[tuple[type, str]]]] ) -> SidebarItem | list[SidebarItem]: category = category.replace("-", " ") - if isinstance(category_list, dict): - category_children = [] - for c in category_list: - category_child = get_category_children(c, category_list[c]) - category_children.extend(category_child) if isinstance( - category_child, list - ) else category_children.append(category_child) - - return SidebarItem( - names=category, - children=[category_children], - ) category_item_children = [] - for c in category_list: - component_name = rx.utils.format.to_snake_case(c[0]) - name = rx.utils.format.to_title_case(component_name) + for component_title, _ in category_list: + component_name = to_snake_case(component_title) + name = to_title_case(component_name) item = SidebarItem( names=name, - link=get_component_link(category, c) + link=get_component_link(category, component_title) if not category == "Markdowns" - else get_component_link(None, c), + else get_component_link(None, component_title), ) category_item_children.append(item) return ( @@ -95,54 +62,26 @@ def get_category_children( ) -def get_sidebar_items_other_libraries(chakra_components): - chakra_children = [] +def get_sidebar_items_other_libraries( + chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]], +) -> list[SidebarItem]: + chakra_children: list[SidebarItem] = [] for category in chakra_components: category_item = get_category_children( category, chakra_components[category], ) - chakra_children.extend(category_item) if isinstance( - category_item, list - ) else chakra_children.append(category_item) + if isinstance(category_item, list): + chakra_children.extend(category_item) + else: + chakra_children.append(category_item) return chakra_children -class NavbarState(rx.State): - """The state for the navbar component.""" - - # Whether the sidebar is open. - sidebar_open: bool = False - - search_input: str = "" - - enter: bool = False - - banner: bool = True - - ai_chat: bool = True - - current_category = "All" - - def toggle_banner(self): - self.banner = not self.banner - - def toggle_sidebar(self): - self.sidebar_open = not self.sidebar_open - - def toggle_ai_chat(self): - self.ai_chat = not self.ai_chat - - def update_category(self, tag): - self.current_category = tag - - def sidebar_link(*children, **props): """Create a sidebar link that closes the sidebar when clicked.""" - on_click = props.pop("on_click", NavbarState.set_sidebar_open(False)) return rx.link( *children, - on_click=on_click, underline="none", **props, ) @@ -234,23 +173,6 @@ def sidebar_leaf( ) -def sidebar_icon(name): - mappings = { - "Getting Started": "rocket", - "Tutorial": "life-buoy", - "Components": "layers", - } - - if name in mappings: - return rx.icon( - tag=mappings[name], - size=16, - margin_right="20px", - ) - else: - return rx.fragment() - - def sidebar_item_comp( item: SidebarItem, index: list[int], @@ -262,7 +184,6 @@ def sidebar_item_comp( if item.names not in ("Introduction",) else rc.accordion_item( rc.accordion_button( - sidebar_icon(item.names), rx.link( rx.text( item.names, @@ -303,7 +224,6 @@ def sidebar_item_comp( ), rc.accordion_item( rc.accordion_button( - sidebar_icon(item.names), rx.text( item.names, style=fonts.small, @@ -356,7 +276,7 @@ def sidebar_item_comp( ) -def create_sidebar_section(items, index, url): +def create_sidebar_section(items: list[SidebarItem], url: str): return rx.list_item( rc.accordion( *[ @@ -368,7 +288,7 @@ def create_sidebar_section(items, index, url): for item in items ], allow_multiple=True, - default_index=rx.cond(index, index, []), + default_index=[], width="100%", padding_left="0em", margin_left="0em", @@ -386,7 +306,6 @@ def create_sidebar_section(items, index, url): @rx.memo def sidebar_comp( url: str, - other_libs_index: list[int], width: str = "100%", ): ul_style = { @@ -398,7 +317,6 @@ def sidebar_comp( rx.unordered_list( create_sidebar_section( chakra_lib_items, - other_libs_index, url, ), style=ul_style, @@ -432,6 +350,7 @@ def sidebar_comp( class MobileAndTabletSidebarState(rx.State): drawer_is_open: bool = False + @rx.event def toggle_drawer(self): self.drawer_is_open = not (self.drawer_is_open) @@ -474,18 +393,24 @@ def sidebar_on_mobile_and_tablet(component): ) -def get_sidebar_content(chakra_components, url=None, width: str = "100%"): +def get_sidebar_content( + chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]], + url: str | None = None, + width: str = "100%", +): global chakra_lib_items chakra_lib_items = get_sidebar_items_other_libraries(chakra_components) - other_libs_index = calculate_index(chakra_lib_items, url) return sidebar_comp( url=url, - other_libs_index=other_libs_index, width=width, ) -def sidebar(chakra_components, url=None, width: str = "100%") -> rx.Component: +def sidebar( + chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]], + url: str | None = None, + width: str = "100%", +) -> rx.Component: """Render the sidebar.""" return rx.flex( diff --git a/pyproject.toml b/pyproject.toml index a2fed0e..2033633 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,8 +26,9 @@ dev = ["ruff", "pyright"] [tool.ruff] target-version = "py310" -lint.extend-select = ["UP", "RUF022"] +lint.select = ["UP", "RUF", "F"] lint.ignore = ["F403", "F405", "UP038"] +lint.allowed-confusables = ["’"] [tool.pyright] reportIncompatibleMethodOverride = false diff --git a/reflex_chakra/components/base.py b/reflex_chakra/components/base.py index f334897..423deae 100644 --- a/reflex_chakra/components/base.py +++ b/reflex_chakra/components/base.py @@ -9,7 +9,7 @@ from reflex.components.component import Component from reflex.utils.imports import ImportDict, ImportVar from reflex.vars.base import Var - +from reflex.components.component import field from reflex_chakra import constants @@ -17,10 +17,13 @@ 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", - ] + lib_dependencies: list[str] = field( + default_factory=lambda: [ + "@chakra-ui/system@2.5.7", + "framer-motion@10.16.4", + ], + is_javascript_property=False, + ) @staticmethod def _get_app_wrap_components() -> dict[tuple[int, str], Component]: @@ -211,14 +214,14 @@ class ChakraColorModeProvider(Component): 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"] +LiteralSpinnerSize = Literal[LiteralTagSize, "xs", "xl"] +LiteralAvatarSize = 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"] +LiteralDrawerSize = Literal[LiteralSpinnerSize, "xl", "full"] LiteralMenuStrategy = Literal["fixed", "absolute"] LiteralMenuOption = Literal["checkbox", "radio"] diff --git a/reflex_chakra/components/base.pyi b/reflex_chakra/components/base.pyi index 9b1b796..fd0dfde 100644 --- a/reflex_chakra/components/base.pyi +++ b/reflex_chakra/components/base.pyi @@ -226,13 +226,13 @@ 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"] +LiteralSpinnerSize = Literal[LiteralTagSize, "xs", "xl"] +LiteralAvatarSize = 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"] +LiteralDrawerSize = Literal[LiteralSpinnerSize, "xl", "full"] LiteralMenuStrategy = Literal["fixed", "absolute"] LiteralMenuOption = Literal["checkbox", "radio"] LiteralPopOverTrigger = Literal["click", "hover"] diff --git a/reflex_chakra/components/datadisplay/table.py b/reflex_chakra/components/datadisplay/table.py index c055f88..6b443ef 100644 --- a/reflex_chakra/components/datadisplay/table.py +++ b/reflex_chakra/components/datadisplay/table.py @@ -99,13 +99,10 @@ def validate_headers(headers): """ 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) + 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") @@ -222,13 +219,10 @@ def validate_footers(footers): """ 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) + 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") diff --git a/reflex_chakra/components/forms/pininput.py b/reflex_chakra/components/forms/pininput.py index 19cb008..419354a 100644 --- a/reflex_chakra/components/forms/pininput.py +++ b/reflex_chakra/components/forms/pininput.py @@ -114,7 +114,7 @@ def _get_ref_hook(self): ) if ref: return Var( - f"const {ref} = {str(refs_declaration)}; " + f"const {ref} = {refs_declaration!s}; " f"{Var(ref)._as_ref()!s} = {ref}" ) return super()._get_ref_hook() diff --git a/reflex_chakra/components/typography/highlight.py b/reflex_chakra/components/typography/highlight.py index fb264db..cdd39d1 100644 --- a/reflex_chakra/components/typography/highlight.py +++ b/reflex_chakra/components/typography/highlight.py @@ -15,7 +15,9 @@ class Highlight(ChakraComponent): # 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 + styles: Var[dict] = Var.create( + {"px": "2", "py": "1", "rounded": "full", "bg": "teal.100"} + ) def _render(self) -> Tag: return super()._render().add_props(styles=self.style) From 3264390a2f2012b42eb89c841cf330e61278ca5a Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sat, 21 Jun 2025 16:56:18 -0700 Subject: [PATCH 11/15] make override a warning --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2033633..bbee932 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,4 +31,4 @@ lint.ignore = ["F403", "F405", "UP038"] lint.allowed-confusables = ["’"] [tool.pyright] -reportIncompatibleMethodOverride = false +reportIncompatibleMethodOverride = "warning" From 0f1b999a10df3706abea3ab6f689db574d2799f5 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sun, 22 Jun 2025 15:23:10 -0700 Subject: [PATCH 12/15] disable check pyi and use better pyi generatio --- .github/workflows/ci.yml | 32 +-- docs/rcweb/rcweb/constants/css.py | 21 +- docs/rcweb/rcweb/rcweb.py | 18 +- docs/rcweb/rcweb/utils/blocks/code.py | 7 +- docs/rcweb/rcweb/utils/blocks/headings.py | 9 +- docs/rcweb/rcweb/utils/blocks/typography.py | 3 +- docs/rcweb/rcweb/utils/docpage.py | 62 +++--- docs/rcweb/rcweb/utils/flexdown.py | 19 +- docs/rcweb/rcweb/utils/sidebar.py | 28 +-- pyproject.toml | 30 ++- reflex_chakra/__init__.py | 2 + reflex_chakra/components/base.py | 20 +- reflex_chakra/components/base.pyi | 113 ++++++----- reflex_chakra/components/datadisplay/badge.py | 3 +- .../components/datadisplay/badge.pyi | 28 ++- reflex_chakra/components/datadisplay/code.pyi | 26 ++- .../components/datadisplay/divider.py | 3 +- .../components/datadisplay/divider.pyi | 31 ++- .../components/datadisplay/keyboard_key.pyi | 26 ++- reflex_chakra/components/datadisplay/list.py | 3 +- reflex_chakra/components/datadisplay/list.pyi | 47 +++-- reflex_chakra/components/datadisplay/stat.py | 3 +- reflex_chakra/components/datadisplay/stat.pyi | 118 ++++++++--- reflex_chakra/components/datadisplay/table.py | 18 +- .../components/datadisplay/table.pyi | 124 ++++++++---- reflex_chakra/components/datadisplay/tag.py | 5 +- reflex_chakra/components/datadisplay/tag.pyi | 98 +++++++--- .../components/disclosure/accordion.py | 3 +- .../components/disclosure/accordion.pyi | 99 +++++++--- reflex_chakra/components/disclosure/tabs.py | 8 +- reflex_chakra/components/disclosure/tabs.pyi | 100 +++++++--- .../components/disclosure/transition.py | 13 +- .../components/disclosure/transition.pyi | 152 ++++++++++++--- .../components/disclosure/visuallyhidden.pyi | 26 ++- reflex_chakra/components/feedback/alert.py | 5 +- reflex_chakra/components/feedback/alert.pyi | 75 +++++-- .../components/feedback/circularprogress.py | 3 +- .../components/feedback/circularprogress.pyi | 33 +++- reflex_chakra/components/feedback/progress.py | 3 +- .../components/feedback/progress.pyi | 35 +++- reflex_chakra/components/feedback/skeleton.py | 3 +- .../components/feedback/skeleton.pyi | 84 ++++++-- reflex_chakra/components/feedback/spinner.py | 3 +- reflex_chakra/components/feedback/spinner.pyi | 31 ++- reflex_chakra/components/forms/__init__.py | 4 +- reflex_chakra/components/forms/button.py | 4 +- reflex_chakra/components/forms/button.pyi | 64 +++++- reflex_chakra/components/forms/checkbox.py | 5 +- reflex_chakra/components/forms/checkbox.pyi | 64 +++++- .../components/forms/colormodeswitch.py | 7 +- .../components/forms/colormodeswitch.pyi | 43 ++-- reflex_chakra/components/forms/date_picker.py | 5 +- .../components/forms/date_picker.pyi | 12 +- .../components/forms/date_time_picker.py | 5 +- .../components/forms/date_time_picker.pyi | 12 +- reflex_chakra/components/forms/editable.py | 3 +- reflex_chakra/components/forms/editable.pyi | 101 ++++++++-- reflex_chakra/components/forms/email.py | 5 +- reflex_chakra/components/forms/email.pyi | 12 +- reflex_chakra/components/forms/form.py | 8 +- reflex_chakra/components/forms/form.pyi | 130 ++++++++++--- reflex_chakra/components/forms/iconbutton.py | 3 +- reflex_chakra/components/forms/iconbutton.pyi | 38 +++- reflex_chakra/components/forms/input.py | 11 +- reflex_chakra/components/forms/input.pyi | 119 ++++++++--- reflex_chakra/components/forms/numberinput.py | 7 +- .../components/forms/numberinput.pyi | 98 +++++++--- reflex_chakra/components/forms/password.py | 5 +- reflex_chakra/components/forms/password.pyi | 12 +- reflex_chakra/components/forms/pininput.py | 14 +- reflex_chakra/components/forms/pininput.pyi | 37 ++-- reflex_chakra/components/forms/radio.py | 9 +- reflex_chakra/components/forms/radio.pyi | 19 +- reflex_chakra/components/forms/rangeslider.py | 10 +- .../components/forms/rangeslider.pyi | 76 ++++++-- reflex_chakra/components/forms/select.py | 5 +- reflex_chakra/components/forms/select.pyi | 13 +- reflex_chakra/components/forms/slider.py | 3 +- reflex_chakra/components/forms/slider.pyi | 100 +++++++--- reflex_chakra/components/forms/switch.py | 3 +- reflex_chakra/components/forms/switch.pyi | 38 +++- reflex_chakra/components/forms/textarea.py | 3 +- reflex_chakra/components/forms/textarea.pyi | 12 +- reflex_chakra/components/forms/time_picker.py | 5 +- .../components/forms/time_picker.pyi | 12 +- .../components/layout/aspect_ratio.py | 3 +- .../components/layout/aspect_ratio.pyi | 27 ++- reflex_chakra/components/layout/box.py | 3 +- reflex_chakra/components/layout/box.pyi | 29 ++- reflex_chakra/components/layout/card.py | 6 +- reflex_chakra/components/layout/card.pyi | 78 ++++++-- reflex_chakra/components/layout/center.pyi | 68 +++++-- reflex_chakra/components/layout/container.py | 3 +- reflex_chakra/components/layout/container.pyi | 27 ++- reflex_chakra/components/layout/flex.py | 3 +- reflex_chakra/components/layout/flex.pyi | 33 +++- reflex_chakra/components/layout/grid.py | 3 +- reflex_chakra/components/layout/grid.pyi | 95 +++++++-- reflex_chakra/components/layout/spacer.pyi | 26 ++- reflex_chakra/components/layout/stack.py | 3 +- reflex_chakra/components/layout/stack.pyi | 92 +++++++-- reflex_chakra/components/layout/wrap.py | 3 +- reflex_chakra/components/layout/wrap.pyi | 33 +++- reflex_chakra/components/media/avatar.py | 7 +- reflex_chakra/components/media/avatar.pyi | 81 ++++++-- reflex_chakra/components/media/icon.py | 16 +- reflex_chakra/components/media/icon.pyi | 33 +++- reflex_chakra/components/media/image.py | 9 +- reflex_chakra/components/media/image.pyi | 45 ++++- .../components/navigation/breadcrumb.py | 7 +- .../components/navigation/breadcrumb.pyi | 49 +++-- reflex_chakra/components/navigation/link.py | 8 +- reflex_chakra/components/navigation/link.pyi | 16 +- .../components/navigation/linkoverlay.py | 3 +- .../components/navigation/linkoverlay.pyi | 49 ++++- .../components/navigation/stepper.py | 5 +- .../components/navigation/stepper.pyi | 183 +++++++++++++---- reflex_chakra/components/overlay/__init__.py | 1 - .../components/overlay/alertdialog.py | 20 +- .../components/overlay/alertdialog.pyi | 146 ++++++++++---- reflex_chakra/components/overlay/drawer.py | 20 +- reflex_chakra/components/overlay/drawer.pyi | 146 ++++++++++---- reflex_chakra/components/overlay/menu.py | 11 +- reflex_chakra/components/overlay/menu.pyi | 168 ++++++++++++---- reflex_chakra/components/overlay/modal.py | 20 +- reflex_chakra/components/overlay/modal.pyi | 151 ++++++++++---- reflex_chakra/components/overlay/popover.py | 11 +- reflex_chakra/components/overlay/popover.pyi | 184 ++++++++++++++---- reflex_chakra/components/overlay/tooltip.py | 9 +- reflex_chakra/components/overlay/tooltip.pyi | 47 ++++- .../components/typography/heading.py | 3 +- .../components/typography/heading.pyi | 28 ++- .../components/typography/highlight.py | 3 +- .../components/typography/highlight.pyi | 28 ++- reflex_chakra/components/typography/span.py | 5 +- reflex_chakra/components/typography/span.pyi | 27 ++- reflex_chakra/components/typography/text.py | 3 +- reflex_chakra/components/typography/text.pyi | 28 ++- reflex_chakra/constants.py | 2 + regenerate_pyi.py | 2 + 140 files changed, 3565 insertions(+), 1253 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c417e7..edea3a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,22 +41,22 @@ jobs: run: ruff check --output-format=github reflex_chakra - name: Run Ruff Formatter run: ruff format --check --diff reflex_chakra - check-pyi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install UV - uses: astral-sh/setup-uv@v6 - with: - python-version: "3.13" - enable-cache: true - activate-environment: true - - name: Install dependencies - run: uv sync - - name: Run PYI generation - run: python regenerate_pyi.py - - name: Check if there are any changes - run: git diff --exit-code -- "*.pyi" || (echo "PYI files have changed. Please commit the changes." && exit 1) + # check-pyi: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install UV + # uses: astral-sh/setup-uv@v6 + # with: + # python-version: "3.13" + # enable-cache: true + # activate-environment: true + # - name: Install dependencies + # run: uv sync + # - name: Run PYI generation + # run: python regenerate_pyi.py + # - name: Check if there are any changes + # run: git diff --exit-code -- "*.pyi" || (echo "PYI files have changed. Please commit the changes." && exit 1) check-export: runs-on: ubuntu-latest steps: diff --git a/docs/rcweb/rcweb/constants/css.py b/docs/rcweb/rcweb/constants/css.py index 125712c..c8916e5 100644 --- a/docs/rcweb/rcweb/constants/css.py +++ b/docs/rcweb/rcweb/constants/css.py @@ -1,9 +1,11 @@ """App styling.""" import reflex as rx -from . import fonts + import reflex_chakra as rc +from . import fonts + font_weights = { "bold": "800", "heading": "700", @@ -40,23 +42,6 @@ def get_code_style_rdx(color: str): "line_height": "1.5", } -tab_style = { - "color": rx.color("slate", 9), - "cursor": "pointer", - "_hover": { - "color": rx.color("slate", 11), - }, - **fonts.small, - "padding_x": "0.5em", - "padding_y": "0.25em", - "&[data-state='active']": { - "color": rx.color("violet", 9), - }, - "not:&[data-state='active']": { - "color": rx.color("slate", 11), - }, -} - # General styles. SANS = "Instrument Sans" diff --git a/docs/rcweb/rcweb/rcweb.py b/docs/rcweb/rcweb/rcweb.py index 0c0f90f..ec848c3 100644 --- a/docs/rcweb/rcweb/rcweb.py +++ b/docs/rcweb/rcweb/rcweb.py @@ -1,18 +1,19 @@ """Welcome to Reflex! This file outlines the steps to create a basic app.""" import os -from pathlib import Path from collections import defaultdict +from pathlib import Path from types import SimpleNamespace +import flexdown import reflex as rx from reflex.utils.format import to_kebab_case, to_snake_case + import reflex_chakra as rc # noqa: F401 -import flexdown -from .utils.flexdown import xd -from .utils.docpage import Route, multi_docs from .constants import css +from .utils.docpage import Route, multi_docs +from .utils.flexdown import xd def find_flexdown_files(directory: str) -> list[str]: @@ -25,7 +26,7 @@ def find_flexdown_files(directory: str) -> list[str]: A list of paths to Flexdown files. """ return [ - os.path.join(root, file).replace("\\", "/") + (Path(root) / file).as_posix() for root, _, files in os.walk(directory) for file in files if file.endswith(".md") @@ -50,7 +51,7 @@ def extract_components_from_metadata( components.append((component, comp_str)) elif hasattr(component, "__self__"): components.append((component.__self__, comp_str)) - elif isinstance(component, SimpleNamespace) and hasattr(component, "__call__"): + elif isinstance(component, SimpleNamespace) and hasattr(component, "__call__"): # noqa: B004 components.append((component.__call__.__self__, comp_str)) return components @@ -101,12 +102,13 @@ def create_doc_component( A component object representing the document page. """ doc_path = doc_path.replace("\\", "/") + doc_path_path = Path(doc_path) route_path = to_kebab_case( f"/{doc_path.removeprefix(base_dir).replace('.md', '/')}" ).replace("//", "/") - category = os.path.basename(os.path.dirname(doc_path)).title() + category = doc_path_path.parent.name.title() document = flexdown.parse_file(doc_path) - title = to_snake_case(os.path.basename(doc_path).replace(".md", "")) + title = to_snake_case(doc_path_path.name.replace(".md", "")) component_list = (title, extract_components_from_metadata(document)) component_registry[category].append(component_list) return multi_docs( diff --git a/docs/rcweb/rcweb/utils/blocks/code.py b/docs/rcweb/rcweb/utils/blocks/code.py index 49f514a..59cb541 100644 --- a/docs/rcweb/rcweb/utils/blocks/code.py +++ b/docs/rcweb/rcweb/utils/blocks/code.py @@ -1,7 +1,8 @@ """Code block components for documentation pages.""" import reflex as rx -from ...constants import css, fonts + +from rcweb.constants import css, fonts @rx.memo @@ -20,8 +21,6 @@ def code_block(code: str, language: str): padding="20px", style=fonts.code, margin="0", - # TODO: use this when it's looking good - # can_copy=True, ), rx.button( rx.icon( @@ -76,8 +75,6 @@ def code_block_dark(code: str, language: str): }, padding="20px", margin="0", - # TODO: use this when it's looking good - # can_copy=True, ), rx.button( rx.icon( diff --git a/docs/rcweb/rcweb/utils/blocks/headings.py b/docs/rcweb/rcweb/utils/blocks/headings.py index 491cf7b..ad60a1d 100644 --- a/docs/rcweb/rcweb/utils/blocks/headings.py +++ b/docs/rcweb/rcweb/utils/blocks/headings.py @@ -1,7 +1,8 @@ """Template for documentation pages.""" import reflex as rx -from ...constants import css, fonts + +from rcweb.constants import css, fonts icon_margins = { "h1": "10px", @@ -20,8 +21,9 @@ def h_comp_common( margin_top: str = "", margin_bottom: str = "", convert_to_str: bool = False, - style: dict = {}, + style: dict | None = None, ) -> rx.Component: + style = style or {} if convert_to_str: id_ = text.to(list[str])[0].lower().split().join("-") else: @@ -70,7 +72,6 @@ def h_comp_common( on_click=lambda: rx.set_clipboard(href), margin_bottom="0.5em", ), - # border_top=f"1px solid {rx.color('mauve', 3)}" if heading == "h2" else None, _hover={ "color": rx.color("violet", 9), }, @@ -86,7 +87,6 @@ def h1_comp(text: rx.Var[str]) -> rx.Component: text=text, heading="h1", style={ - # "color": c_color("slate", 12), "font-size": ["32px", "48px"], "font-style": "normal", "font-weight": "600", @@ -105,7 +105,6 @@ def h1_comp_xd(text: rx.Var[str]) -> rx.Component: heading="h1", style=fonts.xx_large, margin_bottom="24px", - # margin_top="1.5em", scroll_margin="4em", convert_to_str=True, ) diff --git a/docs/rcweb/rcweb/utils/blocks/typography.py b/docs/rcweb/rcweb/utils/blocks/typography.py index f4c41a0..cfe6291 100644 --- a/docs/rcweb/rcweb/utils/blocks/typography.py +++ b/docs/rcweb/rcweb/utils/blocks/typography.py @@ -1,7 +1,8 @@ """Typography blocks for doc pages.""" import reflex as rx -from ...constants import fonts + +from rcweb.constants import fonts def definition(title: str, *children) -> rx.Component: diff --git a/docs/rcweb/rcweb/utils/docpage.py b/docs/rcweb/rcweb/utils/docpage.py index efc84dc..d862e55 100644 --- a/docs/rcweb/rcweb/utils/docpage.py +++ b/docs/rcweb/rcweb/utils/docpage.py @@ -1,11 +1,12 @@ """Utility functions for the component docs page.""" -from collections.abc import Callable import dataclasses import functools +import hashlib import inspect -import reflex_chakra as rc import re +import textwrap +from collections.abc import Callable, Sequence from types import UnionType from typing import ( Any, @@ -14,23 +15,23 @@ get_args, get_origin, ) -from reflex.constants.colors import ColorType -from collections.abc import Sequence -import mistletoe -from ..utils.flexdown import xd, markdown, docdemobox -from ..utils.sidebar import sidebar as sb -from ..utils.sidebar import MobileAndTabletSidebarState -from ..utils.blocks.headings import h2_comp, h1_comp -import reflex as rx + import flexdown import flexdown.blocks -import textwrap +import mistletoe import mistletoe.block_token import mistletoe.token -from reflex.components.component import Component +import reflex as rx from reflex.components.base.fragment import Fragment +from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML -import hashlib +from reflex.constants.colors import ColorType + +import reflex_chakra as rc +from rcweb.utils.blocks.headings import h1_comp, h2_comp +from rcweb.utils.flexdown import docdemobox, markdown, xd +from rcweb.utils.sidebar import MobileAndTabletSidebarState +from rcweb.utils.sidebar import sidebar as sb flat_items = [] @@ -309,8 +310,7 @@ def get_default_value(lines: list[str], start_index: int) -> str: if comment_line.startswith("#"): default_match = re.search(r"Default:\s*(.+)$", comment_line) if default_match: - default_value = default_match.group(1).strip() - return default_value + return default_match.group(1).strip() # Get the initial line line = lines[start_index] @@ -339,8 +339,7 @@ def get_default_value(lines: list[str], start_index: int) -> str: def process_var_create_safe(match): content = match.group(1) # Extract only the first argument - first_arg = re.split(r",", content)[0].strip() - return first_arg + return re.split(r",", content)[0].strip() value = re.sub(r"Var\.create_safe\((.*?)\)", process_var_create_safe, value) value = re.sub(r"\bColor\s*\(", "rx.color(", value) @@ -408,7 +407,8 @@ def get_path(component_fn: Callable): module = inspect.getmodule(component_fn) if module is None: - raise ValueError(f"Could not find module for {component_fn}") + msg = f"Could not find module for {component_fn}" + raise ValueError(msg) # Create a path based on the module name. return ( @@ -418,12 +418,12 @@ def get_path(component_fn: Callable): def docpage( + chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]], set_path: str | None = None, t: str | None = None, right_sidebar: bool = True, page_title: str | None = None, pseudo_right_bar: bool = False, - chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]] = {}, ): """A template that most pages on the reflex.dev site should use. @@ -763,9 +763,9 @@ def _get_props(self) -> list[Prop]: if i > 0: comment_above = self.code[i - 1].strip() - assert comment_above.startswith("#"), ( - f"Expected comment, got {comment_above}" - ) + if not comment_above.startswith("#"): + msg = f"Expected comment above prop {prop}, got {comment_above}" + raise ValueError(msg) comment = Source.get_comment(comments) comments.clear() @@ -860,11 +860,11 @@ def prop_docs(prop: Prop) -> list[rx.Component]: literal_values = [] # Literal values of the prop all_types = [] # List for all the prop types - MAX_PROP_VALUES = 2 + max_prop_values = 2 short_type_name = None - COMMON_TYPES = {} # Used to exclude common types from the MAX_PROP_VALUES + common_types = {} # Used to exclude common types from the MAX_PROP_VALUES if origin in (Union, UnionType): non_literal_types = [] # List for all the non-literal types @@ -902,7 +902,7 @@ def prop_docs(prop: Prop) -> list[rx.Component]: elif origin is Literal: literal_values = list(map(str, args)) - if len(literal_values) > MAX_PROP_VALUES and prop.name not in COMMON_TYPES: + if len(literal_values) > max_prop_values and prop.name not in common_types: type_name = "Literal" else: type_name = " | ".join([f'"{value}"' for value in literal_values]) @@ -936,14 +936,14 @@ def prop_docs(prop: Prop) -> list[rx.Component]: rx.table.cell( rx.box( rx.cond( - (len(literal_values) > 0) & (prop.name not in COMMON_TYPES), + (len(literal_values) > 0) & (prop.name not in common_types), rx.code( ( " | ".join( - [f'"{v}"' for v in literal_values[:MAX_PROP_VALUES]] + [f'"{v}"' for v in literal_values[:max_prop_values]] + ["..."] ) - if len(literal_values) > MAX_PROP_VALUES + if len(literal_values) > max_prop_values else type_name ), style=get_code_style(color), @@ -956,8 +956,8 @@ def prop_docs(prop: Prop) -> list[rx.Component]: ), ), rx.cond( - len(literal_values) > MAX_PROP_VALUES - and prop.name not in COMMON_TYPES, + len(literal_values) > max_prop_values + and prop.name not in common_types, hovercard( rx.icon( tag="circle-ellipsis", @@ -1045,7 +1045,7 @@ def generate_props(src, component, comp): else: comp = rx.fragment() except Exception as e: - print(f"Failed to create component {component.__name__}, error: {e}") + print(f"Failed to create component {component.__name__}, error: {e}") # noqa: T201 comp = rx.fragment() interactive_component = ( diff --git a/docs/rcweb/rcweb/utils/flexdown.py b/docs/rcweb/rcweb/utils/flexdown.py index 102db69..4c097b5 100644 --- a/docs/rcweb/rcweb/utils/flexdown.py +++ b/docs/rcweb/rcweb/utils/flexdown.py @@ -1,11 +1,14 @@ +import textwrap +from typing import Any + +import black import flexdown import reflex as rx + import reflex_chakra as rc # noqa: F401 -import black -import textwrap -from typing import Any -from .blocks import headings, typography, code -from ..constants import fonts +from rcweb.constants import fonts + +from .blocks import code, headings, typography demo_box_style = { "padding": "24px", @@ -35,8 +38,6 @@ def code_block(code: str, language: str): padding="20px", style=fonts.code, margin="0", - # TODO: use this when it's looking good - # can_copy=True, ), rx.button( rx.icon( @@ -88,8 +89,6 @@ def code_block_dark(code: str, language: str): }, padding="20px", margin="0", - # TODO: use this when it's looking good - # can_copy=True, ), rx.button( rx.icon( @@ -223,14 +222,12 @@ def docdemo( rx.hstack( "UI", ), - # style=tab_style, value="tab1", ), rx.tabs.trigger( rx.hstack( "Code", ), - # style=tab_style, value="tab2", ), justify_content="end", diff --git a/docs/rcweb/rcweb/utils/sidebar.py b/docs/rcweb/rcweb/utils/sidebar.py index 3e26b32..a0fbc8c 100644 --- a/docs/rcweb/rcweb/utils/sidebar.py +++ b/docs/rcweb/rcweb/utils/sidebar.py @@ -1,11 +1,12 @@ from __future__ import annotations + import dataclasses import reflex as rx -import reflex_chakra as rc -from ..constants import fonts +from reflex.utils.format import to_kebab_case, to_snake_case, to_title_case -from reflex.utils.format import to_snake_case, to_title_case, to_kebab_case +import reflex_chakra as rc +from rcweb.constants import fonts chakra_lib_items = [] @@ -51,13 +52,13 @@ def get_category_children( item = SidebarItem( names=name, link=get_component_link(category, component_title) - if not category == "Markdowns" + if category != "Markdowns" else get_component_link(None, component_title), ) category_item_children.append(item) return ( SidebarItem(names=category, children=category_item_children) - if not category == "Markdowns" + if category != "Markdowns" else category_item_children ) @@ -66,11 +67,8 @@ def get_sidebar_items_other_libraries( chakra_components: dict[str, list[tuple[str, list[tuple[type, str]]]]], ) -> list[SidebarItem]: chakra_children: list[SidebarItem] = [] - for category in chakra_components: - category_item = get_category_children( - category, - chakra_components[category], - ) + for category, category_list in chakra_components.items(): + category_item = get_category_children(category, category_list) if isinstance(category_item, list): chakra_children.extend(category_item) else: @@ -411,8 +409,16 @@ def sidebar( url: str | None = None, width: str = "100%", ) -> rx.Component: - """Render the sidebar.""" + """Render the sidebar. + + Args: + chakra_components: The components to display in the sidebar. + url: The current URL to highlight the active link. + width: The width of the sidebar. + Returns: + A sidebar component with the given components and URL. + """ return rx.flex( sidebar_on_mobile_and_tablet( get_sidebar_content(chakra_components, url, "100%") diff --git a/pyproject.toml b/pyproject.toml index bbee932..8fbf406 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,9 +26,35 @@ dev = ["ruff", "pyright"] [tool.ruff] target-version = "py310" -lint.select = ["UP", "RUF", "F"] -lint.ignore = ["F403", "F405", "UP038"] +lint.select = ["ALL"] +lint.pydocstyle.convention = "google" +lint.ignore = [ + "A", + "ANN001", + "ANN002", + "ANN003", + "ANN2", + "ANN4", + "BLE", + "COM", + "E501", + "ERA001", + "F403", + "F405", + "FBT", + "PLR", + "PLW", + "PYI021", + "S307", + "SLF", + "TC002", + "UP038", +] lint.allowed-confusables = ["’"] +[tool.ruff.lint.per-file-ignores] +"*.pyi" = ["D301", "D415", "D417", "N803"] +"docs/*" = ["D", "INP001"] + [tool.pyright] reportIncompatibleMethodOverride = "warning" diff --git a/reflex_chakra/__init__.py b/reflex_chakra/__init__.py index dfc3c94..80e589a 100644 --- a/reflex_chakra/__init__.py +++ b/reflex_chakra/__init__.py @@ -1 +1,3 @@ +"""Chakra UI bindings for Reflex.""" + from .components import * diff --git a/reflex_chakra/components/base.py b/reflex_chakra/components/base.py index 423deae..493ec76 100644 --- a/reflex_chakra/components/base.py +++ b/reflex_chakra/components/base.py @@ -6,17 +6,17 @@ from pathlib import Path from typing import Literal -from reflex.components.component import Component +from reflex.components.component import Component, field from reflex.utils.imports import ImportDict, ImportVar from reflex.vars.base import Var -from reflex.components.component import field + from reflex_chakra import constants class ChakraComponent(Component): """A component that wraps a Chakra component.""" - library: str = "@chakra-ui/react@2.6.1" # type: ignore + library = "@chakra-ui/react@2.6.1" lib_dependencies: list[str] = field( default_factory=lambda: [ "@chakra-ui/system@2.5.7", @@ -41,6 +41,15 @@ def _get_style(self) -> dict: @classmethod def create(cls, *children, **props) -> Component: + """Create a new Chakra component. + + Args: + *children: The children of the component. + **props: The properties of the component. + + Returns: + A new Chakra component. + """ # copy color mode provider file to client's asset dir if it doesnt exist. client_asset_dir = Path.cwd() / constants.ASSETS_DIR_NAME if ( @@ -68,7 +77,6 @@ def create(cls, *children, **props) -> Component: for prop in new_prop_names: under_prop = f"{prop}_" if under_prop in props: - # TODO: decide whether to deprecate this prop namespace conversion props[prop] = props.pop(under_prop) return super().create(*children, **props) @@ -99,7 +107,7 @@ def add_imports(self) -> ImportDict: The import dict for the component. """ return { - self.library: ImportVar(tag="extendTheme", is_default=False), + self.library or "": ImportVar(tag="extendTheme", is_default=False), "$/utils/theme": ImportVar(tag="theme", is_default=True), } @@ -199,7 +207,7 @@ class ChakraColorModeProvider(Component): "it", ] LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"] -LiteralInputNumberMode = [ +LiteralInputNumberMode = Literal[ "text", "search", "none", diff --git a/reflex_chakra/components/base.pyi b/reflex_chakra/components/base.pyi index fd0dfde..5dfbe0b 100644 --- a/reflex_chakra/components/base.pyi +++ b/reflex_chakra/components/base.pyi @@ -3,25 +3,25 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, + TypeAlias, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) -from reflex.vars.base import Var -from reflex.components.component import Component from reflex.utils.imports import ImportDict +from reflex.vars.base import Var class ChakraComponent(Component): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -53,13 +53,26 @@ class ChakraComponent(Component): on_unmount: EventType[()] | None = None, **props, ) -> ChakraComponent: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ChakraProvider(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, theme: Var[str] | str | None = None, @@ -95,17 +108,16 @@ class ChakraProvider(ChakraComponent): """Create a new ChakraProvider component. Returns: - A new ChakraProvider component.""" - ... + A new ChakraProvider component. + """ def add_imports(self) -> ImportDict: ... chakra_provider = ChakraProvider.create() class ChakraColorModeProvider(Component): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -151,11 +163,11 @@ class ChakraColorModeProvider(Component): **props: The props of the component. Returns: - The component.""" - ... + The component. + """ chakra_color_mode_provider = ChakraColorModeProvider.create() -LiteralColorScheme = Literal[ +LiteralColorScheme: TypeAlias = Literal[ "none", "gray", "red", @@ -176,21 +188,23 @@ LiteralColorScheme = Literal[ "twitter", "telegram", ] -LiteralVariant = Literal["solid", "subtle", "outline"] -LiteralDividerVariant = Literal["solid", "dashed"] -LiteralTheme = Literal["light", "dark"] -LiteralTagColorScheme = Literal[ +LiteralVariant: TypeAlias = Literal["solid", "subtle", "outline"] +LiteralDividerVariant: TypeAlias = Literal["solid", "dashed"] +LiteralTheme: TypeAlias = Literal["light", "dark"] +LiteralTagColorScheme: TypeAlias = Literal[ "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink" ] -LiteralTagAlign = Literal["center", "end", "start"] -LiteralTabsVariant = Literal[ +LiteralTagAlign: TypeAlias = Literal["center", "end", "start"] +LiteralTabsVariant: TypeAlias = 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[ +LiteralStatus: TypeAlias = Literal["success", "info", "warning", "error"] +LiteralAlertVariant: TypeAlias = Literal["subtle", "left-accent", "top-accent", "solid"] +LiteralButtonVariant: TypeAlias = Literal[ + "ghost", "outline", "solid", "link", "unstyled" +] +LiteralSpinnerPlacement: TypeAlias = Literal["start", "end"] +LiteralLanguage: TypeAlias = Literal[ "en", "da", "de", @@ -210,30 +224,25 @@ LiteralLanguage = Literal[ "he", "it", ] -LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"] -LiteralInputNumberMode = [ - "text", - "search", - "none", - "tel", - "url", - "email", - "numeric", - "decimal", +LiteralInputVariant: TypeAlias = Literal["outline", "filled", "flushed", "unstyled"] +LiteralInputNumberMode: TypeAlias = Literal[ + "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[LiteralTagSize, "xs", "xl"] -LiteralAvatarSize = Literal[LiteralTagSize, "xl", "xs", "2xl", "full", "2xs"] -LiteralButtonSize = Literal["sm", "md", "lg", "xs"] -LiteralAlertDialogSize = Literal[ +LiteralChakraDirection: TypeAlias = Literal["ltr", "rtl"] +LiteralCardVariant: TypeAlias = Literal["outline", "filled", "elevated", "unstyled"] +LiteralStackDirection: TypeAlias = Literal["row", "column"] +LiteralImageLoading: TypeAlias = Literal["eager", "lazy"] +LiteralTagSize: TypeAlias = Literal["sm", "md", "lg"] +LiteralSpinnerSize: TypeAlias = Literal[LiteralTagSize, "xs", "xl"] +LiteralAvatarSize: TypeAlias = Literal[LiteralTagSize, "xl", "xs", "2xl", "full", "2xs"] +LiteralButtonSize: TypeAlias = Literal["sm", "md", "lg", "xs"] +LiteralAlertDialogSize: TypeAlias = Literal[ "sm", "md", "lg", "xs", "2xl", "full", "3xl", "4xl", "5xl", "6xl" ] -LiteralDrawerSize = 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"] +LiteralDrawerSize: TypeAlias = Literal[LiteralSpinnerSize, "xl", "full"] +LiteralMenuStrategy: TypeAlias = Literal["fixed", "absolute"] +LiteralMenuOption: TypeAlias = Literal["checkbox", "radio"] +LiteralPopOverTrigger: TypeAlias = Literal["click", "hover"] +LiteralHeadingSize: TypeAlias = Literal[ + "lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl" +] diff --git a/reflex_chakra/components/datadisplay/badge.py b/reflex_chakra/components/datadisplay/badge.py index d6d932a..edce551 100644 --- a/reflex_chakra/components/datadisplay/badge.py +++ b/reflex_chakra/components/datadisplay/badge.py @@ -1,8 +1,9 @@ """Badge component.""" -from reflex_chakra.components import ChakraComponent, LiteralVariant from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralVariant + class Badge(ChakraComponent): """A badge component.""" diff --git a/reflex_chakra/components/datadisplay/badge.pyi b/reflex_chakra/components/datadisplay/badge.pyi index cafb62e..9212f48 100644 --- a/reflex_chakra/components/datadisplay/badge.pyi +++ b/reflex_chakra/components/datadisplay/badge.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Badge(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, variant: Literal["outline", "solid", "subtle"] @@ -56,5 +56,21 @@ class Badge(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Badge: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/datadisplay/code.pyi b/reflex_chakra/components/datadisplay/code.pyi index 9a991aa..450ca0f 100644 --- a/reflex_chakra/components/datadisplay/code.pyi +++ b/reflex_chakra/components/datadisplay/code.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Code(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -51,5 +51,19 @@ class Code(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Code: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/datadisplay/divider.py b/reflex_chakra/components/datadisplay/divider.py index e5b4163..38c2203 100644 --- a/reflex_chakra/components/datadisplay/divider.py +++ b/reflex_chakra/components/datadisplay/divider.py @@ -2,9 +2,10 @@ from typing import Literal -from reflex_chakra.components import ChakraComponent, LiteralDividerVariant from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralDividerVariant + LiteralLayout = Literal["horizontal", "vertical"] diff --git a/reflex_chakra/components/datadisplay/divider.pyi b/reflex_chakra/components/datadisplay/divider.pyi index 536fc08..0852fdb 100644 --- a/reflex_chakra/components/datadisplay/divider.pyi +++ b/reflex_chakra/components/datadisplay/divider.pyi @@ -3,26 +3,27 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, + TypeAlias, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent -LiteralLayout = Literal["horizontal", "vertical"] +LiteralLayout: TypeAlias = Literal["horizontal", "vertical"] class Divider(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, orientation: Literal["horizontal", "vertical"] @@ -60,5 +61,21 @@ class Divider(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Divider: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/datadisplay/keyboard_key.pyi b/reflex_chakra/components/datadisplay/keyboard_key.pyi index 97aaa70..95c9dd9 100644 --- a/reflex_chakra/components/datadisplay/keyboard_key.pyi +++ b/reflex_chakra/components/datadisplay/keyboard_key.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class KeyboardKey(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -51,5 +51,19 @@ class KeyboardKey(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> KeyboardKey: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/datadisplay/list.py b/reflex_chakra/components/datadisplay/list.py index 4352c63..0f239cd 100644 --- a/reflex_chakra/components/datadisplay/list.py +++ b/reflex_chakra/components/datadisplay/list.py @@ -2,11 +2,12 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.components.core.foreach import Foreach from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class List(ChakraComponent): """Display a list of items.""" diff --git a/reflex_chakra/components/datadisplay/list.pyi b/reflex_chakra/components/datadisplay/list.pyi index 1c0bb2e..270a77c 100644 --- a/reflex_chakra/components/datadisplay/list.pyi +++ b/reflex_chakra/components/datadisplay/list.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class List(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items: Var[list] | list | None = None, @@ -73,13 +73,12 @@ class List(ChakraComponent): **props: The properties of the component. Returns: - The list component.""" - ... + The list component. + """ class ListItem(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -111,13 +110,26 @@ class ListItem(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ListItem: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class OrderedList(List): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items: Var[list] | list | None = None, @@ -171,13 +183,12 @@ class OrderedList(List): **props: The properties of the component. Returns: - The list component.""" - ... + The list component. + """ class UnorderedList(List): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items: Var[list] | list | None = None, @@ -231,5 +242,5 @@ class UnorderedList(List): **props: The properties of the component. Returns: - The list component.""" - ... + The list component. + """ diff --git a/reflex_chakra/components/datadisplay/stat.py b/reflex_chakra/components/datadisplay/stat.py index a43c735..699ac47 100644 --- a/reflex_chakra/components/datadisplay/stat.py +++ b/reflex_chakra/components/datadisplay/stat.py @@ -1,9 +1,10 @@ """Statistics components.""" -from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Stat(ChakraComponent): """The Stat component is used to display some statistics. It can take in a label, a number and a help text.""" diff --git a/reflex_chakra/components/datadisplay/stat.pyi b/reflex_chakra/components/datadisplay/stat.pyi index 36206af..953fc35 100644 --- a/reflex_chakra/components/datadisplay/stat.pyi +++ b/reflex_chakra/components/datadisplay/stat.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Stat(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, label=None, @@ -73,13 +73,12 @@ class Stat(ChakraComponent): **props: The properties of the component. Returns: - The stat component.""" - ... + The stat component. + """ class StatLabel(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -111,13 +110,26 @@ class StatLabel(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StatLabel: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StatNumber(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -149,13 +161,26 @@ class StatNumber(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StatNumber: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StatHelpText(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -187,13 +212,26 @@ class StatHelpText(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StatHelpText: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StatArrow(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type_: Var[str] | str | None = None, @@ -226,13 +264,27 @@ class StatArrow(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StatArrow: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StatGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -264,5 +316,19 @@ class StatGroup(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StatGroup: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/datadisplay/table.py b/reflex_chakra/components/datadisplay/table.py index 6b443ef..b70eb06 100644 --- a/reflex_chakra/components/datadisplay/table.py +++ b/reflex_chakra/components/datadisplay/table.py @@ -1,12 +1,14 @@ """Table components.""" from typing import ClassVar -from reflex_chakra.components import ChakraComponent + from reflex.components.component import Component from reflex.components.core.foreach import Foreach from reflex.utils import types from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Table(ChakraComponent): """A table component.""" @@ -105,7 +107,8 @@ def validate_headers(headers): 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") + msg = "table headers should be a list or tuple" + raise TypeError(msg) class Tbody(ChakraComponent): @@ -170,16 +173,16 @@ def validate_rows(rows): ) ) ): - raise TypeError( - f"table rows should be a list or tuple containing inner lists or tuples. Got {outer_type} instead" - ) + msg = f"table rows should be a list or tuple containing inner lists or tuples. Got {outer_type} instead" + raise TypeError(msg) elif not ( types._issubclass(type(rows), allowed_subclasses) and (not rows or types._issubclass(type(rows[0]), allowed_subclasses)) ): - raise TypeError( + msg = ( "table rows should be a list or tuple containing inner lists or tuples." ) + raise TypeError(msg) class Tfoot(ChakraComponent): @@ -225,7 +228,8 @@ def validate_footers(footers): 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") + msg = "table headers should be a list or tuple" + raise TypeError(msg) class Tr(ChakraComponent): diff --git a/reflex_chakra/components/datadisplay/table.pyi b/reflex_chakra/components/datadisplay/table.pyi index f4b1dfa..b3e073c 100644 --- a/reflex_chakra/components/datadisplay/table.pyi +++ b/reflex_chakra/components/datadisplay/table.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Table(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, caption=None, @@ -81,13 +81,12 @@ class Table(ChakraComponent): **props: The properties of the component. Returns: - The table component.""" - ... + The table component. + """ class Thead(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, headers=None, @@ -137,15 +136,13 @@ class Thead(ChakraComponent): Returns: The table header component. """ - ... @staticmethod def validate_headers(headers): ... class Tbody(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, rows=None, @@ -193,16 +190,15 @@ class Tbody(ChakraComponent): **props: The properties of the component. Returns: - Component: The table body component""" - ... + Component: The table body component + """ @staticmethod def validate_rows(rows): ... class Tfoot(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, footers=None, @@ -250,16 +246,15 @@ class Tfoot(ChakraComponent): **props: The properties of the component. Returns: - The table footer component.""" - ... + The table footer component. + """ @staticmethod def validate_footers(footers): ... class Tr(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, cell_type: str | None = "", @@ -309,13 +304,12 @@ class Tr(ChakraComponent): **props: The properties of the component. Returns: - The table row component""" - ... + The table row component + """ class Th(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_numeric: Var[bool] | bool | None = None, @@ -348,13 +342,27 @@ class Th(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Th: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Td(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_numeric: Var[bool] | bool | None = None, @@ -387,13 +395,27 @@ class Td(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Td: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TableCaption(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, placement: Var[str] | str | None = None, @@ -426,13 +448,27 @@ class TableCaption(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TableCaption: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TableContainer(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -464,5 +500,19 @@ class TableContainer(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TableContainer: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/datadisplay/tag.py b/reflex_chakra/components/datadisplay/tag.py index c1d9fe0..38b29c6 100644 --- a/reflex_chakra/components/datadisplay/tag.py +++ b/reflex_chakra/components/datadisplay/tag.py @@ -1,13 +1,14 @@ """Chakra Tag Component.""" +from reflex.components.component import Component +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralTagColorScheme, LiteralTagSize, LiteralVariant, ) -from reflex.components.component import Component -from reflex.vars.base import Var class TagLabel(ChakraComponent): diff --git a/reflex_chakra/components/datadisplay/tag.pyi b/reflex_chakra/components/datadisplay/tag.pyi index 7dc8745..9a42bdf 100644 --- a/reflex_chakra/components/datadisplay/tag.pyi +++ b/reflex_chakra/components/datadisplay/tag.pyi @@ -3,27 +3,27 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) -from reflex.components.component import Component class TagLabel(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -55,13 +55,26 @@ class TagLabel(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TagLabel: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TagLeftIcon(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -93,13 +106,26 @@ class TagLeftIcon(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TagLeftIcon: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TagRightIcon(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -131,13 +157,26 @@ class TagRightIcon(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TagRightIcon: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TagCloseButton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -169,13 +208,26 @@ class TagCloseButton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TagCloseButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Tag(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, left_icon: Component | None = None, @@ -251,5 +303,5 @@ class Tag(ChakraComponent): props: The properties to be passed to the component. Returns: - The `create()` method returns a Tag object.""" - ... + The `create()` method returns a Tag object. + """ diff --git a/reflex_chakra/components/disclosure/accordion.py b/reflex_chakra/components/disclosure/accordion.py index 809d2b5..e1c19fd 100644 --- a/reflex_chakra/components/disclosure/accordion.py +++ b/reflex_chakra/components/disclosure/accordion.py @@ -1,9 +1,10 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Accordion(ChakraComponent): """The wrapper that uses cloneElement to pass props to AccordionItem children.""" diff --git a/reflex_chakra/components/disclosure/accordion.pyi b/reflex_chakra/components/disclosure/accordion.pyi index c283ddd..bdb82c2 100644 --- a/reflex_chakra/components/disclosure/accordion.pyi +++ b/reflex_chakra/components/disclosure/accordion.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Accordion(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items=None, @@ -79,13 +79,12 @@ class Accordion(ChakraComponent): **props: The properties of the component. Returns: - The accordion component""" - ... + The accordion component + """ class AccordionItem(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, id_: Var[str] | str | None = None, @@ -120,13 +119,29 @@ class AccordionItem(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AccordionItem: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AccordionButton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -158,13 +173,26 @@ class AccordionButton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AccordionButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AccordionPanel(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -196,13 +224,26 @@ class AccordionPanel(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AccordionPanel: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AccordionIcon(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -234,5 +275,19 @@ class AccordionIcon(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AccordionIcon: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/disclosure/tabs.py b/reflex_chakra/components/disclosure/tabs.py index 5299e3e..414f633 100644 --- a/reflex_chakra/components/disclosure/tabs.py +++ b/reflex_chakra/components/disclosure/tabs.py @@ -1,14 +1,16 @@ """Tab components.""" from typing import ClassVar + +from reflex.components.component import Component +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralColorScheme, LiteralTabsVariant, LiteralTagAlign, ) -from reflex.components.component import Component -from reflex.vars.base import Var class Tabs(ChakraComponent): @@ -68,7 +70,7 @@ def create( for label, panel in items: tabs.append(Tab.create(label)) panels.append(TabPanel.create(panel)) - children = [TabList.create(*tabs), TabPanels.create(*panels)] # type: ignore + children = [TabList.create(*tabs), TabPanels.create(*panels)] return super().create(*children, **props) diff --git a/reflex_chakra/components/disclosure/tabs.pyi b/reflex_chakra/components/disclosure/tabs.pyi index 44fcb0e..926b04c 100644 --- a/reflex_chakra/components/disclosure/tabs.pyi +++ b/reflex_chakra/components/disclosure/tabs.pyi @@ -3,26 +3,26 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) class Tabs(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items: list[tuple[str, str]] | None = None, @@ -154,13 +154,12 @@ class Tabs(ChakraComponent): **props: The properties of the component. Returns: - The tab component""" - ... + The tab component + """ class Tab(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_disabled: Var[bool] | bool | None = None, @@ -196,13 +195,30 @@ class Tab(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Tab: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TabList(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -234,13 +250,26 @@ class TabList(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TabList: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TabPanels(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -272,13 +301,26 @@ class TabPanels(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TabPanels: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class TabPanel(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -310,5 +352,19 @@ class TabPanel(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> TabPanel: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/disclosure/transition.py b/reflex_chakra/components/disclosure/transition.py index a85e788..6e09f8f 100644 --- a/reflex_chakra/components/disclosure/transition.py +++ b/reflex_chakra/components/disclosure/transition.py @@ -1,8 +1,9 @@ """A transition Component.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Transition(ChakraComponent): """Base componemt of all transitions.""" @@ -47,10 +48,10 @@ class SlideFade(Transition): tag = "SlideFade" # The offset on the horizontal or x axis - offsetX: Var[str | int] + offsetX: Var[str | int] # noqa: N815 # The offset on the vertical or y axis - offsetY: Var[str | int] + offsetY: Var[str | int] # noqa: N815 # If true, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out reverse: Var[bool] @@ -62,10 +63,10 @@ class Collapse(Transition): tag = "Collapse" # If true, the opacity of the content will be animated - animateOpacity: Var[bool] + animateOpacity: Var[bool] # noqa: N815 # The height you want the content in its expanded state. - endingHeight: Var[str] + endingHeight: Var[str] # noqa: N815 # The height you want the content in its collapsed state. - startingHeight: Var[str | int] + startingHeight: Var[str | int] # noqa: N815 diff --git a/reflex_chakra/components/disclosure/transition.pyi b/reflex_chakra/components/disclosure/transition.pyi index ea4caa6..6b5dbda 100644 --- a/reflex_chakra/components/disclosure/transition.pyi +++ b/reflex_chakra/components/disclosure/transition.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Transition(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, in_: Var[bool] | bool | None = None, @@ -53,13 +53,28 @@ class Transition(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Transition: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Fade(Transition): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, in_: Var[bool] | bool | None = None, @@ -93,13 +108,28 @@ class Fade(Transition): on_unmount: EventType[()] | None = None, **props, ) -> Fade: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ScaleFade(Transition): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, initial_scale: Var[float] | float | None = None, @@ -135,13 +165,30 @@ class ScaleFade(Transition): on_unmount: EventType[()] | None = None, **props, ) -> ScaleFade: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Slide(Transition): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, direction: Var[str] | str | None = None, @@ -176,13 +223,29 @@ class Slide(Transition): on_unmount: EventType[()] | None = None, **props, ) -> Slide: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class SlideFade(Transition): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, offsetX: Var[int | str] | int | str | None = None, @@ -219,13 +282,31 @@ class SlideFade(Transition): on_unmount: EventType[()] | None = None, **props, ) -> SlideFade: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Collapse(Transition): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, animateOpacity: Var[bool] | bool | None = None, @@ -262,5 +343,24 @@ class Collapse(Transition): on_unmount: EventType[()] | None = None, **props, ) -> Collapse: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/disclosure/visuallyhidden.pyi b/reflex_chakra/components/disclosure/visuallyhidden.pyi index bc08ba0..0d8f867 100644 --- a/reflex_chakra/components/disclosure/visuallyhidden.pyi +++ b/reflex_chakra/components/disclosure/visuallyhidden.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class VisuallyHidden(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -51,5 +51,19 @@ class VisuallyHidden(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> VisuallyHidden: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/feedback/alert.py b/reflex_chakra/components/feedback/alert.py index f03db02..fd50bfa 100644 --- a/reflex_chakra/components/feedback/alert.py +++ b/reflex_chakra/components/feedback/alert.py @@ -1,12 +1,13 @@ """Alert components.""" +from reflex.components.component import Component +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralAlertVariant, LiteralStatus, ) -from reflex.components.component import Component -from reflex.vars.base import Var class Alert(ChakraComponent): diff --git a/reflex_chakra/components/feedback/alert.pyi b/reflex_chakra/components/feedback/alert.pyi index b159644..e29dae1 100644 --- a/reflex_chakra/components/feedback/alert.pyi +++ b/reflex_chakra/components/feedback/alert.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Alert(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, icon=True, @@ -80,13 +80,12 @@ class Alert(ChakraComponent): **props: The properties of the component. Returns: - The alert component.""" - ... + The alert component. + """ class AlertIcon(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -118,13 +117,26 @@ class AlertIcon(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertIcon: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AlertTitle(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -156,13 +168,26 @@ class AlertTitle(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertTitle: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AlertDescription(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -194,5 +219,19 @@ class AlertDescription(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertDescription: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/feedback/circularprogress.py b/reflex_chakra/components/feedback/circularprogress.py index 1b3fc0e..91cb080 100644 --- a/reflex_chakra/components/feedback/circularprogress.py +++ b/reflex_chakra/components/feedback/circularprogress.py @@ -1,9 +1,10 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class CircularProgress(ChakraComponent): """The CircularProgress component is used to indicate the progress for determinate and indeterminate processes.""" diff --git a/reflex_chakra/components/feedback/circularprogress.pyi b/reflex_chakra/components/feedback/circularprogress.pyi index ae1aa27..e1a5234 100644 --- a/reflex_chakra/components/feedback/circularprogress.pyi +++ b/reflex_chakra/components/feedback/circularprogress.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class CircularProgress(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, label=None, @@ -87,13 +87,12 @@ class CircularProgress(ChakraComponent): **props: the props of the component. Returns: - The circular progress component.""" - ... + The circular progress component. + """ class CircularProgressLabel(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -125,5 +124,19 @@ class CircularProgressLabel(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> CircularProgressLabel: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/feedback/progress.py b/reflex_chakra/components/feedback/progress.py index 8c4e496..287af86 100644 --- a/reflex_chakra/components/feedback/progress.py +++ b/reflex_chakra/components/feedback/progress.py @@ -1,8 +1,9 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Progress(ChakraComponent): """A bar to display progress.""" diff --git a/reflex_chakra/components/feedback/progress.pyi b/reflex_chakra/components/feedback/progress.pyi index c71d59b..a1cdd8c 100644 --- a/reflex_chakra/components/feedback/progress.pyi +++ b/reflex_chakra/components/feedback/progress.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Progress(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, has_stripe: Var[bool] | bool | None = None, @@ -27,7 +27,7 @@ class Progress(ChakraComponent): is_indeterminate: Var[bool] | bool | None = None, max_: Var[int] | int | None = None, min_: Var[int] | int | None = None, - value: Var[float | int] | float | int | None = None, + value: Var[float | int] | float | None = None, color_scheme: Var[str] | str | None = None, style: Sequence[Mapping[str, Any]] | Mapping[str, Any] @@ -58,5 +58,26 @@ class Progress(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Progress: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/feedback/skeleton.py b/reflex_chakra/components/feedback/skeleton.py index 39182ae..9b4781a 100644 --- a/reflex_chakra/components/feedback/skeleton.py +++ b/reflex_chakra/components/feedback/skeleton.py @@ -1,8 +1,9 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + 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.""" diff --git a/reflex_chakra/components/feedback/skeleton.pyi b/reflex_chakra/components/feedback/skeleton.pyi index 74d7c73..ba9f694 100644 --- a/reflex_chakra/components/feedback/skeleton.pyi +++ b/reflex_chakra/components/feedback/skeleton.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Skeleton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, end_color: Var[str] | str | None = None, @@ -56,13 +56,31 @@ class Skeleton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Skeleton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class SkeletonCircle(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, end_color: Var[str] | str | None = None, @@ -99,13 +117,31 @@ class SkeletonCircle(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> SkeletonCircle: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class SkeletonText(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, end_color: Var[str] | str | None = None, @@ -143,5 +179,25 @@ class SkeletonText(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> SkeletonText: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/feedback/spinner.py b/reflex_chakra/components/feedback/spinner.py index 66460c4..92adf07 100644 --- a/reflex_chakra/components/feedback/spinner.py +++ b/reflex_chakra/components/feedback/spinner.py @@ -1,8 +1,9 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent, LiteralSpinnerSize from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralSpinnerSize + class Spinner(ChakraComponent): """The component that spins.""" diff --git a/reflex_chakra/components/feedback/spinner.pyi b/reflex_chakra/components/feedback/spinner.pyi index c862cb8..a0c2ef2 100644 --- a/reflex_chakra/components/feedback/spinner.pyi +++ b/reflex_chakra/components/feedback/spinner.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Spinner(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, empty_color: Var[str] | str | None = None, @@ -59,5 +59,24 @@ class Spinner(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Spinner: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/__init__.py b/reflex_chakra/components/forms/__init__.py index 96015ab..56aea9d 100644 --- a/reflex_chakra/components/forms/__init__.py +++ b/reflex_chakra/components/forms/__init__.py @@ -1,5 +1,7 @@ """Convenience functions to define core components.""" +from reflex.components.el.elements.forms import Option + from .button import Button, ButtonGroup from .checkbox import Checkbox, CheckboxGroup from .colormodeswitch import ( @@ -37,7 +39,7 @@ RangeSliderThumb, RangeSliderTrack, ) -from .select import Option, Select +from .select import Select from .slider import Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack from .switch import Switch from .textarea import TextArea diff --git a/reflex_chakra/components/forms/button.py b/reflex_chakra/components/forms/button.py index 0d51307..d4a6789 100644 --- a/reflex_chakra/components/forms/button.py +++ b/reflex_chakra/components/forms/button.py @@ -1,6 +1,9 @@ """A button component.""" from typing import ClassVar + +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralButtonSize, @@ -8,7 +11,6 @@ LiteralColorScheme, LiteralSpinnerPlacement, ) -from reflex.vars.base import Var class Button(ChakraComponent): diff --git a/reflex_chakra/components/forms/button.pyi b/reflex_chakra/components/forms/button.pyi index 316860a..18334a3 100644 --- a/reflex_chakra/components/forms/button.pyi +++ b/reflex_chakra/components/forms/button.pyi @@ -3,26 +3,26 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) class Button(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, icon_spacing: Var[int] | int | None = None, @@ -116,13 +116,38 @@ class Button(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Button: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ButtonGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_attached: Var[bool] | bool | None = None, @@ -163,5 +188,24 @@ class ButtonGroup(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ButtonGroup: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/checkbox.py b/reflex_chakra/components/forms/checkbox.py index 9574046..0fb9d58 100644 --- a/reflex_chakra/components/forms/checkbox.py +++ b/reflex_chakra/components/forms/checkbox.py @@ -2,13 +2,14 @@ from __future__ import annotations +from reflex.event import EventHandler +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralColorScheme, LiteralTagSize, ) -from reflex.event import EventHandler -from reflex.vars.base import Var class Checkbox(ChakraComponent): diff --git a/reflex_chakra/components/forms/checkbox.pyi b/reflex_chakra/components/forms/checkbox.pyi index 93110e0..ed62d7d 100644 --- a/reflex_chakra/components/forms/checkbox.pyi +++ b/reflex_chakra/components/forms/checkbox.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Checkbox(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, color_scheme: Literal[ @@ -109,13 +109,39 @@ class Checkbox(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Checkbox: - """""" - ... + """Create a new Chakra 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) + on_change: Fired when the checkbox is checked or unchecked + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class CheckboxGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Var[str] | str | None = None, @@ -151,5 +177,23 @@ class CheckboxGroup(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> CheckboxGroup: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/colormodeswitch.py b/reflex_chakra/components/forms/colormodeswitch.py index 1751a8f..8433eed 100644 --- a/reflex_chakra/components/forms/colormodeswitch.py +++ b/reflex_chakra/components/forms/colormodeswitch.py @@ -17,12 +17,13 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent -from reflex_chakra.components.media.icon import Icon from reflex.components.component import BaseComponent from reflex.components.core.cond import color_mode_cond from reflex.style import LIGHT_COLOR_MODE, color_mode, toggle_color_mode +from reflex_chakra.components import ChakraComponent +from reflex_chakra.components.media.icon import Icon + from .button import Button from .switch import Switch @@ -96,4 +97,4 @@ class ColorModeScript(ChakraComponent): """Chakra color mode script.""" tag = "ColorModeScript" - initialColorMode = LIGHT_COLOR_MODE + initialColorMode = LIGHT_COLOR_MODE # noqa: N815 diff --git a/reflex_chakra/components/forms/colormodeswitch.pyi b/reflex_chakra/components/forms/colormodeswitch.pyi index 25b929b..0213f13 100644 --- a/reflex_chakra/components/forms/colormodeswitch.pyi +++ b/reflex_chakra/components/forms/colormodeswitch.pyi @@ -3,21 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import BaseComponent from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent from reflex_chakra.components.media.icon import Icon -from reflex.components.component import BaseComponent + from .button import Button from .switch import Switch @@ -30,9 +32,8 @@ def color_mode_icon( ): ... class ColorModeSwitch(Switch): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_checked: Var[bool] | bool | None = None, @@ -146,13 +147,12 @@ class ColorModeSwitch(Switch): **props: The props to pass to the component. Returns: - The switch component.""" - ... + The switch component. + """ class ColorModeButton(Button): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, icon_spacing: Var[int] | int | None = None, @@ -272,13 +272,12 @@ class ColorModeButton(Button): **props: The props to pass to the component. Returns: - The switch component.""" - ... + The switch component. + """ class ColorModeScript(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -310,5 +309,19 @@ class ColorModeScript(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ColorModeScript: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/date_picker.py b/reflex_chakra/components/forms/date_picker.py index 2344623..41c000f 100644 --- a/reflex_chakra/components/forms/date_picker.py +++ b/reflex_chakra/components/forms/date_picker.py @@ -1,11 +1,12 @@ """A date input component.""" -from reflex_chakra.components.forms.input import Input from reflex.vars.base import Var +from reflex_chakra.components.forms.input import Input + class DatePicker(Input): """A date input component.""" # The type of input. - type_: Var[str] = "date" # type: ignore + type_: Var[str] = Var.create("date") diff --git a/reflex_chakra/components/forms/date_picker.pyi b/reflex_chakra/components/forms/date_picker.pyi index 3b5b1e5..3586421 100644 --- a/reflex_chakra/components/forms/date_picker.pyi +++ b/reflex_chakra/components/forms/date_picker.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.forms.input import Input class DatePicker(Input): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type_: Var[str] | str | None = None, @@ -104,5 +104,5 @@ class DatePicker(Input): **props: The properties of the component. Returns: - The component.""" - ... + The component. + """ diff --git a/reflex_chakra/components/forms/date_time_picker.py b/reflex_chakra/components/forms/date_time_picker.py index b93e226..81be238 100644 --- a/reflex_chakra/components/forms/date_time_picker.py +++ b/reflex_chakra/components/forms/date_time_picker.py @@ -1,11 +1,12 @@ """A datetime-local input component.""" -from reflex_chakra.components.forms.input import Input from reflex.vars.base import Var +from reflex_chakra.components.forms.input import Input + class DateTimePicker(Input): """A datetime-local input component.""" # The type of input. - type_: Var[str] = "datetime-local" # type: ignore + type_: Var[str] = Var.create("datetime-local") diff --git a/reflex_chakra/components/forms/date_time_picker.pyi b/reflex_chakra/components/forms/date_time_picker.pyi index 05dc13d..a07de89 100644 --- a/reflex_chakra/components/forms/date_time_picker.pyi +++ b/reflex_chakra/components/forms/date_time_picker.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.forms.input import Input class DateTimePicker(Input): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type_: Var[str] | str | None = None, @@ -104,5 +104,5 @@ class DateTimePicker(Input): **props: The properties of the component. Returns: - The component.""" - ... + The component. + """ diff --git a/reflex_chakra/components/forms/editable.py b/reflex_chakra/components/forms/editable.py index dcac25e..13aa8e5 100644 --- a/reflex_chakra/components/forms/editable.py +++ b/reflex_chakra/components/forms/editable.py @@ -2,10 +2,11 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent from reflex.event import EventHandler from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Editable(ChakraComponent): """The wrapper component that provides context value.""" diff --git a/reflex_chakra/components/forms/editable.pyi b/reflex_chakra/components/forms/editable.pyi index 10af2fe..ebee6a3 100644 --- a/reflex_chakra/components/forms/editable.pyi +++ b/reflex_chakra/components/forms/editable.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Editable(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_disabled: Var[bool] | bool | None = None, @@ -63,13 +63,38 @@ class Editable(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Editable: - """""" - ... + """Create a new Chakra 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. + on_change: Fired when the Editable is changed. + on_edit: Fired when the Editable is in edit mode. + on_submit: Fired when the Editable is submitted. + on_cancel: Fired when the Editable is canceled. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class EditableInput(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -101,13 +126,26 @@ class EditableInput(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> EditableInput: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class EditableTextarea(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -139,13 +177,26 @@ class EditableTextarea(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> EditableTextarea: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class EditablePreview(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -177,5 +228,19 @@ class EditablePreview(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> EditablePreview: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/email.py b/reflex_chakra/components/forms/email.py index e1181cd..e45d4a7 100644 --- a/reflex_chakra/components/forms/email.py +++ b/reflex_chakra/components/forms/email.py @@ -1,11 +1,12 @@ """An email input component.""" -from reflex_chakra.components.forms.input import Input from reflex.vars.base import Var +from reflex_chakra.components.forms.input import Input + class Email(Input): """An email input component.""" # The type of input. - type_: Var[str] = "email" # type: ignore + type_: Var[str] = Var.create("email") diff --git a/reflex_chakra/components/forms/email.pyi b/reflex_chakra/components/forms/email.pyi index c59dd6a..2fab836 100644 --- a/reflex_chakra/components/forms/email.pyi +++ b/reflex_chakra/components/forms/email.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.forms.input import Input class Email(Input): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type_: Var[str] | str | None = None, @@ -104,5 +104,5 @@ class Email(Input): **props: The properties of the component. Returns: - The component.""" - ... + The component. + """ diff --git a/reflex_chakra/components/forms/form.py b/reflex_chakra/components/forms/form.py index 969254d..c8a8dbc 100644 --- a/reflex_chakra/components/forms/form.py +++ b/reflex_chakra/components/forms/form.py @@ -2,11 +2,12 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.components.el.elements.forms import Form as HTMLForm from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Form(ChakraComponent, HTMLForm): """A form component.""" @@ -14,7 +15,7 @@ class Form(ChakraComponent, HTMLForm): tag = "Box" # What the form renders to. - as_: Var[str] = "form" # type: ignore + as_: Var[str] = Var.create("form") class FormControl(ChakraComponent): @@ -70,7 +71,8 @@ def create( children.append(FormLabel.create(*label)) if not input: - raise AttributeError("input keyword argument is required") + msg = "input keyword argument is required" + raise AttributeError(msg) children.append(input) if help_text: diff --git a/reflex_chakra/components/forms/form.pyi b/reflex_chakra/components/forms/form.pyi index 3ee0254..adca10e 100644 --- a/reflex_chakra/components/forms/form.pyi +++ b/reflex_chakra/components/forms/form.pyi @@ -3,25 +3,25 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints +from reflex.components.el.elements.forms import Form as HTMLForm from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent -from reflex.components.el.elements.forms import Form as HTMLForm class Form(ChakraComponent, HTMLForm): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, as_: Var[str] | str | None = None, @@ -242,18 +242,60 @@ class Form(ChakraComponent, HTMLForm): on_scroll_end: EventType[()] | None = None, on_submit: EventType[()] | EventType[dict[str, Any]] - | (EventType[()] | EventType[dict[str, str]]) + | EventType[dict[str, str]] | None = None, on_unmount: EventType[()] | None = None, **props, ) -> Form: - """""" - ... + """Create a new Chakra component. + + Args: + *children: The children of the component. + 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. + on_submit: Fired when the form is submitted + 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class FormControl(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, label=None, @@ -318,13 +360,12 @@ class FormControl(ChakraComponent): AttributeError: raise an error if missing required kwargs. Returns: - The form control component.""" - ... + The form control component. + """ class FormHelperText(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -356,13 +397,26 @@ class FormHelperText(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> FormHelperText: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class FormLabel(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, html_for: Var[str] | str | None = None, @@ -395,13 +449,27 @@ class FormLabel(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> FormLabel: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class FormErrorMessage(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -433,5 +501,19 @@ class FormErrorMessage(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> FormErrorMessage: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/iconbutton.py b/reflex_chakra/components/forms/iconbutton.py index da062f6..7e603bf 100644 --- a/reflex_chakra/components/forms/iconbutton.py +++ b/reflex_chakra/components/forms/iconbutton.py @@ -1,9 +1,10 @@ """An icon button component.""" -from reflex_chakra.components.typography.text import Text from reflex.components.component import Component from reflex.vars.base import Var +from reflex_chakra.components.typography.text import Text + class IconButton(Text): """A button with an icon.""" diff --git a/reflex_chakra/components/forms/iconbutton.pyi b/reflex_chakra/components/forms/iconbutton.pyi index 1ff3970..7a0002f 100644 --- a/reflex_chakra/components/forms/iconbutton.pyi +++ b/reflex_chakra/components/forms/iconbutton.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.typography.text import Text -from reflex.components.component import Component class IconButton(Text): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type: Var[str] | str | None = None, @@ -62,5 +62,29 @@ class IconButton(Text): on_unmount: EventType[()] | None = None, **props, ) -> IconButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/input.py b/reflex_chakra/components/forms/input.py index 0ac41ef..a0c3a5d 100644 --- a/reflex_chakra/components/forms/input.py +++ b/reflex_chakra/components/forms/input.py @@ -1,10 +1,5 @@ """An input component.""" -from reflex_chakra.components import ( - ChakraComponent, - LiteralButtonSize, - LiteralInputVariant, -) from reflex.components.component import Component from reflex.components.core.debounce import DebounceInput from reflex.components.literals import LiteralInputType @@ -13,6 +8,12 @@ from reflex.utils.imports import ImportDict from reflex.vars.base import Var +from reflex_chakra.components import ( + ChakraComponent, + LiteralButtonSize, + LiteralInputVariant, +) + class Input(ChakraComponent): """The Input component is a component that is used to get user input in a text field.""" diff --git a/reflex_chakra/components/forms/input.pyi b/reflex_chakra/components/forms/input.pyi index 725c13c..4735e09 100644 --- a/reflex_chakra/components/forms/input.pyi +++ b/reflex_chakra/components/forms/input.pyi @@ -3,28 +3,28 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) +from reflex.utils.imports import ImportDict from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) -from reflex.utils.imports import ImportDict class Input(ChakraComponent): def add_imports(self) -> ImportDict: ... - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Var[str] | str | None = None, @@ -158,13 +158,12 @@ class Input(ChakraComponent): **props: The properties of the component. Returns: - The component.""" - ... + The component. + """ class InputGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -196,13 +195,26 @@ class InputGroup(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> InputGroup: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class InputLeftAddon(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -234,13 +246,26 @@ class InputLeftAddon(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> InputLeftAddon: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class InputRightAddon(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -272,13 +297,26 @@ class InputRightAddon(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> InputRightAddon: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class InputLeftElement(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -310,13 +348,26 @@ class InputLeftElement(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> InputLeftElement: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class InputRightElement(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -348,5 +399,19 @@ class InputRightElement(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> InputRightElement: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/numberinput.py b/reflex_chakra/components/forms/numberinput.py index 65e3e0d..621cb6c 100644 --- a/reflex_chakra/components/forms/numberinput.py +++ b/reflex_chakra/components/forms/numberinput.py @@ -2,14 +2,15 @@ from numbers import Number +from reflex.components.component import Component +from reflex.event import EventHandler +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralButtonSize, LiteralInputVariant, ) -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars.base import Var class NumberInput(ChakraComponent): diff --git a/reflex_chakra/components/forms/numberinput.pyi b/reflex_chakra/components/forms/numberinput.pyi index 07f269b..9df6fff 100644 --- a/reflex_chakra/components/forms/numberinput.pyi +++ b/reflex_chakra/components/forms/numberinput.pyi @@ -3,27 +3,27 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence +from numbers import Number from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var -from numbers import Number + from reflex_chakra.components import ( ChakraComponent, ) class NumberInput(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Number | Var[Number] | None = None, @@ -113,13 +113,12 @@ class NumberInput(ChakraComponent): **props: The props of the component. Returns: - The component.""" - ... + The component. + """ class NumberInputField(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -151,13 +150,26 @@ class NumberInputField(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> NumberInputField: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class NumberInputStepper(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -189,13 +201,26 @@ class NumberInputStepper(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> NumberInputStepper: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class NumberIncrementStepper(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -227,13 +252,26 @@ class NumberIncrementStepper(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> NumberIncrementStepper: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class NumberDecrementStepper(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -265,5 +303,19 @@ class NumberDecrementStepper(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> NumberDecrementStepper: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/password.py b/reflex_chakra/components/forms/password.py index 847b8ca..7e81332 100644 --- a/reflex_chakra/components/forms/password.py +++ b/reflex_chakra/components/forms/password.py @@ -1,11 +1,12 @@ """A password input component.""" -from reflex_chakra.components.forms.input import Input from reflex.vars.base import Var +from reflex_chakra.components.forms.input import Input + class Password(Input): """A password input component.""" # The type of input. - type_: Var[str] = "password" # type: ignore + type_: Var[str] = Var.create("password") diff --git a/reflex_chakra/components/forms/password.pyi b/reflex_chakra/components/forms/password.pyi index 6bc9c63..604678e 100644 --- a/reflex_chakra/components/forms/password.pyi +++ b/reflex_chakra/components/forms/password.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.forms.input import Input class Password(Input): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type_: Var[str] | str | None = None, @@ -104,5 +104,5 @@ class Password(Input): **props: The properties of the component. Returns: - The component.""" - ... + The component. + """ diff --git a/reflex_chakra/components/forms/pininput.py b/reflex_chakra/components/forms/pininput.py index 419354a..8d9621c 100644 --- a/reflex_chakra/components/forms/pininput.py +++ b/reflex_chakra/components/forms/pininput.py @@ -2,9 +2,7 @@ from __future__ import annotations - import reflex as rx -from reflex_chakra.components import ChakraComponent, LiteralInputVariant from reflex.components.component import Component from reflex.components.tags.tag import Tag from reflex.event import EventHandler @@ -12,6 +10,8 @@ from reflex.utils.imports import ParsedImportDict, merge_imports from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralInputVariant + class PinInput(ChakraComponent): """The component that provides context to all the pin-input fields.""" @@ -78,7 +78,7 @@ def _get_imports(self) -> ParsedImportDict: range_var = Var.range(0) return merge_imports( super()._get_imports(), - PinInputField._unsafe_create(children=[])._get_all_imports(), # type: ignore + PinInputField._unsafe_create(children=[])._get_all_imports(), range_var._var_data.imports if range_var._var_data is not None else {}, ) @@ -118,6 +118,7 @@ def _get_ref_hook(self): f"{Var(ref)._as_ref()!s} = {ref}" ) return super()._get_ref_hook() + return None def _render(self) -> Tag: """Override the base _render to remove the fake get_ref. @@ -168,7 +169,7 @@ class PinInputField(ChakraComponent): name: Var[str] @classmethod - def for_length(cls, length: Var | int, **props) -> Var: + def for_length(cls, length: Var[int] | int, **props): """Create a PinInputField for a PinInput with a given length. Args: @@ -185,8 +186,8 @@ def _create(i): props["name"] = f"{name}-{i}" return PinInputField.create(**props, index=i, key=i) - return rx.foreach( # type: ignore - Var.range(length), # type: ignore + return rx.foreach( + Var.range(Var.create(length).to(int)), _create, ) @@ -201,3 +202,4 @@ def get_ref(self): """ if self.id: return format.format_array_ref(self.id, self.index) + return None diff --git a/reflex_chakra/components/forms/pininput.pyi b/reflex_chakra/components/forms/pininput.pyi index 4c890ad..3f58251 100644 --- a/reflex_chakra/components/forms/pininput.pyi +++ b/reflex_chakra/components/forms/pininput.pyi @@ -3,25 +3,25 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class PinInput(ChakraComponent): def get_ref(self) -> str | None: ... - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Var[str] | str | None = None, @@ -106,16 +106,15 @@ class PinInput(ChakraComponent): **props: The props of the component. Returns: - The pin input component.""" - ... + The pin input component. + """ class PinInputField(ChakraComponent): @classmethod - def for_length(cls, length: Var | int, **props) -> Var: ... + def for_length(cls, length: Var[int] | int, **props): ... def get_ref(self): ... - @overload @classmethod - def create( # type: ignore + def create( cls, *children, index: Var[int | None] | int | None = None, @@ -149,5 +148,21 @@ class PinInputField(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PinInputField: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/radio.py b/reflex_chakra/components/forms/radio.py index 995c76b..e29241d 100644 --- a/reflex_chakra/components/forms/radio.py +++ b/reflex_chakra/components/forms/radio.py @@ -2,14 +2,15 @@ from typing import Any -from reflex_chakra.components import ChakraComponent -from reflex_chakra.components.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.base import Var +from reflex_chakra.components import ChakraComponent +from reflex_chakra.components.typography.text import Text + class RadioGroup(ChakraComponent): """A grouping of individual radio options.""" @@ -96,6 +97,8 @@ def create(cls, *children, **props) -> Component: The radio component. """ if "value" not in props: - assert len(children) == 1 + if len(children) != 1: + msg = "Radio must have exactly one child or a value prop." + raise ValueError(msg) props["value"] = children[0] return super().create(*children, **props) diff --git a/reflex_chakra/components/forms/radio.pyi b/reflex_chakra/components/forms/radio.pyi index 5ce633f..a2d6832 100644 --- a/reflex_chakra/components/forms/radio.pyi +++ b/reflex_chakra/components/forms/radio.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent from reflex_chakra.components.typography.text import Text class RadioGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Any | Var[Any] | None = None, @@ -74,13 +74,12 @@ class RadioGroup(ChakraComponent): **props: The props of the component. Returns: - The component.""" - ... + The component. + """ class Radio(Text): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Any | Var[Any] | None = None, @@ -150,5 +149,5 @@ class Radio(Text): **props: The props of the component. Returns: - The radio component.""" - ... + The radio component. + """ diff --git a/reflex_chakra/components/forms/rangeslider.py b/reflex_chakra/components/forms/rangeslider.py index c4f64fd..3edb728 100644 --- a/reflex_chakra/components/forms/rangeslider.py +++ b/reflex_chakra/components/forms/rangeslider.py @@ -2,13 +2,13 @@ from __future__ import annotations - -from reflex_chakra.components import ChakraComponent, LiteralChakraDirection from reflex.components.component import Component from reflex.event import EventHandler from reflex.utils import format from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralChakraDirection + 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.""" @@ -63,7 +63,7 @@ def get_ref(self): Returns: The ref of the component. """ - return None + return def _get_ref_hook(self): """Override the base _get_ref_hook to handle array refs. @@ -79,6 +79,7 @@ def _get_ref_hook(self): f"{Var(_js_expr=ref)._as_ref()!s} = {ref}", ) return super()._get_ref_hook() + return None @classmethod def create(cls, *children, **props) -> Component: @@ -94,7 +95,7 @@ def create(cls, *children, **props) -> Component: The RangeSlider component. """ if len(children) == 0: - _id = props.get("id", None) + _id = props.get("id") if _id: children = [ RangeSliderTrack.create( @@ -146,3 +147,4 @@ def get_ref(self): """ if self.id: return format.format_array_ref(self.id, self.index) + return None diff --git a/reflex_chakra/components/forms/rangeslider.pyi b/reflex_chakra/components/forms/rangeslider.pyi index 7afffdf..93cfd61 100644 --- a/reflex_chakra/components/forms/rangeslider.pyi +++ b/reflex_chakra/components/forms/rangeslider.pyi @@ -3,25 +3,25 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class RangeSlider(ChakraComponent): def get_ref(self): ... - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Var[list[int]] | list[int] | None = None, @@ -97,13 +97,12 @@ class RangeSlider(ChakraComponent): **props: The properties of the component. Returns: - The RangeSlider component.""" - ... + The RangeSlider component. + """ class RangeSliderTrack(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -135,13 +134,26 @@ class RangeSliderTrack(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> RangeSliderTrack: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class RangeSliderFilledTrack(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -173,14 +185,27 @@ class RangeSliderFilledTrack(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> RangeSliderFilledTrack: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class RangeSliderThumb(ChakraComponent): def get_ref(self): ... - @overload @classmethod - def create( # type: ignore + def create( cls, *children, index: Var[int] | int | None = None, @@ -213,5 +238,20 @@ class RangeSliderThumb(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> RangeSliderThumb: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/select.py b/reflex_chakra/components/forms/select.py index c6b6341..2c85378 100644 --- a/reflex_chakra/components/forms/select.py +++ b/reflex_chakra/components/forms/select.py @@ -1,12 +1,13 @@ """A select component.""" -from reflex_chakra.components import ChakraComponent, LiteralInputVariant from reflex.components.component import Component from reflex.components.core.foreach import Foreach +from reflex.components.el import Option from reflex.event import EventHandler from reflex.utils.types import _issubclass from reflex.vars.base import Var -from reflex.components.el import Option as Option + +from reflex_chakra.components import ChakraComponent, LiteralInputVariant class Select(ChakraComponent): diff --git a/reflex_chakra/components/forms/select.pyi b/reflex_chakra/components/forms/select.pyi index ae307cf..081db33 100644 --- a/reflex_chakra/components/forms/select.pyi +++ b/reflex_chakra/components/forms/select.pyi @@ -3,25 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent -from reflex.components.el import Option as Option class Select(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Var[str] | str | None = None, @@ -96,5 +95,5 @@ class Select(ChakraComponent): **props: The props of the component. Returns: - The component.""" - ... + The component. + """ diff --git a/reflex_chakra/components/forms/slider.py b/reflex_chakra/components/forms/slider.py index 1530c66..387b233 100644 --- a/reflex_chakra/components/forms/slider.py +++ b/reflex_chakra/components/forms/slider.py @@ -4,11 +4,12 @@ from typing import Literal -from reflex_chakra.components import ChakraComponent, LiteralChakraDirection from reflex.components.component import Component from reflex.event import EventHandler from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralChakraDirection + LiteralLayout = Literal["horizontal", "vertical"] diff --git a/reflex_chakra/components/forms/slider.pyi b/reflex_chakra/components/forms/slider.pyi index 0e38b78..13200b8 100644 --- a/reflex_chakra/components/forms/slider.pyi +++ b/reflex_chakra/components/forms/slider.pyi @@ -3,26 +3,27 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, + TypeAlias, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent -LiteralLayout = Literal["horizontal", "vertical"] +LiteralLayout: TypeAlias = Literal["horizontal", "vertical"] class Slider(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Var[int] | int | None = None, @@ -114,13 +115,12 @@ class Slider(ChakraComponent): **props: The properties of the component. Returns: - The slider component.""" - ... + The slider component. + """ class SliderTrack(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -152,13 +152,26 @@ class SliderTrack(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> SliderTrack: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class SliderFilledTrack(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -190,13 +203,26 @@ class SliderFilledTrack(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> SliderFilledTrack: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class SliderThumb(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, box_size: Var[str] | str | None = None, @@ -229,13 +255,27 @@ class SliderThumb(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> SliderThumb: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class SliderMark(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -267,5 +307,19 @@ class SliderMark(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> SliderMark: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/switch.py b/reflex_chakra/components/forms/switch.py index 18477ee..ce5fdea 100644 --- a/reflex_chakra/components/forms/switch.py +++ b/reflex_chakra/components/forms/switch.py @@ -2,10 +2,11 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent, LiteralColorScheme from reflex.event import EventHandler from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralColorScheme + class Switch(ChakraComponent): """Toggleable switch component.""" diff --git a/reflex_chakra/components/forms/switch.pyi b/reflex_chakra/components/forms/switch.pyi index 64d5609..6a95004 100644 --- a/reflex_chakra/components/forms/switch.pyi +++ b/reflex_chakra/components/forms/switch.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Switch(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_checked: Var[bool] | bool | None = None, @@ -108,5 +108,31 @@ class Switch(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Switch: - """""" - ... + """Create a new Chakra 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.) + on_change: Fired when the switch value changes + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/forms/textarea.py b/reflex_chakra/components/forms/textarea.py index e575878..b453edc 100644 --- a/reflex_chakra/components/forms/textarea.py +++ b/reflex_chakra/components/forms/textarea.py @@ -2,12 +2,13 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent, LiteralInputVariant from reflex.components.component import Component from reflex.components.core.debounce import DebounceInput from reflex.event import EventHandler from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralInputVariant + class TextArea(ChakraComponent): """A text area component.""" diff --git a/reflex_chakra/components/forms/textarea.pyi b/reflex_chakra/components/forms/textarea.pyi index 22a17b1..7d09fb2 100644 --- a/reflex_chakra/components/forms/textarea.pyi +++ b/reflex_chakra/components/forms/textarea.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class TextArea(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, value: Var[str] | str | None = None, @@ -98,5 +98,5 @@ class TextArea(ChakraComponent): **props: The properties of the component. Returns: - The component.""" - ... + The component. + """ diff --git a/reflex_chakra/components/forms/time_picker.py b/reflex_chakra/components/forms/time_picker.py index 73b009b..f5fda2e 100644 --- a/reflex_chakra/components/forms/time_picker.py +++ b/reflex_chakra/components/forms/time_picker.py @@ -1,11 +1,12 @@ """A time input component.""" -from reflex_chakra.components.forms.input import Input from reflex.vars.base import Var +from reflex_chakra.components.forms.input import Input + class TimePicker(Input): """A time input component.""" # The type of input. - type_: Var[str] = "time" # type: ignore + type_: Var[str] = Var.create("time") diff --git a/reflex_chakra/components/forms/time_picker.pyi b/reflex_chakra/components/forms/time_picker.pyi index 9e8acf6..1da9ebd 100644 --- a/reflex_chakra/components/forms/time_picker.pyi +++ b/reflex_chakra/components/forms/time_picker.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.forms.input import Input class TimePicker(Input): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type_: Var[str] | str | None = None, @@ -104,5 +104,5 @@ class TimePicker(Input): **props: The properties of the component. Returns: - The component.""" - ... + The component. + """ diff --git a/reflex_chakra/components/layout/aspect_ratio.py b/reflex_chakra/components/layout/aspect_ratio.py index c8054ff..c694404 100644 --- a/reflex_chakra/components/layout/aspect_ratio.py +++ b/reflex_chakra/components/layout/aspect_ratio.py @@ -1,8 +1,9 @@ """A AspectRatio component.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class AspectRatio(ChakraComponent): """AspectRatio component is used to embed responsive videos and maps, etc.""" diff --git a/reflex_chakra/components/layout/aspect_ratio.pyi b/reflex_chakra/components/layout/aspect_ratio.pyi index 9e298cf..9a7167a 100644 --- a/reflex_chakra/components/layout/aspect_ratio.pyi +++ b/reflex_chakra/components/layout/aspect_ratio.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class AspectRatio(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, ratio: Var[float] | float | None = None, @@ -52,5 +52,20 @@ class AspectRatio(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AspectRatio: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/box.py b/reflex_chakra/components/layout/box.py index c7240dc..178c611 100644 --- a/reflex_chakra/components/layout/box.py +++ b/reflex_chakra/components/layout/box.py @@ -1,9 +1,10 @@ """A box component that can contain other components.""" -from reflex_chakra.components import ChakraComponent from reflex.components.tags.tag import Tag from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Box(ChakraComponent): """A generic container component that can contain other components.""" diff --git a/reflex_chakra/components/layout/box.pyi b/reflex_chakra/components/layout/box.pyi index 60088f4..a7e520e 100644 --- a/reflex_chakra/components/layout/box.pyi +++ b/reflex_chakra/components/layout/box.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Box(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, element: Var[str] | str | None = None, @@ -54,5 +54,22 @@ class Box(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Box: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/card.py b/reflex_chakra/components/layout/card.py index 1ac401e..8d564c7 100644 --- a/reflex_chakra/components/layout/card.py +++ b/reflex_chakra/components/layout/card.py @@ -1,13 +1,14 @@ """Chakra Card component.""" +from reflex.components.component import Component +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralCardVariant, LiteralColorScheme, LiteralTagSize, ) -from reflex.components.component import Component -from reflex.vars.base import Var class CardHeader(ChakraComponent): @@ -69,6 +70,7 @@ def create( **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. diff --git a/reflex_chakra/components/layout/card.pyi b/reflex_chakra/components/layout/card.pyi index 8eab452..54d7a59 100644 --- a/reflex_chakra/components/layout/card.pyi +++ b/reflex_chakra/components/layout/card.pyi @@ -3,27 +3,27 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) -from reflex.components.component import Component class CardHeader(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -55,13 +55,26 @@ class CardHeader(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> CardHeader: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class CardBody(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -93,13 +106,26 @@ class CardBody(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> CardBody: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class CardFooter(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -131,13 +157,26 @@ class CardFooter(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> CardFooter: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Card(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, header: Component | None = None, @@ -224,6 +263,7 @@ class Card(ChakraComponent): **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. @@ -235,5 +275,5 @@ class Card(ChakraComponent): props: The properties to be passed to the component. Returns: - The `create()` method returns a Card object.""" - ... + The `create()` method returns a Card object. + """ diff --git a/reflex_chakra/components/layout/center.pyi b/reflex_chakra/components/layout/center.pyi index 4ed0e58..a57c12d 100644 --- a/reflex_chakra/components/layout/center.pyi +++ b/reflex_chakra/components/layout/center.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Center(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -51,13 +51,26 @@ class Center(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Center: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Square(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -89,13 +102,26 @@ class Square(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Square: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Circle(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -127,5 +153,19 @@ class Circle(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Circle: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/container.py b/reflex_chakra/components/layout/container.py index f0d8eb6..bbcdc5f 100644 --- a/reflex_chakra/components/layout/container.py +++ b/reflex_chakra/components/layout/container.py @@ -1,8 +1,9 @@ """A flexbox container.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Container(ChakraComponent): """A flexbox container that centers its children and sets a max width.""" diff --git a/reflex_chakra/components/layout/container.pyi b/reflex_chakra/components/layout/container.pyi index e7aafd6..3095f1c 100644 --- a/reflex_chakra/components/layout/container.pyi +++ b/reflex_chakra/components/layout/container.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Container(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, center_content: Var[bool] | bool | None = None, @@ -52,5 +52,20 @@ class Container(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Container: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/flex.py b/reflex_chakra/components/layout/flex.py index 0d12dfc..4247ec1 100644 --- a/reflex_chakra/components/layout/flex.py +++ b/reflex_chakra/components/layout/flex.py @@ -1,8 +1,9 @@ """A reflexive container component.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Flex(ChakraComponent): """A reflexive container component.""" diff --git a/reflex_chakra/components/layout/flex.pyi b/reflex_chakra/components/layout/flex.pyi index 20a6ea5..f3f64dd 100644 --- a/reflex_chakra/components/layout/flex.pyi +++ b/reflex_chakra/components/layout/flex.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Flex(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, align: Var[str] | str | None = None, @@ -58,5 +58,26 @@ class Flex(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Flex: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/grid.py b/reflex_chakra/components/layout/grid.py index 075395c..6551c64 100644 --- a/reflex_chakra/components/layout/grid.py +++ b/reflex_chakra/components/layout/grid.py @@ -1,8 +1,9 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Grid(ChakraComponent): """A grid component.""" diff --git a/reflex_chakra/components/layout/grid.pyi b/reflex_chakra/components/layout/grid.pyi index 9ef6a8d..2670ece 100644 --- a/reflex_chakra/components/layout/grid.pyi +++ b/reflex_chakra/components/layout/grid.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Grid(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, auto_columns: Var[str] | str | None = None, @@ -58,13 +58,33 @@ class Grid(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Grid: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class GridItem(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, area: Var[str] | str | None = None, @@ -103,13 +123,33 @@ class GridItem(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> GridItem: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ResponsiveGrid(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, auto_columns: Var[str] | str | None = None, @@ -154,5 +194,32 @@ class ResponsiveGrid(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ResponsiveGrid: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/spacer.pyi b/reflex_chakra/components/layout/spacer.pyi index 17c8847..99613c9 100644 --- a/reflex_chakra/components/layout/spacer.pyi +++ b/reflex_chakra/components/layout/spacer.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Spacer(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -51,5 +51,19 @@ class Spacer(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Spacer: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/stack.py b/reflex_chakra/components/layout/stack.py index 17e9280..ace877a 100644 --- a/reflex_chakra/components/layout/stack.py +++ b/reflex_chakra/components/layout/stack.py @@ -1,8 +1,9 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent, LiteralStackDirection from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralStackDirection + class Stack(ChakraComponent): """Container to stack elements with spacing.""" diff --git a/reflex_chakra/components/layout/stack.pyi b/reflex_chakra/components/layout/stack.pyi index 840df18..562ad46 100644 --- a/reflex_chakra/components/layout/stack.pyi +++ b/reflex_chakra/components/layout/stack.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Stack(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, align_items: Var[str] | str | None = None, @@ -63,13 +63,34 @@ class Stack(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Stack: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Hstack(Stack): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, align_items: Var[str] | str | None = None, @@ -112,13 +133,34 @@ class Hstack(Stack): on_unmount: EventType[()] | None = None, **props, ) -> Hstack: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Vstack(Stack): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, align_items: Var[str] | str | None = None, @@ -161,5 +203,27 @@ class Vstack(Stack): on_unmount: EventType[()] | None = None, **props, ) -> Vstack: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/layout/wrap.py b/reflex_chakra/components/layout/wrap.py index ca92b8d..58865fa 100644 --- a/reflex_chakra/components/layout/wrap.py +++ b/reflex_chakra/components/layout/wrap.py @@ -1,9 +1,10 @@ """Container to stack elements with spacing.""" -from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Wrap(ChakraComponent): """Layout component used to add space between elements and wrap automatically if there isn't enough space.""" diff --git a/reflex_chakra/components/layout/wrap.pyi b/reflex_chakra/components/layout/wrap.pyi index 12cf1bf..8227ee0 100644 --- a/reflex_chakra/components/layout/wrap.pyi +++ b/reflex_chakra/components/layout/wrap.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Wrap(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items=None, @@ -81,13 +81,12 @@ class Wrap(ChakraComponent): **props: The properties of the component. Returns: - The wrap component.""" - ... + The wrap component. + """ class WrapItem(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -119,5 +118,19 @@ class WrapItem(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> WrapItem: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/media/avatar.py b/reflex_chakra/components/media/avatar.py index 1e26c14..c768b66 100644 --- a/reflex_chakra/components/media/avatar.py +++ b/reflex_chakra/components/media/avatar.py @@ -2,10 +2,11 @@ from __future__ import annotations -from reflex_chakra.components.base import ChakraComponent, LiteralAvatarSize -from reflex.event import EventHandler +from reflex.event import EventHandler, no_args_event_spec from reflex.vars.base import Var +from reflex_chakra.components.base import ChakraComponent, LiteralAvatarSize + class Avatar(ChakraComponent): """The image that represents the user.""" @@ -37,7 +38,7 @@ class Avatar(ChakraComponent): size: Var[LiteralAvatarSize] # Fired when the image fails to load. - on_error: EventHandler[lambda: []] + on_error: EventHandler[no_args_event_spec] class AvatarBadge(ChakraComponent): diff --git a/reflex_chakra/components/media/avatar.pyi b/reflex_chakra/components/media/avatar.pyi index e92dca4..39f33d1 100644 --- a/reflex_chakra/components/media/avatar.pyi +++ b/reflex_chakra/components/media/avatar.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.base import ChakraComponent class Avatar(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, icon: Var[str] | str | None = None, @@ -48,7 +48,7 @@ class Avatar(ChakraComponent): on_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_error: EventType[Any] | None = None, + on_error: EventType[()] | None = None, on_focus: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, @@ -63,13 +63,35 @@ class Avatar(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Avatar: - """""" - ... + """Create a new Chakra 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" + on_error: Fired when the image fails to load. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AvatarBadge(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -101,13 +123,26 @@ class AvatarBadge(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AvatarBadge: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AvatarGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, max_: Var[int] | int | None = None, @@ -141,5 +176,21 @@ class AvatarGroup(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AvatarGroup: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/media/icon.py b/reflex_chakra/components/media/icon.py index 34cd1e7..f8c78cd 100644 --- a/reflex_chakra/components/media/icon.py +++ b/reflex_chakra/components/media/icon.py @@ -1,8 +1,9 @@ """An icon component.""" -from reflex_chakra.components.base import ChakraComponent from reflex.utils import format +from reflex_chakra.components.base import ChakraComponent + class ChakraIconComponent(ChakraComponent): """A component that wraps a Chakra icon component.""" @@ -33,15 +34,14 @@ def create(cls, *children, **props): The created component. """ if children: - raise AttributeError( - f"Passing children to Icon component is not allowed: remove positional arguments {children} to fix" - ) + msg = f"Passing children to Icon component is not allowed: remove positional arguments {children} to fix" + raise AttributeError(msg) if "tag" not in props: - raise AttributeError("Missing 'tag' keyword-argument for Icon") + msg = "Missing 'tag' keyword-argument for Icon" + raise AttributeError(msg) 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)}" - ) + msg = f"Invalid icon tag: {props['tag']}. Please use one of the following: {sorted(ICON_LIST)}" + raise ValueError(msg) props["tag"] = format.to_title_case(props["tag"]) + "Icon" return super().create(*children, **props) diff --git a/reflex_chakra/components/media/icon.pyi b/reflex_chakra/components/media/icon.pyi index 1bc16ee..75c0b98 100644 --- a/reflex_chakra/components/media/icon.pyi +++ b/reflex_chakra/components/media/icon.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.base import ChakraComponent class ChakraIconComponent(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -51,13 +51,26 @@ class ChakraIconComponent(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ChakraIconComponent: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class Icon(ChakraIconComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -109,7 +122,7 @@ class Icon(ChakraIconComponent): ValueError: If the icon tag is invalid. Returns: - The created component.""" - ... + The created component. + """ ICON_LIST: list[str] diff --git a/reflex_chakra/components/media/image.py b/reflex_chakra/components/media/image.py index 48daece..810efae 100644 --- a/reflex_chakra/components/media/image.py +++ b/reflex_chakra/components/media/image.py @@ -4,11 +4,12 @@ from typing import Any -from reflex_chakra.components.base import ChakraComponent, LiteralImageLoading from reflex.components.component import Component -from reflex.event import EventHandler +from reflex.event import EventHandler, no_args_event_spec from reflex.vars.base import Var +from reflex_chakra.components.base import ChakraComponent, LiteralImageLoading + class Image(ChakraComponent): """Display an image.""" @@ -52,7 +53,7 @@ class Image(ChakraComponent): src_set: Var[str] # Fired when the image fails to load. - on_error: EventHandler[lambda: []] + on_error: EventHandler[no_args_event_spec] # Fired when the image is loaded. - on_load: EventHandler[lambda: []] + on_load: EventHandler[no_args_event_spec] diff --git a/reflex_chakra/components/media/image.pyi b/reflex_chakra/components/media/image.pyi index e0ec7aa..9310ff1 100644 --- a/reflex_chakra/components/media/image.pyi +++ b/reflex_chakra/components/media/image.pyi @@ -3,25 +3,25 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components.base import ChakraComponent -from reflex.components.component import Component class Image(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, align: Var[str] | str | None = None, @@ -50,9 +50,9 @@ class Image(ChakraComponent): on_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_error: EventType[Any] | None = None, + on_error: EventType[()] | None = None, on_focus: EventType[()] | None = None, - on_load: EventType[Any] | None = None, + on_load: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, on_mouse_enter: EventType[()] | None = None, @@ -66,5 +66,32 @@ class Image(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Image: - """""" - ... + """Create a new Chakra component. + + Args: + *children: The children of the component. + 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)_ + on_error: Fired when the image fails to load. + on_load: Fired when the image is loaded. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/navigation/breadcrumb.py b/reflex_chakra/components/navigation/breadcrumb.py index e48e51b..31548ec 100644 --- a/reflex_chakra/components/navigation/breadcrumb.py +++ b/reflex_chakra/components/navigation/breadcrumb.py @@ -1,11 +1,12 @@ """Breadcrumb components.""" -from reflex_chakra.components import ChakraComponent -from reflex_chakra.components.navigation.link import Link from reflex.components.component import Component from reflex.components.core.foreach import Foreach from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent +from reflex_chakra.components.navigation.link import Link + class Breadcrumb(ChakraComponent): """The parent container for breadcrumbs.""" @@ -79,7 +80,7 @@ def create(cls, *children, label=None, href=None, **props): The BreadcrumbItem component """ if len(children) == 0: - children = [BreadcrumbLink.create(label or "", href=href or "")] # type: ignore + children = [BreadcrumbLink.create(label or "", href=href or "")] return super().create(*children, **props) diff --git a/reflex_chakra/components/navigation/breadcrumb.pyi b/reflex_chakra/components/navigation/breadcrumb.pyi index 6a08a17..2fc4dd7 100644 --- a/reflex_chakra/components/navigation/breadcrumb.pyi +++ b/reflex_chakra/components/navigation/breadcrumb.pyi @@ -3,25 +3,25 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent from reflex_chakra.components.navigation.link import Link -from reflex.components.component import Component class Breadcrumb(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items=None, @@ -75,13 +75,12 @@ class Breadcrumb(ChakraComponent): **props: The properties of the component. Returns: - The breadcrumb component.""" - ... + The breadcrumb component. + """ class BreadcrumbItem(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, label=None, @@ -139,13 +138,12 @@ class BreadcrumbItem(ChakraComponent): **props: The properties of the component. Returns: - The BreadcrumbItem component""" - ... + The BreadcrumbItem component + """ class BreadcrumbSeparator(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -177,13 +175,26 @@ class BreadcrumbSeparator(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> BreadcrumbSeparator: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class BreadcrumbLink(Link): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_current_page: Var[bool] | bool | None = None, @@ -244,5 +255,5 @@ class BreadcrumbLink(Link): ValueError: in case of missing children Returns: - Component: The link component""" - ... + Component: The link component + """ diff --git a/reflex_chakra/components/navigation/link.py b/reflex_chakra/components/navigation/link.py index 6d7dbee..b8ac2c4 100644 --- a/reflex_chakra/components/navigation/link.py +++ b/reflex_chakra/components/navigation/link.py @@ -1,11 +1,12 @@ """A link component.""" from reflex import ImportVar -from reflex_chakra.components import ChakraComponent from reflex.components.component import Component from reflex.utils.imports import ImportDict from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Link(ChakraComponent): """Link to another page.""" @@ -52,8 +53,9 @@ def create(cls, *children, **props): Component: The link component """ if props.get("href") is not None: - if not len(children): - raise ValueError("Link without a child will not display") + if not children: + msg = "Link without a child will not display" + raise ValueError(msg) else: # Don't use a NextLink if there is no href. props["as_"] = "" diff --git a/reflex_chakra/components/navigation/link.pyi b/reflex_chakra/components/navigation/link.pyi index c2194f9..641aa16 100644 --- a/reflex_chakra/components/navigation/link.pyi +++ b/reflex_chakra/components/navigation/link.pyi @@ -3,26 +3,26 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) +from reflex.utils.imports import ImportDict from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent -from reflex.components.component import Component -from reflex.utils.imports import ImportDict class Link(ChakraComponent): def add_imports(self) -> ImportDict: ... - @overload @classmethod - def create( # type: ignore + def create( cls, *children, rel: Var[str] | str | None = None, @@ -81,5 +81,5 @@ class Link(ChakraComponent): ValueError: in case of missing children Returns: - Component: The link component""" - ... + Component: The link component + """ diff --git a/reflex_chakra/components/navigation/linkoverlay.py b/reflex_chakra/components/navigation/linkoverlay.py index b31c953..acad961 100644 --- a/reflex_chakra/components/navigation/linkoverlay.py +++ b/reflex_chakra/components/navigation/linkoverlay.py @@ -1,8 +1,9 @@ """Link overlay components.""" -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class LinkOverlay(ChakraComponent): """Wraps child component in a link.""" diff --git a/reflex_chakra/components/navigation/linkoverlay.pyi b/reflex_chakra/components/navigation/linkoverlay.pyi index 68b2669..5759c59 100644 --- a/reflex_chakra/components/navigation/linkoverlay.pyi +++ b/reflex_chakra/components/navigation/linkoverlay.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class LinkOverlay(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, is_external: Var[bool] | bool | None = None, @@ -53,13 +53,28 @@ class LinkOverlay(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> LinkOverlay: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class LinkBox(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -91,5 +106,19 @@ class LinkBox(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> LinkBox: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/navigation/stepper.py b/reflex_chakra/components/navigation/stepper.py index e37c32d..91ef299 100644 --- a/reflex_chakra/components/navigation/stepper.py +++ b/reflex_chakra/components/navigation/stepper.py @@ -2,10 +2,11 @@ from typing import Literal -from reflex_chakra.components import ChakraComponent, LiteralColorScheme from reflex.components.component import Component from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralColorScheme + class Stepper(ChakraComponent): """The parent container for a stepper.""" @@ -16,7 +17,7 @@ class Stepper(ChakraComponent): orientation: Var[Literal["vertical", "horizontal"]] # The color scheme to use for the stepper; default is blue. - colorScheme: Var[LiteralColorScheme] + colorScheme: Var[LiteralColorScheme] # noqa: N815 # Chakra provides a useSteps hook to control the stepper. # Instead, use an integer state value to set progress in the stepper. diff --git a/reflex_chakra/components/navigation/stepper.pyi b/reflex_chakra/components/navigation/stepper.pyi index 7cc48de..6ebf85d 100644 --- a/reflex_chakra/components/navigation/stepper.pyi +++ b/reflex_chakra/components/navigation/stepper.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Stepper(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items: list[tuple] | None = None, @@ -124,13 +124,12 @@ class Stepper(ChakraComponent): **props: The properties of the component. Returns: - The stepper component.""" - ... + The stepper component. + """ class Step(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -162,13 +161,26 @@ class Step(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Step: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StepDescription(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -200,13 +212,26 @@ class StepDescription(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StepDescription: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StepIcon(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -238,13 +263,26 @@ class StepIcon(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StepIcon: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StepIndicator(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -276,13 +314,26 @@ class StepIndicator(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StepIndicator: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StepNumber(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -314,13 +365,26 @@ class StepNumber(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StepNumber: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StepSeparator(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -352,13 +416,26 @@ class StepSeparator(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StepSeparator: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StepStatus(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, active: Var[str] | str | None = None, @@ -393,13 +470,29 @@ class StepStatus(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StepStatus: - """""" - ... + """Create a new Chakra component. + + Args: + *children: The children of the component. + active: The CSS class name to apply when a step is the currently active step. + complete: The CSS class name to apply when a step is completed. + incomplete: The CSS class name to apply when a step is incomplete. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class StepTitle(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -431,5 +524,19 @@ class StepTitle(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> StepTitle: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/overlay/__init__.py b/reflex_chakra/components/overlay/__init__.py index c5137fc..f708bc1 100644 --- a/reflex_chakra/components/overlay/__init__.py +++ b/reflex_chakra/components/overlay/__init__.py @@ -49,7 +49,6 @@ ) from .tooltip import Tooltip - __all__ = [ "AlertDialog", "AlertDialogBody", diff --git a/reflex_chakra/components/overlay/alertdialog.py b/reflex_chakra/components/overlay/alertdialog.py index 11f716a..76e5fe4 100644 --- a/reflex_chakra/components/overlay/alertdialog.py +++ b/reflex_chakra/components/overlay/alertdialog.py @@ -2,12 +2,13 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent, LiteralAlertDialogSize -from reflex_chakra.components.media.icon import Icon from reflex.components.component import Component -from reflex.event import EventHandler +from reflex.event import EventHandler, no_args_event_spec from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralAlertDialogSize +from reflex_chakra.components.media.icon import Icon + class AlertDialog(ChakraComponent): """Provides context and state for the dialog.""" @@ -54,16 +55,16 @@ class AlertDialog(ChakraComponent): use_inert: Var[bool] # Fired when the modal is closing. - on_close: EventHandler[lambda: []] + on_close: EventHandler[no_args_event_spec] # Fired when the modal is closed and the exit animation is complete. - on_close_complete: EventHandler[lambda: []] + on_close_complete: EventHandler[no_args_event_spec] # Fired when the Esc key is pressed. - on_esc: EventHandler[lambda: []] + on_esc: EventHandler[no_args_event_spec] # Fired when the overlay is clicked. - on_overlay_click: EventHandler[lambda: []] + on_overlay_click: EventHandler[no_args_event_spec] @classmethod def create( @@ -104,9 +105,8 @@ def create( 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" - ) + msg = "Close button can not be used if on_close event handler is not defined" + raise AttributeError(msg) children = [ AlertDialogOverlay.create( diff --git a/reflex_chakra/components/overlay/alertdialog.pyi b/reflex_chakra/components/overlay/alertdialog.pyi index a485b94..52617fc 100644 --- a/reflex_chakra/components/overlay/alertdialog.pyi +++ b/reflex_chakra/components/overlay/alertdialog.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class AlertDialog(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, header=None, @@ -57,11 +57,11 @@ class AlertDialog(ChakraComponent): custom_attrs: dict[str, Var | Any] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_close: EventType[Any] | None = None, - on_close_complete: EventType[Any] | None = None, + on_close: EventType[()] | None = None, + on_close_complete: EventType[()] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_esc: EventType[Any] | None = None, + on_esc: EventType[()] | None = None, on_focus: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, @@ -71,7 +71,7 @@ class AlertDialog(ChakraComponent): on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, - on_overlay_click: EventType[Any] | None = None, + on_overlay_click: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, @@ -115,13 +115,12 @@ class AlertDialog(ChakraComponent): AttributeError: if there is a conflict between the props used. Returns: - The alert dialog component.""" - ... + The alert dialog component. + """ class AlertDialogBody(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -153,13 +152,26 @@ class AlertDialogBody(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertDialogBody: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AlertDialogHeader(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -191,13 +203,26 @@ class AlertDialogHeader(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertDialogHeader: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AlertDialogFooter(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -229,13 +254,26 @@ class AlertDialogFooter(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertDialogFooter: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AlertDialogContent(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -267,13 +305,26 @@ class AlertDialogContent(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertDialogContent: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AlertDialogOverlay(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -305,13 +356,26 @@ class AlertDialogOverlay(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertDialogOverlay: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class AlertDialogCloseButton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -343,5 +407,19 @@ class AlertDialogCloseButton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> AlertDialogCloseButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/overlay/drawer.py b/reflex_chakra/components/overlay/drawer.py index b866f02..903f1e9 100644 --- a/reflex_chakra/components/overlay/drawer.py +++ b/reflex_chakra/components/overlay/drawer.py @@ -2,15 +2,16 @@ from __future__ import annotations +from reflex.components.component import Component +from reflex.event import EventHandler, no_args_event_spec +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralColorScheme, LiteralDrawerSize, ) from reflex_chakra.components.media.icon import Icon -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars.base import Var class Drawer(ChakraComponent): @@ -70,16 +71,16 @@ class Drawer(ChakraComponent): color_scheme: Var[LiteralColorScheme] # Fired when the modal is closing. - on_close: EventHandler[lambda: []] + on_close: EventHandler[no_args_event_spec] # Fired when the modal is closed and the exit animation is complete. - on_close_complete: EventHandler[lambda: []] + on_close_complete: EventHandler[no_args_event_spec] # Fired when the Esc key is pressed. - on_esc: EventHandler[lambda: []] + on_esc: EventHandler[no_args_event_spec] # Fired when the overlay is clicked. - on_overlay_click: EventHandler[lambda: []] + on_overlay_click: EventHandler[no_args_event_spec] @classmethod def create( @@ -119,9 +120,8 @@ def create( 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" - ) + msg = "Close button can not be used if on_close event handler is not defined" + raise AttributeError(msg) children = [ DrawerOverlay.create( diff --git a/reflex_chakra/components/overlay/drawer.pyi b/reflex_chakra/components/overlay/drawer.pyi index 7e31316..080914c 100644 --- a/reflex_chakra/components/overlay/drawer.pyi +++ b/reflex_chakra/components/overlay/drawer.pyi @@ -3,26 +3,26 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) class Drawer(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, header=None, @@ -104,11 +104,11 @@ class Drawer(ChakraComponent): custom_attrs: dict[str, Var | Any] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_close: EventType[Any] | None = None, - on_close_complete: EventType[Any] | None = None, + on_close: EventType[()] | None = None, + on_close_complete: EventType[()] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_esc: EventType[Any] | None = None, + on_esc: EventType[()] | None = None, on_focus: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, @@ -118,7 +118,7 @@ class Drawer(ChakraComponent): on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, - on_overlay_click: EventType[Any] | None = None, + on_overlay_click: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, @@ -165,13 +165,12 @@ class Drawer(ChakraComponent): AttributeError: error that occurs if conflicting props are passed Returns: - The drawer component.""" - ... + The drawer component. + """ class DrawerBody(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -203,13 +202,26 @@ class DrawerBody(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> DrawerBody: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class DrawerHeader(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -241,13 +253,26 @@ class DrawerHeader(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> DrawerHeader: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class DrawerFooter(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -279,13 +304,26 @@ class DrawerFooter(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> DrawerFooter: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class DrawerOverlay(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -317,13 +355,26 @@ class DrawerOverlay(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> DrawerOverlay: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class DrawerContent(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -355,13 +406,26 @@ class DrawerContent(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> DrawerContent: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class DrawerCloseButton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -393,5 +457,19 @@ class DrawerCloseButton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> DrawerCloseButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/overlay/menu.py b/reflex_chakra/components/overlay/menu.py index 7063780..791f88b 100644 --- a/reflex_chakra/components/overlay/menu.py +++ b/reflex_chakra/components/overlay/menu.py @@ -4,6 +4,10 @@ from typing import ClassVar +from reflex.components.component import Component +from reflex.event import EventHandler, no_args_event_spec +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralChakraDirection, @@ -11,9 +15,6 @@ LiteralMenuStrategy, ) from reflex_chakra.components.forms.button import Button -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars.base import Var class Menu(ChakraComponent): @@ -70,10 +71,10 @@ class Menu(ChakraComponent): strategy: Var[LiteralMenuStrategy] # Fired when the menu is closed. - on_close: EventHandler[lambda: []] + on_close: EventHandler[no_args_event_spec] # Fired when the menu is opened. - on_open: EventHandler[lambda: []] + on_open: EventHandler[no_args_event_spec] @classmethod def create( diff --git a/reflex_chakra/components/overlay/menu.pyi b/reflex_chakra/components/overlay/menu.pyi index 32a6b62..43c6dac 100644 --- a/reflex_chakra/components/overlay/menu.pyi +++ b/reflex_chakra/components/overlay/menu.pyi @@ -3,27 +3,27 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) -from reflex.components.component import Component class Menu(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, button: Component | None = None, @@ -59,7 +59,7 @@ class Menu(ChakraComponent): custom_attrs: dict[str, Var | Any] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_close: EventType[Any] | None = None, + on_close: EventType[()] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_focus: EventType[()] | None = None, @@ -71,7 +71,7 @@ class Menu(ChakraComponent): on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, - on_open: EventType[Any] | None = None, + on_open: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, @@ -111,13 +111,12 @@ class Menu(ChakraComponent): **props: The properties of the component. Returns: - The menu component.""" - ... + The menu component. + """ class MenuButton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, variant: Var[str] | str | None = None, @@ -151,13 +150,28 @@ class MenuButton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> MenuButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class MenuList(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, items: list | None = None, @@ -205,13 +219,12 @@ class MenuList(ChakraComponent): **props: The properties of the component. Returns: - The MenuList component.""" - ... + The MenuList component. + """ class MenuItem(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, close_on_select: Var[bool] | bool | None = None, @@ -248,13 +261,31 @@ class MenuItem(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> MenuItem: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class MenuItemOption(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, close_on_select: Var[bool] | bool | None = None, @@ -296,13 +327,34 @@ class MenuItemOption(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> MenuItemOption: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class MenuGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -334,13 +386,26 @@ class MenuGroup(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> MenuGroup: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class MenuOptionGroup(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, type_: Literal["checkbox", "radio"] @@ -376,13 +441,28 @@ class MenuOptionGroup(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> MenuOptionGroup: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class MenuDivider(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -414,5 +494,19 @@ class MenuDivider(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> MenuDivider: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/overlay/modal.py b/reflex_chakra/components/overlay/modal.py index 4450f2c..26694a6 100644 --- a/reflex_chakra/components/overlay/modal.py +++ b/reflex_chakra/components/overlay/modal.py @@ -4,12 +4,13 @@ from typing import Literal -from reflex_chakra.components import ChakraComponent -from reflex_chakra.components.media import Icon from reflex.components.component import Component -from reflex.event import EventHandler +from reflex.event import EventHandler, no_args_event_spec from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent +from reflex_chakra.components.media import Icon + ModalSizes = Literal["xs", "sm", "md", "lg", "xl", "full"] @@ -58,16 +59,16 @@ class Modal(ChakraComponent): use_inert: Var[bool] # Fired when the modal is closing. - on_close: EventHandler[lambda: []] + on_close: EventHandler[no_args_event_spec] # Fired when the modal is closed and the exit animation is complete. - on_close_complete: EventHandler[lambda: []] + on_close_complete: EventHandler[no_args_event_spec] # Fired when the Esc key is pressed. - on_esc: EventHandler[lambda: []] + on_esc: EventHandler[no_args_event_spec] # Fired when the overlay is clicked. - on_overlay_click: EventHandler[lambda: []] + on_overlay_click: EventHandler[no_args_event_spec] @classmethod def create( @@ -117,9 +118,8 @@ def create( 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" - ) + msg = "Close button can not be used if on_close event handler is not defined" + raise AttributeError(msg) children = [ ModalOverlay.create( diff --git a/reflex_chakra/components/overlay/modal.pyi b/reflex_chakra/components/overlay/modal.pyi index 88970cf..f7b6676 100644 --- a/reflex_chakra/components/overlay/modal.pyi +++ b/reflex_chakra/components/overlay/modal.pyi @@ -3,27 +3,28 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, + TypeAlias, ) -from collections.abc import Mapping, Sequence + +from reflex.components.component import Component from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent -from reflex.components.component import Component -ModalSizes = Literal["xs", "sm", "md", "lg", "xl", "full"] +ModalSizes: TypeAlias = Literal["xs", "sm", "md", "lg", "xl", "full"] class Modal(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, header: Component | str | None = None, @@ -58,11 +59,11 @@ class Modal(ChakraComponent): custom_attrs: dict[str, Var | Any] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_close: EventType[Any] | None = None, - on_close_complete: EventType[Any] | None = None, + on_close: EventType[()] | None = None, + on_close_complete: EventType[()] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_esc: EventType[Any] | None = None, + on_esc: EventType[()] | None = None, on_focus: EventType[()] | None = None, on_mount: EventType[()] | None = None, on_mouse_down: EventType[()] | None = None, @@ -72,7 +73,7 @@ class Modal(ChakraComponent): on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, - on_overlay_click: EventType[Any] | None = None, + on_overlay_click: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, @@ -116,13 +117,12 @@ class Modal(ChakraComponent): AttributeError: error that occurs if conflicting props are passed Returns: - The modal component.""" - ... + The modal component. + """ class ModalOverlay(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -154,13 +154,26 @@ class ModalOverlay(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ModalOverlay: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ModalHeader(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -192,13 +205,26 @@ class ModalHeader(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ModalHeader: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ModalFooter(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -230,13 +256,26 @@ class ModalFooter(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ModalFooter: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ModalContent(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -268,13 +307,26 @@ class ModalContent(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ModalContent: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ModalBody(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -306,13 +358,26 @@ class ModalBody(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ModalBody: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class ModalCloseButton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -344,5 +409,19 @@ class ModalCloseButton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> ModalCloseButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/overlay/popover.py b/reflex_chakra/components/overlay/popover.py index acb737f..2c823b2 100644 --- a/reflex_chakra/components/overlay/popover.py +++ b/reflex_chakra/components/overlay/popover.py @@ -2,15 +2,16 @@ from __future__ import annotations +from reflex.components.component import Component +from reflex.event import EventHandler, no_args_event_spec +from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, LiteralChakraDirection, LiteralMenuStrategy, LiteralPopOverTrigger, ) -from reflex.components.component import Component -from reflex.event import EventHandler -from reflex.vars.base import Var class Popover(ChakraComponent): @@ -82,10 +83,10 @@ class Popover(ChakraComponent): trigger: Var[LiteralPopOverTrigger] # Fired when the popover is closed. - on_close: EventHandler[lambda: []] + on_close: EventHandler[no_args_event_spec] # Fired when the popover is opened. - on_open: EventHandler[lambda: []] + on_open: EventHandler[no_args_event_spec] @classmethod def create( diff --git a/reflex_chakra/components/overlay/popover.pyi b/reflex_chakra/components/overlay/popover.pyi index 7919bef..befa3f9 100644 --- a/reflex_chakra/components/overlay/popover.pyi +++ b/reflex_chakra/components/overlay/popover.pyi @@ -3,26 +3,26 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ( ChakraComponent, ) class Popover(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, trigger=None, @@ -65,7 +65,7 @@ class Popover(ChakraComponent): custom_attrs: dict[str, Var | Any] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_close: EventType[Any] | None = None, + on_close: EventType[()] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_focus: EventType[()] | None = None, @@ -77,7 +77,7 @@ class Popover(ChakraComponent): on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, - on_open: EventType[Any] | None = None, + on_open: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, @@ -124,13 +124,12 @@ class Popover(ChakraComponent): **props: The properties of the component. Returns: - The popover component.""" - ... + The popover component. + """ class PopoverContent(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -162,13 +161,26 @@ class PopoverContent(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverContent: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class PopoverHeader(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -200,13 +212,26 @@ class PopoverHeader(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverHeader: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class PopoverFooter(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -238,13 +263,26 @@ class PopoverFooter(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverFooter: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class PopoverBody(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -276,13 +314,26 @@ class PopoverBody(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverBody: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class PopoverArrow(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -314,13 +365,26 @@ class PopoverArrow(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverArrow: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class PopoverCloseButton(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -352,13 +416,26 @@ class PopoverCloseButton(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverCloseButton: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class PopoverAnchor(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -390,13 +467,26 @@ class PopoverAnchor(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverAnchor: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ class PopoverTrigger(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, style: Sequence[Mapping[str, Any]] @@ -428,5 +518,19 @@ class PopoverTrigger(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> PopoverTrigger: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/overlay/tooltip.py b/reflex_chakra/components/overlay/tooltip.py index 6aa4ba6..d2344ae 100644 --- a/reflex_chakra/components/overlay/tooltip.py +++ b/reflex_chakra/components/overlay/tooltip.py @@ -2,10 +2,11 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent, LiteralChakraDirection -from reflex.event import EventHandler +from reflex.event import EventHandler, no_args_event_spec from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralChakraDirection + class Tooltip(ChakraComponent): """A tooltip message to appear.""" @@ -64,7 +65,7 @@ class Tooltip(ChakraComponent): should_wrap_children: Var[bool] # Fired when the tooltip is closing. - on_close: EventHandler[lambda: []] + on_close: EventHandler[list] # Fired when the tooltip is opened. - on_open: EventHandler[lambda: []] + on_open: EventHandler[no_args_event_spec] diff --git a/reflex_chakra/components/overlay/tooltip.pyi b/reflex_chakra/components/overlay/tooltip.pyi index cd50abf..e8e5948 100644 --- a/reflex_chakra/components/overlay/tooltip.pyi +++ b/reflex_chakra/components/overlay/tooltip.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Tooltip(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, arrow_padding: Var[int] | int | None = None, @@ -65,11 +65,44 @@ class Tooltip(ChakraComponent): on_mouse_out: EventType[()] | None = None, on_mouse_over: EventType[()] | None = None, on_mouse_up: EventType[()] | None = None, - on_open: EventType[Any] | None = None, + on_open: EventType[()] | None = None, on_scroll: EventType[()] | None = None, on_scroll_end: EventType[()] | None = None, on_unmount: EventType[()] | None = None, **props, ) -> Tooltip: - """""" - ... + """Create a new Chakra 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` + on_close: Fired when the tooltip is closing. + on_open: Fired when the tooltip is opened. + style: The style of the component. + key: A unique key for the component. + id: The id for the component. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/typography/heading.py b/reflex_chakra/components/typography/heading.py index 01da7b5..688e5ee 100644 --- a/reflex_chakra/components/typography/heading.py +++ b/reflex_chakra/components/typography/heading.py @@ -1,8 +1,9 @@ """A heading component.""" -from reflex_chakra.components import ChakraComponent, LiteralHeadingSize from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent, LiteralHeadingSize + class Heading(ChakraComponent): """A page heading.""" diff --git a/reflex_chakra/components/typography/heading.pyi b/reflex_chakra/components/typography/heading.pyi index b1934ae..c97fa6d 100644 --- a/reflex_chakra/components/typography/heading.pyi +++ b/reflex_chakra/components/typography/heading.pyi @@ -3,24 +3,24 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, Literal, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Heading(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, as_: Var[str] | str | None = None, @@ -56,5 +56,21 @@ class Heading(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Heading: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/typography/highlight.py b/reflex_chakra/components/typography/highlight.py index cdd39d1..a01adc2 100644 --- a/reflex_chakra/components/typography/highlight.py +++ b/reflex_chakra/components/typography/highlight.py @@ -1,9 +1,10 @@ """A highlight component.""" -from reflex_chakra.components import ChakraComponent from reflex.components.tags.tag import Tag from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Highlight(ChakraComponent): """Highlights a specific part of a string.""" diff --git a/reflex_chakra/components/typography/highlight.pyi b/reflex_chakra/components/typography/highlight.pyi index 992fcc9..f8dee7f 100644 --- a/reflex_chakra/components/typography/highlight.pyi +++ b/reflex_chakra/components/typography/highlight.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Highlight(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, query: Var[list[str]] | list[str] | None = None, @@ -53,5 +53,21 @@ class Highlight(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Highlight: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/typography/span.py b/reflex_chakra/components/typography/span.py index 839a4c2..21b299e 100644 --- a/reflex_chakra/components/typography/span.py +++ b/reflex_chakra/components/typography/span.py @@ -2,9 +2,10 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Span(ChakraComponent): """Render an inline span of text.""" @@ -12,4 +13,4 @@ class Span(ChakraComponent): tag = "Text" # Override the tag. The default tag is ``. - as_: Var[str] = "span" # type: ignore + as_: Var[str] = Var.create("span") diff --git a/reflex_chakra/components/typography/span.pyi b/reflex_chakra/components/typography/span.pyi index db996a0..8c8325d 100644 --- a/reflex_chakra/components/typography/span.pyi +++ b/reflex_chakra/components/typography/span.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Span(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, as_: Var[str] | str | None = None, @@ -52,5 +52,20 @@ class Span(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Span: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/components/typography/text.py b/reflex_chakra/components/typography/text.py index 0f3b05a..069db59 100644 --- a/reflex_chakra/components/typography/text.py +++ b/reflex_chakra/components/typography/text.py @@ -2,9 +2,10 @@ from __future__ import annotations -from reflex_chakra.components import ChakraComponent from reflex.vars.base import Var +from reflex_chakra.components import ChakraComponent + class Text(ChakraComponent): """Render a paragraph of text.""" diff --git a/reflex_chakra/components/typography/text.pyi b/reflex_chakra/components/typography/text.pyi index f93b732..881a610 100644 --- a/reflex_chakra/components/typography/text.pyi +++ b/reflex_chakra/components/typography/text.pyi @@ -3,23 +3,23 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ +from collections.abc import Mapping, Sequence from typing import ( Any, - overload, ) -from collections.abc import Mapping, Sequence + from reflex.components.core.breakpoints import Breakpoints from reflex.event import ( EventType, PointerEventInfo, ) from reflex.vars.base import Var + from reflex_chakra.components import ChakraComponent class Text(ChakraComponent): - @overload @classmethod - def create( # type: ignore + def create( cls, *children, as_: Var[str] | str | None = None, @@ -53,5 +53,21 @@ class Text(ChakraComponent): on_unmount: EventType[()] | None = None, **props, ) -> Text: - """""" - ... + """Create a new Chakra 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. + ref: The Var to pass as the ref to 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: + A new Chakra component. + """ diff --git a/reflex_chakra/constants.py b/reflex_chakra/constants.py index a63de53..e442ce9 100644 --- a/reflex_chakra/constants.py +++ b/reflex_chakra/constants.py @@ -1,3 +1,5 @@ +"""Constants for the Reflex Chakra package.""" + from pathlib import Path ASSETS_DIR_NAME = "assets" diff --git a/regenerate_pyi.py b/regenerate_pyi.py index 5247fff..f07de06 100644 --- a/regenerate_pyi.py +++ b/regenerate_pyi.py @@ -1,3 +1,5 @@ +"""Generate .pyi files for type hinting in Reflex Chakra components.""" + from reflex.utils.pyi_generator import PyiGenerator PyiGenerator().scan_all(["reflex_chakra"]) From b44efe2f2d7a13dc0fb3ebb46b1a741a09286a87 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Sun, 22 Jun 2025 15:35:24 -0700 Subject: [PATCH 13/15] make the headings work --- docs/rcweb/rcweb/utils/blocks/headings.py | 6 +++--- docs/rcweb/rcweb/utils/sidebar.py | 16 ++++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/rcweb/rcweb/utils/blocks/headings.py b/docs/rcweb/rcweb/utils/blocks/headings.py index ad60a1d..0fb99cd 100644 --- a/docs/rcweb/rcweb/utils/blocks/headings.py +++ b/docs/rcweb/rcweb/utils/blocks/headings.py @@ -13,7 +13,7 @@ def h_comp_common( - text: rx.Var[str], + text: rx.Var[str] | rx.Var[list[str]], heading: str, font_size: list[str] | str = "", font_weight: str = "", @@ -25,9 +25,9 @@ def h_comp_common( ) -> rx.Component: style = style or {} if convert_to_str: - id_ = text.to(list[str])[0].lower().split().join("-") + id_ = text.to(list)[0].to(str).lower().split(" ").join("-") else: - id_ = text.lower().split().join("-") + id_ = text.to(str).lower().split(" ").join("-") href = rx.State.router.page.full_path + "#" + id_ return rx.box( diff --git a/docs/rcweb/rcweb/utils/sidebar.py b/docs/rcweb/rcweb/utils/sidebar.py index a0fbc8c..b77989c 100644 --- a/docs/rcweb/rcweb/utils/sidebar.py +++ b/docs/rcweb/rcweb/utils/sidebar.py @@ -33,12 +33,16 @@ class SidebarItem: def get_component_link(category: str | None, category_title: str): component_name = to_kebab_case(category_title) # construct the component link. The component name points to the name of the md file. - return "/".join( - [ - category.lower().replace(" ", "-") if category else "", - component_name.lower(), - ] - ).replace("//", "/") + return "/" + ( + "/".join( + [ + category.lower().replace(" ", "-") if category else "", + component_name.lower(), + ] + ) + .replace("//", "/") + .removeprefix("/") + ) def get_category_children( From 3db4b33d7ff7ee3775d25ef6e66cd7e462d00dce Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 25 Jun 2025 14:34:55 -0700 Subject: [PATCH 14/15] huh --- reflex_chakra/components/overlay/tooltip.py | 2 +- reflex_chakra/components/overlay/tooltip.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex_chakra/components/overlay/tooltip.py b/reflex_chakra/components/overlay/tooltip.py index d2344ae..6130a5c 100644 --- a/reflex_chakra/components/overlay/tooltip.py +++ b/reflex_chakra/components/overlay/tooltip.py @@ -65,7 +65,7 @@ class Tooltip(ChakraComponent): should_wrap_children: Var[bool] # Fired when the tooltip is closing. - on_close: EventHandler[list] + on_close: EventHandler[no_args_event_spec] # Fired when the tooltip is opened. on_open: EventHandler[no_args_event_spec] diff --git a/reflex_chakra/components/overlay/tooltip.pyi b/reflex_chakra/components/overlay/tooltip.pyi index e8e5948..6696e82 100644 --- a/reflex_chakra/components/overlay/tooltip.pyi +++ b/reflex_chakra/components/overlay/tooltip.pyi @@ -53,7 +53,7 @@ class Tooltip(ChakraComponent): custom_attrs: dict[str, Var | Any] | None = None, on_blur: EventType[()] | None = None, on_click: EventType[()] | EventType[PointerEventInfo] | None = None, - on_close: EventType[Any] | None = None, + on_close: EventType[()] | None = None, on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None, on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None, on_focus: EventType[()] | None = None, From d9bd83f6910a7dd862815924f3fd4f19386fbc6f Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 25 Jun 2025 14:38:36 -0700 Subject: [PATCH 15/15] enable pyi in ci --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- uv.lock | 18 +++++++++--------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edea3a1..5c417e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,22 +41,22 @@ jobs: run: ruff check --output-format=github reflex_chakra - name: Run Ruff Formatter run: ruff format --check --diff reflex_chakra - # check-pyi: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install UV - # uses: astral-sh/setup-uv@v6 - # with: - # python-version: "3.13" - # enable-cache: true - # activate-environment: true - # - name: Install dependencies - # run: uv sync - # - name: Run PYI generation - # run: python regenerate_pyi.py - # - name: Check if there are any changes - # run: git diff --exit-code -- "*.pyi" || (echo "PYI files have changed. Please commit the changes." && exit 1) + check-pyi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install UV + uses: astral-sh/setup-uv@v6 + with: + python-version: "3.13" + enable-cache: true + activate-environment: true + - name: Install dependencies + run: uv sync + - name: Run PYI generation + run: python regenerate_pyi.py + - name: Check if there are any changes + run: git diff --exit-code -- "*.pyi" || (echo "PYI files have changed. Please commit the changes." && exit 1) check-export: runs-on: ubuntu-latest steps: diff --git a/uv.lock b/uv.lock index 9c2490c..15a6b71 100644 --- a/uv.lock +++ b/uv.lock @@ -103,16 +103,16 @@ wheels = [ [[package]] name = "fastapi" -version = "0.115.12" +version = "0.115.13" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pydantic" }, { name = "starlette" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f4/55/ae499352d82338331ca1e28c7f4a63bfd09479b16395dce38cf50a39e2c2/fastapi-0.115.12.tar.gz", hash = "sha256:1e2c2a2646905f9e83d32f04a3f86aff4a286669c6c950ca95b5fd68c2602681", size = 295236, upload-time = "2025-03-23T22:55:43.822Z" } +sdist = { url = "https://files.pythonhosted.org/packages/20/64/ec0788201b5554e2a87c49af26b77a4d132f807a0fa9675257ac92c6aa0e/fastapi-0.115.13.tar.gz", hash = "sha256:55d1d25c2e1e0a0a50aceb1c8705cd932def273c102bff0b1c1da88b3c6eb307", size = 295680, upload-time = "2025-06-17T11:49:45.575Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/50/b3/b51f09c2ba432a576fe63758bddc81f78f0c6309d9e5c10d194313bf021e/fastapi-0.115.12-py3-none-any.whl", hash = "sha256:e94613d6c05e27be7ffebdd6ea5f388112e5e430c8f7d6494a9d1d88d43e814d", size = 95164, upload-time = "2025-03-23T22:55:42.101Z" }, + { url = "https://files.pythonhosted.org/packages/59/4a/e17764385382062b0edbb35a26b7cf76d71e27e456546277a42ba6545c6e/fastapi-0.115.13-py3-none-any.whl", hash = "sha256:0a0cab59afa7bab22f5eb347f8c9864b681558c278395e94035a741fc10cd865", size = 95315, upload-time = "2025-06-17T11:49:44.106Z" }, ] [[package]] @@ -541,11 +541,11 @@ wheels = [ [[package]] name = "pygments" -version = "2.19.1" +version = "2.19.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581, upload-time = "2025-01-06T17:26:30.443Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" }, + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, ] [[package]] @@ -653,7 +653,7 @@ wheels = [ [[package]] name = "reflex" -version = "0.8.0a1" +version = "0.8.0a5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "alembic" }, @@ -675,9 +675,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a5/17/54b428a81216f066d7f80593b75988f669a787f4eccc2d671edcc744e771/reflex-0.8.0a1.tar.gz", hash = "sha256:01916bc8dd3ef8ebf3c736e81744da7ecde23149c4de2bd81bb2014a858de927", size = 576937, upload-time = "2025-06-16T05:12:57.091Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4a/b6/89d4fa4bd314c4323150eefe1ef22d0573738a78229fc37ab6509a5e93ad/reflex-0.8.0a5.tar.gz", hash = "sha256:fd5549bf5cddc6bbc929753e9d7f784977882080ec236435c370bcfce26d7c26", size = 581218, upload-time = "2025-06-25T16:51:55.411Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/38/e1/94abaa957935c0a4a624e2592fa746aafca64f49344fb755626e1eb4f252/reflex-0.8.0a1-py3-none-any.whl", hash = "sha256:02da84fd4951dad8cc0ae40db5806d396c6d4a400c09dc7c63ff6b173decc1cd", size = 870655, upload-time = "2025-06-16T05:12:54.235Z" }, + { url = "https://files.pythonhosted.org/packages/e3/01/bbf818c5af0535b0c5202bff9a870be26437815867d3bc2d10aa18226e6d/reflex-0.8.0a5-py3-none-any.whl", hash = "sha256:4835d7e6677deab1bf9ab5e333991085add0c19e7e4456f446a3ee3113386a2d", size = 875402, upload-time = "2025-06-25T16:51:53.507Z" }, ] [[package]]