diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..5c417e7
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,80 @@
+name: ci
+env:
+ OPENAI_API_KEY: "dummy"
+on:
+ push:
+ branches: [main]
+ pull_request:
+ 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:
+ extra-args: reflex_chakra
+ version: PATH
+ 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-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:
+ - 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 Reflex
+ working-directory: ./docs/rcweb
+ run: uv pip install $(grep -ivE "reflex-chakra" requirements.txt)
+
+ - name: Initialize Reflex
+ working-directory: ./docs/rcweb
+ run: uv run reflex init
+
+ - name: Build frontend
+ working-directory: ./docs/rcweb
+ run: uv run reflex export
diff --git a/.github/workflows/export_docs.yml b/.github/workflows/export_docs.yml
deleted file mode 100644
index 24b0c17..0000000
--- a/.github/workflows/export_docs.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: ci
-env:
- OPENAI_API_KEY: "dummy"
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- check-export:
- 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 Reflex
- working-directory: ./docs/rcweb
- run: uv pip install $(grep -ivE "reflex-chakra" requirements.txt)
-
- - name: Initialize Reflex
- working-directory: ./docs/rcweb
- run: uv run reflex init
-
- - name: Build frontend
- working-directory: ./docs/rcweb
- run: uv run reflex export
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
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/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 32cc27e..ec848c3 100644
--- a/docs/rcweb/rcweb/rcweb.py
+++ b/docs/rcweb/rcweb/rcweb.py
@@ -1,33 +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 reflex as rx
-import reflex_chakra as rc
import flexdown
+import reflex as rx
+from reflex.utils.format import to_kebab_case, to_snake_case
-from .utils.flexdown import xd
-from .utils.docpage import 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
+import reflex_chakra as rc # noqa: F401
- # 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
+from .constants import css
+from .utils.docpage import Route, multi_docs
+from .utils.flexdown import xd
def find_flexdown_files(directory: str) -> list[str]:
@@ -40,14 +26,16 @@ 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")
]
-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,14 +44,14 @@ 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):
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
@@ -99,8 +87,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 +102,14 @@ def create_doc_component(
A component object representing the document page.
"""
doc_path = doc_path.replace("\\", "/")
- route_path = rx.utils.format.to_kebab_case(
+ 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 = 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(doc_path_path.name.replace(".md", ""))
+ component_list = (title, extract_components_from_metadata(document))
component_registry[category].append(component_list)
return multi_docs(
path=route_path,
@@ -129,7 +120,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 +137,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/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..0fb99cd 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",
@@ -12,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 = "",
@@ -20,12 +21,13 @@ 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("-")
+ 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(
@@ -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 fde63a4..d862e55 100644
--- a/docs/rcweb/rcweb/utils/docpage.py
+++ b/docs/rcweb/rcweb/utils/docpage.py
@@ -1,39 +1,42 @@
"""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 os
import re
+import textwrap
+from collections.abc import Callable, Sequence
from types import UnionType
from typing import (
Any,
- Sequence,
- Type,
Literal,
Union,
get_args,
get_origin,
)
+
+import flexdown
+import flexdown.blocks
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 mistletoe.block_token
+import mistletoe.token
import reflex as rx
-import flexdown
-import textwrap
-from reflex.base import Base
-from reflex.components.component import Component
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 = []
# Mapping from types to colors.
-TYPE_COLORS = {
+TYPE_COLORS: dict[str, ColorType] = {
"int": "red",
"float": "orange",
"str": "yellow",
@@ -307,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]
@@ -337,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)
@@ -346,7 +347,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.
@@ -362,7 +364,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.
@@ -403,6 +406,10 @@ def get_path(component_fn: Callable):
"""
module = inspect.getmodule(component_fn)
+ if module is None:
+ msg = f"Could not find module for {component_fn}"
+ raise ValueError(msg)
+
# Create a path based on the module name.
return (
module.__name__.replace(".", "/").replace("_", "-").split("pcweb/pages")[1]
@@ -411,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={},
):
"""A template that most pages on the reflex.dev site should use.
@@ -430,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:
@@ -511,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"
@@ -626,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",
),
@@ -672,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]
+ 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 = [
@@ -698,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.
@@ -752,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()
@@ -777,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",
@@ -840,20 +851,20 @@ 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_)
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
@@ -891,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])
@@ -925,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),
@@ -945,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",
@@ -1034,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 = (
@@ -1214,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.
@@ -1232,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.
@@ -1242,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:
@@ -1268,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/flexdown.py b/docs/rcweb/rcweb/utils/flexdown.py
index eb31d68..4c097b5 100644
--- a/docs/rcweb/rcweb/utils/flexdown.py
+++ b/docs/rcweb/rcweb/utils/flexdown.py
@@ -1,11 +1,14 @@
-import flexdown
-import reflex as rx
-import reflex_chakra as rc
-import black
import textwrap
from typing import Any
-from .blocks import headings, typography, code
-from ..constants import fonts
+
+import black
+import flexdown
+import reflex as rx
+
+import reflex_chakra as rc # noqa: F401
+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 b27c41b..b77989c 100644
--- a/docs/rcweb/rcweb/utils/sidebar.py
+++ b/docs/rcweb/rcweb/utils/sidebar.py
@@ -1,13 +1,18 @@
from __future__ import annotations
+import dataclasses
+
import reflex as rx
+from reflex.utils.format import to_kebab_case, to_snake_case, to_title_case
+
import reflex_chakra as rc
-from ..constants import fonts
+from rcweb.constants import fonts
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,118 +24,66 @@ 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()]).replace("//", "/")
+ return "/" + (
+ "/".join(
+ [
+ category.lower().replace(" ", "-") if category else "",
+ component_name.lower(),
+ ]
+ )
+ .replace("//", "/")
+ .removeprefix("/")
+ )
-def get_category_children(category, category_list, prefix="") -> SidebarItem | list[SidebarItem]:
+def get_category_children(
+ 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) if not category == "Markdowns" else get_component_link(None, c),
+ link=get_component_link(category, component_title)
+ 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" else category_item_children
+ return (
+ SidebarItem(names=category, children=category_item_children)
+ if category != "Markdowns"
+ else category_item_children
+ )
-def get_sidebar_items_other_libraries(chakra_components):
- chakra_children = []
- 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)
+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, 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:
+ 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,
)
@@ -143,8 +96,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("_", "-")
@@ -222,35 +175,17 @@ 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],
- 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),
rx.link(
rx.text(
item.names,
@@ -265,9 +200,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,
),
@@ -292,7 +226,6 @@ def sidebar_item_comp(
),
rc.accordion_item(
rc.accordion_button(
- sidebar_icon(item.names),
rx.text(
item.names,
style=fonts.small,
@@ -345,8 +278,7 @@ def sidebar_item_comp(
)
-def create_sidebar_section(items, index, url):
- nested = False
+def create_sidebar_section(items: list[SidebarItem], url: str):
return rx.list_item(
rc.accordion(
*[
@@ -358,7 +290,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",
@@ -375,9 +307,8 @@ def create_sidebar_section(items, index, url):
@rx.memo
def sidebar_comp(
- url: str,
- other_libs_index: list[int],
- width: str = "100%",
+ url: str,
+ width: str = "100%",
):
ul_style = {
"display": "flex",
@@ -388,7 +319,6 @@ def sidebar_comp(
rx.unordered_list(
create_sidebar_section(
chakra_lib_items,
- other_libs_index,
url,
),
style=ul_style,
@@ -422,6 +352,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)
@@ -458,29 +389,44 @@ 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),
-
)
-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:
- """Render the sidebar."""
+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.
+
+ 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%")),
+ 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..8fbf406 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]
@@ -21,7 +21,40 @@ build-backend = "hatchling.build"
[tool.hatch.build]
include = ["reflex_chakra"]
+[dependency-groups]
+dev = ["ruff", "pyright"]
+
[tool.ruff]
target-version = "py310"
+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 bd16084..80e589a 100644
--- a/reflex_chakra/__init__.py
+++ b/reflex_chakra/__init__.py
@@ -1 +1,3 @@
-from .components import *
\ No newline at end of file
+"""Chakra UI bindings for Reflex."""
+
+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..493ec76 100644
--- a/reflex_chakra/components/base.py
+++ b/reflex_chakra/components/base.py
@@ -3,11 +3,10 @@
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.components.component import Component, field
from reflex.utils.imports import ImportDict, ImportVar
from reflex.vars.base import Var
@@ -17,14 +16,16 @@
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",
- ]
+ library = "@chakra-ui/react@2.6.1"
+ lib_dependencies: list[str] = field(
+ default_factory=lambda: [
+ "@chakra-ui/system@2.5.7",
+ "framer-motion@10.16.4",
+ ],
+ is_javascript_property=False,
+ )
@staticmethod
- @lru_cache(maxsize=None)
def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
return {
(60, "ChakraProvider"): chakra_provider,
@@ -39,23 +40,16 @@ 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.
+ 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:
- The dependencies imports of the component.
+ A new Chakra 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.
client_asset_dir = Path.cwd() / constants.ASSETS_DIR_NAME
if (
@@ -83,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)
@@ -114,12 +107,11 @@ 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),
}
@staticmethod
- @lru_cache(maxsize=None)
def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
return {
(50, "ChakraColorModeProvider"): chakra_color_mode_provider,
@@ -215,7 +207,7 @@ class ChakraColorModeProvider(Component):
"it",
]
LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"]
-LiteralInputNumberMode = [
+LiteralInputNumberMode = Literal[
"text",
"search",
"none",
@@ -230,14 +222,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 baa3bc7..5dfbe0b 100644
--- a/reflex_chakra/components/base.pyi
+++ b/reflex_chakra/components/base.pyi
@@ -1,192 +1,154 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+ TypeAlias,
+)
from reflex.components.component import Component
-from reflex.event import EventHandler, EventSpec
-from reflex.style import Style
+from reflex.components.core.breakpoints import Breakpoints
+from reflex.event import (
+ EventType,
+ PointerEventInfo,
+)
from reflex.utils.imports import ImportDict
-from reflex.vars import Var
+from reflex.vars.base import Var
class ChakraComponent(Component):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class ChakraProvider(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
"""
- ...
def add_imports(self) -> ImportDict: ...
chakra_provider = ChakraProvider.create()
class ChakraColorModeProvider(Component):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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,6 +156,7 @@ 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
@@ -202,10 +165,9 @@ class ChakraColorModeProvider(Component):
Returns:
The component.
"""
- ...
chakra_color_mode_provider = ChakraColorModeProvider.create()
-LiteralColorScheme = Literal[
+LiteralColorScheme: TypeAlias = Literal[
"none",
"gray",
"red",
@@ -226,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",
@@ -260,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[Literal[LiteralTagSize], "xs", "xl"]
-LiteralAvatarSize = Literal[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[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/__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..edce551 100644
--- a/reflex_chakra/components/datadisplay/badge.py
+++ b/reflex_chakra/components/datadisplay/badge.py
@@ -1,7 +1,8 @@
"""Badge component."""
+from reflex.vars.base import Var
+
from reflex_chakra.components import ChakraComponent, LiteralVariant
-from reflex.vars import Var
class Badge(ChakraComponent):
diff --git a/reflex_chakra/components/datadisplay/badge.pyi b/reflex_chakra/components/datadisplay/badge.pyi
index 2462cf6..9212f48 100644
--- a/reflex_chakra/components/datadisplay/badge.pyi
+++ b/reflex_chakra/components/datadisplay/badge.pyi
@@ -1,72 +1,62 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Badge:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -75,12 +65,12 @@ class Badge(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/datadisplay/code.pyi b/reflex_chakra/components/datadisplay/code.pyi
index 0a8003e..450ca0f 100644
--- a/reflex_chakra/components/datadisplay/code.pyi
+++ b/reflex_chakra/components/datadisplay/code.pyi
@@ -1,77 +1,69 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/datadisplay/divider.py b/reflex_chakra/components/datadisplay/divider.py
index 4a45d24..38c2203 100644
--- a/reflex_chakra/components/datadisplay/divider.py
+++ b/reflex_chakra/components/datadisplay/divider.py
@@ -2,8 +2,9 @@
from typing import Literal
+from reflex.vars.base import Var
+
from reflex_chakra.components import ChakraComponent, LiteralDividerVariant
-from reflex.vars import Var
LiteralLayout = Literal["horizontal", "vertical"]
diff --git a/reflex_chakra/components/datadisplay/divider.pyi b/reflex_chakra/components/datadisplay/divider.pyi
index 7afda15..0852fdb 100644
--- a/reflex_chakra/components/datadisplay/divider.pyi
+++ b/reflex_chakra/components/datadisplay/divider.pyi
@@ -1,76 +1,67 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+ TypeAlias,
+)
+
+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"]
+LiteralLayout: TypeAlias = Literal["horizontal", "vertical"]
class Divider(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Divider:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -79,12 +70,12 @@ class Divider(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/datadisplay/keyboard_key.pyi b/reflex_chakra/components/datadisplay/keyboard_key.pyi
index c5d4756..95c9dd9 100644
--- a/reflex_chakra/components/datadisplay/keyboard_key.pyi
+++ b/reflex_chakra/components/datadisplay/keyboard_key.pyi
@@ -1,77 +1,69 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/datadisplay/list.py b/reflex_chakra/components/datadisplay/list.py
index f60befe..0f239cd 100644
--- a/reflex_chakra/components/datadisplay/list.py
+++ b/reflex_chakra/components/datadisplay/list.py
@@ -2,10 +2,11 @@
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 import Var
+from reflex.vars.base import Var
+
+from reflex_chakra.components import ChakraComponent
class List(ChakraComponent):
diff --git a/reflex_chakra/components/datadisplay/list.pyi b/reflex_chakra/components/datadisplay/list.pyi
index 3d0120a..270a77c 100644
--- a/reflex_chakra/components/datadisplay/list.pyi
+++ b/reflex_chakra/components/datadisplay/list.pyi
@@ -1,68 +1,60 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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,6 +66,7 @@ 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
@@ -82,127 +75,96 @@ class List(ChakraComponent):
Returns:
The list component.
"""
- ...
class ListItem(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class OrderedList(List):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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,6 +176,7 @@ 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
@@ -222,61 +185,45 @@ class OrderedList(List):
Returns:
The list component.
"""
- ...
class UnorderedList(List):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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,6 +235,7 @@ 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
@@ -296,4 +244,3 @@ class UnorderedList(List):
Returns:
The list component.
"""
- ...
diff --git a/reflex_chakra/components/datadisplay/stat.py b/reflex_chakra/components/datadisplay/stat.py
index 841f282..699ac47 100644
--- a/reflex_chakra/components/datadisplay/stat.py
+++ b/reflex_chakra/components/datadisplay/stat.py
@@ -1,8 +1,9 @@
"""Statistics components."""
-from reflex_chakra.components import ChakraComponent
from reflex.components.component import Component
-from reflex.vars import Var
+from reflex.vars.base import Var
+
+from reflex_chakra.components import ChakraComponent
class Stat(ChakraComponent):
diff --git a/reflex_chakra/components/datadisplay/stat.pyi b/reflex_chakra/components/datadisplay/stat.pyi
index 8a4da36..953fc35 100644
--- a/reflex_chakra/components/datadisplay/stat.pyi
+++ b/reflex_chakra/components/datadisplay/stat.pyi
@@ -1,68 +1,60 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
cls,
*children,
label=None,
number=0,
help_text=None,
arrow_type=None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_context_menu: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_double_click: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mouse_down: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_enter: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_leave: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_move: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_out: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_over: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_up: Optional[
- Union[EventHandler, EventSpec, 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,6 +66,7 @@ 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
@@ -82,257 +75,196 @@ class Stat(ChakraComponent):
Returns:
The stat component.
"""
- ...
class StatLabel(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class StatNumber(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class StatHelpText(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class StatArrow(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> StatArrow:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -340,78 +272,63 @@ class StatArrow(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class StatGroup(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/datadisplay/table.py b/reflex_chakra/components/datadisplay/table.py
index e3102e6..b70eb06 100644
--- a/reflex_chakra/components/datadisplay/table.py
+++ b/reflex_chakra/components/datadisplay/table.py
@@ -1,12 +1,13 @@
"""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
+
+from reflex_chakra.components import ChakraComponent
class Table(ChakraComponent):
@@ -66,7 +67,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:
@@ -100,16 +101,14 @@ 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")
+ msg = "table headers should be a list or tuple"
+ raise TypeError(msg)
class Tbody(ChakraComponent):
@@ -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 = (
@@ -174,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):
@@ -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:
@@ -223,16 +222,14 @@ 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")
+ msg = "table headers should be a list or tuple"
+ raise TypeError(msg)
class Tr(ChakraComponent):
@@ -241,7 +238,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 +269,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 +281,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..b3e073c 100644
--- a/reflex_chakra/components/datadisplay/table.pyi
+++ b/reflex_chakra/components/datadisplay/table.pyi
@@ -1,72 +1,64 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
cls,
*children,
caption=None,
headers=None,
rows=None,
footers=None,
- color_scheme: Optional[Union[Var[str], str]] = None,
- variant: Optional[Union[Var[str], str]] = None,
- size: Optional[Union[Var[str], str]] = None,
- placement: Optional[Union[Var[str], str]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_context_menu: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_double_click: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mouse_down: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_enter: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_leave: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_move: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_out: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_over: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_up: Optional[
- Union[EventHandler, EventSpec, 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,6 +74,7 @@ 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
@@ -90,58 +83,42 @@ class Table(ChakraComponent):
Returns:
The table component.
"""
- ...
class Thead(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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 +127,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,63 +135,46 @@ 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,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_context_menu: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_double_click: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mouse_down: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_enter: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_leave: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_move: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_out: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_over: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_up: Optional[
- Union[EventHandler, EventSpec, 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,6 +183,7 @@ 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
@@ -230,61 +192,45 @@ class Tbody(ChakraComponent):
Returns:
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,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_context_menu: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_double_click: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mouse_down: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_enter: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_leave: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_move: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_out: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_over: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_up: Optional[
- Union[EventHandler, EventSpec, 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,6 +239,7 @@ 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
@@ -301,62 +248,46 @@ class Tfoot(ChakraComponent):
Returns:
The table footer component.
"""
- ...
@staticmethod
def validate_footers(footers): ...
class Tr(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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,6 +297,7 @@ 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
@@ -374,59 +306,43 @@ class Tr(ChakraComponent):
Returns:
The table row component
"""
- ...
class Th(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Th:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -434,67 +350,52 @@ class Th(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class Td(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Td:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -502,67 +403,52 @@ class Td(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TableCaption(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> TableCaption:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -570,78 +456,63 @@ class TableCaption(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TableContainer(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/datadisplay/tag.py b/reflex_chakra/components/datadisplay/tag.py
index ef8f5eb..38b29c6 100644
--- a/reflex_chakra/components/datadisplay/tag.py
+++ b/reflex_chakra/components/datadisplay/tag.py
@@ -1,6 +1,7 @@
"""Chakra Tag Component."""
-from typing import Optional
+from reflex.components.component import Component
+from reflex.vars.base import Var
from reflex_chakra.components import (
ChakraComponent,
@@ -8,8 +9,6 @@
LiteralTagSize,
LiteralVariant,
)
-from reflex.components.component import Component
-from reflex.vars import Var
class TagLabel(ChakraComponent):
@@ -62,9 +61,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..9a42bdf 100644
--- a/reflex_chakra/components/datadisplay/tag.pyi
+++ b/reflex_chakra/components/datadisplay/tag.pyi
@@ -1,373 +1,298 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
-from reflex.event import EventHandler, EventSpec
-from reflex.style import Style
-from reflex.vars import Var
class TagLabel(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TagLeftIcon(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TagRightIcon(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TagCloseButton(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class Tag(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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:
@@ -380,4 +305,3 @@ class Tag(ChakraComponent):
Returns:
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..e1c19fd 100644
--- a/reflex_chakra/components/disclosure/accordion.py
+++ b/reflex_chakra/components/disclosure/accordion.py
@@ -1,10 +1,9 @@
"""Container to stack elements with spacing."""
-from typing import List, Optional, Union
+from reflex.components.component import Component
+from reflex.vars.base import Var
from reflex_chakra.components import ChakraComponent
-from reflex.components.component import Component
-from reflex.vars import Var
class Accordion(ChakraComponent):
@@ -19,10 +18,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 +32,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..bdb82c2 100644
--- a/reflex_chakra/components/disclosure/accordion.pyi
+++ b/reflex_chakra/components/disclosure/accordion.pyi
@@ -1,71 +1,63 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
cls,
*children,
items=None,
icon_pos="right",
- allow_multiple: Optional[Union[Var[bool], bool]] = None,
- allow_toggle: Optional[Union[Var[bool], bool]] = None,
- default_index: Optional[Union[Var[Optional[List[int]]], List[int]]] = None,
- index: Optional[Union[Var[Union[List[int], int]], int, List[int]]] = None,
- reduce_motion: Optional[Union[Var[bool], bool]] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_context_menu: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_double_click: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mouse_down: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_enter: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_leave: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_move: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_out: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_over: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_up: Optional[
- Union[EventHandler, EventSpec, 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: 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]
+ | 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,6 +72,7 @@ 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
@@ -88,61 +81,45 @@ class Accordion(ChakraComponent):
Returns:
The accordion component
"""
- ...
class AccordionItem(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> AccordionItem:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -152,210 +129,165 @@ class AccordionItem(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class AccordionButton(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class AccordionPanel(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class AccordionIcon(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/disclosure/tabs.py b/reflex_chakra/components/disclosure/tabs.py
index 3d49cc4..414f633 100644
--- a/reflex_chakra/components/disclosure/tabs.py
+++ b/reflex_chakra/components/disclosure/tabs.py
@@ -1,6 +1,9 @@
"""Tab components."""
-from typing import List, Optional, Tuple
+from typing import ClassVar
+
+from reflex.components.component import Component
+from reflex.vars.base import Var
from reflex_chakra.components import (
ChakraComponent,
@@ -8,8 +11,6 @@
LiteralTabsVariant,
LiteralTagAlign,
)
-from reflex.components.component import Component
-from reflex.vars import Var
class Tabs(ChakraComponent):
@@ -49,7 +50,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.
@@ -69,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)
@@ -90,7 +91,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 +99,7 @@ class TabList(ChakraComponent):
tag = "TabList"
- _valid_parents: List[str] = ["Tabs"]
+ _valid_parents: ClassVar[list[str]] = ["Tabs"]
class TabPanels(ChakraComponent):
@@ -106,7 +107,7 @@ class TabPanels(ChakraComponent):
tag = "TabPanels"
- _valid_parents: List[str] = ["Tabs"]
+ _valid_parents: ClassVar[list[str]] = ["Tabs"]
class TabPanel(ChakraComponent):
@@ -114,4 +115,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..926b04c 100644
--- a/reflex_chakra/components/disclosure/tabs.pyi
+++ b/reflex_chakra/components/disclosure/tabs.pyi
@@ -1,150 +1,134 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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,6 +147,7 @@ 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
@@ -171,62 +156,46 @@ class Tabs(ChakraComponent):
Returns:
The tab component
"""
- ...
class Tab(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Tab:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -237,210 +206,165 @@ class Tab(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TabList(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TabPanels(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class TabPanel(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/disclosure/transition.py b/reflex_chakra/components/disclosure/transition.py
index abad0d5..6e09f8f 100644
--- a/reflex_chakra/components/disclosure/transition.py
+++ b/reflex_chakra/components/disclosure/transition.py
@@ -1,9 +1,8 @@
"""A transition Component."""
-from typing import Union
+from reflex.vars.base import Var
from reflex_chakra.components import ChakraComponent
-from reflex.vars import Var
class Transition(ChakraComponent):
@@ -49,10 +48,10 @@ class SlideFade(Transition):
tag = "SlideFade"
# The offset on the horizontal or x axis
- offsetX: Var[Union[str, int]]
+ offsetX: Var[str | int] # noqa: N815
# The offset on the vertical or y axis
- offsetY: Var[Union[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]
@@ -64,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[Union[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 b83ce95..6b5dbda 100644
--- a/reflex_chakra/components/disclosure/transition.pyi
+++ b/reflex_chakra/components/disclosure/transition.pyi
@@ -1,67 +1,59 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Transition:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -70,68 +62,53 @@ class Transition(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class Fade(Transition):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Fade:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -140,70 +117,55 @@ class Fade(Transition):
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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class ScaleFade(Transition):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> ScaleFade:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -214,69 +176,54 @@ class ScaleFade(Transition):
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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class Slide(Transition):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Slide:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -286,71 +233,56 @@ class Slide(Transition):
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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class SlideFade(Transition):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> SlideFade:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -362,71 +294,56 @@ class SlideFade(Transition):
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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class Collapse(Transition):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Collapse:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -438,12 +355,12 @@ class Collapse(Transition):
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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/disclosure/visuallyhidden.pyi b/reflex_chakra/components/disclosure/visuallyhidden.pyi
index 1a99bb6..0d8f867 100644
--- a/reflex_chakra/components/disclosure/visuallyhidden.pyi
+++ b/reflex_chakra/components/disclosure/visuallyhidden.pyi
@@ -1,77 +1,69 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
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..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 import Var
class Alert(ChakraComponent):
diff --git a/reflex_chakra/components/feedback/alert.pyi b/reflex_chakra/components/feedback/alert.pyi
index 7a2e827..e29dae1 100644
--- a/reflex_chakra/components/feedback/alert.pyi
+++ b/reflex_chakra/components/feedback/alert.pyi
@@ -1,79 +1,66 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
cls,
*children,
icon=True,
title="Alert title",
desc=None,
- status: Optional[
- Union[
- Var[Literal["success", "info", "warning", "error"]],
- Literal["success", "info", "warning", "error"],
- ]
- ] = None,
- variant: Optional[
- Union[
- Var[Literal["subtle", "left-accent", "top-accent", "solid"]],
- Literal["subtle", "left-accent", "top-accent", "solid"],
- ]
- ] = None,
- style: Optional[Style] = None,
- key: Optional[Any] = None,
- id: Optional[Any] = None,
- class_name: Optional[Any] = None,
- autofocus: Optional[bool] = None,
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_context_menu: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_double_click: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
- on_mouse_down: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_enter: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_leave: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_move: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_out: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_over: Optional[
- Union[EventHandler, EventSpec, list, Callable, Var]
- ] = None,
- on_mouse_up: Optional[
- Union[EventHandler, EventSpec, 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,6 +73,7 @@ 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
@@ -94,202 +82,156 @@ class Alert(ChakraComponent):
Returns:
The alert component.
"""
- ...
class AlertIcon(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class AlertTitle(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class AlertDescription(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/feedback/circularprogress.py b/reflex_chakra/components/feedback/circularprogress.py
index 8847dc7..91cb080 100644
--- a/reflex_chakra/components/feedback/circularprogress.py
+++ b/reflex_chakra/components/feedback/circularprogress.py
@@ -1,10 +1,9 @@
"""Container to stack elements with spacing."""
-from typing import Union
+from reflex.components.component import Component
+from reflex.vars.base import Var
from reflex_chakra.components import ChakraComponent
-from reflex.components.component import Component
-from reflex.vars import Var
class CircularProgress(ChakraComponent):
@@ -25,7 +24,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..e1a5234 100644
--- a/reflex_chakra/components/feedback/circularprogress.pyi
+++ b/reflex_chakra/components/feedback/circularprogress.pyi
@@ -1,75 +1,67 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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,6 +80,7 @@ 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
@@ -96,70 +89,54 @@ class CircularProgress(ChakraComponent):
Returns:
The circular progress component.
"""
- ...
class CircularProgressLabel(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/feedback/progress.py b/reflex_chakra/components/feedback/progress.py
index 63fda11..287af86 100644
--- a/reflex_chakra/components/feedback/progress.py
+++ b/reflex_chakra/components/feedback/progress.py
@@ -1,9 +1,8 @@
"""Container to stack elements with spacing."""
-from typing import Union
+from reflex.vars.base import Var
from reflex_chakra.components import ChakraComponent
-from reflex.vars import Var
class Progress(ChakraComponent):
@@ -27,7 +26,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..a1cdd8c 100644
--- a/reflex_chakra/components/feedback/progress.pyi
+++ b/reflex_chakra/components/feedback/progress.pyi
@@ -1,72 +1,64 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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 | 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.
+ ) -> Progress:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -80,12 +72,12 @@ class Progress(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/feedback/skeleton.py b/reflex_chakra/components/feedback/skeleton.py
index 8e97e17..9b4781a 100644
--- a/reflex_chakra/components/feedback/skeleton.py
+++ b/reflex_chakra/components/feedback/skeleton.py
@@ -1,7 +1,8 @@
"""Container to stack elements with spacing."""
+from reflex.vars.base import Var
+
from reflex_chakra.components import ChakraComponent
-from reflex.vars import Var
class Skeleton(ChakraComponent):
diff --git a/reflex_chakra/components/feedback/skeleton.pyi b/reflex_chakra/components/feedback/skeleton.pyi
index fd95c41..ba9f694 100644
--- a/reflex_chakra/components/feedback/skeleton.pyi
+++ b/reflex_chakra/components/feedback/skeleton.pyi
@@ -1,70 +1,62 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Skeleton:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -76,71 +68,56 @@ class Skeleton(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class SkeletonCircle(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> SkeletonCircle:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -152,72 +129,57 @@ class SkeletonCircle(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class SkeletonText(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> SkeletonText:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -230,12 +192,12 @@ class SkeletonText(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/feedback/spinner.py b/reflex_chakra/components/feedback/spinner.py
index 1096668..92adf07 100644
--- a/reflex_chakra/components/feedback/spinner.py
+++ b/reflex_chakra/components/feedback/spinner.py
@@ -1,7 +1,8 @@
"""Container to stack elements with spacing."""
+from reflex.vars.base import Var
+
from reflex_chakra.components import ChakraComponent, LiteralSpinnerSize
-from reflex.vars import Var
class Spinner(ChakraComponent):
diff --git a/reflex_chakra/components/feedback/spinner.pyi b/reflex_chakra/components/feedback/spinner.pyi
index 5c06019..a0c2ef2 100644
--- a/reflex_chakra/components/feedback/spinner.pyi
+++ b/reflex_chakra/components/feedback/spinner.pyi
@@ -1,75 +1,65 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Spinner:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -81,12 +71,12 @@ class Spinner(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/forms/__init__.py b/reflex_chakra/components/forms/__init__.py
index b3a4b1b..56aea9d 100644
--- a/reflex_chakra/components/forms/__init__.py
+++ b/reflex_chakra/components/forms/__init__.py
@@ -1,10 +1,11 @@
"""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 (
ColorModeButton,
- color_mode_icon,
ColorModeScript,
ColorModeSwitch,
)
@@ -22,8 +23,6 @@
InputRightAddon,
InputRightElement,
)
-from .multiselect import Option as MultiSelectOption
-from .multiselect import Select as MultiSelect
from .numberinput import (
NumberDecrementStepper,
NumberIncrementStepper,
@@ -40,10 +39,61 @@
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
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..d4a6789 100644
--- a/reflex_chakra/components/forms/button.py
+++ b/reflex_chakra/components/forms/button.py
@@ -1,6 +1,8 @@
"""A button component."""
-from typing import List
+from typing import ClassVar
+
+from reflex.vars.base import Var
from reflex_chakra.components import (
ChakraComponent,
@@ -9,7 +11,6 @@
LiteralColorScheme,
LiteralSpinnerPlacement,
)
-from reflex.vars import Var
class Button(ChakraComponent):
@@ -56,7 +57,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..18334a3 100644
--- a/reflex_chakra/components/forms/button.pyi
+++ b/reflex_chakra/components/forms/button.pyi
@@ -1,135 +1,122 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Button:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -148,78 +135,60 @@ class Button(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class ButtonGroup(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> ButtonGroup:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -231,12 +200,12 @@ class ButtonGroup(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.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/forms/checkbox.py b/reflex_chakra/components/forms/checkbox.py
index 8c06a0d..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 import Var
class Checkbox(ChakraComponent):
diff --git a/reflex_chakra/components/forms/checkbox.pyi b/reflex_chakra/components/forms/checkbox.pyi
index 20c0ab0..ed62d7d 100644
--- a/reflex_chakra/components/forms/checkbox.pyi
+++ b/reflex_chakra/components/forms/checkbox.pyi
@@ -1,127 +1,115 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Checkbox:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -137,73 +125,59 @@ class Checkbox(ChakraComponent):
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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class CheckboxGroup(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> CheckboxGroup:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -214,12 +188,12 @@ class CheckboxGroup(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.
+ **props: The properties of the component.
Returns:
- The component.
+ 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 9ff616c..0213f13 100644
--- a/reflex_chakra/components/forms/colormodeswitch.pyi
+++ b/reflex_chakra/components/forms/colormodeswitch.pyi
@@ -1,16 +1,24 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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 reflex.event import EventHandler, EventSpec
-from reflex.style import Style
-from reflex.vars import Var
from .button import Button
from .switch import Switch
@@ -19,128 +27,100 @@ 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
@classmethod
- def create( # type: ignore
+ def create(
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,9 +136,11 @@ 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
@@ -167,125 +149,103 @@ class ColorModeSwitch(Switch):
Returns:
The switch component.
"""
- ...
class ColorModeButton(Button):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
cls,
*children,
- icon_spacing: Optional[Union[Var[int], int]] = None,
- is_active: Optional[Union[Var[bool], bool]] = None,
- is_disabled: Optional[Union[Var[bool], bool]] = None,
- is_full_width: Optional[Union[Var[bool], bool]] = None,
- is_loading: Optional[Union[Var[bool], bool]] = None,
- loading_text: Optional[Union[Var[str], str]] = None,
- size: Optional[
- Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
- ] = None,
- variant: Optional[
- Union[
- Var[Literal["ghost", "outline", "solid", "link", "unstyled"]],
- Literal["ghost", "outline", "solid", "link", "unstyled"],
- ]
- ] = None,
- color_scheme: Optional[
- Union[
- Var[
- Literal[
- "none",
- "gray",
- "red",
- "orange",
- "yellow",
- "green",
- "teal",
- "blue",
- "cyan",
- "purple",
- "pink",
- "whiteAlpha",
- "blackAlpha",
- "linkedin",
- "facebook",
- "messenger",
- "whatsapp",
- "twitter",
- "telegram",
- ]
- ],
- Literal[
- "none",
- "gray",
- "red",
- "orange",
- "yellow",
- "green",
- "teal",
- "blue",
- "cyan",
- "purple",
- "pink",
- "whiteAlpha",
- "blackAlpha",
- "linkedin",
- "facebook",
- "messenger",
- "whatsapp",
- "twitter",
- "telegram",
- ],
+ 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,
- 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,6 +265,7 @@ 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
@@ -313,70 +274,54 @@ class ColorModeButton(Button):
Returns:
The switch component.
"""
- ...
class ColorModeScript(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/forms/date_picker.py b/reflex_chakra/components/forms/date_picker.py
index 9aed7ff..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.vars.base import Var
+
from reflex_chakra.components.forms.input import Input
-from reflex.vars import Var
class DatePicker(Input):
"""A date input component."""
# The type of input.
- type_: Var[str] = "date" # type: ignore
+ 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 7f3923e..3586421 100644
--- a/reflex_chakra/components/forms/date_picker.pyi
+++ b/reflex_chakra/components/forms/date_picker.pyi
@@ -1,89 +1,77 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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,9 +89,15 @@ 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
@@ -112,4 +106,3 @@ class DatePicker(Input):
Returns:
The component.
"""
- ...
diff --git a/reflex_chakra/components/forms/date_time_picker.py b/reflex_chakra/components/forms/date_time_picker.py
index 3d45b49..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.vars.base import Var
+
from reflex_chakra.components.forms.input import Input
-from reflex.vars import Var
class DateTimePicker(Input):
"""A datetime-local input component."""
# The type of input.
- type_: Var[str] = "datetime-local" # type: ignore
+ 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 b8c6972..a07de89 100644
--- a/reflex_chakra/components/forms/date_time_picker.pyi
+++ b/reflex_chakra/components/forms/date_time_picker.pyi
@@ -1,89 +1,77 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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,9 +89,15 @@ 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
@@ -112,4 +106,3 @@ class DateTimePicker(Input):
Returns:
The component.
"""
- ...
diff --git a/reflex_chakra/components/forms/editable.py b/reflex_chakra/components/forms/editable.py
index 5f5032f..13aa8e5 100644
--- a/reflex_chakra/components/forms/editable.py
+++ b/reflex_chakra/components/forms/editable.py
@@ -2,9 +2,10 @@
from __future__ import annotations
-from reflex_chakra.components import ChakraComponent
from reflex.event import EventHandler
-from reflex.vars import Var
+from reflex.vars.base import Var
+
+from reflex_chakra.components import ChakraComponent
class Editable(ChakraComponent):
diff --git a/reflex_chakra/components/forms/editable.pyi b/reflex_chakra/components/forms/editable.pyi
index d4e079f..ebee6a3 100644
--- a/reflex_chakra/components/forms/editable.pyi
+++ b/reflex_chakra/components/forms/editable.pyi
@@ -1,77 +1,69 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> Editable:
+ """Create a new Chakra component.
Args:
*children: The children of the component.
@@ -83,213 +75,172 @@ class Editable(ChakraComponent):
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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class EditableInput(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class EditableTextarea(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
class EditablePreview(ChakraComponent):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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.
+ ) -> 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 props of the component.
+ **props: The properties of the component.
Returns:
- The component.
+ A new Chakra component.
"""
- ...
diff --git a/reflex_chakra/components/forms/email.py b/reflex_chakra/components/forms/email.py
index bd0e9f2..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.vars.base import Var
+
from reflex_chakra.components.forms.input import Input
-from reflex.vars import Var
class Email(Input):
"""An email input component."""
# The type of input.
- type_: Var[str] = "email" # type: ignore
+ type_: Var[str] = Var.create("email")
diff --git a/reflex_chakra/components/forms/email.pyi b/reflex_chakra/components/forms/email.pyi
index 4c6e6fa..2fab836 100644
--- a/reflex_chakra/components/forms/email.pyi
+++ b/reflex_chakra/components/forms/email.pyi
@@ -1,89 +1,77 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
+
+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
@classmethod
- def create( # type: ignore
+ def create(
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,9 +89,15 @@ 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
@@ -112,4 +106,3 @@ class Email(Input):
Returns:
The component.
"""
- ...
diff --git a/reflex_chakra/components/forms/form.py b/reflex_chakra/components/forms/form.py
index bb0a1fc..c8a8dbc 100644
--- a/reflex_chakra/components/forms/form.py
+++ b/reflex_chakra/components/forms/form.py
@@ -2,10 +2,11 @@
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 import Var
+from reflex.vars.base import Var
+
+from reflex_chakra.components import ChakraComponent
class Form(ChakraComponent, HTMLForm):
@@ -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 52465bd..adca10e 100644
--- a/reflex_chakra/components/forms/form.pyi
+++ b/reflex_chakra/components/forms/form.pyi
@@ -1,110 +1,256 @@
-"""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 collections.abc import Mapping, Sequence
+from typing import (
+ Any,
+ Literal,
+)
-from reflex_chakra.components import ChakraComponent
+from reflex.components.core.breakpoints import Breakpoints
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
+from reflex.event import (
+ EventType,
+ PointerEventInfo,
+)
+from reflex.vars.base import Var
+
+from reflex_chakra.components import ChakraComponent
class Form(ChakraComponent, HTMLForm):
- @overload
@classmethod
- def create( # type: ignore
+ def create(
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[dict[str, str]]
+ | None = None,
+ on_unmount: EventType[()] | None = None,
**props,
- ) -> "Form":
- """Create a form component.
+ ) -> Form:
+ """Create a new Chakra component.
Args:
- *children: The children of the form.
+ *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
@@ -117,7 +263,8 @@ class Form(ChakraComponent, HTMLForm):
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.
+ 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