[REF-3591] Remove chakra-related files from immutable vars PR (#3821)

* Add comments to html metadata component (#3731)

* fix: add verification for path /404 (#3723)

Co-authored-by: coolstorm <manas.gupta@fampay.in>

* Use the new state name when setting `is_hydrated` to false (#3738)

* Use `._is_mutable()` to account for parent state proxy (#3739)

When a parent state proxy is set, also allow child StateProxy._self_mutable to
override the parent's `_is_mutable()`.

* bump to 0.5.9 (#3746)

* add message when installing requirements.txt is needed for chosen template during init (#3750)

* #3752 bugfix add domain for XAxis (#3764)

* fix appharness app_source typing (#3777)

* fix import clash between connectionToaster and hooks.useState (#3749)

* use different registry when in china, fixes #3700 (#3702)

* do not reload compilation if using local app in AppHarness (#3790)

* do not reload if using local app

* Update reflex/testing.py

Co-authored-by: Masen Furer <m_github@0x26.net>

---------

Co-authored-by: Masen Furer <m_github@0x26.net>

* Bump memory on relevant actions (#3781)

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>

* [REF-3334] Validate Toast Props (#3793)

* [REF-3536][REF-3537][REF-3541] Move chakra components into its repo(reflex-chakra) (#3798)

* fix get_uuid_string_var (#3795)

* minor State cleanup (#3768)

* Fix code wrap in markdown (#3755)

---------

Co-authored-by: Alek Petuskey <alek@pynecone.io>
Co-authored-by: Manas Gupta <53006261+Manas1820@users.noreply.github.com>
Co-authored-by: coolstorm <manas.gupta@fampay.in>
Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>
Co-authored-by: Shubhankar Dimri <dimrishubhi@gmail.com>
Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com>
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
Co-authored-by: Elijah Ahianyo <elijahahianyo@gmail.com>
This commit is contained in:
Masen Furer 2024-08-22 16:15:12 -07:00 committed by GitHub
parent 9fb4b67da5
commit 26002a809b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
189 changed files with 439 additions and 22045 deletions

View File

@ -17,7 +17,7 @@ defaults:
env:
PYTHONIOENCODING: 'utf8'
TELEMETRY_ENABLED: false
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: '--max_old_space_size=8192'
PR_TITLE: ${{ github.event.pull_request.title }}
jobs:

View File

@ -29,7 +29,7 @@ env:
# - Best effort print lines that contain illegal chars (map to some default char, etc.)
PYTHONIOENCODING: 'utf8'
TELEMETRY_ENABLED: false
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: '--max_old_space_size=8192'
PR_TITLE: ${{ github.event.pull_request.title }}
jobs:

View File

@ -7,6 +7,7 @@ import time
from typing import Generator
import pytest
import reflex_chakra as rc
from benchmarks import WINDOWS_SKIP_REASON
from reflex import constants
@ -144,7 +145,7 @@ def AppWithOnePage():
def index() -> rx.Component:
return rx.center(
rx.chakra.input(
rc.input(
id="token", value=State.router.session.client_token, is_read_only=True
),
rx.vstack(

View File

@ -13,6 +13,7 @@ def BackgroundTask():
import asyncio
import pytest
import reflex_chakra as rc
import reflex as rx
from reflex.state import ImmutableStateError
@ -108,11 +109,11 @@ def BackgroundTask():
def index() -> rx.Component:
return rx.vstack(
rx.chakra.input(
rc.input(
id="token", value=State.router.session.client_token, is_read_only=True
),
rx.heading(State.counter, id="counter"),
rx.chakra.input(
rc.input(
id="iterations",
placeholder="Iterations",
value=State.iterations.to_string(), # type: ignore

View File

@ -17,6 +17,8 @@ from . import utils
def ClientSide():
"""App for testing client-side state."""
import reflex_chakra as rc
import reflex as rx
class ClientSideState(rx.State):
@ -70,18 +72,18 @@ def ClientSide():
def index():
return rx.fragment(
rx.chakra.input(
rc.input(
value=ClientSideState.router.session.client_token,
is_read_only=True,
id="token",
),
rx.chakra.input(
rc.input(
placeholder="state var",
value=ClientSideState.state_var,
on_change=ClientSideState.set_state_var, # type: ignore
id="state_var",
),
rx.chakra.input(
rc.input(
placeholder="input value",
value=ClientSideState.input_value,
on_change=ClientSideState.set_input_value, # type: ignore

View File

@ -17,6 +17,8 @@ def DynamicRoute():
"""App for testing dynamic routes."""
from typing import List
import reflex_chakra as rc
import reflex as rx
class DynamicState(rx.State):
@ -40,15 +42,13 @@ def DynamicRoute():
def index():
return rx.fragment(
rx.chakra.input(
rc.input(
value=DynamicState.router.session.client_token,
is_read_only=True,
id="token",
),
rx.chakra.input(
value=DynamicState.page_id, is_read_only=True, id="page_id"
),
rx.chakra.input(
rc.input(value=DynamicState.page_id, is_read_only=True, id="page_id"),
rc.input(
value=DynamicState.router.page.raw_path,
is_read_only=True,
id="raw_path",
@ -61,10 +61,10 @@ def DynamicRoute():
id="link_page_next", # type: ignore
),
rx.link("missing", href="/missing", id="link_missing"),
rx.chakra.list(
rc.list(
rx.foreach(
DynamicState.order, # type: ignore
lambda i: rx.chakra.list_item(rx.text(i)),
lambda i: rc.list_item(rx.text(i)),
),
),
)

View File

@ -16,6 +16,8 @@ def TestEventAction():
"""App for testing event_actions."""
from typing import List, Optional
import reflex_chakra as rc
import reflex as rx
class EventActionState(rx.State):
@ -53,7 +55,7 @@ def TestEventAction():
def index():
return rx.vstack(
rx.chakra.input(
rc.input(
value=EventActionState.router.session.client_token,
is_read_only=True,
id="token",
@ -146,10 +148,10 @@ def TestEventAction():
200
).stop_propagation,
),
rx.chakra.list(
rc.list(
rx.foreach(
EventActionState.order, # type: ignore
rx.chakra.list_item,
rc.list_item,
),
),
on_click=EventActionState.on_click("outer"), # type: ignore

View File

@ -18,6 +18,8 @@ def EventChain():
import time
from typing import List
import reflex_chakra as rc
import reflex as rx
# repeated here since the outer global isn't exported into the App module
@ -127,7 +129,7 @@ def EventChain():
app = rx.App(state=rx.State)
token_input = rx.chakra.input(
token_input = rc.input(
value=State.router.session.client_token, is_read_only=True, id="token"
)
@ -135,9 +137,7 @@ def EventChain():
def index():
return rx.fragment(
token_input,
rx.chakra.input(
value=State.interim_value, is_read_only=True, id="interim_value"
),
rc.input(value=State.interim_value, is_read_only=True, id="interim_value"),
rx.button(
"Return Event",
id="return_event",

View File

@ -20,6 +20,8 @@ def FormSubmit(form_component):
"""
from typing import Dict, List
import reflex_chakra as rc
import reflex as rx
class FormState(rx.State):
@ -35,28 +37,28 @@ def FormSubmit(form_component):
@app.add_page
def index():
return rx.vstack(
rx.chakra.input(
rc.input(
value=FormState.router.session.client_token,
is_read_only=True,
id="token",
),
eval(form_component)(
rx.vstack(
rx.chakra.input(id="name_input"),
rx.hstack(rx.chakra.pin_input(length=4, id="pin_input")),
rx.chakra.number_input(id="number_input"),
rc.input(id="name_input"),
rx.hstack(rc.pin_input(length=4, id="pin_input")),
rc.number_input(id="number_input"),
rx.checkbox(id="bool_input"),
rx.switch(id="bool_input2"),
rx.checkbox(id="bool_input3"),
rx.switch(id="bool_input4"),
rx.slider(id="slider_input", default_value=[50], width="100%"),
rx.chakra.range_slider(id="range_input"),
rc.range_slider(id="range_input"),
rx.radio(["option1", "option2"], id="radio_input"),
rx.radio(FormState.var_options, id="radio_input_var"),
rx.chakra.select(["option1", "option2"], id="select_input"),
rx.chakra.select(FormState.var_options, id="select_input_var"),
rc.select(["option1", "option2"], id="select_input"),
rc.select(FormState.var_options, id="select_input_var"),
rx.text_area(id="text_area_input"),
rx.chakra.input(
rc.input(
id="debounce_input",
debounce_timeout=0,
on_change=rx.console_log,
@ -79,6 +81,8 @@ def FormSubmitName(form_component):
"""
from typing import Dict, List
import reflex_chakra as rc
import reflex as rx
class FormState(rx.State):
@ -94,22 +98,22 @@ def FormSubmitName(form_component):
@app.add_page
def index():
return rx.vstack(
rx.chakra.input(
rc.input(
value=FormState.router.session.client_token,
is_read_only=True,
id="token",
),
eval(form_component)(
rx.vstack(
rx.chakra.input(name="name_input"),
rx.hstack(rx.chakra.pin_input(length=4, name="pin_input")),
rx.chakra.number_input(name="number_input"),
rc.input(name="name_input"),
rx.hstack(rc.pin_input(length=4, name="pin_input")),
rc.number_input(name="number_input"),
rx.checkbox(name="bool_input"),
rx.switch(name="bool_input2"),
rx.checkbox(name="bool_input3"),
rx.switch(name="bool_input4"),
rx.slider(name="slider_input", default_value=[50], width="100%"),
rx.chakra.range_slider(name="range_input"),
rc.range_slider(name="range_input"),
rx.radio(FormState.options, name="radio_input"),
rx.select(
FormState.options,
@ -117,16 +121,16 @@ def FormSubmitName(form_component):
default_value=FormState.options[0],
),
rx.text_area(name="text_area_input"),
rx.chakra.input_group(
rx.chakra.input_left_element(rx.icon(tag="chevron_right")),
rx.chakra.input(
rc.input_group(
rc.input_left_element(rx.icon(tag="chevron_right")),
rc.input(
name="debounce_input",
debounce_timeout=0,
on_change=rx.console_log,
),
rx.chakra.input_right_element(rx.icon(tag="chevron_left")),
rc.input_right_element(rx.icon(tag="chevron_left")),
),
rx.chakra.button_group(
rc.button_group(
rx.button("Submit", type_="submit"),
rx.icon_button(FormState.val, icon=rx.icon(tag="plus")),
variant="outline",
@ -148,8 +152,8 @@ def FormSubmitName(form_component):
functools.partial(FormSubmitName, form_component="rx.form.root"),
functools.partial(FormSubmit, form_component="rx.el.form"),
functools.partial(FormSubmitName, form_component="rx.el.form"),
functools.partial(FormSubmit, form_component="rx.chakra.form"),
functools.partial(FormSubmitName, form_component="rx.chakra.form"),
functools.partial(FormSubmit, form_component="rc.form"),
functools.partial(FormSubmitName, form_component="rc.form"),
],
ids=[
"id-radix",

View File

@ -11,6 +11,8 @@ from reflex.testing import AppHarness
def ServerSideEvent():
"""App with inputs set via event handlers and set_value."""
import reflex_chakra as rc
import reflex as rx
class SSState(rx.State):
@ -39,12 +41,12 @@ def ServerSideEvent():
@app.add_page
def index():
return rx.fragment(
rx.chakra.input(
rc.input(
id="token", value=SSState.router.session.client_token, is_read_only=True
),
rx.chakra.input(default_value="a", id="a"),
rx.chakra.input(default_value="b", id="b"),
rx.chakra.input(default_value="c", id="c"),
rc.input(default_value="a", id="a"),
rc.input(default_value="b", id="b"),
rc.input(default_value="c", id="c"),
rx.button(
"Clear Immediate",
id="clear_immediate",

View File

@ -12,6 +12,8 @@ def Table():
"""App using table component."""
from typing import List
import reflex_chakra as rc
import reflex as rx
class TableState(rx.State):
@ -32,13 +34,13 @@ def Table():
@app.add_page
def index():
return rx.center(
rx.chakra.input(
rc.input(
id="token",
value=TableState.router.session.client_token,
is_read_only=True,
),
rx.chakra.table_container(
rx.chakra.table(
rc.table_container(
rc.table(
headers=TableState.headers,
rows=TableState.rows,
footers=TableState.footers,
@ -53,40 +55,40 @@ def Table():
@app.add_page
def another():
return rx.center(
rx.chakra.table_container(
rx.chakra.table( # type: ignore
rx.chakra.thead( # type: ignore
rx.chakra.tr( # type: ignore
rx.chakra.th("Name"),
rx.chakra.th("Age"),
rx.chakra.th("Location"),
rc.table_container(
rc.table( # type: ignore
rc.thead( # type: ignore
rc.tr( # type: ignore
rc.th("Name"),
rc.th("Age"),
rc.th("Location"),
)
),
rx.chakra.tbody( # type: ignore
rx.chakra.tr( # type: ignore
rx.chakra.td("John"),
rx.chakra.td(30),
rx.chakra.td("New York"),
rc.tbody( # type: ignore
rc.tr( # type: ignore
rc.td("John"),
rc.td(30),
rc.td("New York"),
),
rx.chakra.tr( # type: ignore
rx.chakra.td("Jane"),
rx.chakra.td(31),
rx.chakra.td("San Francisco"),
rc.tr( # type: ignore
rc.td("Jane"),
rc.td(31),
rc.td("San Francisco"),
),
rx.chakra.tr( # type: ignore
rx.chakra.td("Joe"),
rx.chakra.td(32),
rx.chakra.td("Los Angeles"),
rc.tr( # type: ignore
rc.td("Joe"),
rc.td(32),
rc.td("Los Angeles"),
),
),
rx.chakra.tfoot( # type: ignore
rx.chakra.tr(
rx.chakra.td("footer1"),
rx.chakra.td("footer2"),
rx.chakra.td("footer3"),
rc.tfoot( # type: ignore
rc.tr(
rc.td("footer1"),
rc.td("footer2"),
rc.td("footer3"),
) # type: ignore
),
rx.chakra.table_caption("random caption"),
rc.table_caption("random caption"),
variant="striped",
color_scheme="teal",
)

View File

@ -27,6 +27,8 @@ def TailwindApp(
"""
from pathlib import Path
import reflex_chakra as rc
import reflex as rx
class UnusedState(rx.State):
@ -34,7 +36,7 @@ def TailwindApp(
def index():
return rx.el.div(
rx.chakra.text(paragraph_text, class_name=paragraph_class_name),
rc.text(paragraph_text, class_name=paragraph_class_name),
rx.el.p(paragraph_text, class_name=paragraph_class_name),
rx.text(paragraph_text, as_="p", class_name=paragraph_class_name),
rx.el.div("Test external stylesheet", class_name="external"),

View File

@ -16,6 +16,8 @@ def UploadFile():
"""App for testing dynamic routes."""
from typing import Dict, List
import reflex_chakra as rc
import reflex as rx
class UploadState(rx.State):
@ -44,7 +46,7 @@ def UploadFile():
def index():
return rx.vstack(
rx.chakra.input(
rc.input(
value=UploadState.router.session.client_token,
is_read_only=True,
id="token",

View File

@ -14,6 +14,8 @@ def VarOperations():
"""App with var operations."""
from typing import Dict, List
import reflex_chakra as rc
import reflex as rx
from reflex.ivars.base import LiteralVar
from reflex.ivars.sequence import ArrayVar
@ -545,7 +547,7 @@ def VarOperations():
VarOperationState.html_str,
id="html_str",
),
rx.chakra.highlight(
rc.highlight(
"second",
query=[VarOperationState.str_var2],
),

162
poetry.lock generated
View File

@ -1,9 +1,10 @@
# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
[[package]]
name = "alembic"
version = "1.13.2"
description = "A database migration tool for SQLAlchemy."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -25,6 +26,7 @@ tz = ["backports.zoneinfo"]
name = "annotated-types"
version = "0.7.0"
description = "Reusable constraint types to use with typing.Annotated"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -39,6 +41,7 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""}
name = "anyio"
version = "4.4.0"
description = "High level compatibility layer for multiple asynchronous event loop implementations"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -61,6 +64,7 @@ trio = ["trio (>=0.23)"]
name = "async-timeout"
version = "4.0.3"
description = "Timeout context manager for asyncio programs"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -72,6 +76,7 @@ files = [
name = "asynctest"
version = "0.13.0"
description = "Enhance the standard unittest package with features for testing asyncio libraries"
category = "dev"
optional = false
python-versions = ">=3.5"
files = [
@ -83,6 +88,7 @@ files = [
name = "attrs"
version = "23.2.0"
description = "Classes Without Boilerplate"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -102,6 +108,7 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p
name = "backports-tarfile"
version = "1.2.0"
description = "Backport of CPython tarfile module"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -117,6 +124,7 @@ testing = ["jaraco.test", "pytest (!=8.0.*)", "pytest (>=6,!=8.1.*)", "pytest-ch
name = "bidict"
version = "0.23.1"
description = "The bidirectional mapping library for Python."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -128,6 +136,7 @@ files = [
name = "build"
version = "1.2.1"
description = "A simple, correct Python build frontend"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -153,6 +162,7 @@ virtualenv = ["virtualenv (>=20.0.35)"]
name = "certifi"
version = "2024.6.2"
description = "Python package for providing Mozilla's CA Bundle."
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -164,6 +174,7 @@ files = [
name = "cffi"
version = "1.16.0"
description = "Foreign Function Interface for Python calling C code."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -228,6 +239,7 @@ pycparser = "*"
name = "cfgv"
version = "3.4.0"
description = "Validate configuration and produce human readable error messages."
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -239,6 +251,7 @@ files = [
name = "charset-normalizer"
version = "3.3.2"
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
category = "main"
optional = false
python-versions = ">=3.7.0"
files = [
@ -338,6 +351,7 @@ files = [
name = "click"
version = "8.1.7"
description = "Composable command line interface toolkit"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -352,6 +366,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""}
name = "colorama"
version = "0.4.6"
description = "Cross-platform colored terminal text."
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
@ -363,6 +378,7 @@ files = [
name = "coverage"
version = "7.5.4"
description = "Code coverage measurement for Python"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -430,6 +446,7 @@ toml = ["tomli"]
name = "cryptography"
version = "42.0.8"
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -484,6 +501,7 @@ test-randomorder = ["pytest-randomly"]
name = "darglint"
version = "1.8.1"
description = "A utility for ensuring Google-style docstrings stay up to date with the source code."
category = "dev"
optional = false
python-versions = ">=3.6,<4.0"
files = [
@ -495,6 +513,7 @@ files = [
name = "dill"
version = "0.3.8"
description = "serialize all of Python"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -510,6 +529,7 @@ profile = ["gprof2dot (>=2022.7.29)"]
name = "distlib"
version = "0.3.8"
description = "Distribution utilities"
category = "dev"
optional = false
python-versions = "*"
files = [
@ -521,6 +541,7 @@ files = [
name = "distro"
version = "1.9.0"
description = "Distro - an OS platform information API"
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -532,14 +553,19 @@ files = [
name = "docutils"
version = "0.20.1"
description = "Docutils -- Python Documentation Utilities"
category = "main"
optional = false
python-versions = "*"
files = []
python-versions = ">=3.7"
files = [
{file = "docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"},
{file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"},
]
[[package]]
name = "exceptiongroup"
version = "1.2.1"
description = "Backport of PEP 654 (exception groups)"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -554,6 +580,7 @@ test = ["pytest (>=6)"]
name = "fastapi"
version = "0.110.3"
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -573,6 +600,7 @@ all = ["email_validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)"
name = "filelock"
version = "3.15.4"
description = "A platform independent file lock."
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -589,6 +617,7 @@ typing = ["typing-extensions (>=4.8)"]
name = "greenlet"
version = "3.0.3"
description = "Lightweight in-process concurrent programming"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -660,6 +689,7 @@ test = ["objgraph", "psutil"]
name = "gunicorn"
version = "22.0.0"
description = "WSGI HTTP Server for UNIX"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -681,6 +711,7 @@ tornado = ["tornado (>=0.2)"]
name = "h11"
version = "0.14.0"
description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -692,6 +723,7 @@ files = [
name = "httpcore"
version = "1.0.5"
description = "A minimal low-level HTTP client."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -706,13 +738,14 @@ h11 = ">=0.13,<0.15"
[package.extras]
asyncio = ["anyio (>=4.0,<5.0)"]
http2 = ["h2 (>=3,<5)"]
socks = ["socksio (==1.*)"]
socks = ["socksio (>=1.0.0,<2.0.0)"]
trio = ["trio (>=0.22.0,<0.26.0)"]
[[package]]
name = "httpx"
version = "0.27.0"
description = "The next generation HTTP client."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -723,20 +756,21 @@ files = [
[package.dependencies]
anyio = "*"
certifi = "*"
httpcore = "==1.*"
httpcore = ">=1.0.0,<2.0.0"
idna = "*"
sniffio = "*"
[package.extras]
brotli = ["brotli", "brotlicffi"]
cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]
cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<14)"]
http2 = ["h2 (>=3,<5)"]
socks = ["socksio (==1.*)"]
socks = ["socksio (>=1.0.0,<2.0.0)"]
[[package]]
name = "identify"
version = "2.5.36"
description = "File identification library for Python"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -751,6 +785,7 @@ license = ["ukkonen"]
name = "idna"
version = "3.7"
description = "Internationalized Domain Names in Applications (IDNA)"
category = "main"
optional = false
python-versions = ">=3.5"
files = [
@ -762,6 +797,7 @@ files = [
name = "importlib-metadata"
version = "8.0.0"
description = "Read metadata from Python packages"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -781,6 +817,7 @@ test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "p
name = "importlib-resources"
version = "6.4.0"
description = "Read resources from Python packages"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -799,6 +836,7 @@ testing = ["jaraco.test (>=5.4)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "p
name = "iniconfig"
version = "2.0.0"
description = "brain-dead simple config-ini parsing"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -810,6 +848,7 @@ files = [
name = "jaraco-classes"
version = "3.4.0"
description = "Utility functions for Python class constructs"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -828,6 +867,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-ena
name = "jaraco-context"
version = "5.3.0"
description = "Useful decorators and context managers"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -846,6 +886,7 @@ testing = ["portend", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytes
name = "jaraco-functools"
version = "4.0.1"
description = "Functools like those found in stdlib"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -864,6 +905,7 @@ testing = ["jaraco.classes", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest
name = "jeepney"
version = "0.8.0"
description = "Low-level, pure Python DBus protocol wrapper."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -879,6 +921,7 @@ trio = ["async_generator", "trio"]
name = "jinja2"
version = "3.1.4"
description = "A very fast and expressive template engine."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -896,6 +939,7 @@ i18n = ["Babel (>=2.7)"]
name = "keyring"
version = "25.2.1"
description = "Store and access your passwords safely."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -922,6 +966,7 @@ testing = ["pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "py
name = "lazy-loader"
version = "0.4"
description = "Makes it easy to load subpackages and functions on demand."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -941,6 +986,7 @@ test = ["pytest (>=7.4)", "pytest-cov (>=4.1)"]
name = "mako"
version = "1.3.5"
description = "A super-fast templating language that borrows the best ideas from the existing templating languages."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -960,6 +1006,7 @@ testing = ["pytest"]
name = "markdown-it-py"
version = "3.0.0"
description = "Python port of markdown-it. Markdown parsing, done right!"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -984,6 +1031,7 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"]
name = "markupsafe"
version = "2.1.5"
description = "Safely add untrusted strings to HTML/XML markup."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -1053,6 +1101,7 @@ files = [
name = "mdurl"
version = "0.1.2"
description = "Markdown URL utilities"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -1064,6 +1113,7 @@ files = [
name = "more-itertools"
version = "10.3.0"
description = "More routines for operating on iterables, beyond itertools"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1075,6 +1125,7 @@ files = [
name = "nh3"
version = "0.2.17"
description = "Python bindings to the ammonia HTML sanitization library."
category = "main"
optional = false
python-versions = "*"
files = [
@ -1100,6 +1151,7 @@ files = [
name = "nodeenv"
version = "1.9.1"
description = "Node.js virtual environment builder"
category = "dev"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
@ -1111,6 +1163,7 @@ files = [
name = "numpy"
version = "1.24.4"
description = "Fundamental package for array computing in Python"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -1148,6 +1201,7 @@ files = [
name = "numpy"
version = "2.0.0"
description = "Fundamental package for array computing in Python"
category = "dev"
optional = false
python-versions = ">=3.9"
files = [
@ -1202,6 +1256,7 @@ files = [
name = "outcome"
version = "1.3.0.post0"
description = "Capture the outcome of Python function calls."
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -1216,6 +1271,7 @@ attrs = ">=19.2.0"
name = "packaging"
version = "24.1"
description = "Core utilities for Python packages"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1227,6 +1283,7 @@ files = [
name = "pandas"
version = "1.5.3"
description = "Powerful data structures for data analysis, time series, and statistics"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -1271,6 +1328,7 @@ test = ["hypothesis (>=5.5.3)", "pytest (>=6.0)", "pytest-xdist (>=1.31)"]
name = "pandas"
version = "2.2.2"
description = "Powerful data structures for data analysis, time series, and statistics"
category = "dev"
optional = false
python-versions = ">=3.9"
files = [
@ -1344,6 +1402,7 @@ xml = ["lxml (>=4.9.2)"]
name = "pillow"
version = "10.3.0"
description = "Python Imaging Library (Fork)"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -1430,6 +1489,7 @@ xmp = ["defusedxml"]
name = "pip"
version = "24.1.1"
description = "The PyPA recommended tool for installing Python packages."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1441,6 +1501,7 @@ files = [
name = "pipdeptree"
version = "2.16.2"
description = "Command line utility to show dependency tree of packages."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1459,6 +1520,7 @@ test = ["covdefaults (>=2.3)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pyte
name = "pkginfo"
version = "1.10.0"
description = "Query metadata from sdists / bdists / installed packages."
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -1473,6 +1535,7 @@ testing = ["pytest", "pytest-cov", "wheel"]
name = "platformdirs"
version = "4.2.2"
description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1489,6 +1552,7 @@ type = ["mypy (>=1.8)"]
name = "plotly"
version = "5.22.0"
description = "An open-source, interactive data visualization library for Python"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -1504,6 +1568,7 @@ tenacity = ">=6.2.0"
name = "pluggy"
version = "1.5.0"
description = "plugin and hook calling mechanisms for python"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -1519,6 +1584,7 @@ testing = ["pytest", "pytest-benchmark"]
name = "pre-commit"
version = "3.5.0"
description = "A framework for managing and maintaining multi-language pre-commit hooks."
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -1537,6 +1603,7 @@ virtualenv = ">=20.10.0"
name = "psutil"
version = "6.0.0"
description = "Cross-platform lib for process and system monitoring in Python."
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7"
files = [
@ -1566,6 +1633,7 @@ test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"]
name = "py-cpuinfo"
version = "9.0.0"
description = "Get CPU info with pure Python"
category = "dev"
optional = false
python-versions = "*"
files = [
@ -1577,6 +1645,7 @@ files = [
name = "pycparser"
version = "2.22"
description = "C parser in Python"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1588,6 +1657,7 @@ files = [
name = "pydantic"
version = "2.7.4"
description = "Data validation using Python type hints"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1607,6 +1677,7 @@ email = ["email-validator (>=2.0.0)"]
name = "pydantic-core"
version = "2.18.4"
description = "Core functionality for Pydantic validation and serialization"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1698,6 +1769,7 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0"
name = "pygments"
version = "2.18.0"
description = "Pygments is a syntax highlighting package written in Python."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1712,6 +1784,7 @@ windows-terminal = ["colorama (>=0.4.6)"]
name = "pyproject-hooks"
version = "1.1.0"
description = "Wrappers to call pyproject.toml-based build backend hooks."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -1723,6 +1796,7 @@ files = [
name = "pyright"
version = "1.1.334"
description = "Command line wrapper for pyright"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -1741,6 +1815,7 @@ dev = ["twine (>=3.4.1)"]
name = "pysocks"
version = "1.7.1"
description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information."
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
files = [
@ -1753,6 +1828,7 @@ files = [
name = "pytest"
version = "7.4.4"
description = "pytest: simple powerful testing with Python"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -1775,6 +1851,7 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no
name = "pytest-asyncio"
version = "0.21.2"
description = "Pytest support for asyncio"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -1793,6 +1870,7 @@ testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy
name = "pytest-benchmark"
version = "4.0.0"
description = "A ``pytest`` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer."
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -1813,6 +1891,7 @@ histogram = ["pygal", "pygaljs"]
name = "pytest-cov"
version = "4.1.0"
description = "Pytest plugin for measuring coverage."
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -1831,6 +1910,7 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale
name = "pytest-mock"
version = "3.14.0"
description = "Thin-wrapper around the mock package for easier use with pytest"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -1848,6 +1928,7 @@ dev = ["pre-commit", "pytest-asyncio", "tox"]
name = "python-dateutil"
version = "2.9.0.post0"
description = "Extensions to the standard Python datetime module"
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
files = [
@ -1862,6 +1943,7 @@ six = ">=1.5"
name = "python-engineio"
version = "4.9.1"
description = "Engine.IO server and client for Python"
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -1881,6 +1963,7 @@ docs = ["sphinx"]
name = "python-multipart"
version = "0.0.9"
description = "A streaming multipart parser for Python"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1895,6 +1978,7 @@ dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatc
name = "python-socketio"
version = "5.11.3"
description = "Socket.IO server and client for Python"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -1915,6 +1999,7 @@ docs = ["sphinx"]
name = "pytz"
version = "2024.1"
description = "World timezone definitions, modern and historical"
category = "dev"
optional = false
python-versions = "*"
files = [
@ -1926,6 +2011,7 @@ files = [
name = "pywin32-ctypes"
version = "0.2.2"
description = "A (partial) reimplementation of pywin32 using ctypes/cffi"
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -1937,6 +2023,7 @@ files = [
name = "pyyaml"
version = "6.0.1"
description = "YAML parser and emitter for Python"
category = "dev"
optional = false
python-versions = ">=3.6"
files = [
@ -1986,6 +2073,7 @@ files = [
name = "readme-renderer"
version = "43.0"
description = "readme_renderer is a library for rendering readme descriptions for Warehouse"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2005,6 +2093,7 @@ md = ["cmarkgfm (>=0.8.0)"]
name = "redis"
version = "5.0.7"
description = "Python client for Redis database and key-value store"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2019,10 +2108,26 @@ async-timeout = {version = ">=4.0.3", markers = "python_full_version < \"3.11.3\
hiredis = ["hiredis (>=1.0.0)"]
ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"]
[[package]]
name = "reflex-chakra"
version = "0.1.1a1"
description = "reflex using chakra components"
category = "main"
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "reflex_chakra-0.1.1a1-py3-none-any.whl", hash = "sha256:e27a3ffb171802a5309a4a7215e7f894810a4a8f0753e2779b5a7010ef36173c"},
{file = "reflex_chakra-0.1.1a1.tar.gz", hash = "sha256:f224d42255fde675a65a622cdb19bff0e073edafe94b15019bfd8b21a461801c"},
]
[package.dependencies]
reflex = ">=0.5.9"
[[package]]
name = "reflex-hosting-cli"
version = "0.1.13"
description = "Reflex Hosting CLI"
category = "main"
optional = false
python-versions = "<4.0,>=3.8"
files = [
@ -2046,6 +2151,7 @@ websockets = ">=10.4"
name = "requests"
version = "2.32.3"
description = "Python HTTP for Humans."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2067,6 +2173,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
name = "requests-toolbelt"
version = "1.0.0"
description = "A utility belt for advanced users of python-requests"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
files = [
@ -2081,6 +2188,7 @@ requests = ">=2.0.1,<3.0.0"
name = "rfc3986"
version = "2.0.0"
description = "Validating URI References per RFC 3986"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2095,6 +2203,7 @@ idna2008 = ["idna"]
name = "rich"
version = "13.7.1"
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
category = "main"
optional = false
python-versions = ">=3.7.0"
files = [
@ -2114,6 +2223,7 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"]
name = "ruff"
version = "0.4.10"
description = "An extremely fast Python linter and code formatter, written in Rust."
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -2140,6 +2250,7 @@ files = [
name = "secretstorage"
version = "3.3.3"
description = "Python bindings to FreeDesktop.org Secret Service API"
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -2155,6 +2266,7 @@ jeepney = ">=0.6"
name = "selenium"
version = "4.22.0"
description = "Official Python bindings for Selenium WebDriver"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -2174,6 +2286,7 @@ websocket-client = ">=1.8.0"
name = "setuptools"
version = "70.1.1"
description = "Easily download, build, install, upgrade, and uninstall Python packages"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2189,6 +2302,7 @@ testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metad
name = "shellingham"
version = "1.5.4"
description = "Tool to Detect Surrounding Shell"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2200,6 +2314,7 @@ files = [
name = "simple-websocket"
version = "1.0.0"
description = "Simple WebSocket server and client for Python"
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -2217,6 +2332,7 @@ docs = ["sphinx"]
name = "six"
version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
files = [
@ -2228,6 +2344,7 @@ files = [
name = "sniffio"
version = "1.3.1"
description = "Sniff out which async library your code is running under"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2239,6 +2356,7 @@ files = [
name = "sortedcontainers"
version = "2.4.0"
description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set"
category = "dev"
optional = false
python-versions = "*"
files = [
@ -2250,6 +2368,7 @@ files = [
name = "sqlalchemy"
version = "2.0.31"
description = "Database Abstraction Library"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2305,7 +2424,7 @@ files = [
]
[package.dependencies]
greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"}
greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and platform_machine == \"aarch64\" or python_version < \"3.13\" and platform_machine == \"ppc64le\" or python_version < \"3.13\" and platform_machine == \"x86_64\" or python_version < \"3.13\" and platform_machine == \"amd64\" or python_version < \"3.13\" and platform_machine == \"AMD64\" or python_version < \"3.13\" and platform_machine == \"win32\" or python_version < \"3.13\" and platform_machine == \"WIN32\""}
typing-extensions = ">=4.6.0"
[package.extras]
@ -2337,6 +2456,7 @@ sqlcipher = ["sqlcipher3_binary"]
name = "sqlmodel"
version = "0.0.19"
description = "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2352,6 +2472,7 @@ SQLAlchemy = ">=2.0.14,<2.1.0"
name = "starlette"
version = "0.37.2"
description = "The little ASGI library that shines."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2370,6 +2491,7 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7
name = "starlette-admin"
version = "0.14.0"
description = "Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2393,6 +2515,7 @@ test = ["aiomysql (>=0.1.1,<0.3.0)", "aiosqlite (>=0.17.0,<0.20.0)", "arrow (>=1
name = "tabulate"
version = "0.9.0"
description = "Pretty-print tabular data"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2407,6 +2530,7 @@ widechars = ["wcwidth"]
name = "tenacity"
version = "8.4.2"
description = "Retry code until it succeeds"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -2422,6 +2546,7 @@ test = ["pytest", "tornado (>=4.5)", "typeguard"]
name = "toml"
version = "0.10.2"
description = "Python Library for Tom's Obvious, Minimal Language"
category = "dev"
optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
files = [
@ -2433,6 +2558,7 @@ files = [
name = "tomli"
version = "2.0.1"
description = "A lil' TOML parser"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2444,6 +2570,7 @@ files = [
name = "tomlkit"
version = "0.12.5"
description = "Style preserving TOML library"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2455,6 +2582,7 @@ files = [
name = "trio"
version = "0.25.1"
description = "A friendly Python library for async concurrency and I/O"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -2475,6 +2603,7 @@ sortedcontainers = "*"
name = "trio-websocket"
version = "0.11.1"
description = "WebSocket library for Trio"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -2491,6 +2620,7 @@ wsproto = ">=0.14"
name = "twine"
version = "5.1.1"
description = "Collection of utilities for publishing packages on PyPI"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2513,6 +2643,7 @@ urllib3 = ">=1.26.0"
name = "typer"
version = "0.12.3"
description = "Typer, build great CLIs. Easy to code. Based on Python type hints."
category = "main"
optional = false
python-versions = ">=3.7"
files = [
@ -2530,6 +2661,7 @@ typing-extensions = ">=3.7.4.3"
name = "typing-extensions"
version = "4.12.2"
description = "Backported and Experimental Type Hints for Python 3.8+"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2541,6 +2673,7 @@ files = [
name = "tzdata"
version = "2024.1"
description = "Provider of IANA time zone data"
category = "dev"
optional = false
python-versions = ">=2"
files = [
@ -2552,6 +2685,7 @@ files = [
name = "urllib3"
version = "2.2.2"
description = "HTTP library with thread-safe connection pooling, file post, and more."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2572,6 +2706,7 @@ zstd = ["zstandard (>=0.18.0)"]
name = "uvicorn"
version = "0.30.1"
description = "The lightning-fast ASGI server."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2591,6 +2726,7 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)",
name = "virtualenv"
version = "20.26.3"
description = "Virtual Python Environment builder"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
@ -2611,6 +2747,7 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess
name = "watchdog"
version = "4.0.1"
description = "Filesystem events monitoring"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2655,6 +2792,7 @@ watchmedo = ["PyYAML (>=3.10)"]
name = "watchfiles"
version = "0.22.0"
description = "Simple, modern and high performance file watching and code reload in python."
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2742,6 +2880,7 @@ anyio = ">=3.0.0"
name = "websocket-client"
version = "1.8.0"
description = "WebSocket client for Python with low level API options"
category = "dev"
optional = false
python-versions = ">=3.8"
files = [
@ -2758,6 +2897,7 @@ test = ["websockets"]
name = "websockets"
version = "12.0"
description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2839,6 +2979,7 @@ files = [
name = "wheel"
version = "0.43.0"
description = "A built-package format for Python"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2853,6 +2994,7 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"]
name = "wrapt"
version = "1.16.0"
description = "Module for decorators, wrappers and monkey patching."
category = "main"
optional = false
python-versions = ">=3.6"
files = [
@ -2932,6 +3074,7 @@ files = [
name = "wsproto"
version = "1.2.0"
description = "WebSockets state-machine based protocol implementation"
category = "main"
optional = false
python-versions = ">=3.7.0"
files = [
@ -2946,6 +3089,7 @@ h11 = ">=0.9.0,<1"
name = "zipp"
version = "3.19.2"
description = "Backport of pathlib-compatible object wrapper for zip files"
category = "main"
optional = false
python-versions = ">=3.8"
files = [
@ -2960,4 +3104,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools",
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "c17ccb320267b8b3a56c698bd07c2b02dda13824d4bf4b1657de752ad361e643"
content-hash = "6ccb5032cfabd61c45fd11151c91adfb3e4aae7260fadc7184248e65207d27f0"

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "reflex"
version = "0.5.8"
version = "0.5.9"
description = "Web apps in pure Python."
license = "Apache-2.0"
authors = [
@ -61,6 +61,7 @@ httpx = ">=0.25.1,<1.0"
twine = ">=4.0.0,<6.0"
tomlkit = ">=0.12.4,<1.0"
lazy_loader = ">=0.4"
reflex-chakra = ">=0.1.1a1"
[tool.poetry.group.dev.dependencies]
pytest = ">=7.1.2,<8.0"

View File

@ -23,7 +23,12 @@ export const useClientSideRouting = () => {
router.replace({
pathname: window.location.pathname,
query: window.location.search.slice(1),
})
}).then(()=>{
// Check if the current route is /404
if (router.pathname === '/404') {
setRouteNotFound(true); // Mark as an actual 404
}
})
.catch((e) => {
setRouteNotFound(true) // navigation failed, so this is a real 404
})

View File

@ -782,7 +782,7 @@ export const useEventLoop = (
// Route after the initial page hydration.
useEffect(() => {
const change_start = () => {
const main_state_dispatch = dispatch["state"]
const main_state_dispatch = dispatch["reflex___state____state"]
if (main_state_dispatch !== undefined) {
main_state_dispatch({ is_hydrated: false })
}

View File

@ -270,7 +270,7 @@ _MAPPING: dict = {
"EditorButtonList",
"EditorOptions",
],
"components": ["el", "chakra", "radix", "lucide", "recharts", "next"],
"components": ["el", "radix", "lucide", "recharts", "next"],
"components.markdown": ["markdown"],
**RADIX_MAPPING,
"components.plotly": ["plotly"],
@ -343,8 +343,27 @@ _SUBMODULES: set[str] = {
"compiler",
}
_SUBMOD_ATTRS: dict = _MAPPING
__getattr__, __dir__, __all__ = lazy_loader.attach(
getattr, __dir__, __all__ = lazy_loader.attach(
__name__,
submodules=_SUBMODULES,
submod_attrs=_SUBMOD_ATTRS,
)
def __getattr__(name):
if name == "chakra":
from reflex.utils import console
console.deprecate(
"rx.chakra",
reason="and moved to a separate package. "
"To continue using Chakra UI components, install the `reflex-chakra` package via `pip install "
"reflex-chakra`.",
deprecation_version="0.6.0",
removal_version="0.7.0",
dedupe=True,
)
import reflex_chakra as rc
return rc
return getattr(name)

View File

@ -22,7 +22,6 @@ from .admin import AdminDash as AdminDash
from .app import App as App
from .app import UploadFile as UploadFile
from .base import Base as Base
from .components import chakra as chakra
from .components import el as el
from .components import lucide as lucide
from .components import next as next

View File

@ -125,8 +125,8 @@ def default_backend_exception_handler(exception: Exception) -> EventSpec:
)
if Toaster.is_used:
return toast(
"An error occurred.",
level="error",
title="An error occurred.",
description="<br/>".join(error_message),
position="top-center",
id="backend_error",

View File

@ -16,7 +16,6 @@ _SUBMODULES: set[str] = {
"react_player",
"sonner",
"suneditor",
"chakra",
"el",
"base",
"recharts",

View File

@ -4,7 +4,6 @@
# ------------------------------------------------------
from . import base as base
from . import chakra as chakra
from . import core as core
from . import datadisplay as datadisplay
from . import el as el

View File

@ -1,204 +0,0 @@
"""Chakra components."""
from .base import *
from .datadisplay import *
from .disclosure import *
from .feedback import *
from .forms import *
from .layout import *
from .media import *
from .navigation import *
from .overlay import *
from .typography import *
accordion = Accordion.create
accordion_button = AccordionButton.create
accordion_icon = AccordionIcon.create
accordion_item = AccordionItem.create
accordion_panel = AccordionPanel.create
alert = Alert.create
alert_description = AlertDescription.create
alert_dialog = AlertDialog.create
alert_dialog_body = AlertDialogBody.create
alert_dialog_content = AlertDialogContent.create
alert_dialog_footer = AlertDialogFooter.create
alert_dialog_header = AlertDialogHeader.create
alert_dialog_overlay = AlertDialogOverlay.create
alert_icon = AlertIcon.create
alert_title = AlertTitle.create
aspect_ratio = AspectRatio.create
avatar = Avatar.create
avatar_badge = AvatarBadge.create
avatar_group = AvatarGroup.create
badge = Badge.create
box = Box.create
breadcrumb = Breadcrumb.create
breadcrumb_item = BreadcrumbItem.create
breadcrumb_link = BreadcrumbLink.create
breadcrumb_separator = BreadcrumbSeparator.create
button = Button.create
button_group = ButtonGroup.create
card = Card.create
card_body = CardBody.create
card_footer = CardFooter.create
card_header = CardHeader.create
center = Center.create
checkbox = Checkbox.create
checkbox_group = CheckboxGroup.create
circle = Circle.create
circular_progress = CircularProgress.create
circular_progress_label = CircularProgressLabel.create
code = Code.create
collapse = Collapse.create
color_mode_button = ColorModeButton.create
color_mode_icon = ColorModeIcon.create
color_mode_switch = ColorModeSwitch.create
component = Component.create
container = Container.create
date_picker = DatePicker.create
date_time_picker = DateTimePicker.create
divider = Divider.create
drawer = Drawer.create
drawer_body = DrawerBody.create
drawer_close_button = DrawerCloseButton.create
drawer_content = DrawerContent.create
drawer_footer = DrawerFooter.create
drawer_header = DrawerHeader.create
drawer_overlay = DrawerOverlay.create
editable = Editable.create
editable_input = EditableInput.create
editable_preview = EditablePreview.create
editable_textarea = EditableTextarea.create
email = Email.create
fade = Fade.create
flex = Flex.create
form = Form.create
form_control = FormControl.create
form_error_message = FormErrorMessage.create
form_helper_text = FormHelperText.create
form_label = FormLabel.create
grid = Grid.create
grid_item = GridItem.create
heading = Heading.create
highlight = Highlight.create
hstack = Hstack.create
icon = Icon.create
icon_button = IconButton.create
image = Image.create
input = Input.create
input_group = InputGroup.create
input_left_addon = InputLeftAddon.create
input_left_element = InputLeftElement.create
input_right_addon = InputRightAddon.create
input_right_element = InputRightElement.create
kbd = Kbd.create
link = Link.create
link_box = LinkBox.create
link_overlay = LinkOverlay.create
list = List.create
list_item = ListItem.create
menu = Menu.create
menu_button = MenuButton.create
menu_divider = MenuDivider.create
menu_group = MenuGroup.create
menu_item = MenuItem.create
menu_item_option = MenuItemOption.create
menu_list = MenuList.create
menu_option_group = MenuOptionGroup.create
modal = Modal.create
modal_body = ModalBody.create
modal_close_button = ModalCloseButton.create
modal_content = ModalContent.create
modal_footer = ModalFooter.create
modal_header = ModalHeader.create
modal_overlay = ModalOverlay.create
multi_select = MultiSelect.create
multi_select_option = MultiSelectOption
number_decrement_stepper = NumberDecrementStepper.create
number_increment_stepper = NumberIncrementStepper.create
number_input = NumberInput.create
number_input_field = NumberInputField.create
number_input_stepper = NumberInputStepper.create
option = Option.create
ordered_list = OrderedList.create
password = Password.create
pin_input = PinInput.create
pin_input_field = PinInputField.create
popover = Popover.create
popover_anchor = PopoverAnchor.create
popover_arrow = PopoverArrow.create
popover_body = PopoverBody.create
popover_close_button = PopoverCloseButton.create
popover_content = PopoverContent.create
popover_footer = PopoverFooter.create
popover_header = PopoverHeader.create
popover_trigger = PopoverTrigger.create
progress = Progress.create
radio = Radio.create
radio_group = RadioGroup.create
range_slider = RangeSlider.create
range_slider_filled_track = RangeSliderFilledTrack.create
range_slider_thumb = RangeSliderThumb.create
range_slider_track = RangeSliderTrack.create
responsive_grid = ResponsiveGrid.create
scale_fade = ScaleFade.create
select = Select.create
skeleton = Skeleton.create
skeleton_circle = SkeletonCircle.create
skeleton_text = SkeletonText.create
slide = Slide.create
slide_fade = SlideFade.create
slider = Slider.create
slider_filled_track = SliderFilledTrack.create
slider_mark = SliderMark.create
slider_thumb = SliderThumb.create
slider_track = SliderTrack.create
spacer = Spacer.create
span = Span.create
spinner = Spinner.create
square = Square.create
stack = Stack.create
stat = Stat.create
stat_arrow = StatArrow.create
stat_group = StatGroup.create
stat_help_text = StatHelpText.create
stat_label = StatLabel.create
stat_number = StatNumber.create
step = Step.create
step_description = StepDescription.create
step_icon = StepIcon.create
step_indicator = StepIndicator.create
step_number = StepNumber.create
step_separator = StepSeparator.create
step_status = StepStatus.create
step_title = StepTitle.create
stepper = Stepper.create
switch = Switch.create
tab = Tab.create
tab_list = TabList.create
tab_panel = TabPanel.create
tab_panels = TabPanels.create
table = Table.create
table_caption = TableCaption.create
table_container = TableContainer.create
tabs = Tabs.create
tag = Tag.create
tag_close_button = TagCloseButton.create
tag_label = TagLabel.create
tag_left_icon = TagLeftIcon.create
tag_right_icon = TagRightIcon.create
tbody = Tbody.create
td = Td.create
text = Text.create
text_area = TextArea.create
tfoot = Tfoot.create
th = Th.create
thead = Thead.create
time_picker = TimePicker.create
tooltip = Tooltip.create
tr = Tr.create
unordered_list = UnorderedList.create
visually_hidden = VisuallyHidden.create
vstack = Vstack.create
wrap = Wrap.create
wrap_item = WrapItem.create

View File

@ -1,209 +0,0 @@
"""Components that are based on Chakra-UI."""
from __future__ import annotations
from functools import lru_cache
from typing import List, Literal
from reflex.components.component import Component
from reflex.ivars.base import ImmutableVar
from reflex.utils.imports import ImportDict, ImportVar
from reflex.vars import Var
class ChakraComponent(Component):
"""A component that wraps a Chakra component."""
library: str = "@chakra-ui/react@2.6.1" # type: ignore
lib_dependencies: List[str] = [
"@chakra-ui/system@2.5.7",
"framer-motion@10.16.4",
]
@staticmethod
@lru_cache(maxsize=None)
def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
return {
(60, "ChakraProvider"): chakra_provider,
}
def _get_style(self) -> dict:
"""Get the style for the component.
Returns:
The dictionary of the component style as value and the style notation as key.
"""
return {"sx": self.style}
@classmethod
@lru_cache(maxsize=None)
def _get_dependencies_imports(cls) -> ImportDict:
"""Get the imports from lib_dependencies for installing.
Returns:
The dependencies imports of the component.
"""
return {
dep: [ImportVar(tag=None, render=False)]
for dep in [
"@chakra-ui/system@2.5.7",
"framer-motion@10.16.4",
]
}
class ChakraProvider(ChakraComponent):
"""Top level Chakra provider must be included in any app using chakra components."""
tag = "ChakraProvider"
theme: Var[str]
@classmethod
def create(cls) -> Component:
"""Create a new ChakraProvider component.
Returns:
A new ChakraProvider component.
"""
return super().create(
theme=ImmutableVar.create("extendTheme(theme)"),
)
def add_imports(self) -> ImportDict:
"""Add imports for the ChakraProvider component.
Returns:
The import dict for the component.
"""
return {
self.library: ImportVar(tag="extendTheme", is_default=False),
"/utils/theme.js": ImportVar(tag="theme", is_default=True),
}
@staticmethod
@lru_cache(maxsize=None)
def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
return {
(50, "ChakraColorModeProvider"): chakra_color_mode_provider,
}
chakra_provider = ChakraProvider.create()
class ChakraColorModeProvider(Component):
"""Next-themes integration for chakra colorModeProvider."""
library = "/components/reflex/chakra_color_mode_provider.js"
tag = "ChakraColorModeProvider"
is_default = True
chakra_color_mode_provider = ChakraColorModeProvider.create()
LiteralColorScheme = Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
]
LiteralVariant = Literal["solid", "subtle", "outline"]
LiteralDividerVariant = Literal["solid", "dashed"]
LiteralTheme = Literal["light", "dark"]
LiteralTagColorScheme = Literal[
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
]
LiteralTagAlign = Literal["center", "end", "start"]
LiteralTabsVariant = Literal[
"line",
"enclosed",
"enclosed-colored",
"soft-rounded",
"solid-rounded",
"unstyled",
]
LiteralStatus = Literal["success", "info", "warning", "error"]
LiteralAlertVariant = Literal["subtle", "left-accent", "top-accent", "solid"]
LiteralButtonVariant = Literal["ghost", "outline", "solid", "link", "unstyled"]
LiteralSpinnerPlacement = Literal["start", "end"]
LiteralLanguage = Literal[
"en",
"da",
"de",
"es",
"fr",
"ja",
"ko",
"pt_br",
"ru",
"zh_cn",
"ro",
"pl",
"ckb",
"lv",
"se",
"ua",
"he",
"it",
]
LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"]
LiteralInputNumberMode = [
"text",
"search",
"none",
"tel",
"url",
"email",
"numeric",
"decimal",
]
LiteralChakraDirection = Literal["ltr", "rtl"]
LiteralCardVariant = Literal["outline", "filled", "elevated", "unstyled"]
LiteralStackDirection = Literal["row", "column"]
LiteralImageLoading = Literal["eager", "lazy"]
LiteralTagSize = Literal["sm", "md", "lg"]
LiteralSpinnerSize = Literal[Literal[LiteralTagSize], "xs", "xl"]
LiteralAvatarSize = Literal[Literal[LiteralTagSize], "xl", "xs", "2xl", "full", "2xs"]
LiteralButtonSize = Literal["sm", "md", "lg", "xs"]
# Applies to AlertDialog and Modal
LiteralAlertDialogSize = Literal[
"sm", "md", "lg", "xs", "2xl", "full", "3xl", "4xl", "5xl", "6xl"
]
LiteralDrawerSize = Literal[Literal[LiteralSpinnerSize], "xl", "full"]
LiteralMenuStrategy = Literal["fixed", "absolute"]
LiteralMenuOption = Literal["checkbox", "radio"]
LiteralPopOverTrigger = Literal["click", "hover"]
LiteralHeadingSize = Literal["lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl"]

View File

@ -1,289 +0,0 @@
"""Stub file for reflex/components/chakra/base.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.component import Component
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.utils.imports import ImportDict
from reflex.vars import Var
class ChakraComponent(Component):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ChakraComponent":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class ChakraProvider(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
theme: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ChakraProvider":
"""Create a new ChakraProvider component.
Returns:
A new ChakraProvider component.
"""
...
def add_imports(self) -> ImportDict: ...
chakra_provider = ChakraProvider.create()
class ChakraColorModeProvider(Component):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ChakraColorModeProvider":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
chakra_color_mode_provider = ChakraColorModeProvider.create()
LiteralColorScheme = Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
]
LiteralVariant = Literal["solid", "subtle", "outline"]
LiteralDividerVariant = Literal["solid", "dashed"]
LiteralTheme = Literal["light", "dark"]
LiteralTagColorScheme = Literal[
"gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink"
]
LiteralTagAlign = Literal["center", "end", "start"]
LiteralTabsVariant = Literal[
"line", "enclosed", "enclosed-colored", "soft-rounded", "solid-rounded", "unstyled"
]
LiteralStatus = Literal["success", "info", "warning", "error"]
LiteralAlertVariant = Literal["subtle", "left-accent", "top-accent", "solid"]
LiteralButtonVariant = Literal["ghost", "outline", "solid", "link", "unstyled"]
LiteralSpinnerPlacement = Literal["start", "end"]
LiteralLanguage = Literal[
"en",
"da",
"de",
"es",
"fr",
"ja",
"ko",
"pt_br",
"ru",
"zh_cn",
"ro",
"pl",
"ckb",
"lv",
"se",
"ua",
"he",
"it",
]
LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"]
LiteralInputNumberMode = [
"text",
"search",
"none",
"tel",
"url",
"email",
"numeric",
"decimal",
]
LiteralChakraDirection = Literal["ltr", "rtl"]
LiteralCardVariant = Literal["outline", "filled", "elevated", "unstyled"]
LiteralStackDirection = Literal["row", "column"]
LiteralImageLoading = Literal["eager", "lazy"]
LiteralTagSize = Literal["sm", "md", "lg"]
LiteralSpinnerSize = Literal[Literal[LiteralTagSize], "xs", "xl"]
LiteralAvatarSize = Literal[Literal[LiteralTagSize], "xl", "xs", "2xl", "full", "2xs"]
LiteralButtonSize = Literal["sm", "md", "lg", "xs"]
LiteralAlertDialogSize = Literal[
"sm", "md", "lg", "xs", "2xl", "full", "3xl", "4xl", "5xl", "6xl"
]
LiteralDrawerSize = Literal[Literal[LiteralSpinnerSize], "xl", "full"]
LiteralMenuStrategy = Literal["fixed", "absolute"]
LiteralMenuOption = Literal["checkbox", "radio"]
LiteralPopOverTrigger = Literal["click", "hover"]
LiteralHeadingSize = Literal["lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl"]

View File

@ -1,10 +0,0 @@
"""Data display components."""
from .badge import Badge
from .code import Code
from .divider import Divider
from .keyboard_key import KeyboardKey as Kbd
from .list import List, ListItem, OrderedList, UnorderedList
from .stat import Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber
from .table import Table, TableCaption, TableContainer, Tbody, Td, Tfoot, Th, Thead, Tr
from .tag import Tag, TagCloseButton, TagLabel, TagLeftIcon, TagRightIcon

View File

@ -1,16 +0,0 @@
"""Badge component."""
from reflex.components.chakra import ChakraComponent, LiteralVariant
from reflex.vars import Var
class Badge(ChakraComponent):
"""A badge component."""
tag = "Badge"
# Variant of the badge ("solid" | "subtle" | "outline")
variant: Var[LiteralVariant]
# The color of the badge
color_scheme: Var[str]

View File

@ -1,86 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/badge.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Badge(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
variant: Optional[
Union[
Var[Literal["solid", "subtle", "outline"]],
Literal["solid", "subtle", "outline"],
]
] = None,
color_scheme: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Badge":
"""Create the component.
Args:
*children: The children of the component.
variant: Variant of the badge ("solid" | "subtle" | "outline")
color_scheme: The color of the badge
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,11 +0,0 @@
"""A code component."""
from reflex.components.chakra import (
ChakraComponent,
)
class Code(ChakraComponent):
"""Used to display inline code."""
tag = "Code"

View File

@ -1,77 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/code.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Code(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Code":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,20 +0,0 @@
"""A line to divide parts of the layout."""
from typing import Literal
from reflex.components.chakra import ChakraComponent, LiteralDividerVariant
from reflex.vars import Var
LiteralLayout = Literal["horizontal", "vertical"]
class Divider(ChakraComponent):
"""Dividers are used to visually separate content in a list or group."""
tag = "Divider"
# Pass the orientation prop and set it to either horizontal or vertical. If the vertical orientation is used, make sure that the parent element is assigned a height.
orientation: Var[LiteralLayout]
# Variant of the divider ("solid" | "dashed")
variant: Var[LiteralDividerVariant]

View File

@ -1,90 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/divider.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
LiteralLayout = Literal["horizontal", "vertical"]
class Divider(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
orientation: Optional[
Union[
Var[Literal["horizontal", "vertical"]],
Literal["horizontal", "vertical"],
]
] = None,
variant: Optional[
Union[Var[Literal["solid", "dashed"]], Literal["solid", "dashed"]]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Divider":
"""Create the component.
Args:
*children: The children of the component.
orientation: Pass the orientation prop and set it to either horizontal or vertical. If the vertical orientation is used, make sure that the parent element is assigned a height.
variant: Variant of the divider ("solid" | "dashed")
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,9 +0,0 @@
"""A Keyboard Key Component."""
from reflex.components.chakra import ChakraComponent
class KeyboardKey(ChakraComponent):
"""Display a keyboard key text."""
tag = "Kbd"

View File

@ -1,77 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/keyboard_key.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class KeyboardKey(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "KeyboardKey":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,60 +0,0 @@
"""List components."""
from __future__ import annotations
from reflex.components.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.components.core.foreach import Foreach
from reflex.vars import Var
class List(ChakraComponent):
"""Display a list of items."""
tag = "List"
# The space between each list item
spacing: Var[str]
# Shorthand prop for listStylePosition
style_position: Var[str]
# Shorthand prop for listStyleType
style_type: Var[str]
@classmethod
def create(cls, *children, items: Var[list] | None = None, **props) -> Component:
"""Create a list component.
Args:
*children: The children of the component.
items: A list of items to add to the list.
**props: The properties of the component.
Returns:
The list component.
"""
if len(children) == 0:
if isinstance(items, Var):
children = [Foreach.create(items, ListItem.create)]
else:
children = [ListItem.create(item) for item in items or []]
return super().create(*children, **props)
class ListItem(ChakraComponent):
"""A single list item."""
tag = "ListItem"
class OrderedList(List):
"""An ordered list component with numbers."""
tag = "OrderedList"
class UnorderedList(List):
"""An unordered list component with bullets."""
tag = "UnorderedList"

View File

@ -1,299 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/list.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class List(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
items: Optional[Union[Var[list], list]] = None,
spacing: Optional[Union[Var[str], str]] = None,
style_position: Optional[Union[Var[str], str]] = None,
style_type: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "List":
"""Create a list component.
Args:
*children: The children of the component.
items: A list of items to add to the list.
spacing: The space between each list item
style_position: Shorthand prop for listStylePosition
style_type: Shorthand prop for listStyleType
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The list component.
"""
...
class ListItem(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ListItem":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class OrderedList(List):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
items: Optional[Union[Var[list], list]] = None,
spacing: Optional[Union[Var[str], str]] = None,
style_position: Optional[Union[Var[str], str]] = None,
style_type: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "OrderedList":
"""Create a list component.
Args:
*children: The children of the component.
items: A list of items to add to the list.
spacing: The space between each list item
style_position: Shorthand prop for listStylePosition
style_type: Shorthand prop for listStyleType
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The list component.
"""
...
class UnorderedList(List):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
items: Optional[Union[Var[list], list]] = None,
spacing: Optional[Union[Var[str], str]] = None,
style_position: Optional[Union[Var[str], str]] = None,
style_type: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "UnorderedList":
"""Create a list component.
Args:
*children: The children of the component.
items: A list of items to add to the list.
spacing: The space between each list item
style_position: Shorthand prop for listStylePosition
style_type: Shorthand prop for listStyleType
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The list component.
"""
...

View File

@ -1,80 +0,0 @@
"""Statistics components."""
from reflex.components.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var
class Stat(ChakraComponent):
"""The Stat component is used to display some statistics. It can take in a label, a number and a help text."""
tag = "Stat"
@classmethod
def create(
cls, *children, label=None, number=0, help_text=None, arrow_type=None, **props
) -> Component:
"""Create a stat component.
Args:
*children: The children of the component.
label: A label for the stat component.
number: The value of the stat component.
help_text: A text added to the stat component.
arrow_type: The type of the arrow ("increase", "decrease", None)
**props: The properties of the component.
Returns:
The stat component.
"""
if len(children) == 0:
children = []
if label:
children.append(StatLabel.create(label))
children.append(StatNumber.create(number))
if help_text:
if arrow_type:
children.append(
StatHelpText.create(
help_text, StatArrow.create(type_=arrow_type)
)
)
else:
children.append(StatHelpText.create(help_text))
return super().create(*children, **props)
class StatLabel(ChakraComponent):
"""A stat label component."""
tag = "StatLabel"
class StatNumber(ChakraComponent):
"""The stat to display."""
tag = "StatNumber"
class StatHelpText(ChakraComponent):
"""A helper text to display under the stat."""
tag = "StatHelpText"
class StatArrow(ChakraComponent):
"""A stat arrow component indicating the direction of change."""
tag = "StatArrow"
# The type of arrow, either increase or decrease.
type_: Var[str]
class StatGroup(ChakraComponent):
"""A stat group component to evenly space out the stats."""
tag = "StatGroup"

View File

@ -1,417 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/stat.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Stat(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
label=None,
number=0,
help_text=None,
arrow_type=None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Stat":
"""Create a stat component.
Args:
*children: The children of the component.
label: A label for the stat component.
number: The value of the stat component.
help_text: A text added to the stat component.
arrow_type: The type of the arrow ("increase", "decrease", None)
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The stat component.
"""
...
class StatLabel(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "StatLabel":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class StatNumber(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "StatNumber":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class StatHelpText(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "StatHelpText":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class StatArrow(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
type_: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "StatArrow":
"""Create the component.
Args:
*children: The children of the component.
type_: The type of arrow, either increase or decrease.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class StatGroup(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "StatGroup":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,305 +0,0 @@
"""Table components."""
from typing import List, Tuple
from reflex.components.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.components.core.foreach import Foreach
from reflex.utils import types
from reflex.vars import Var
class Table(ChakraComponent):
"""A table component."""
tag = "Table"
# The color scheme of the table
color_scheme: Var[str]
# The variant of the table style to use
variant: Var[str]
# The size of the table
size: Var[str]
# The placement of the table caption.
placement: Var[str]
@classmethod
def create(
cls, *children, caption=None, headers=None, rows=None, footers=None, **props
) -> Component:
"""Create a table component.
Args:
*children: The children of the component.
caption: The caption of the table component.
headers: The headers of the table component.
rows: The rows of the table component.
footers: The footers of the table component.
**props: The properties of the component.
Returns:
The table component.
"""
if len(children) == 0:
children = []
if caption is not None:
children.append(TableCaption.create(caption))
if headers is not None:
children.append(Thead.create(headers=headers))
if rows is not None:
children.append(Tbody.create(rows=rows))
if footers is not None:
children.append(Tfoot.create(footers=footers))
return super().create(*children, **props)
class Thead(ChakraComponent):
"""A table header component."""
tag = "Thead"
# invalid children components
_invalid_children: List[str] = ["Tbody", "Thead", "Tfoot"]
@classmethod
def create(cls, *children, headers=None, **props) -> Component:
"""Create a table header component.
Args:
*children: The children of the component.
headers (list, optional): List of headers. Defaults to None.
**props: The properties of the component.
Returns:
The table header component.
"""
if len(children) == 0:
cls.validate_headers(headers)
children = [Tr.create(cell_type="header", cells=headers)]
return super().create(*children, **props)
@staticmethod
def validate_headers(headers):
"""Type checking for table headers.
Args:
headers: The table headers.
Raises:
TypeError: If headers are not of type list or type tuple.
"""
allowed_types = (list, tuple)
if (
(
isinstance(headers, Var)
and not types.check_type_in_allowed_types(
headers._var_type, allowed_types
)
)
or not isinstance(headers, Var)
and not types.check_type_in_allowed_types(type(headers), allowed_types)
):
raise TypeError("table headers should be a list or tuple")
class Tbody(ChakraComponent):
"""A table body component."""
tag = "Tbody"
# invalid children components
_invalid_children: List[str] = ["Tbody", "Thead", "Tfoot", "Td", "Th"]
@classmethod
def create(cls, *children, rows=None, **props) -> Component:
"""Create a table body component.
Args:
*children: The children of the component.
rows (list[list], optional): The rows of the table body. Defaults to None.
**props: The properties of the component.
Returns:
Component: The table body component
"""
if len(children) == 0:
cls.validate_rows(rows) if rows is not None else None
if isinstance(rows, Var):
children = [
Foreach.create(
rows, lambda row: Tr.create(cell_type="data", cells=row)
)
]
else:
children = [
Tr.create(cell_type="data", cells=row) for row in rows or []
]
return super().create(*children, **props)
@staticmethod
def validate_rows(rows):
"""Type checking for table rows.
Args:
rows: Table rows.
Raises:
TypeError: If rows are not lists or tuples containing inner lists or tuples.
"""
allowed_subclasses = (List, Tuple)
if isinstance(rows, Var):
outer_type = rows._var_type
inner_type = (
outer_type.__args__[0] if hasattr(outer_type, "__args__") else None
)
# check that the outer container and inner container types are lists or tuples.
if not (
types._issubclass(types.get_base_class(outer_type), allowed_subclasses)
and (
inner_type is None
or types._issubclass(
types.get_base_class(inner_type), allowed_subclasses
)
)
):
raise TypeError(
f"table rows should be a list or tuple containing inner lists or tuples. Got {outer_type} instead"
)
elif not (
types._issubclass(type(rows), allowed_subclasses)
and (not rows or types._issubclass(type(rows[0]), allowed_subclasses))
):
raise TypeError(
"table rows should be a list or tuple containing inner lists or tuples."
)
class Tfoot(ChakraComponent):
"""A table footer component."""
tag = "Tfoot"
# invalid children components
_invalid_children: List[str] = ["Tbody", "Thead", "Td", "Th", "Tfoot"]
@classmethod
def create(cls, *children, footers=None, **props) -> Component:
"""Create a table footer component.
Args:
*children: The children of the component.
footers (list, optional): List of footers. Defaults to None.
**props: The properties of the component.
Returns:
The table footer component.
"""
if len(children) == 0:
cls.validate_footers(footers)
children = [Tr.create(cell_type="header", cells=footers)]
return super().create(*children, **props)
@staticmethod
def validate_footers(footers):
"""Type checking for table footers.
Args:
footers: Table rows.
Raises:
TypeError: If footers are not of type list.
"""
allowed_types = (list, tuple)
if (
(
isinstance(footers, Var)
and not types.check_type_in_allowed_types(
footers._var_type, allowed_types
)
)
or not isinstance(footers, Var)
and not types.check_type_in_allowed_types(type(footers), allowed_types)
):
raise TypeError("table headers should be a list or tuple")
class Tr(ChakraComponent):
"""A table row component."""
tag = "Tr"
# invalid children components
_invalid_children: List[str] = ["Tbody", "Thead", "Tfoot", "Tr"]
@classmethod
def create(cls, *children, cell_type: str = "", cells=None, **props) -> Component:
"""Create a table row component.
Args:
*children: The children of the component.
cell_type: the type of cells in this table row. "header" or "data". Defaults to None.
cells: The cells value to add in the table row. Defaults to None.
**props: The properties of the component.
Returns:
The table row component
"""
types = {"header": Th, "data": Td}
cell_cls = types.get(cell_type)
if len(children) == 0 and cell_cls:
if isinstance(cells, Var):
children = [Foreach.create(cells, cell_cls.create)]
else:
children = [cell_cls.create(cell) for cell in cells or []]
return super().create(*children, **props)
class Th(ChakraComponent):
"""A table header cell component."""
tag = "Th"
# invalid children components
_invalid_children: List[str] = ["Tbody", "Thead", "Tr", "Td", "Th"]
# Aligns the cell content to the right.
is_numeric: Var[bool]
class Td(ChakraComponent):
"""A table data cell component."""
tag = "Td"
# invalid children components
_invalid_children: List[str] = ["Tbody", "Thead"]
# Aligns the cell content to the right.
is_numeric: Var[bool]
class TableCaption(ChakraComponent):
"""A table caption component."""
tag = "TableCaption"
# The placement of the table caption. This sets the `caption-side` CSS attribute.
placement: Var[str]
class TableContainer(ChakraComponent):
"""The table container component renders a div that wraps the table component."""
tag = "TableContainer"

View File

@ -1,647 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/table.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Table(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
caption=None,
headers=None,
rows=None,
footers=None,
color_scheme: Optional[Union[Var[str], str]] = None,
variant: Optional[Union[Var[str], str]] = None,
size: Optional[Union[Var[str], str]] = None,
placement: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Table":
"""Create a table component.
Args:
*children: The children of the component.
caption: The caption of the table component.
headers: The headers of the table component.
rows: The rows of the table component.
footers: The footers of the table component.
color_scheme: The color scheme of the table
variant: The variant of the table style to use
size: The size of the table
placement: The placement of the table caption.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The table component.
"""
...
class Thead(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
headers=None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Thead":
"""Create a table header component.
Args:
*children: The children of the component.
headers (list, optional): List of headers. Defaults to None.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The table header component.
"""
...
@staticmethod
def validate_headers(headers): ...
class Tbody(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
rows=None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Tbody":
"""Create a table body component.
Args:
*children: The children of the component.
rows (list[list], optional): The rows of the table body. Defaults to None.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
Component: The table body component
"""
...
@staticmethod
def validate_rows(rows): ...
class Tfoot(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
footers=None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Tfoot":
"""Create a table footer component.
Args:
*children: The children of the component.
footers (list, optional): List of footers. Defaults to None.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The table footer component.
"""
...
@staticmethod
def validate_footers(footers): ...
class Tr(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
cell_type: Optional[str] = "",
cells=None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Tr":
"""Create a table row component.
Args:
*children: The children of the component.
cell_type: the type of cells in this table row. "header" or "data". Defaults to None.
cells: The cells value to add in the table row. Defaults to None.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The table row component
"""
...
class Th(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
is_numeric: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Th":
"""Create the component.
Args:
*children: The children of the component.
is_numeric: Aligns the cell content to the right.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class Td(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
is_numeric: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Td":
"""Create the component.
Args:
*children: The children of the component.
is_numeric: Aligns the cell content to the right.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TableCaption(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
placement: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TableCaption":
"""Create the component.
Args:
*children: The children of the component.
placement: The placement of the table caption. This sets the `caption-side` CSS attribute.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TableContainer(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TableContainer":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,85 +0,0 @@
"""Chakra Tag Component."""
from typing import Optional
from reflex.components.chakra import (
ChakraComponent,
LiteralTagColorScheme,
LiteralTagSize,
LiteralVariant,
)
from reflex.components.component import Component
from reflex.vars import Var
class TagLabel(ChakraComponent):
"""The label of the tag."""
tag = "TagLabel"
class TagLeftIcon(ChakraComponent):
"""The left icon of the tag."""
tag = "TagLeftIcon"
class TagRightIcon(ChakraComponent):
"""The right icon of the tag."""
tag = "TagRightIcon"
class TagCloseButton(ChakraComponent):
"""The close button of the tag."""
tag = "TagCloseButton"
class Tag(ChakraComponent):
"""The parent wrapper that provides context for its children."""
tag = "Tag"
# The visual color appearance of the tag.
# options: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" |
# "cyan" | "purple" | "pink"
# default: "gray"
color_scheme: Var[LiteralTagColorScheme]
# The size of the tag
# options: "sm" | "md" | "lg"
# default: "md"
size: Var[LiteralTagSize]
# The variant of the tag
# options: "solid" | "subtle" | "outline"
# default: "solid"
variant: Var[LiteralVariant]
@classmethod
def create(
cls,
label: Component,
*,
left_icon: Optional[Component] = None,
right_icon: Optional[Component] = None,
close_button: Optional[Component] = None,
**props,
) -> Component:
"""Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it.
Args:
label (Component): The label of the Tag that will be created.
left_icon (Optional[Component]): Should be a rx.TagLeftIcon instance.
right_icon (Optional[Component]): Should be a rx.TagRightIcon instance.
close_button (Optional[Component]): Should be a rx.TagCloseButton instance.
props: The properties to be passed to the component.
Returns:
The `create()` method returns a Tag object.
"""
children = [
x for x in (left_icon, label, right_icon, close_button) if x is not None
]
return super().create(*children, **props)

View File

@ -1,383 +0,0 @@
"""Stub file for reflex/components/chakra/datadisplay/tag.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import (
ChakraComponent,
)
from reflex.components.component import Component
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class TagLabel(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TagLabel":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TagLeftIcon(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TagLeftIcon":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TagRightIcon(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TagRightIcon":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TagCloseButton(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TagCloseButton":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class Tag(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
left_icon: Optional[Component] = None,
right_icon: Optional[Component] = None,
close_button: Optional[Component] = None,
color_scheme: Optional[
Union[
Var[
Literal[
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
]
],
Literal[
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg"]], Literal["sm", "md", "lg"]]
] = None,
variant: Optional[
Union[
Var[Literal["solid", "subtle", "outline"]],
Literal["solid", "subtle", "outline"],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Tag":
"""Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it.
Args:
label (Component): The label of the Tag that will be created.
left_icon (Optional[Component]): Should be a rx.TagLeftIcon instance.
right_icon (Optional[Component]): Should be a rx.TagRightIcon instance.
close_button (Optional[Component]): Should be a rx.TagCloseButton instance.
props: The properties to be passed to the component.
Returns:
The `create()` method returns a Tag object.
"""
...

View File

@ -1,14 +0,0 @@
"""Disclosure components."""
from .accordion import (
Accordion,
AccordionButton,
AccordionIcon,
AccordionItem,
AccordionPanel,
)
from .tabs import Tab, TabList, TabPanel, TabPanels, Tabs
from .transition import Collapse, Fade, ScaleFade, Slide, SlideFade
from .visuallyhidden import VisuallyHidden
__all__ = [f for f in dir() if f[0].isupper()] # type: ignore

View File

@ -1,110 +0,0 @@
"""Container to stack elements with spacing."""
from typing import List, Optional, Union
from reflex.components.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var
class Accordion(ChakraComponent):
"""The wrapper that uses cloneElement to pass props to AccordionItem children."""
tag = "Accordion"
# If true, multiple accordion items can be expanded at once.
allow_multiple: Var[bool]
# If true, any expanded accordion item can be collapsed again.
allow_toggle: Var[bool]
# The initial index(es) of the expanded accordion item(s).
default_index: Var[Optional[List[int]]]
# The index(es) of the expanded accordion item
index: Var[Union[int, List[int]]]
# If true, height animation and transitions will be disabled.
reduce_motion: Var[bool]
@classmethod
def create(
cls,
*children,
items=None,
icon_pos="right",
allow_multiple: Optional[Var[bool]] = None,
allow_toggle: Optional[Var[bool]] = None,
**props,
) -> Component:
"""Create an accordion component.
Args:
*children: The children of the component.
items: The items of the accordion component: list of tuples (label,panel)
icon_pos: The position of the arrow icon of the accordion. "right", "left" or None
allow_multiple: The allow_multiple property of the accordion. (True or False)
allow_toggle: The allow_toggle property of the accordion. (True or False)
**props: The properties of the component.
Returns:
The accordion component
"""
if len(children) == 0:
children = []
if not items:
items = []
for label, panel in items:
if icon_pos == "right":
button = AccordionButton.create(label, AccordionIcon.create())
elif icon_pos == "left":
button = AccordionButton.create(AccordionIcon.create(), label)
else:
button = AccordionButton.create(label)
children.append(
AccordionItem.create(
button,
AccordionPanel.create(panel),
)
)
# if allow_multiple is True, allow_toggle is implicitely used and does not need to be defined
if allow_multiple:
props.update({"allow_multiple": allow_multiple})
elif allow_toggle:
props.update({"allow_toggle": allow_toggle})
return super().create(*children, **props)
class AccordionItem(ChakraComponent):
"""A single accordion item."""
tag = "AccordionItem"
# A unique id for the accordion item.
id_: Var[str]
# If true, the accordion item will be disabled.
is_disabled: Var[bool]
# If true, the accordion item will be focusable.
is_focusable: Var[bool]
class AccordionButton(ChakraComponent):
"""The button that toggles the expand/collapse state of the accordion item. This button must be wrapped in an element with role heading."""
tag = "AccordionButton"
class AccordionPanel(ChakraComponent):
"""The container for the details to be revealed."""
tag = "AccordionPanel"
class AccordionIcon(ChakraComponent):
"""A chevron-down icon that rotates based on the expanded/collapsed state."""
tag = "AccordionIcon"

View File

@ -1,361 +0,0 @@
"""Stub file for reflex/components/chakra/disclosure/accordion.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, List, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Accordion(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
items=None,
icon_pos="right",
allow_multiple: Optional[Union[Var[bool], bool]] = None,
allow_toggle: Optional[Union[Var[bool], bool]] = None,
default_index: Optional[Union[Var[Optional[List[int]]], List[int]]] = None,
index: Optional[Union[Var[Union[List[int], int]], int, List[int]]] = None,
reduce_motion: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Accordion":
"""Create an accordion component.
Args:
*children: The children of the component.
items: The items of the accordion component: list of tuples (label,panel)
icon_pos: The position of the arrow icon of the accordion. "right", "left" or None
allow_multiple: The allow_multiple property of the accordion. (True or False)
allow_toggle: The allow_toggle property of the accordion. (True or False)
default_index: The initial index(es) of the expanded accordion item(s).
index: The index(es) of the expanded accordion item
reduce_motion: If true, height animation and transitions will be disabled.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The accordion component
"""
...
class AccordionItem(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
id_: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_focusable: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "AccordionItem":
"""Create the component.
Args:
*children: The children of the component.
id_: A unique id for the accordion item.
is_disabled: If true, the accordion item will be disabled.
is_focusable: If true, the accordion item will be focusable.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class AccordionButton(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "AccordionButton":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class AccordionPanel(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "AccordionPanel":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class AccordionIcon(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "AccordionIcon":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,117 +0,0 @@
"""Tab components."""
from typing import List, Optional, Tuple
from reflex.components.chakra import (
ChakraComponent,
LiteralColorScheme,
LiteralTabsVariant,
LiteralTagAlign,
)
from reflex.components.component import Component
from reflex.vars import Var
class Tabs(ChakraComponent):
"""An accessible tabs component that provides keyboard interactions and ARIA attributes described in the WAI-ARIA Tabs Design Pattern. Tabs, provides context and state for all components."""
tag = "Tabs"
# The alignment of the tabs ("center" | "end" | "start").
align: Var[LiteralTagAlign]
# The initial index of the selected tab (in uncontrolled mode).
default_index: Var[int]
# The id of the tab.
id_: Var[str]
# If true, tabs will stretch to width of the tablist.
is_fitted: Var[bool]
# Performance booster. If true, rendering of the tab panel's will be deferred until it is selected.
is_lazy: Var[bool]
# If true, the tabs will be manually activated and display its panel by pressing Space or Enter. If false, the tabs will be automatically activated and their panel is displayed when they receive focus.
is_manual: Var[bool]
# The orientation of the tab list.
orientation: Var[str]
# "line" | "enclosed" | "enclosed-colored" | "soft-rounded" | "solid-rounded" | "unstyled"
variant: Var[LiteralTabsVariant]
# The color scheme of the tabs.
color_scheme: Var[LiteralColorScheme]
# Index of the selected tab (in controlled mode).
index: Var[int]
@classmethod
def create(
cls, *children, items: Optional[List[Tuple[str, str]]] = None, **props
) -> Component:
"""Create a tab component.
Args:
*children: The children of the component.
items: The items for the tabs component, a list of tuple (label, panel)
**props: The properties of the component.
Returns:
The tab component
"""
if len(children) == 0:
tabs = []
panels = []
if not items:
items = []
for label, panel in items:
tabs.append(Tab.create(label))
panels.append(TabPanel.create(panel))
children = [TabList.create(*tabs), TabPanels.create(*panels)] # type: ignore
return super().create(*children, **props)
class Tab(ChakraComponent):
"""An element that serves as a label for one of the tab panels and can be activated to display that panel.."""
tag = "Tab"
# If true, the Tab won't be toggleable.
is_disabled: Var[bool]
# If true, the Tab will be selected.
is_selected: Var[bool]
# The id of the tab.
id_: Var[str]
# The id of the panel.
panel_id: Var[str]
_valid_parents: List[str] = ["TabList"]
class TabList(ChakraComponent):
"""Wrapper for the Tab components."""
tag = "TabList"
_valid_parents: List[str] = ["Tabs"]
class TabPanels(ChakraComponent):
"""Wrapper for the Tab components."""
tag = "TabPanels"
_valid_parents: List[str] = ["Tabs"]
class TabPanel(ChakraComponent):
"""An element that contains the content associated with a tab."""
tag = "TabPanel"
_valid_parents: List[str] = ["TabPanels"]

View File

@ -1,446 +0,0 @@
"""Stub file for reflex/components/chakra/disclosure/tabs.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union, overload
from reflex.components.chakra import (
ChakraComponent,
)
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Tabs(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
items: Optional[List[Tuple[str, str]]] = None,
align: Optional[
Union[
Var[Literal["center", "end", "start"]],
Literal["center", "end", "start"],
]
] = None,
default_index: Optional[Union[Var[int], int]] = None,
id_: Optional[Union[Var[str], str]] = None,
is_fitted: Optional[Union[Var[bool], bool]] = None,
is_lazy: Optional[Union[Var[bool], bool]] = None,
is_manual: Optional[Union[Var[bool], bool]] = None,
orientation: Optional[Union[Var[str], str]] = None,
variant: Optional[
Union[
Var[
Literal[
"line",
"enclosed",
"enclosed-colored",
"soft-rounded",
"solid-rounded",
"unstyled",
]
],
Literal[
"line",
"enclosed",
"enclosed-colored",
"soft-rounded",
"solid-rounded",
"unstyled",
],
]
] = None,
color_scheme: Optional[
Union[
Var[
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
]
],
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
],
]
] = None,
index: Optional[Union[Var[int], int]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Tabs":
"""Create a tab component.
Args:
*children: The children of the component.
items: The items for the tabs component, a list of tuple (label, panel)
align: The alignment of the tabs ("center" | "end" | "start").
default_index: The initial index of the selected tab (in uncontrolled mode).
id_: The id of the tab.
is_fitted: If true, tabs will stretch to width of the tablist.
is_lazy: Performance booster. If true, rendering of the tab panel's will be deferred until it is selected.
is_manual: If true, the tabs will be manually activated and display its panel by pressing Space or Enter. If false, the tabs will be automatically activated and their panel is displayed when they receive focus.
orientation: The orientation of the tab list.
variant: "line" | "enclosed" | "enclosed-colored" | "soft-rounded" | "solid-rounded" | "unstyled"
color_scheme: The color scheme of the tabs.
index: Index of the selected tab (in controlled mode).
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The tab component
"""
...
class Tab(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_selected: Optional[Union[Var[bool], bool]] = None,
id_: Optional[Union[Var[str], str]] = None,
panel_id: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Tab":
"""Create the component.
Args:
*children: The children of the component.
is_disabled: If true, the Tab won't be toggleable.
is_selected: If true, the Tab will be selected.
id_: The id of the tab.
panel_id: The id of the panel.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TabList(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TabList":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TabPanels(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TabPanels":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class TabPanel(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "TabPanel":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,73 +0,0 @@
"""A transition Component."""
from typing import Union
from reflex.components.chakra import ChakraComponent
from reflex.vars import Var
class Transition(ChakraComponent):
"""Base componemt of all transitions."""
# Show the component; triggers when enter or exit states
in_: Var[bool]
# If true, the element will unmount when `in={false}` and animation is done
unmount_on_exit: Var[bool]
class Fade(Transition):
"""Fade component cab be used show and hide content of your app."""
tag = "Fade"
class ScaleFade(Transition):
"""Fade component can be scaled and reverse your app."""
tag = "ScaleFade"
# The initial scale of the element
initial_scale: Var[float]
# If true, the element will transition back to exit state
reverse: Var[bool]
class Slide(Transition):
"""Side can be used show content below your app."""
tag = "Slide"
# The direction to slide from
direction: Var[str]
class SlideFade(Transition):
"""SlideFade component."""
tag = "SlideFade"
# The offset on the horizontal or x axis
offsetX: Var[Union[str, int]]
# The offset on the vertical or y axis
offsetY: Var[Union[str, int]]
# If true, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out
reverse: Var[bool]
class Collapse(Transition):
"""Collapse component can collapse some content."""
tag = "Collapse"
# If true, the opacity of the content will be animated
animateOpacity: Var[bool]
# The height you want the content in its expanded state.
endingHeight: Var[str]
# The height you want the content in its collapsed state.
startingHeight: Var[Union[str, int]]

View File

@ -1,449 +0,0 @@
"""Stub file for reflex/components/chakra/disclosure/transition.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Transition(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
in_: Optional[Union[Var[bool], bool]] = None,
unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Transition":
"""Create the component.
Args:
*children: The children of the component.
in_: Show the component; triggers when enter or exit states
unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class Fade(Transition):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
in_: Optional[Union[Var[bool], bool]] = None,
unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Fade":
"""Create the component.
Args:
*children: The children of the component.
in_: Show the component; triggers when enter or exit states
unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class ScaleFade(Transition):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
initial_scale: Optional[Union[Var[float], float]] = None,
reverse: Optional[Union[Var[bool], bool]] = None,
in_: Optional[Union[Var[bool], bool]] = None,
unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ScaleFade":
"""Create the component.
Args:
*children: The children of the component.
initial_scale: The initial scale of the element
reverse: If true, the element will transition back to exit state
in_: Show the component; triggers when enter or exit states
unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class Slide(Transition):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
direction: Optional[Union[Var[str], str]] = None,
in_: Optional[Union[Var[bool], bool]] = None,
unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Slide":
"""Create the component.
Args:
*children: The children of the component.
direction: The direction to slide from
in_: Show the component; triggers when enter or exit states
unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class SlideFade(Transition):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
offsetX: Optional[Union[Var[Union[int, str]], str, int]] = None,
offsetY: Optional[Union[Var[Union[int, str]], str, int]] = None,
reverse: Optional[Union[Var[bool], bool]] = None,
in_: Optional[Union[Var[bool], bool]] = None,
unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "SlideFade":
"""Create the component.
Args:
*children: The children of the component.
offsetX: The offset on the horizontal or x axis
offsetY: The offset on the vertical or y axis
reverse: If true, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out
in_: Show the component; triggers when enter or exit states
unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class Collapse(Transition):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
animateOpacity: Optional[Union[Var[bool], bool]] = None,
endingHeight: Optional[Union[Var[str], str]] = None,
startingHeight: Optional[Union[Var[Union[int, str]], str, int]] = None,
in_: Optional[Union[Var[bool], bool]] = None,
unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Collapse":
"""Create the component.
Args:
*children: The children of the component.
animateOpacity: If true, the opacity of the content will be animated
endingHeight: The height you want the content in its expanded state.
startingHeight: The height you want the content in its collapsed state.
in_: Show the component; triggers when enter or exit states
unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,9 +0,0 @@
"""A component to display visually hidden text."""
from reflex.components.chakra import ChakraComponent
class VisuallyHidden(ChakraComponent):
"""A component that visually hides content while still allowing it to be read by screen readers."""
tag = "VisuallyHidden"

View File

@ -1,77 +0,0 @@
"""Stub file for reflex/components/chakra/disclosure/visuallyhidden.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class VisuallyHidden(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "VisuallyHidden":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,7 +0,0 @@
"""Convenience functions to define core components."""
from .alert import Alert, AlertDescription, AlertIcon, AlertTitle
from .circularprogress import CircularProgress, CircularProgressLabel
from .progress import Progress
from .skeleton import Skeleton, SkeletonCircle, SkeletonText
from .spinner import Spinner

View File

@ -1,68 +0,0 @@
"""Alert components."""
from reflex.components.chakra import (
ChakraComponent,
LiteralAlertVariant,
LiteralStatus,
)
from reflex.components.component import Component
from reflex.vars import Var
class Alert(ChakraComponent):
"""An alert feedback box."""
tag = "Alert"
# The status of the alert ("success" | "info" | "warning" | "error")
status: Var[LiteralStatus]
# "subtle" | "left-accent" | "top-accent" | "solid"
variant: Var[LiteralAlertVariant]
@classmethod
def create(
cls, *children, icon=True, title="Alert title", desc=None, **props
) -> Component:
"""Create an alert component.
Args:
*children: The children of the component.
icon: The icon of the alert.
title: The title of the alert.
desc: The description of the alert
**props: The properties of the component.
Returns:
The alert component.
"""
if len(children) == 0:
children = []
if icon:
children.append(AlertIcon.create())
children.append(AlertTitle.create(title))
if desc:
children.append(AlertDescription.create(desc))
return super().create(*children, **props)
class AlertIcon(ChakraComponent):
"""An icon displayed in the alert."""
tag = "AlertIcon"
class AlertTitle(ChakraComponent):
"""The title of the alert."""
tag = "AlertTitle"
class AlertDescription(ChakraComponent):
"""AlertDescription composes the Box component."""
tag = "AlertDescription"

View File

@ -1,295 +0,0 @@
"""Stub file for reflex/components/chakra/feedback/alert.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Alert(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
icon=True,
title="Alert title",
desc=None,
status: Optional[
Union[
Var[Literal["success", "info", "warning", "error"]],
Literal["success", "info", "warning", "error"],
]
] = None,
variant: Optional[
Union[
Var[Literal["subtle", "left-accent", "top-accent", "solid"]],
Literal["subtle", "left-accent", "top-accent", "solid"],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Alert":
"""Create an alert component.
Args:
*children: The children of the component.
icon: The icon of the alert.
title: The title of the alert.
desc: The description of the alert
status: The status of the alert ("success" | "info" | "warning" | "error")
variant: "subtle" | "left-accent" | "top-accent" | "solid"
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The alert component.
"""
...
class AlertIcon(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "AlertIcon":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class AlertTitle(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "AlertTitle":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class AlertDescription(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "AlertDescription":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,68 +0,0 @@
"""Container to stack elements with spacing."""
from typing import Union
from reflex.components.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var
class CircularProgress(ChakraComponent):
"""The CircularProgress component is used to indicate the progress for determinate and indeterminate processes."""
tag = "CircularProgress"
# If true, the cap of the progress indicator will be rounded.
cap_is_round: Var[bool]
# If true, the progress will be indeterminate and the value prop will be ignored
is_indeterminate: Var[bool]
# Maximum value defining 100% progress made (must be higher than 'min')
max_: Var[int]
# Minimum value defining 'no progress' (must be lower than 'max')
min_: Var[int]
# This defines the stroke width of the svg circle.
thickness: Var[Union[str, int]]
# The color name of the progress track. Use a color key in the theme object
track_color: Var[str]
# Current progress (must be between min/max).
value: Var[int]
# The desired valueText to use in place of the value.
value_text: Var[str]
# The color name of the progress bar
color: Var[str]
# The size of the circular progress
size: Var[str]
@classmethod
def create(cls, *children, label=None, **props) -> Component:
"""Create a circular progress component.
Args:
*children: the children of the component.
label: A label to add in the circular progress. Defaults to None.
**props: the props of the component.
Returns:
The circular progress component.
"""
if len(children) == 0:
children = []
if label is not None:
children.append(CircularProgressLabel.create(label))
return super().create(*children, **props)
class CircularProgressLabel(ChakraComponent):
"""Label of CircularProcess."""
tag = "CircularProgressLabel"

View File

@ -1,165 +0,0 @@
"""Stub file for reflex/components/chakra/feedback/circularprogress.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class CircularProgress(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
label=None,
cap_is_round: Optional[Union[Var[bool], bool]] = None,
is_indeterminate: Optional[Union[Var[bool], bool]] = None,
max_: Optional[Union[Var[int], int]] = None,
min_: Optional[Union[Var[int], int]] = None,
thickness: Optional[Union[Var[Union[int, str]], str, int]] = None,
track_color: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[int], int]] = None,
value_text: Optional[Union[Var[str], str]] = None,
color: Optional[Union[Var[str], str]] = None,
size: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "CircularProgress":
"""Create a circular progress component.
Args:
*children: the children of the component.
label: A label to add in the circular progress. Defaults to None.
cap_is_round: If true, the cap of the progress indicator will be rounded.
is_indeterminate: If true, the progress will be indeterminate and the value prop will be ignored
max_: Maximum value defining 100% progress made (must be higher than 'min')
min_: Minimum value defining 'no progress' (must be lower than 'max')
thickness: This defines the stroke width of the svg circle.
track_color: The color name of the progress track. Use a color key in the theme object
value: Current progress (must be between min/max).
value_text: The desired valueText to use in place of the value.
color: The color name of the progress bar
size: The size of the circular progress
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: the props of the component.
Returns:
The circular progress component.
"""
...
class CircularProgressLabel(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "CircularProgressLabel":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,33 +0,0 @@
"""Container to stack elements with spacing."""
from typing import Union
from reflex.components.chakra import ChakraComponent
from reflex.vars import Var
class Progress(ChakraComponent):
"""A bar to display progress."""
tag = "Progress"
# If true, the progress bar will show stripe
has_stripe: Var[bool]
# If true, and has_stripe is true, the stripes will be animated
is_animated: Var[bool]
# If true, the progress will be indeterminate and the value prop will be ignored
is_indeterminate: Var[bool]
# The maximum value of the progress
max_: Var[int]
# The minimum value of the progress
min_: Var[int]
# The value of the progress indicator. If undefined the progress bar will be in indeterminate state
value: Var[Union[int, float]]
# The color scheme of the progress bar.
color_scheme: Var[str]

View File

@ -1,91 +0,0 @@
"""Stub file for reflex/components/chakra/feedback/progress.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Progress(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
has_stripe: Optional[Union[Var[bool], bool]] = None,
is_animated: Optional[Union[Var[bool], bool]] = None,
is_indeterminate: Optional[Union[Var[bool], bool]] = None,
max_: Optional[Union[Var[int], int]] = None,
min_: Optional[Union[Var[int], int]] = None,
value: Optional[Union[Var[Union[float, int]], int, float]] = None,
color_scheme: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Progress":
"""Create the component.
Args:
*children: The children of the component.
has_stripe: If true, the progress bar will show stripe
is_animated: If true, and has_stripe is true, the stripes will be animated
is_indeterminate: If true, the progress will be indeterminate and the value prop will be ignored
max_: The maximum value of the progress
min_: The minimum value of the progress
value: The value of the progress indicator. If undefined the progress bar will be in indeterminate state
color_scheme: The color scheme of the progress bar.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,70 +0,0 @@
"""Container to stack elements with spacing."""
from reflex.components.chakra import ChakraComponent
from reflex.vars import Var
class Skeleton(ChakraComponent):
"""Skeleton is used to display the loading state of some components. You can use it as a standalone component. Or to wrap another component to take the same height and width."""
tag = "Skeleton"
# The color at the animation end
end_color: Var[str]
# The fadeIn duration in seconds
fade_duration: Var[float]
# If true, it'll render its children with a nice fade transition
is_loaded: Var[bool]
# The animation speed in seconds
speed: Var[float]
# The color at the animation start
start_color: Var[str]
class SkeletonCircle(ChakraComponent):
"""SkeletonCircle is used to display the loading state of some components."""
tag = "SkeletonCircle"
# The color at the animation end
end_color: Var[str]
# The fadeIn duration in seconds
fade_duration: Var[float]
# If true, it'll render its children with a nice fade transition
is_loaded: Var[bool]
# The animation speed in seconds
speed: Var[float]
# The color at the animation start
start_color: Var[str]
class SkeletonText(ChakraComponent):
"""SkeletonText is used to display the loading state of some components."""
tag = "SkeletonText"
# The color at the animation end
end_color: Var[str]
# The fadeIn duration in seconds
fade_duration: Var[float]
# If true, it'll render its children with a nice fade transition
is_loaded: Var[bool]
# The animation speed in seconds
speed: Var[float]
# The color at the animation start
start_color: Var[str]
# Number is lines of text.
no_of_lines: Var[int]

View File

@ -1,241 +0,0 @@
"""Stub file for reflex/components/chakra/feedback/skeleton.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Skeleton(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
end_color: Optional[Union[Var[str], str]] = None,
fade_duration: Optional[Union[Var[float], float]] = None,
is_loaded: Optional[Union[Var[bool], bool]] = None,
speed: Optional[Union[Var[float], float]] = None,
start_color: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Skeleton":
"""Create the component.
Args:
*children: The children of the component.
end_color: The color at the animation end
fade_duration: The fadeIn duration in seconds
is_loaded: If true, it'll render its children with a nice fade transition
speed: The animation speed in seconds
start_color: The color at the animation start
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class SkeletonCircle(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
end_color: Optional[Union[Var[str], str]] = None,
fade_duration: Optional[Union[Var[float], float]] = None,
is_loaded: Optional[Union[Var[bool], bool]] = None,
speed: Optional[Union[Var[float], float]] = None,
start_color: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "SkeletonCircle":
"""Create the component.
Args:
*children: The children of the component.
end_color: The color at the animation end
fade_duration: The fadeIn duration in seconds
is_loaded: If true, it'll render its children with a nice fade transition
speed: The animation speed in seconds
start_color: The color at the animation start
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class SkeletonText(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
end_color: Optional[Union[Var[str], str]] = None,
fade_duration: Optional[Union[Var[float], float]] = None,
is_loaded: Optional[Union[Var[bool], bool]] = None,
speed: Optional[Union[Var[float], float]] = None,
start_color: Optional[Union[Var[str], str]] = None,
no_of_lines: Optional[Union[Var[int], int]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "SkeletonText":
"""Create the component.
Args:
*children: The children of the component.
end_color: The color at the animation end
fade_duration: The fadeIn duration in seconds
is_loaded: If true, it'll render its children with a nice fade transition
speed: The animation speed in seconds
start_color: The color at the animation start
no_of_lines: Number is lines of text.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,25 +0,0 @@
"""Container to stack elements with spacing."""
from reflex.components.chakra import ChakraComponent, LiteralSpinnerSize
from reflex.vars import Var
class Spinner(ChakraComponent):
"""The component that spins."""
tag = "Spinner"
# The color of the empty area in the spinner
empty_color: Var[str]
# For accessibility, it is important to add a fallback loading text. This text will be visible to screen readers.
label: Var[str]
# The speed of the spinner must be as a string and in seconds '1s'. Default is '0.45s'.
speed: Var[str]
# The thickness of the spinner.
thickness: Var[int]
# "xs" | "sm" | "md" | "lg" | "xl"
size: Var[LiteralSpinnerSize]

View File

@ -1,92 +0,0 @@
"""Stub file for reflex/components/chakra/feedback/spinner.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Spinner(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
empty_color: Optional[Union[Var[str], str]] = None,
label: Optional[Union[Var[str], str]] = None,
speed: Optional[Union[Var[str], str]] = None,
thickness: Optional[Union[Var[int], int]] = None,
size: Optional[
Union[
Var[Literal["sm", "md", "lg", "xs", "xl"]],
Literal["sm", "md", "lg", "xs", "xl"],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Spinner":
"""Create the component.
Args:
*children: The children of the component.
empty_color: The color of the empty area in the spinner
label: For accessibility, it is important to add a fallback loading text. This text will be visible to screen readers.
speed: The speed of the spinner must be as a string and in seconds '1s'. Default is '0.45s'.
thickness: The thickness of the spinner.
size: "xs" | "sm" | "md" | "lg" | "xl"
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,49 +0,0 @@
"""Convenience functions to define core components."""
from .button import Button, ButtonGroup
from .checkbox import Checkbox, CheckboxGroup
from .colormodeswitch import (
ColorModeButton,
ColorModeIcon,
ColorModeScript,
ColorModeSwitch,
)
from .date_picker import DatePicker
from .date_time_picker import DateTimePicker
from .editable import Editable, EditableInput, EditablePreview, EditableTextarea
from .email import Email
from .form import Form, FormControl, FormErrorMessage, FormHelperText, FormLabel
from .iconbutton import IconButton
from .input import (
Input,
InputGroup,
InputLeftAddon,
InputLeftElement,
InputRightAddon,
InputRightElement,
)
from .multiselect import Option as MultiSelectOption
from .multiselect import Select as MultiSelect
from .numberinput import (
NumberDecrementStepper,
NumberIncrementStepper,
NumberInput,
NumberInputField,
NumberInputStepper,
)
from .password import Password
from .pininput import PinInput, PinInputField
from .radio import Radio, RadioGroup
from .rangeslider import (
RangeSlider,
RangeSliderFilledTrack,
RangeSliderThumb,
RangeSliderTrack,
)
from .select import Option, Select
from .slider import Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack
from .switch import Switch
from .textarea import TextArea
from .time_picker import TimePicker
__all__ = [f for f in dir() if f[0].isupper()] # type: ignore

View File

@ -1,83 +0,0 @@
"""A button component."""
from typing import List
from reflex.components.chakra import (
ChakraComponent,
LiteralButtonSize,
LiteralButtonVariant,
LiteralColorScheme,
LiteralSpinnerPlacement,
)
from reflex.vars import Var
class Button(ChakraComponent):
"""The Button component is used to trigger an event or event, such as submitting a form, opening a dialog, canceling an event, or performing a delete operation."""
tag = "Button"
# The space between the button icon and label.
icon_spacing: Var[int]
# If true, the button will be styled in its active state.
is_active: Var[bool]
# If true, the button will be styled in its disabled state.
is_disabled: Var[bool]
# If true, the button will take up the full width of its container.
is_full_width: Var[bool]
# If true, the button will show a spinner.
is_loading: Var[bool]
# The label to show in the button when isLoading is true If no text is passed, it only shows the spinner.
loading_text: Var[str]
# "lg" | "md" | "sm" | "xs"
size: Var[LiteralButtonSize]
# "ghost" | "outline" | "solid" | "link" | "unstyled"
variant: Var[LiteralButtonVariant]
# Built in color scheme for ease of use.
# Options:
# "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan"
# | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"
color_scheme: Var[LiteralColorScheme]
# Position of the loading spinner.
# Options:
# "start" | "end"
spinner_placement: Var[LiteralSpinnerPlacement]
# The type of button.
type_: Var[str]
# Components that are not allowed as children.
_invalid_children: List[str] = ["Button", "MenuButton"]
# The name of the form field
name: Var[str]
class ButtonGroup(ChakraComponent):
"""A group of buttons."""
tag = "ButtonGroup"
# If true, the borderRadius of button that are direct children will be altered to look flushed together.
is_attached: Var[bool]
# If true, all wrapped button will be disabled.
is_disabled: Var[bool]
# The spacing between the buttons.
spacing: Var[int]
# "lg" | "md" | "sm" | "xs"
size: Var[LiteralButtonSize]
# "ghost" | "outline" | "solid" | "link" | "unstyled"
variant: Var[LiteralButtonVariant]

View File

@ -1,242 +0,0 @@
"""Stub file for reflex/components/chakra/forms/button.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import (
ChakraComponent,
)
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Button(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
icon_spacing: Optional[Union[Var[int], int]] = None,
is_active: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_full_width: Optional[Union[Var[bool], bool]] = None,
is_loading: Optional[Union[Var[bool], bool]] = None,
loading_text: Optional[Union[Var[str], str]] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
variant: Optional[
Union[
Var[Literal["ghost", "outline", "solid", "link", "unstyled"]],
Literal["ghost", "outline", "solid", "link", "unstyled"],
]
] = None,
color_scheme: Optional[
Union[
Var[
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
]
],
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
],
]
] = None,
spinner_placement: Optional[
Union[Var[Literal["start", "end"]], Literal["start", "end"]]
] = None,
type_: Optional[Union[Var[str], str]] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Button":
"""Create the component.
Args:
*children: The children of the component.
icon_spacing: The space between the button icon and label.
is_active: If true, the button will be styled in its active state.
is_disabled: If true, the button will be styled in its disabled state.
is_full_width: If true, the button will take up the full width of its container.
is_loading: If true, the button will show a spinner.
loading_text: The label to show in the button when isLoading is true If no text is passed, it only shows the spinner.
size: "lg" | "md" | "sm" | "xs"
variant: "ghost" | "outline" | "solid" | "link" | "unstyled"
color_scheme: Built in color scheme for ease of use. Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"
spinner_placement: Position of the loading spinner. Options: "start" | "end"
type_: The type of button.
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class ButtonGroup(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
is_attached: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
spacing: Optional[Union[Var[int], int]] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
variant: Optional[
Union[
Var[Literal["ghost", "outline", "solid", "link", "unstyled"]],
Literal["ghost", "outline", "solid", "link", "unstyled"],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ButtonGroup":
"""Create the component.
Args:
*children: The children of the component.
is_attached: If true, the borderRadius of button that are direct children will be altered to look flushed together.
is_disabled: If true, all wrapped button will be disabled.
spacing: The spacing between the buttons.
size: "lg" | "md" | "sm" | "xs"
variant: "ghost" | "outline" | "solid" | "link" | "unstyled"
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,78 +0,0 @@
"""A checkbox component."""
from __future__ import annotations
from reflex.components.chakra import (
ChakraComponent,
LiteralColorScheme,
LiteralTagSize,
)
from reflex.event import EventHandler
from reflex.ivars.base import LiteralVar
from reflex.vars import Var
class Checkbox(ChakraComponent):
"""The Checkbox component is used in forms when a user needs to select multiple values from several options."""
tag = "Checkbox"
# Color scheme for checkbox.
# Options:
# "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan"
# | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"
color_scheme: Var[LiteralColorScheme]
# "sm" | "md" | "lg"
size: Var[LiteralTagSize]
# If true, the checkbox will be checked.
is_checked: Var[bool]
# If true, the checkbox will be disabled
is_disabled: Var[bool]
# If true and is_disabled is passed, the checkbox will remain tabbable but not interactive
is_focusable: Var[bool]
# If true, the checkbox will be indeterminate. This only affects the icon shown inside checkbox and does not modify the is_checked var.
is_indeterminate: Var[bool]
# If true, the checkbox is marked as invalid. Changes style of unchecked state.
is_invalid: Var[bool]
# If true, the checkbox will be readonly
is_read_only: Var[bool]
# If true, the checkbox input is marked as required, and required attribute will be added
is_required: Var[bool]
# The name of the input field in a checkbox (Useful for form submission).
name: Var[str]
# The value of the input field when checked (use is_checked prop for a bool)
value: Var[str] = LiteralVar.create("true")
# The spacing between the checkbox and its label text (0.5rem)
spacing: Var[str]
# Fired when the checkbox is checked or unchecked
on_change: EventHandler[lambda e0: [e0.target.checked]]
class CheckboxGroup(ChakraComponent):
"""A group of checkboxes."""
tag = "CheckboxGroup"
# The value of the checkbox group
value: Var[str]
# The initial value of the checkbox group
default_value: Var[str]
# If true, all wrapped checkbox inputs will be disabled
is_disabled: Var[bool]
# If true, input elements will receive checked attribute instead of isChecked. This assumes, you're using native radio inputs
is_native: Var[bool]

View File

@ -1,225 +0,0 @@
"""Stub file for reflex/components/chakra/forms/checkbox.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Checkbox(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
color_scheme: Optional[
Union[
Var[
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
]
],
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg"]], Literal["sm", "md", "lg"]]
] = None,
is_checked: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_focusable: Optional[Union[Var[bool], bool]] = None,
is_indeterminate: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
name: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
spacing: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "Checkbox":
"""Create the component.
Args:
*children: The children of the component.
color_scheme: Color scheme for checkbox. Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"
size: "sm" | "md" | "lg"
is_checked: If true, the checkbox will be checked.
is_disabled: If true, the checkbox will be disabled
is_focusable: If true and is_disabled is passed, the checkbox will remain tabbable but not interactive
is_indeterminate: If true, the checkbox will be indeterminate. This only affects the icon shown inside checkbox and does not modify the is_checked var.
is_invalid: If true, the checkbox is marked as invalid. Changes style of unchecked state.
is_read_only: If true, the checkbox will be readonly
is_required: If true, the checkbox input is marked as required, and required attribute will be added
name: The name of the input field in a checkbox (Useful for form submission).
value: The value of the input field when checked (use is_checked prop for a bool)
spacing: The spacing between the checkbox and its label text (0.5rem)
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class CheckboxGroup(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_native: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "CheckboxGroup":
"""Create the component.
Args:
*children: The children of the component.
value: The value of the checkbox group
default_value: The initial value of the checkbox group
is_disabled: If true, all wrapped checkbox inputs will be disabled
is_native: If true, input elements will receive checked attribute instead of isChecked. This assumes, you're using native radio inputs
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,104 +0,0 @@
"""A switch component for toggling color_mode.
To style components based on color mode, use style props with `color_mode_cond`:
```
rx.text(
"Hover over me",
_hover={
"background": rx.color_mode_cond(
light="var(--chakra-colors-gray-200)",
dark="var(--chakra-colors-gray-700)",
),
},
)
```
"""
from __future__ import annotations
from reflex.components.chakra import ChakraComponent
from reflex.components.chakra.media.icon import Icon
from reflex.components.component import BaseComponent
from reflex.components.core.cond import Cond, color_mode_cond
from reflex.style import LIGHT_COLOR_MODE, color_mode, toggle_color_mode
from .button import Button
from .switch import Switch
DEFAULT_LIGHT_ICON: Icon = Icon.create(tag="sun")
DEFAULT_DARK_ICON: Icon = Icon.create(tag="moon")
class ColorModeIcon(Cond):
"""Displays the current color mode as an icon."""
@classmethod
def create(
cls,
light_component: BaseComponent | None = None,
dark_component: BaseComponent | None = None,
):
"""Create an icon component based on color_mode.
Args:
light_component: the component to display when color mode is default
dark_component: the component to display when color mode is dark (non-default)
Returns:
The conditionally rendered component
"""
return color_mode_cond(
light=light_component or DEFAULT_LIGHT_ICON,
dark=dark_component or DEFAULT_DARK_ICON,
)
class ColorModeSwitch(Switch):
"""Switch for toggling chakra light / dark mode via toggle_color_mode."""
@classmethod
def create(cls, *children, **props):
"""Create a switch component bound to color_mode.
Args:
*children: The children of the component.
**props: The props to pass to the component.
Returns:
The switch component.
"""
return Switch.create(
*children,
is_checked=color_mode != LIGHT_COLOR_MODE,
on_change=toggle_color_mode,
**props,
)
class ColorModeButton(Button):
"""Button for toggling chakra light / dark mode via toggle_color_mode."""
@classmethod
def create(cls, *children, **props):
"""Create a button component that calls toggle_color_mode on click.
Args:
*children: The children of the component.
**props: The props to pass to the component.
Returns:
The switch component.
"""
return Button.create(
*children,
on_click=toggle_color_mode,
**props,
)
class ColorModeScript(ChakraComponent):
"""Chakra color mode script."""
tag = "ColorModeScript"
initialColorMode = LIGHT_COLOR_MODE

View File

@ -1,431 +0,0 @@
"""Stub file for reflex/components/chakra/forms/colormodeswitch.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.components.chakra.media.icon import Icon
from reflex.components.component import BaseComponent
from reflex.components.core.cond import Cond
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
from .button import Button
from .switch import Switch
DEFAULT_LIGHT_ICON: Icon
DEFAULT_DARK_ICON: Icon
class ColorModeIcon(Cond):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
cond: Optional[Union[Var[Any], Any]] = None,
comp1: Optional[BaseComponent] = None,
comp2: Optional[BaseComponent] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ColorModeIcon":
"""Create an icon component based on color_mode.
Args:
light_component: the component to display when color mode is default
dark_component: the component to display when color mode is dark (non-default)
Returns:
The conditionally rendered component
"""
...
class ColorModeSwitch(Switch):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
is_checked: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_focusable: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
name: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
spacing: Optional[Union[Var[str], str]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
color_scheme: Optional[
Union[
Var[
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
]
],
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "ColorModeSwitch":
"""Create a switch component bound to color_mode.
Args:
*children: The children of the component.
is_checked: If true, the switch will be checked. You'll need to set an on_change event handler to update its value (since it is now controlled)
is_disabled: If true, the switch will be disabled
is_focusable: If true and is_disabled prop is set, the switch will remain tabbable but not interactive.
is_invalid: If true, the switch is marked as invalid. Changes style of unchecked state.
is_read_only: If true, the switch will be readonly
is_required: If true, the switch will be required
name: The name of the input field in a switch (Useful for form submission).
value: The value of the input field when checked (use is_checked prop for a bool)
spacing: The spacing between the switch and its label text (0.5rem)
placeholder: The placeholder text.
color_scheme: The color scheme of the switch (e.g. "blue", "green", "red", etc.)
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props to pass to the component.
Returns:
The switch component.
"""
...
class ColorModeButton(Button):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
icon_spacing: Optional[Union[Var[int], int]] = None,
is_active: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_full_width: Optional[Union[Var[bool], bool]] = None,
is_loading: Optional[Union[Var[bool], bool]] = None,
loading_text: Optional[Union[Var[str], str]] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
variant: Optional[
Union[
Var[Literal["ghost", "outline", "solid", "link", "unstyled"]],
Literal["ghost", "outline", "solid", "link", "unstyled"],
]
] = None,
color_scheme: Optional[
Union[
Var[
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
]
],
Literal[
"none",
"gray",
"red",
"orange",
"yellow",
"green",
"teal",
"blue",
"cyan",
"purple",
"pink",
"whiteAlpha",
"blackAlpha",
"linkedin",
"facebook",
"messenger",
"whatsapp",
"twitter",
"telegram",
],
]
] = None,
spinner_placement: Optional[
Union[Var[Literal["start", "end"]], Literal["start", "end"]]
] = None,
type_: Optional[Union[Var[str], str]] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ColorModeButton":
"""Create a button component that calls toggle_color_mode on click.
Args:
*children: The children of the component.
icon_spacing: The space between the button icon and label.
is_active: If true, the button will be styled in its active state.
is_disabled: If true, the button will be styled in its disabled state.
is_full_width: If true, the button will take up the full width of its container.
is_loading: If true, the button will show a spinner.
loading_text: The label to show in the button when isLoading is true If no text is passed, it only shows the spinner.
size: "lg" | "md" | "sm" | "xs"
variant: "ghost" | "outline" | "solid" | "link" | "unstyled"
color_scheme: Built in color scheme for ease of use. Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"
spinner_placement: Position of the loading spinner. Options: "start" | "end"
type_: The type of button.
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props to pass to the component.
Returns:
The switch component.
"""
...
class ColorModeScript(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "ColorModeScript":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,11 +0,0 @@
"""A date input component."""
from reflex.components.chakra.forms.input import Input
from reflex.vars import Var
class DatePicker(Input):
"""A date input component."""
# The type of input.
type_: Var[str] = "date" # type: ignore

View File

@ -1,115 +0,0 @@
"""Stub file for reflex/components/chakra/forms/date_picker.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra.forms.input import Input
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class DatePicker(Input):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
type_: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "DatePicker":
"""Create an Input component.
Args:
*children: The children of the component.
type_: The type of input.
value: State var to bind the input.
default_value: The default value of the input.
placeholder: The placeholder text.
error_border_color: The border color when the input is invalid.
focus_border_color: The border color when the input is focused.
is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_read_only: If true, the form control will be readonly.
is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
variant: "outline" | "filled" | "flushed" | "unstyled"
size: "lg" | "md" | "sm" | "xs"
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The component.
"""
...

View File

@ -1,11 +0,0 @@
"""A datetime-local input component."""
from reflex.components.chakra.forms.input import Input
from reflex.vars import Var
class DateTimePicker(Input):
"""A datetime-local input component."""
# The type of input.
type_: Var[str] = "datetime-local" # type: ignore

View File

@ -1,115 +0,0 @@
"""Stub file for reflex/components/chakra/forms/date_time_picker.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra.forms.input import Input
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class DateTimePicker(Input):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
type_: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "DateTimePicker":
"""Create an Input component.
Args:
*children: The children of the component.
type_: The type of input.
value: State var to bind the input.
default_value: The default value of the input.
placeholder: The placeholder text.
error_border_color: The border color when the input is invalid.
focus_border_color: The border color when the input is focused.
is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_read_only: If true, the form control will be readonly.
is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
variant: "outline" | "filled" | "flushed" | "unstyled"
size: "lg" | "md" | "sm" | "xs"
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The component.
"""
...

View File

@ -1,67 +0,0 @@
"""An editable component."""
from __future__ import annotations
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler
from reflex.vars import Var
class Editable(ChakraComponent):
"""The wrapper component that provides context value."""
tag = "Editable"
# If true, the Editable will be disabled.
is_disabled: Var[bool]
# If true, the read only view, has a tabIndex set to 0 so it can receive focus via the keyboard or click.
is_preview_focusable: Var[bool]
# The placeholder text when the value is empty.
placeholder: Var[str]
# If true, the input's text will be highlighted on focus.
select_all_on_focus: Var[bool]
# If true, the Editable will start with edit mode by default.
start_with_edit_view: Var[bool]
# If true, it'll update the value onBlur and turn off the edit mode.
submit_on_blur: Var[bool]
# The value of the Editable in both edit & preview mode
value: Var[str]
# The initial value of the Editable in both edit and preview mode.
default_value: Var[str]
# Fired when the Editable is changed.
on_change: EventHandler[lambda e0: [e0]]
# Fired when the Editable is in edit mode.
on_edit: EventHandler[lambda e0: [e0]]
# Fired when the Editable is submitted.
on_submit: EventHandler[lambda e0: [e0]]
# Fired when the Editable is canceled.
on_cancel: EventHandler[lambda e0: [e0]]
class EditableInput(ChakraComponent):
"""The edit view of the component. It shows when you click or focus on the text."""
tag = "EditableInput"
class EditableTextarea(ChakraComponent):
"""Use the textarea element to handle multi line text input in an editable context."""
tag = "EditableTextarea"
class EditablePreview(ChakraComponent):
"""The read-only view of the component."""
tag = "EditablePreview"

View File

@ -1,295 +0,0 @@
"""Stub file for reflex/components/chakra/forms/editable.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Editable(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_preview_focusable: Optional[Union[Var[bool], bool]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
select_all_on_focus: Optional[Union[Var[bool], bool]] = None,
start_with_edit_view: Optional[Union[Var[bool], bool]] = None,
submit_on_blur: Optional[Union[Var[bool], bool]] = None,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "Editable":
"""Create the component.
Args:
*children: The children of the component.
is_disabled: If true, the Editable will be disabled.
is_preview_focusable: If true, the read only view, has a tabIndex set to 0 so it can receive focus via the keyboard or click.
placeholder: The placeholder text when the value is empty.
select_all_on_focus: If true, the input's text will be highlighted on focus.
start_with_edit_view: If true, the Editable will start with edit mode by default.
submit_on_blur: If true, it'll update the value onBlur and turn off the edit mode.
value: The value of the Editable in both edit & preview mode
default_value: The initial value of the Editable in both edit and preview mode.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class EditableInput(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "EditableInput":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class EditableTextarea(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "EditableTextarea":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class EditablePreview(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "EditablePreview":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,11 +0,0 @@
"""An email input component."""
from reflex.components.chakra.forms.input import Input
from reflex.vars import Var
class Email(Input):
"""An email input component."""
# The type of input.
type_: Var[str] = "email" # type: ignore

View File

@ -1,115 +0,0 @@
"""Stub file for reflex/components/chakra/forms/email.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra.forms.input import Input
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Email(Input):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
type_: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "Email":
"""Create an Input component.
Args:
*children: The children of the component.
type_: The type of input.
value: State var to bind the input.
default_value: The default value of the input.
placeholder: The placeholder text.
error_border_color: The border color when the input is invalid.
focus_border_color: The border color when the input is focused.
is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_read_only: If true, the form control will be readonly.
is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
variant: "outline" | "filled" | "flushed" | "unstyled"
size: "lg" | "md" | "sm" | "xs"
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The component.
"""
...

View File

@ -1,103 +0,0 @@
"""Form components."""
from __future__ import annotations
from reflex.components.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.components.el.elements.forms import Form as HTMLForm
from reflex.vars import Var
class Form(ChakraComponent, HTMLForm):
"""A form component."""
tag = "Box"
# What the form renders to.
as_: Var[str] = "form" # type: ignore
class FormControl(ChakraComponent):
"""Provide context to form components."""
tag = "FormControl"
# If true, the form control will be disabled.
is_disabled: Var[bool]
# If true, the form control will be invalid.
is_invalid: Var[bool]
# If true, the form control will be readonly
is_read_only: Var[bool]
# If true, the form control will be required.
is_required: Var[bool]
# The label text used to inform users as to what information is requested for a text field.
label: Var[str]
@classmethod
def create(
cls,
*children,
label=None,
input=None,
help_text=None,
error_message=None,
**props,
) -> Component:
"""Create a form control component.
Args:
*children: The children of the form control.
label: The label of the form control.
input: The input of the form control.
help_text: The help text of the form control.
error_message: The error message of the form control.
**props: The properties of the form control.
Raises:
AttributeError: raise an error if missing required kwargs.
Returns:
The form control component.
"""
if len(children) == 0:
children = []
if label:
children.append(FormLabel.create(*label))
if not input:
raise AttributeError("input keyword argument is required")
children.append(input)
if help_text:
children.append(FormHelperText.create(*help_text))
if error_message:
children.append(FormErrorMessage.create(*error_message))
return super().create(*children, **props)
class FormHelperText(ChakraComponent):
"""A form helper text component."""
tag = "FormHelperText"
class FormLabel(ChakraComponent):
"""A form label component."""
tag = "FormLabel"
# Link
html_for: Var[str]
class FormErrorMessage(ChakraComponent):
"""A form error message component."""
tag = "FormErrorMessage"

View File

@ -1,432 +0,0 @@
"""Stub file for reflex/components/chakra/forms/form.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.components.el.elements.forms import Form as HTMLForm
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Form(ChakraComponent, HTMLForm):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
as_: Optional[Union[Var[str], str]] = None,
accept: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
accept_charset: Optional[
Union[Var[Union[bool, int, str]], str, int, bool]
] = None,
action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
auto_complete: Optional[
Union[Var[Union[bool, int, str]], str, int, bool]
] = None,
enc_type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
no_validate: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
reset_on_submit: Optional[Union[Var[bool], bool]] = None,
handle_submit_unique_name: Optional[Union[Var[str], str]] = None,
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
auto_capitalize: Optional[
Union[Var[Union[bool, int, str]], str, int, bool]
] = None,
content_editable: Optional[
Union[Var[Union[bool, int, str]], str, int, bool]
] = None,
context_menu: Optional[
Union[Var[Union[bool, int, str]], str, int, bool]
] = None,
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
enter_key_hint: Optional[
Union[Var[Union[bool, int, str]], str, int, bool]
] = None,
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "Form":
"""Create a form component.
Args:
*children: The children of the form.
as_: What the form renders to.
accept: MIME types the server accepts for file upload
accept_charset: Character encodings to be used for form submission
action: URL where the form's data should be submitted
auto_complete: Whether the form should have autocomplete enabled
enc_type: Encoding type for the form data when submitted
method: HTTP method to use for form submission
name: Name of the form
no_validate: Indicates that the form should not be validated on submit
target: Where to display the response after submitting the form
reset_on_submit: If true, the form will be cleared after submit.
handle_submit_unique_name: The name used to make this form's submit handler function unique.
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
draggable: Defines whether the element can be dragged.
enter_key_hint: Hints what media types the media element is able to play.
hidden: Defines whether the element is hidden.
input_mode: Defines the type of the element.
item_prop: Defines the name of the element for metadata purposes.
lang: Defines the language used in the element.
role: Defines the role of the element.
slot: Assigns a slot in a shadow DOM shadow tree to an element.
spell_check: Defines whether the element may be checked for spelling errors.
tab_index: Defines the position of the current element in the tabbing order.
title: Defines a tooltip for the element.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the form.
Returns:
The form component.
"""
...
class FormControl(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
label=None,
input=None,
help_text=None,
error_message=None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "FormControl":
"""Create a form control component.
Args:
*children: The children of the form control.
label: The label of the form control.
input: The input of the form control.
help_text: The help text of the form control.
error_message: The error message of the form control.
is_disabled: If true, the form control will be disabled.
is_invalid: If true, the form control will be invalid.
is_read_only: If true, the form control will be readonly
is_required: If true, the form control will be required.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the form control.
Raises:
AttributeError: raise an error if missing required kwargs.
Returns:
The form control component.
"""
...
class FormHelperText(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "FormHelperText":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class FormLabel(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
html_for: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "FormLabel":
"""Create the component.
Args:
*children: The children of the component.
html_for: Link
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class FormErrorMessage(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "FormErrorMessage":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,38 +0,0 @@
"""An icon button component."""
from typing import Optional
from reflex.components.chakra.typography.text import Text
from reflex.components.component import Component
from reflex.vars import Var
class IconButton(Text):
"""A button with an icon."""
tag = "IconButton"
library = "@chakra-ui/button@2.1.0"
# The type of button.
type: Var[str]
# A label that describes the button
aria_label: Var[str]
# The icon to be used in the button.
icon: Optional[Component]
# If true, the button will be styled in its active state.
is_active: Var[bool]
# If true, the button will be disabled.
is_disabled: Var[bool]
# If true, the button will show a spinner.
is_loading: Var[bool]
# If true, the button will be perfectly round. Else, it'll be slightly round
is_round: Var[bool]
# Replace the spinner component when isLoading is set to true
spinner: Var[str]

View File

@ -1,98 +0,0 @@
"""Stub file for reflex/components/chakra/forms/iconbutton.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra.typography.text import Text
from reflex.components.component import Component
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class IconButton(Text):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
type: Optional[Union[Var[str], str]] = None,
aria_label: Optional[Union[Var[str], str]] = None,
icon: Optional[Component] = None,
is_active: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_loading: Optional[Union[Var[bool], bool]] = None,
is_round: Optional[Union[Var[bool], bool]] = None,
spinner: Optional[Union[Var[str], str]] = None,
as_: Optional[Union[Var[str], str]] = None,
no_of_lines: Optional[Union[Var[int], int]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "IconButton":
"""Create the component.
Args:
*children: The children of the component.
type: The type of button.
aria_label: A label that describes the button
icon: The icon to be used in the button.
is_active: If true, the button will be styled in its active state.
is_disabled: If true, the button will be disabled.
is_loading: If true, the button will show a spinner.
is_round: If true, the button will be perfectly round. Else, it'll be slightly round
spinner: Replace the spinner component when isLoading is set to true
as_: Override the tag. The default tag is `<p>`.
no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,130 +0,0 @@
"""An input component."""
from reflex.components.chakra import (
ChakraComponent,
LiteralButtonSize,
LiteralInputVariant,
)
from reflex.components.component import Component
from reflex.components.core.debounce import DebounceInput
from reflex.components.literals import LiteralInputType
from reflex.constants import MemoizationMode
from reflex.event import EventHandler
from reflex.utils.imports import ImportDict
from reflex.vars import Var
class Input(ChakraComponent):
"""The Input component is a component that is used to get user input in a text field."""
tag = "Input"
# State var to bind the input.
value: Var[str]
# The default value of the input.
default_value: Var[str]
# The placeholder text.
placeholder: Var[str]
# The type of input.
type_: Var[LiteralInputType]
# The border color when the input is invalid.
error_border_color: Var[str]
# The border color when the input is focused.
focus_border_color: Var[str]
# If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
is_disabled: Var[bool]
# If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_invalid: Var[bool]
# If true, the form control will be readonly.
is_read_only: Var[bool]
# If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
is_required: Var[bool]
# "outline" | "filled" | "flushed" | "unstyled"
variant: Var[LiteralInputVariant]
# "lg" | "md" | "sm" | "xs"
size: Var[LiteralButtonSize]
# The name of the form field
name: Var[str]
# Fired when the input value changes.
on_change: EventHandler[lambda e0: [e0.target.value]]
# Fired when the input is focused.
on_focus: EventHandler[lambda e0: [e0.target.value]]
# Fired when the input lose focus.
on_blur: EventHandler[lambda e0: [e0.target.value]]
# Fired when a key is pressed down.
on_key_down: EventHandler[lambda e0: [e0.key]]
# Fired when a key is released.
on_key_up: EventHandler[lambda e0: [e0.key]]
def add_imports(self) -> ImportDict:
"""Add imports for the Input component.
Returns:
The import dict.
"""
return {"/utils/state": "set_val"}
@classmethod
def create(cls, *children, **props) -> Component:
"""Create an Input component.
Args:
*children: The children of the component.
**props: The properties of the component.
Returns:
The component.
"""
if props.get("value") is not None and props.get("on_change") is not None:
# create a debounced input if the user requests full control to avoid typing jank
return DebounceInput.create(super().create(*children, **props))
return super().create(*children, **props)
class InputGroup(ChakraComponent):
"""The InputGroup component is a component that is used to group a set of inputs."""
tag = "InputGroup"
_memoization_mode = MemoizationMode(recursive=False)
class InputLeftAddon(ChakraComponent):
"""The InputLeftAddon component is a component that is used to add an addon to the left of an input."""
tag = "InputLeftAddon"
class InputRightAddon(ChakraComponent):
"""The InputRightAddon component is a component that is used to add an addon to the right of an input."""
tag = "InputRightAddon"
class InputLeftElement(ChakraComponent):
"""The InputLeftElement component is a component that is used to add an element to the left of an input."""
tag = "InputLeftElement"
class InputRightElement(ChakraComponent):
"""The InputRightElement component is a component that is used to add an element to the right of an input."""
tag = "InputRightElement"

View File

@ -1,502 +0,0 @@
"""Stub file for reflex/components/chakra/forms/input.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import (
ChakraComponent,
)
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.utils.imports import ImportDict
from reflex.vars import Var
class Input(ChakraComponent):
def add_imports(self) -> ImportDict: ...
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
type_: Optional[
Union[
Var[
Literal[
"button",
"checkbox",
"color",
"date",
"datetime-local",
"email",
"file",
"hidden",
"image",
"month",
"number",
"password",
"radio",
"range",
"reset",
"search",
"submit",
"tel",
"text",
"time",
"url",
"week",
]
],
Literal[
"button",
"checkbox",
"color",
"date",
"datetime-local",
"email",
"file",
"hidden",
"image",
"month",
"number",
"password",
"radio",
"range",
"reset",
"search",
"submit",
"tel",
"text",
"time",
"url",
"week",
],
]
] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "Input":
"""Create an Input component.
Args:
*children: The children of the component.
value: State var to bind the input.
default_value: The default value of the input.
placeholder: The placeholder text.
type_: The type of input.
error_border_color: The border color when the input is invalid.
focus_border_color: The border color when the input is focused.
is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_read_only: If true, the form control will be readonly.
is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
variant: "outline" | "filled" | "flushed" | "unstyled"
size: "lg" | "md" | "sm" | "xs"
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The component.
"""
...
class InputGroup(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "InputGroup":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class InputLeftAddon(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "InputLeftAddon":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class InputRightAddon(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "InputRightAddon":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class InputLeftElement(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "InputLeftElement":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class InputRightElement(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "InputRightElement":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,355 +0,0 @@
"""Provides a feature-rich Select and some (not all) related components."""
from __future__ import annotations
from typing import Any, Dict, List, Optional, Set, Union
from reflex.base import Base
from reflex.components.component import Component
from reflex.constants import EventTriggers
from reflex.vars import Var
class Option(Base):
"""An option component for the chakra-react-select Select."""
# What is displayed to the user
label: str
# The value of the option, must be serializable
value: Any
# the variant of the option tag
variant: Optional[str] = None
# [not working yet]
# Whether the option is disabled
# is_disabled: Optional[bool] = None
# [not working yet]
# The visual color appearance of the component
# options: "whiteAlpha" | "blackAlpha" | "gray" | "red" |
# "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" |
# "purple" | "pink" | "linkedin" | "facebook" | "messenger" |
# "whatsapp" | "twitter" | "telegram"
# default: "gray"
# color_scheme: Optional[str] = None
# [not working yet]
# The icon of the option tag
# icon: Optional[str] = None
class Select(Component):
"""The default chakra-react-select Select component.
Not every available prop is listed here,
for a complete overview check the react-select/chakra-react-select docs.
Props added by chakra-react-select are marked with "[chakra]".
"""
library = "chakra-react-select@4.7.5"
tag = "Select"
alias = "MultiSelect"
# Focus the control when it is mounted
auto_focus: Var[bool]
# Remove the currently focused option when the user presses backspace
# when Select isClearable or isMulti
backspace_removes_value: Var[bool]
# Remove focus from the input when the user selects an option
# (handy for dismissing the keyboard on touch devices)
blur_input_on_select: Var[bool]
# When the user reaches the top/bottom of the menu,
# prevent scroll on the scroll-parent
capture_menu_scroll: Var[bool]
# [chakra]
# To use the chakraStyles prop, first,
# check the documentation for the original styles prop from the react-select docs.
# This package offers an identical API for the chakraStyles prop, however,
# the provided and output style objects use Chakra's sx prop
# instead of the default emotion styles the original package offers.
# This allows you to both use the shorthand styling props you'd normally use
# to style Chakra components, as well as tokens from your theme such as named colors.
# All of the style keys offered in the original package can be used in the chakraStyles prop
# except for menuPortal. Along with some other caveats, this is explained below.
# Most of the components rendered by this package use the basic Chakra <Box /> component with a few exceptions.
# Here are the style keys offered and the corresponding Chakra component that is rendered:
# - clearIndicator - Box (uses theme styles for Chakra's CloseButton)
# - container - Box
# - control - Box (uses theme styles for Chakra's Input)
# - dropdownIndicator - Box (uses theme styles for Chrakra's InputRightAddon)
# - downChevron - Icon
# - crossIcon - Icon
# - group - Box
# - groupHeading - Box (uses theme styles for Chakra's Menu group title)
# - indicatorsContainer - Box
# - indicatorSeparator - Divider
# - input - chakra.input (wrapped in a Box)
# - inputContainer - Box
# - loadingIndicator - Spinner
# - loadingMessage - Box
# - menu - Box
# - menuList - Box (uses theme styles for Chakra's Menu)
# - multiValue - chakra.span (uses theme styles for Chakra's Tag)
# - multiValueLabel - chakra.span (uses theme styles for Chakra's TagLabel)
# - multiValueRemove - Box (uses theme styles for Chakra's TagCloseButton)
# - noOptionsMessage - Box
# - option - Box (uses theme styles for Chakra's MenuItem)
# - placeholder - Box
# - singleValue - Box
# - valueContainer - Box
chakra_styles: Var[str]
# Close the select menu when the user selects an option
close_menu_on_select: Var[bool]
# If true, close the select menu when the user scrolls the document/body.
close_menu_on_scroll: Var[bool]
# [chakra]
# The visual color appearance of the component
# options: "whiteAlpha" | "blackAlpha" | "gray" | "red" |
# "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" |
# "purple" | "pink" | "linkedin" | "facebook" | "messenger" |
# "whatsapp" | "twitter" | "telegram"
# default: "gray"
color_scheme: Var[str]
# This complex object includes all the compositional components
# that are used in react-select. If you wish to overwrite a component,
# pass in an object with the appropriate namespace.
# If you only wish to restyle a component,
# we recommend using the styles prop instead.
components: Var[Dict[str, Component]]
# Whether the value of the select, e.g. SingleValue,
# should be displayed in the control.
control_should_render_value: Var[bool]
# Delimiter used to join multiple values into a single HTML Input value
delimiter: Var[str]
# [chakra]
# Colors the component border with the given chakra color string on error state
# default: "red.500"
error_border_color: Var[str]
# Clear all values when the user presses escape AND the menu is closed
escape_clears_value: Var[bool]
# [chakra]
# Colors the component border with the given chakra color string on focus
# default: "blue.500"
focus_border_color: Var[str]
# Sets the form attribute on the input
form: Var[str]
# Hide the selected option from the menu
hide_selected_options: Var[bool]
# The id to set on the SelectContainer component.
# id: Var[str]
# The value of the search input
input_value: Var[str]
# The id of the search input
input_id: Var[str]
# Is the select value clearable
is_clearable: Var[bool]
# Is the select disabled
is_disabled: Var[bool]
# [chakra]
# Style component in the chakra invalid style
# default: False
is_invalid: Var[bool]
# Support multiple selected options
is_multi: Var[bool]
# [chakra]
# Style component as disabled (chakra style)
# default: False
is_read_only: Var[bool]
# Is the select direction right-to-left
is_rtl: Var[bool]
# Whether to enable search functionality
is_searchable: Var[bool]
# Minimum height of the menu before flipping
min_menu_height: Var[int]
# Maximum height of the menu before scrolling
max_menu_height: Var[int]
# Default placement of the menu in relation to the control.
# 'auto' will flip when there isn't enough space below the control.
# options: "bottom" | "auto" | "top"
menu_placement: Var[str]
# The CSS position value of the menu,
# when "fixed" extra layout management is required
# options: "absolute" | "fixed"
menu_position: Var[str]
# Whether to block scroll events when the menu is open
menu_should_block_scroll: Var[bool]
# Whether the menu should be scrolled into view when it opens
menu_should_scroll_into_view: Var[bool]
# Name of the HTML Input (optional - without this, no input will be rendered)
name: Var[str]
# Allows control of whether the menu is opened when the Select is focused
open_menu_on_focus: Var[bool]
# Allows control of whether the menu is opened when the Select is clicked
open_menu_on_click: Var[bool]
# Array of options that populate the select menu
options: Var[List[Dict]]
# Number of options to jump in menu when page{up|down} keys are used
page_size: Var[int]
# Placeholder for the select value
placeholder: Var[Optional[str]]
# Marks the value-holding input as required for form validation
required: Var[bool]
# [chakra]
# If you choose to stick with the default selectedOptionStyle="color",
# you have one additional styling option.
# If you do not like the default of blue for the highlight color,
# you can pass the selectedOptionColorScheme prop to change it.
# This prop will accept any named color from your theme's color palette,
# and it will use the 500 value in light mode or the 300 value in dark mode.
# This prop can only be used for named colors from your theme, not arbitrary hex/rgb colors.
# If you would like to use a specific color for the background that's not a part of your theme,
# use the chakraStyles prop to customize it.
# default: "blue"
selected_option_color_scheme: Var[str]
# [chakra]
# The default option "color" will style a selected option
# similar to how react-select does it,
# by highlighting the selected option in the color blue.
# Alternatively, if you pass "check" for the value,
# the selected option will be styled like the Chakra UI Menu component
# and include a check icon next to the selected option(s).
# If is_multi and selected_option_style="check" are passed,
# space will only be added for the check marks
# if hide_selected_options=False is also passed.
# options: "color" | "check"
# default: "color"
selected_option_style: Var[str]
# [chakra]
# The size of the component.
# options: "sm" | "md" | "lg"
# default: "md"
size: Var[str]
# Sets the tabIndex attribute on the input
tab_index: Var[int]
# Select the currently focused option when the user presses tab
tab_selects_value: Var[bool]
# [chakra]
# Variant of multi-select tags
# options: "subtle" | "solid" | "outline"
# default: "subtle"
tag_variant: Var[str]
# Remove all non-essential styles
unstyled: Var[bool]
# [chakra]
# If this prop is passed,
# the dropdown indicator at the right of the component will be styled
# in the same way the original Chakra Select component is styled,
# instead of being styled as an InputRightAddon.
# The original purpose of styling it as an addon
# was to create a visual separation between the dropdown indicator
# and the button for clearing the selected options.
# However, as this button only appears when isMulti is passed,
# using this style could make more sense for a single select.
# default: False
use_basic_style: Var[bool]
# [chakra]
# The variant of the Select. If no variant is passed,
# it will default to defaultProps.variant from the theme for Chakra's Input component.
# If your component theme for Input is not modified, it will be outline.
# options: "outline" | "filled" | "flushed" | "unstyled"
# default: "outline"
variant: Var[str]
# How the options should be displayed in the menu.
menu_position: Var[str] = "fixed" # type: ignore
def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
"""Get the event triggers that pass the component's value to the handler.
Returns:
A dict mapping the event trigger to the var that is passed to the handler.
"""
return {
**super().get_event_triggers(),
EventTriggers.ON_CHANGE: (
lambda e0: [
Var.create_safe(f"{e0}.map(e => e.value)", _var_is_local=True)
]
if self.is_multi.equals(Var.create_safe(True))
else lambda e0: [e0]
),
}
@classmethod
def get_initial_props(cls) -> Set[str]:
"""Get the initial props to set for the component.
Returns:
The initial props to set.
"""
return super().get_initial_props() | {"is_multi"}
@classmethod
def create(
cls, options: List[Union[Option, str, int, float, bool]], **props
) -> Component:
"""Takes a list of options and additional properties, checks if each option is an
instance of Option, and returns a Select component with the given options and
properties. No children allowed.
Args:
options (List[Option | str | int | float | bool]): A list of values.
**props: Additional properties to be passed to the Select component.
Returns:
The `create` method is returning an instance of the `Select` class.
"""
converted_options: List[Option] = []
if not isinstance(options, Var):
for option in options:
if not isinstance(option, Option):
converted_options.append(Option(label=str(option), value=option))
else:
converted_options.append(option)
props["options"] = [o.dict() for o in converted_options]
else:
props["options"] = options
return super().create(*[], **props)

View File

@ -1,128 +0,0 @@
"""A number input component."""
from numbers import Number
from reflex.components.chakra import (
ChakraComponent,
LiteralButtonSize,
LiteralInputVariant,
)
from reflex.components.component import Component
from reflex.event import EventHandler
from reflex.vars import Var
class NumberInput(ChakraComponent):
"""The wrapper that provides context and logic to the components."""
tag = "NumberInput"
# State var to bind the input.
value: Var[Number]
# If true, the input's value will change based on mouse wheel.
allow_mouse_wheel: Var[bool]
# This controls the value update when you blur out of the input. - If true and the value is greater than max, the value will be reset to max - Else, the value remains the same.
clamped_value_on_blur: Var[bool]
# The initial value of the counter. Should be less than max and greater than min
default_value: Var[Number]
# The border color when the input is invalid.
error_border_color: Var[str]
# The border color when the input is focused.
focus_border_color: Var[str]
# If true, the input will be focused as you increment or decrement the value with the stepper
focus_input_on_change: Var[bool]
# Hints at the type of data that might be entered by the user. It also determines the type of keyboard shown to the user on mobile devices ("text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal")
# input_mode: Var[LiteralInputNumberMode]
# Whether the input should be disabled.
is_disabled: Var[bool]
# If true, the input will have `aria-invalid` set to true
is_invalid: Var[bool]
# If true, the input will be in readonly mode
is_read_only: Var[bool]
# Whether the input is required
is_required: Var[bool]
# Whether the pressed key should be allowed in the input. The default behavior is to allow DOM floating point characters defined by /^[Ee0-9+\-.]$/
is_valid_character: Var[str]
# This controls the value update behavior in general. - If true and you use the stepper or up/down arrow keys, the value will not exceed the max or go lower than min - If false, the value will be allowed to go out of range.
keep_within_range: Var[bool]
# The maximum value of the counter
max_: Var[Number]
# The minimum value of the counter
min_: Var[Number]
# "outline" | "filled" | "flushed" | "unstyled"
variant: Var[LiteralInputVariant]
# "lg" | "md" | "sm" | "xs"
size: Var[LiteralButtonSize]
# The name of the form field
name: Var[str]
# Fired when the input value changes.
on_change: EventHandler[lambda e0: [e0]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a number input component.
If no children are provided, a default stepper will be used.
Args:
*children: The children of the component.
**props: The props of the component.
Returns:
The component.
"""
if len(children) == 0:
_id = props.pop("id", None)
children = [
NumberInputField.create(id=_id)
if _id is not None
else NumberInputField.create(),
NumberInputStepper.create(
NumberIncrementStepper.create(),
NumberDecrementStepper.create(),
),
]
return super().create(*children, **props)
class NumberInputField(ChakraComponent):
"""The input field itself."""
tag = "NumberInputField"
class NumberInputStepper(ChakraComponent):
"""The wrapper for the input's stepper buttons."""
tag = "NumberInputStepper"
class NumberIncrementStepper(ChakraComponent):
"""The button to increment the value of the input."""
tag = "NumberIncrementStepper"
class NumberDecrementStepper(ChakraComponent):
"""The button to decrement the value of the input."""
tag = "NumberDecrementStepper"

View File

@ -1,390 +0,0 @@
"""Stub file for reflex/components/chakra/forms/numberinput.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from numbers import Number
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import (
ChakraComponent,
)
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class NumberInput(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[Number], Number]] = None,
allow_mouse_wheel: Optional[Union[Var[bool], bool]] = None,
clamped_value_on_blur: Optional[Union[Var[bool], bool]] = None,
default_value: Optional[Union[Var[Number], Number]] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
focus_input_on_change: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
is_valid_character: Optional[Union[Var[str], str]] = None,
keep_within_range: Optional[Union[Var[bool], bool]] = None,
max_: Optional[Union[Var[Number], Number]] = None,
min_: Optional[Union[Var[Number], Number]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "NumberInput":
"""Create a number input component.
If no children are provided, a default stepper will be used.
Args:
*children: The children of the component.
value: State var to bind the input.
allow_mouse_wheel: If true, the input's value will change based on mouse wheel.
clamped_value_on_blur: This controls the value update when you blur out of the input. - If true and the value is greater than max, the value will be reset to max - Else, the value remains the same.
default_value: The initial value of the counter. Should be less than max and greater than min
error_border_color: The border color when the input is invalid.
focus_border_color: The border color when the input is focused.
focus_input_on_change: If true, the input will be focused as you increment or decrement the value with the stepper
is_disabled: Hints at the type of data that might be entered by the user. It also determines the type of keyboard shown to the user on mobile devices ("text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal") input_mode: Var[LiteralInputNumberMode] Whether the input should be disabled.
is_invalid: If true, the input will have `aria-invalid` set to true
is_read_only: If true, the input will be in readonly mode
is_required: Whether the input is required
is_valid_character: Whether the pressed key should be allowed in the input. The default behavior is to allow DOM floating point characters defined by /^[Ee0-9+\\-.]$/
keep_within_range: This controls the value update behavior in general. - If true and you use the stepper or up/down arrow keys, the value will not exceed the max or go lower than min - If false, the value will be allowed to go out of range.
max_: The maximum value of the counter
min_: The minimum value of the counter
variant: "outline" | "filled" | "flushed" | "unstyled"
size: "lg" | "md" | "sm" | "xs"
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class NumberInputField(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "NumberInputField":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class NumberInputStepper(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "NumberInputStepper":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class NumberIncrementStepper(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "NumberIncrementStepper":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class NumberDecrementStepper(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "NumberDecrementStepper":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,11 +0,0 @@
"""A password input component."""
from reflex.components.chakra.forms.input import Input
from reflex.vars import Var
class Password(Input):
"""A password input component."""
# The type of input.
type_: Var[str] = "password" # type: ignore

View File

@ -1,115 +0,0 @@
"""Stub file for reflex/components/chakra/forms/password.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra.forms.input import Input
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Password(Input):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
type_: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "Password":
"""Create an Input component.
Args:
*children: The children of the component.
type_: The type of input.
value: State var to bind the input.
default_value: The default value of the input.
placeholder: The placeholder text.
error_border_color: The border color when the input is invalid.
focus_border_color: The border color when the input is focused.
is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_read_only: If true, the form control will be readonly.
is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
variant: "outline" | "filled" | "flushed" | "unstyled"
size: "lg" | "md" | "sm" | "xs"
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The component.
"""
...

View File

@ -1,206 +0,0 @@
"""A pin input component."""
from __future__ import annotations
from typing import Optional
import reflex as rx
from reflex.components.chakra import ChakraComponent, LiteralInputVariant
from reflex.components.component import Component
from reflex.components.tags.tag import Tag
from reflex.event import EventHandler
from reflex.ivars import ArrayVar
from reflex.utils import format
from reflex.utils.imports import ImportDict, merge_imports
from reflex.vars import Var
class PinInput(ChakraComponent):
"""The component that provides context to all the pin-input fields."""
tag = "PinInput"
# State var to bind the input.
value: Var[str]
# If true, the pin input receives focus on mount
auto_focus: Var[bool]
# The default value of the pin input
default_value: Var[str]
# The border color when the input is invalid.
error_border_color: Var[str]
# The border color when the input is focused.
focus_border_color: Var[str]
# The top-level id string that will be applied to the input fields. The index of the input will be appended to this top-level id.
id_: Var[str]
# The length of the number input.
length: Var[int]
# If true, the pin input component is put in the disabled state
is_disabled: Var[bool]
# If true, the pin input component is put in the invalid state
is_invalid: Var[bool]
# If true, focus will move automatically to the next input once filled
manage_focus: Var[bool]
# If true, the input's value will be masked just like `type=password`
mask: Var[bool]
# The placeholder for the pin input
placeholder: Var[str]
# The type of values the pin-input should allow ("number" | "alphanumeric").
type_: Var[str]
# "outline" | "flushed" | "filled" | "unstyled"
variant: Var[LiteralInputVariant]
# The name of the form field
name: Var[str]
# Fired when the pin input is changed.
on_change: EventHandler[lambda e0: [e0]]
# Fired when the pin input is completed.
on_complete: EventHandler[lambda e0: [e0]]
def _get_imports(self) -> ImportDict:
"""Include PinInputField explicitly because it may not be a child component at compile time.
Returns:
The merged import dict.
"""
range_var = Var.range(0)
return merge_imports(
super()._get_imports(),
PinInputField()._get_all_imports(), # type: ignore
range_var._var_data.imports if range_var._var_data is not None else {},
)
def get_ref(self) -> str | None:
"""Override ref handling to handle array refs.
PinInputFields may be created dynamically, so it's not possible
to compute their ref at compile time, so we return a cheating
guess if the id is specified.
The `ref` for this outer component will always be stripped off, so what
is returned here only matters for form ref collection purposes.
Returns:
None.
"""
if any(isinstance(c, PinInputField) for c in self.children):
return None
if self.id:
return format.format_array_ref(self.id, idx=self.length)
return super().get_ref()
def _get_ref_hook(self) -> Optional[str]:
"""Override the base _get_ref_hook to handle array refs.
Returns:
The overrided hooks.
"""
if self.id:
ref = format.format_array_ref(self.id, None)
refs_declaration = Var.range(self.length).foreach(
lambda: Var.create_safe("useRef(null)", _var_is_string=False),
)
refs_declaration._var_is_local = True
if ref:
return (
f"const {ref} = {str(refs_declaration)}; "
f"{str(Var.create_safe(ref, _var_is_string=False).as_ref())} = {ref}"
)
return super()._get_ref_hook()
def _render(self) -> Tag:
"""Override the base _render to remove the fake get_ref.
Returns:
The rendered component.
"""
return super()._render().remove_props("ref")
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a pin input component.
If no children are passed in, the component will create a default pin input
based on the length prop.
Args:
*children: The children of the component.
**props: The props of the component.
Returns:
The pin input component.
"""
if children:
props.pop("length", None)
elif "length" in props:
field_props = {}
if "id" in props:
field_props["id"] = props["id"]
if "name" in props:
field_props["name"] = props["name"]
children = [
PinInputField.for_length(props["length"], **field_props),
]
return super().create(*children, **props)
class PinInputField(ChakraComponent):
"""The text field that user types in - must be a direct child of PinInput."""
tag = "PinInputField"
# the position of the PinInputField inside the PinInput.
# Default to None because it is assigned by PinInput when created.
index: Optional[Var[int]] = None
# The name of the form field
name: Var[str]
@classmethod
def for_length(cls, length: Var | int, **props) -> Var:
"""Create a PinInputField for a PinInput with a given length.
Args:
length: The length of the PinInput.
props: The props of each PinInputField (name will become indexed).
Returns:
The PinInputField.
"""
name = props.get("name")
def _create(i):
if name is not None:
props["name"] = f"{name}-{i}"
return PinInputField.create(**props, index=i, key=i)
return rx.foreach( # type: ignore
ArrayVar.range(length), # type: ignore
_create,
)
def _get_ref_hook(self) -> Optional[str]:
return None
def get_ref(self):
"""Get the array ref for the pin input.
Returns:
The array ref.
"""
if self.id:
return format.format_array_ref(self.id, self.index)

View File

@ -1,193 +0,0 @@
"""Stub file for reflex/components/chakra/forms/pininput.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class PinInput(ChakraComponent):
def get_ref(self) -> str | None: ...
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[str], str]] = None,
auto_focus: Optional[Union[Var[bool], bool]] = None,
default_value: Optional[Union[Var[str], str]] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
id_: Optional[Union[Var[str], str]] = None,
length: Optional[Union[Var[int], int]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
manage_focus: Optional[Union[Var[bool], bool]] = None,
mask: Optional[Union[Var[bool], bool]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
type_: Optional[Union[Var[str], str]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_complete: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "PinInput":
"""Create a pin input component.
If no children are passed in, the component will create a default pin input
based on the length prop.
Args:
*children: The children of the component.
value: State var to bind the input.
auto_focus: If true, the pin input receives focus on mount
default_value: The default value of the pin input
error_border_color: The border color when the input is invalid.
focus_border_color: The border color when the input is focused.
id_: The top-level id string that will be applied to the input fields. The index of the input will be appended to this top-level id.
length: The length of the number input.
is_disabled: If true, the pin input component is put in the disabled state
is_invalid: If true, the pin input component is put in the invalid state
manage_focus: If true, focus will move automatically to the next input once filled
mask: If true, the input's value will be masked just like `type=password`
placeholder: The placeholder for the pin input
type_: The type of values the pin-input should allow ("number" | "alphanumeric").
variant: "outline" | "flushed" | "filled" | "unstyled"
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The pin input component.
"""
...
class PinInputField(ChakraComponent):
@classmethod
def for_length(cls, length: Var | int, **props) -> Var: ...
def get_ref(self): ...
@overload
@classmethod
def create( # type: ignore
cls,
*children,
index: Optional[Union[Var[int], int]] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "PinInputField":
"""Create the component.
Args:
*children: The children of the component.
index: the position of the PinInputField inside the PinInput. Default to None because it is assigned by PinInput when created.
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,101 +0,0 @@
"""A radio component."""
from typing import Any, List
from reflex.components.chakra import ChakraComponent
from reflex.components.chakra.typography.text import Text
from reflex.components.component import Component
from reflex.components.core.foreach import Foreach
from reflex.event import EventHandler
from reflex.utils.types import _issubclass
from reflex.vars import Var
class RadioGroup(ChakraComponent):
"""A grouping of individual radio options."""
tag = "RadioGroup"
# State var to bind the input.
value: Var[Any]
# The default value.
default_value: Var[Any]
# The name of the form field
name: Var[str]
# Fired when the radio group value changes.
on_change: EventHandler[lambda e0: [e0]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a radio group component.
Args:
*children: The children of the component.
**props: The props of the component.
Returns:
The component.
"""
if len(children) == 1 and isinstance(children[0], list):
children = [Radio.create(child) for child in children[0]]
if (
len(children) == 1
and isinstance(children[0], Var)
and _issubclass(children[0]._var_type, List)
):
children = [Foreach.create(children[0], lambda item: Radio.create(item))]
return super().create(*children, **props)
class Radio(Text):
"""Radios are used when only one choice may be selected in a series of options."""
tag = "Radio"
# Value of radio.
value: Var[Any]
# The default value.
default_value: Var[Any]
# The color scheme.
color_scheme: Var[str]
# If true, the radio will be initially checked.
default_checked: Var[bool]
# If true, the radio will be checked. You'll need to pass onChange to update its value (since it is now controlled)
is_checked: Var[bool]
# If true, the radio will be disabled.
is_disabled: Var[bool]
# If true, the radio button will be invalid. This also sets `aria-invalid` to true.
is_invalid: Var[bool]
# If true, the radio will be read-only
is_read_only: Var[bool]
# If true, the radio button will be required. This also sets `aria-required` to true.
is_required: Var[bool]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a radio component.
By default, the value is bound to the first child.
Args:
*children: The children of the component.
**props: The props of the component.
Returns:
The radio component.
"""
if "value" not in props:
assert len(children) == 1
props["value"] = children[0]
return super().create(*children, **props)

View File

@ -1,175 +0,0 @@
"""Stub file for reflex/components/chakra/forms/radio.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.components.chakra.typography.text import Text
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class RadioGroup(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[Any], Any]] = None,
default_value: Optional[Union[Var[Any], Any]] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "RadioGroup":
"""Create a radio group component.
Args:
*children: The children of the component.
value: State var to bind the input.
default_value: The default value.
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class Radio(Text):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[Any], Any]] = None,
default_value: Optional[Union[Var[Any], Any]] = None,
color_scheme: Optional[Union[Var[str], str]] = None,
default_checked: Optional[Union[Var[bool], bool]] = None,
is_checked: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
as_: Optional[Union[Var[str], str]] = None,
no_of_lines: Optional[Union[Var[int], int]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Radio":
"""Create a radio component.
By default, the value is bound to the first child.
Args:
*children: The children of the component.
value: Value of radio.
default_value: The default value.
color_scheme: The color scheme.
default_checked: If true, the radio will be initially checked.
is_checked: If true, the radio will be checked. You'll need to pass onChange to update its value (since it is now controlled)
is_disabled: If true, the radio will be disabled.
is_invalid: If true, the radio button will be invalid. This also sets `aria-invalid` to true.
is_read_only: If true, the radio will be read-only
is_required: If true, the radio button will be required. This also sets `aria-required` to true.
as_: Override the tag. The default tag is `<p>`.
no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The radio component.
"""
...

View File

@ -1,149 +0,0 @@
"""A range slider component."""
from __future__ import annotations
from typing import List, Optional
from reflex.components.chakra import ChakraComponent, LiteralChakraDirection
from reflex.components.component import Component
from reflex.event import EventHandler
from reflex.utils import format
from reflex.vars import Var
class RangeSlider(ChakraComponent):
"""The RangeSlider is a multi thumb slider used to select a range of related values. A common use-case of this component is a price range picker that allows a user to set the minimum and maximum price."""
tag = "RangeSlider"
# State var to bind the input.
value: Var[List[int]]
# The default values.
default_value: Var[List[int]]
# The writing mode ("ltr" | "rtl")
direction: Var[LiteralChakraDirection]
# If false, the slider handle will not capture focus when value changes.
focus_thumb_on_change: Var[bool]
# If true, the slider will be disabled
is_disabled: Var[bool]
# If true, the slider will be in `read-only` state.
is_read_only: Var[bool]
# If true, the value will be incremented or decremented in reverse.
is_reversed: Var[bool]
# The minimum value of the slider.
min_: Var[int]
# The maximum value of the slider.
max_: Var[int]
# The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together.
min_steps_between_thumbs: Var[int]
# The name of the form field
name: Var[str]
# Fired when the value changes.
on_change: EventHandler[lambda e0: [e0]]
# Fired when the value starts changing.
on_change_start: EventHandler[lambda e0: [e0]]
# Fired when the value stops changing.
on_change_end: EventHandler[lambda e0: [e0]]
def get_ref(self):
"""Get the ref of the component.
Returns:
The ref of the component.
"""
return None
def _get_ref_hook(self) -> Optional[str]:
"""Override the base _get_ref_hook to handle array refs.
Returns:
The overrided hooks.
"""
if self.id:
ref = format.format_array_ref(self.id, None)
if ref:
return (
f"const {ref} = Array.from({{length:2}}, () => useRef(null)); "
f"{str(Var.create_safe(ref, _var_is_string=False).as_ref())} = {ref}"
)
return super()._get_ref_hook()
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a RangeSlider component.
If no children are provided, a default RangeSlider will be created.
Args:
*children: The children of the component.
**props: The properties of the component.
Returns:
The RangeSlider component.
"""
if len(children) == 0:
_id = props.get("id", None)
if _id:
children = [
RangeSliderTrack.create(
RangeSliderFilledTrack.create(),
),
RangeSliderThumb.create(index=0, id=_id),
RangeSliderThumb.create(index=1, id=_id),
]
else:
children = [
RangeSliderTrack.create(
RangeSliderFilledTrack.create(),
),
RangeSliderThumb.create(index=0),
RangeSliderThumb.create(index=1),
]
return super().create(*children, **props)
class RangeSliderTrack(ChakraComponent):
"""A range slider track."""
tag = "RangeSliderTrack"
class RangeSliderFilledTrack(ChakraComponent):
"""A filled range slider track."""
tag = "RangeSliderFilledTrack"
class RangeSliderThumb(ChakraComponent):
"""A range slider thumb."""
tag = "RangeSliderThumb"
# The position of the thumb.
index: Var[int]
def _get_ref_hook(self) -> Optional[str]:
# hook is None because RangeSlider is handling it.
return None
def get_ref(self):
"""Get an array ref for the range slider thumb.
Returns:
The array ref.
"""
if self.id:
return format.format_array_ref(self.id, self.index)

View File

@ -1,312 +0,0 @@
"""Stub file for reflex/components/chakra/forms/rangeslider.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class RangeSlider(ChakraComponent):
def get_ref(self): ...
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[List[int]], List[int]]] = None,
default_value: Optional[Union[Var[List[int]], List[int]]] = None,
direction: Optional[
Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]
] = None,
focus_thumb_on_change: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_reversed: Optional[Union[Var[bool], bool]] = None,
min_: Optional[Union[Var[int], int]] = None,
max_: Optional[Union[Var[int], int]] = None,
min_steps_between_thumbs: Optional[Union[Var[int], int]] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_change_end: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_change_start: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "RangeSlider":
"""Create a RangeSlider component.
If no children are provided, a default RangeSlider will be created.
Args:
*children: The children of the component.
value: State var to bind the input.
default_value: The default values.
direction: The writing mode ("ltr" | "rtl")
focus_thumb_on_change: If false, the slider handle will not capture focus when value changes.
is_disabled: If true, the slider will be disabled
is_read_only: If true, the slider will be in `read-only` state.
is_reversed: If true, the value will be incremented or decremented in reverse.
min_: The minimum value of the slider.
max_: The maximum value of the slider.
min_steps_between_thumbs: The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together.
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The RangeSlider component.
"""
...
class RangeSliderTrack(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "RangeSliderTrack":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class RangeSliderFilledTrack(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "RangeSliderFilledTrack":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class RangeSliderThumb(ChakraComponent):
def get_ref(self): ...
@overload
@classmethod
def create( # type: ignore
cls,
*children,
index: Optional[Union[Var[int], int]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "RangeSliderThumb":
"""Create the component.
Args:
*children: The children of the component.
index: The position of the thumb.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,103 +0,0 @@
"""A select component."""
from typing import Any, List
from reflex.components.chakra import ChakraComponent, LiteralInputVariant
from reflex.components.chakra.typography.text import Text
from reflex.components.component import Component
from reflex.components.core.foreach import Foreach
from reflex.event import EventHandler
from reflex.utils.types import _issubclass
from reflex.vars import Var
class Select(ChakraComponent):
"""Select component is a component that allows users pick a value from predefined options. Ideally, it should be used when there are more than 5 options, otherwise you might consider using a radio group instead."""
tag = "Select"
# State var to bind the select.
value: Var[str]
# The default value of the select.
default_value: Var[str]
# The placeholder text.
placeholder: Var[str]
# The border color when the select is invalid.
error_border_color: Var[str]
# The border color when the select is focused.
focus_border_color: Var[str]
# If true, the select will be disabled.
is_disabled: Var[bool]
# If true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_invalid: Var[bool]
# If true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
is_required: Var[bool]
# "outline" | "filled" | "flushed" | "unstyled"
variant: Var[LiteralInputVariant]
# The size of the select.
size: Var[str]
# The name of the form field
name: Var[str]
# Fired when the value changes.
on_change: EventHandler[lambda e0: [e0.target.value]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a select component.
If a list is provided as the first children, a default component
will be created for each item in the list.
Args:
*children: The children of the component.
**props: The props of the component.
Returns:
The component.
"""
if len(children) == 1 and isinstance(children[0], list):
children = [Option.create(child) for child in children[0]]
if (
len(children) == 1
and isinstance(children[0], Var)
and _issubclass(children[0]._var_type, List)
):
children = [Foreach.create(children[0], lambda item: Option.create(item))]
return super().create(*children, **props)
class Option(Text):
"""A select option."""
tag = "option"
value: Var[Any]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a select option component.
By default, the value of the option is the text of the option.
Args:
*children: The children of the component.
**props: The props of the component.
Returns:
The component.
"""
if "value" not in props:
assert len(children) == 1
props["value"] = children[0]
return super().create(*children, **props)

View File

@ -1,182 +0,0 @@
"""Stub file for reflex/components/chakra/forms/select.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.components.chakra.typography.text import Text
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
class Select(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[str], str]] = None,
placeholder: Optional[Union[Var[str], str]] = None,
error_border_color: Optional[Union[Var[str], str]] = None,
focus_border_color: Optional[Union[Var[str], str]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_invalid: Optional[Union[Var[bool], bool]] = None,
is_required: Optional[Union[Var[bool], bool]] = None,
variant: Optional[
Union[
Var[Literal["outline", "filled", "flushed", "unstyled"]],
Literal["outline", "filled", "flushed", "unstyled"],
]
] = None,
size: Optional[Union[Var[str], str]] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, 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,
**props,
) -> "Select":
"""Create a select component.
If a list is provided as the first children, a default component
will be created for each item in the list.
Args:
*children: The children of the component.
value: State var to bind the select.
default_value: The default value of the select.
placeholder: The placeholder text.
error_border_color: The border color when the select is invalid.
focus_border_color: The border color when the select is focused.
is_disabled: If true, the select will be disabled.
is_invalid: If true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
is_required: If true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
variant: "outline" | "filled" | "flushed" | "unstyled"
size: The size of the select.
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class Option(Text):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[Any], Any]] = None,
as_: Optional[Union[Var[str], str]] = None,
no_of_lines: Optional[Union[Var[int], int]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Option":
"""Create a select option component.
By default, the value of the option is the text of the option.
Args:
*children: The children of the component.
as_: Override the tag. The default tag is `<p>`.
no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,130 +0,0 @@
"""A slider component."""
from __future__ import annotations
from typing import Literal
from reflex.components.chakra import ChakraComponent, LiteralChakraDirection
from reflex.components.component import Component
from reflex.event import EventHandler
from reflex.vars import Var
LiteralLayout = Literal["horizontal", "vertical"]
class Slider(ChakraComponent):
"""The wrapper that provides context and functionality for all children."""
tag = "Slider"
# State var to bind the input.
value: Var[int]
# The color scheme.
color_scheme: Var[str]
# The placeholder text.
default_value: Var[int]
# The writing mode ("ltr" | "rtl")
direction: Var[LiteralChakraDirection]
# If false, the slider handle will not capture focus when value changes.
focus_thumb_on_change: Var[bool]
# If true, the slider will be disabled
is_disabled: Var[bool]
# If true, the slider will be in `read-only` state.
is_read_only: Var[bool]
# If true, the value will be incremented or decremented in reverse.
is_reversed: Var[bool]
# The minimum value of the slider.
min_: Var[int]
# The maximum value of the slider.
max_: Var[int]
# The step in which increments/decrements have to be made
step: Var[int]
# The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together.
min_steps_between_thumbs: Var[int]
# Oreintation of the slider vertical | horizontal.
orientation: Var[LiteralLayout]
# Minimum height of the slider.
min_h: Var[str]
# Minimum width of the slider.
min_w: Var[str]
# Maximum height of the slider.
max_h: Var[str]
# Maximum width of the slider.
max_w: Var[str]
# The name of the form field
name: Var[str]
# Fired when the value changes.
on_change: EventHandler[lambda e0: [e0]]
# Fired when the value starts changing.
on_change_start: EventHandler[lambda e0: [e0]]
# Fired when the value stops changing.
on_change_end: EventHandler[lambda e0: [e0]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create a slider component.
If no children are provided, a default slider will be created.
Args:
*children: The children of the component.
**props: The properties of the component.
Returns:
The slider component.
"""
if len(children) == 0:
children = [
SliderTrack.create(
SliderFilledTrack.create(),
),
SliderThumb.create(),
]
return super().create(*children, **props)
class SliderTrack(ChakraComponent):
"""The empty part of the slider that shows the track."""
tag = "SliderTrack"
class SliderFilledTrack(ChakraComponent):
"""The filled part of the slider."""
tag = "SliderFilledTrack"
class SliderThumb(ChakraComponent):
"""The handle that's used to change the slider value."""
tag = "SliderThumb"
# The size of the thumb.
box_size: Var[str]
class SliderMark(ChakraComponent):
"""The label or mark that shows names for specific slider values."""
tag = "SliderMark"

View File

@ -1,397 +0,0 @@
"""Stub file for reflex/components/chakra/forms/slider.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.chakra import ChakraComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import Var
LiteralLayout = Literal["horizontal", "vertical"]
class Slider(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
value: Optional[Union[Var[int], int]] = None,
color_scheme: Optional[Union[Var[str], str]] = None,
default_value: Optional[Union[Var[int], int]] = None,
direction: Optional[
Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]
] = None,
focus_thumb_on_change: Optional[Union[Var[bool], bool]] = None,
is_disabled: Optional[Union[Var[bool], bool]] = None,
is_read_only: Optional[Union[Var[bool], bool]] = None,
is_reversed: Optional[Union[Var[bool], bool]] = None,
min_: Optional[Union[Var[int], int]] = None,
max_: Optional[Union[Var[int], int]] = None,
step: Optional[Union[Var[int], int]] = None,
min_steps_between_thumbs: Optional[Union[Var[int], int]] = None,
orientation: Optional[
Union[
Var[Literal["horizontal", "vertical"]],
Literal["horizontal", "vertical"],
]
] = None,
min_h: Optional[Union[Var[str], str]] = None,
min_w: Optional[Union[Var[str], str]] = None,
max_h: Optional[Union[Var[str], str]] = None,
max_w: Optional[Union[Var[str], str]] = None,
name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_change_end: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_change_start: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Slider":
"""Create a slider component.
If no children are provided, a default slider will be created.
Args:
*children: The children of the component.
value: State var to bind the input.
color_scheme: The color scheme.
default_value: The placeholder text.
direction: The writing mode ("ltr" | "rtl")
focus_thumb_on_change: If false, the slider handle will not capture focus when value changes.
is_disabled: If true, the slider will be disabled
is_read_only: If true, the slider will be in `read-only` state.
is_reversed: If true, the value will be incremented or decremented in reverse.
min_: The minimum value of the slider.
max_: The maximum value of the slider.
step: The step in which increments/decrements have to be made
min_steps_between_thumbs: The minimum distance between slider thumbs. Useful for preventing the thumbs from being too close together.
orientation: Oreintation of the slider vertical | horizontal.
min_h: Minimum height of the slider.
min_w: Minimum width of the slider.
max_h: Maximum height of the slider.
max_w: Maximum width of the slider.
name: The name of the form field
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the component.
Returns:
The slider component.
"""
...
class SliderTrack(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "SliderTrack":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class SliderFilledTrack(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "SliderFilledTrack":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class SliderThumb(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
box_size: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "SliderThumb":
"""Create the component.
Args:
*children: The children of the component.
box_size: The size of the thumb.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...
class SliderMark(ChakraComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "SliderMark":
"""Create the component.
Args:
*children: The children of the component.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The props of the component.
Returns:
The component.
"""
...

View File

@ -1,50 +0,0 @@
"""A switch component."""
from __future__ import annotations
from reflex.components.chakra import ChakraComponent, LiteralColorScheme
from reflex.event import EventHandler
from reflex.ivars.base import LiteralVar
from reflex.vars import Var
class Switch(ChakraComponent):
"""Toggleable switch component."""
tag = "Switch"
# If true, the switch will be checked. You'll need to set an on_change event handler to update its value (since it is now controlled)
is_checked: Var[bool]
# If true, the switch will be disabled
is_disabled: Var[bool]
# If true and is_disabled prop is set, the switch will remain tabbable but not interactive.
is_focusable: Var[bool]
# If true, the switch is marked as invalid. Changes style of unchecked state.
is_invalid: Var[bool]
# If true, the switch will be readonly
is_read_only: Var[bool]
# If true, the switch will be required
is_required: Var[bool]
# The name of the input field in a switch (Useful for form submission).
name: Var[str]
# The value of the input field when checked (use is_checked prop for a bool)
value: Var[str] = LiteralVar.create("true")
# The spacing between the switch and its label text (0.5rem)
spacing: Var[str]
# The placeholder text.
placeholder: Var[str]
# The color scheme of the switch (e.g. "blue", "green", "red", etc.)
color_scheme: Var[LiteralColorScheme]
# Fired when the switch value changes
on_change: EventHandler[lambda e0: [e0.target.checked]]

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