add pyi_generator script (#1708)

This commit is contained in:
Thomas Brandého 2023-08-31 23:25:56 +02:00 committed by GitHub
parent fed75ea7f8
commit 63b5fbd7b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
97 changed files with 2520 additions and 21 deletions

View File

@ -35,7 +35,7 @@ def DynamicRoute():
def index():
return rx.fragment(
rx.input(value=DynamicState.token, is_read_only=True, id="token"),
rx.input(value=DynamicState.token, is_read_only=True, id="token"), # type: ignore
rx.input(value=DynamicState.page_id, is_read_only=True, id="page_id"),
rx.link("index", href="/", id="link_index"),
rx.link("page_X", href="/static/x", id="link_page_x"),

View File

@ -89,3 +89,4 @@ target-version = "py37"
"__init__.py" = ["F401"]
"tests/*.py" = ["D100", "D103", "D104"]
"reflex/.templates/*.py" = ["D100", "D103", "D104"]
"*.pyi" = ["ALL"]

View File

@ -0,0 +1,14 @@
"""Stub file for body.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Body(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "Body": ... # type: ignore

View File

@ -0,0 +1,40 @@
"""Stub file for document.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class NextDocumentLib(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "NextDocumentLib": ... # type: ignore
class Html(NextDocumentLib):
@overload
@classmethod
def create(cls, *children, **props) -> "Html": ... # type: ignore
class DocumentHead(NextDocumentLib):
@overload
@classmethod
def create(cls, *children, **props) -> "DocumentHead": ... # type: ignore
class Main(NextDocumentLib):
@overload
@classmethod
def create(cls, *children, **props) -> "Main": ... # type: ignore
class NextScript(NextDocumentLib):
@overload
@classmethod
def create(cls, *children, **props) -> "NextScript": ... # type: ignore
class ColorModeScript(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ColorModeScript": ... # type: ignore

View File

@ -0,0 +1,19 @@
"""Stub file for head.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class NextHeadLib(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "NextHeadLib": ... # type: ignore
class Head(NextHeadLib):
@overload
@classmethod
def create(cls, *children, **props) -> "Head": ... # type: ignore

View File

@ -0,0 +1,19 @@
"""Stub file for link.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class RawLink(Component):
@overload
@classmethod
def create(cls, *children, href: Optional[Union[Var[str], str]] = None, rel: Optional[Union[Var[str], str]] = None, **props) -> "RawLink": ... # type: ignore
class ScriptTag(Component):
@overload
@classmethod
def create(cls, *children, type_: Optional[Union[Var[str], str]] = None, source: Optional[Union[Var[str], str]] = None, integrity: Optional[Union[Var[str], str]] = None, crossorigin: Optional[Union[Var[str], str]] = None, referrer_policy: Optional[Union[Var[str], str]] = None, is_async: Optional[Union[Var[bool], bool]] = None, defer: Optional[Union[Var[bool], bool]] = None, **props) -> "ScriptTag": ... # type: ignore

View File

@ -0,0 +1,29 @@
"""Stub file for meta.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Title(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "Title": ... # type: ignore
class Meta(Component):
@overload
@classmethod
def create(cls, *children, char_set: Optional[str] = None, content: Optional[str] = None, name: Optional[str] = None, property: Optional[str] = None, http_equiv: Optional[str] = None, **props) -> "Meta": ... # type: ignore
class Description(Meta):
@overload
@classmethod
def create(cls, *children, name: Optional[str] = None, **props) -> "Description": ... # type: ignore
class Image(Meta):
@overload
@classmethod
def create(cls, *children, property: Optional[str] = None, **props) -> "Image": ... # type: ignore

View File

@ -0,0 +1,16 @@
"""Stub file for script.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Set, Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
def client_side(javascript_code) -> Var[EventChain]: ...
class Script(Component):
@overload
@classmethod
def create(cls, *children, src: Optional[Union[Var[str], str]] = None, strategy: Optional[Union[Var[str], str]] = None, **props) -> "Script": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for badge.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Badge(ChakraComponent):
@overload
@classmethod
def create(cls, *children, variant: Optional[Union[Var[str], str]] = None, color_scheme: Optional[Union[Var[str], str]] = None, **props) -> "Badge": ... # type: ignore

View File

@ -1,6 +1,6 @@
"""A code component."""
from typing import Dict
from typing import Dict, Optional, Union
from reflex.components.component import Component
from reflex.components.forms import Button
@ -13,7 +13,7 @@ from reflex.utils import imports
from reflex.vars import ImportVar, Var
# Path to the prism styles.
PRISM_STYLES_PATH = "/styles/code/prism"
PRISM_STYLES_PATH: str = "/styles/code/prism"
class CodeBlock(Component):
@ -53,7 +53,13 @@ class CodeBlock(Component):
return merged_imports
@classmethod
def create(cls, *children, can_copy=False, copy_button=None, **props):
def create(
cls,
*children,
can_copy: Optional[bool] = False,
copy_button: Optional[Union[bool, Component]] = None,
**props
):
"""Create a text component.
Args:
@ -70,7 +76,7 @@ class CodeBlock(Component):
if can_copy:
code = children[0]
copy_button = (
copy_button = ( # type: ignore
copy_button
if copy_button is not None
else Button.create(

View File

@ -0,0 +1,22 @@
"""Stub file for code.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
PRISM_STYLES_PATH: str
class CodeBlock(Component):
@overload
@classmethod
def create(cls, *children, can_copy: Optional[bool] = None, copy_button: Optional[Union[bool, Component]] = None, theme: Optional[Union[Var[str], str]] = None, language: Optional[Union[Var[str], str]] = None, show_line_numbers: Optional[Union[Var[bool], bool]] = None, starting_line_number: Optional[Union[Var[int], int]] = None, wrap_long_lines: Optional[Union[Var[bool], bool]] = None, custom_style: Optional[Union[Var[Dict[str, str]], Dict[str, str]]] = None, code_tag_props: Optional[Union[Var[Dict[str, str]], Dict[str, str]]] = None, **props) -> "CodeBlock": ... # type: ignore
class Code(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Code": ... # type: ignore

View File

@ -0,0 +1,19 @@
"""Stub file for datatable.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, List, Any, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Gridjs(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "Gridjs": ... # type: ignore
class DataTable(Gridjs):
@overload
@classmethod
def create(cls, *children, data: Optional[Any] = None, columns: Optional[Union[Var[List], List]] = None, search: Optional[Union[Var[bool], bool]] = None, sort: Optional[Union[Var[bool], bool]] = None, resizable: Optional[Union[Var[bool], bool]] = None, pagination: Optional[Union[Var[Union[bool, Dict]], Union[bool, Dict]]] = None, **props) -> "DataTable": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for divider.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Divider(ChakraComponent):
@overload
@classmethod
def create(cls, *children, orientation: Optional[Union[Var[str], str]] = None, variant: Optional[Union[Var[str], str]] = None, **props) -> "Divider": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for keyboard_key.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class KeyboardKey(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "KeyboardKey": ... # type: ignore

View File

@ -0,0 +1,30 @@
"""Stub file for list.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class List(ChakraComponent):
@overload
@classmethod
def create(cls, *children, items, spacing: Optional[Union[Var[str], str]] = None, style_position: Optional[Union[Var[str], str]] = None, style_type: Optional[Union[Var[str], str]] = None, **props) -> "List": ... # type: ignore
class ListItem(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ListItem": ... # type: ignore
class OrderedList(List):
@overload
@classmethod
def create(cls, *children, items, **props) -> "OrderedList": ... # type: ignore
class UnorderedList(List):
@overload
@classmethod
def create(cls, *children, items, **props) -> "UnorderedList": ... # type: ignore

View File

@ -0,0 +1,40 @@
"""Stub file for stat.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Stat(ChakraComponent):
@overload
@classmethod
def create(cls, *children, label, number, help_text, arrow_type, **props) -> "Stat": ... # type: ignore
class StatLabel(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StatLabel": ... # type: ignore
class StatNumber(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StatNumber": ... # type: ignore
class StatHelpText(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StatHelpText": ... # type: ignore
class StatArrow(ChakraComponent):
@overload
@classmethod
def create(cls, *children, type_: Optional[Union[Var[str], str]] = None, **props) -> "StatArrow": ... # type: ignore
class StatGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StatGroup": ... # type: ignore

View File

@ -0,0 +1,55 @@
"""Stub file for table.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Table(ChakraComponent):
@overload
@classmethod
def create(cls, *children, caption, headers, rows, footers, 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, **props) -> "Table": ... # type: ignore
class Thead(ChakraComponent):
@overload
@classmethod
def create(cls, *children, headers, invalid_children: Optional[List[str]] = None, **props) -> "Thead": ... # type: ignore
class Tbody(ChakraComponent):
@overload
@classmethod
def create(cls, *children, rows, invalid_children: Optional[List[str]] = None, **props) -> "Tbody": ... # type: ignore
class Tfoot(ChakraComponent):
@overload
@classmethod
def create(cls, *children, footers, invalid_children: Optional[List[str]] = None, **props) -> "Tfoot": ... # type: ignore
class Tr(ChakraComponent):
@overload
@classmethod
def create(cls, *children, cell_type: Optional[str] = None, cells, invalid_children: Optional[List[str]] = None, **props) -> "Tr": ... # type: ignore
class Th(ChakraComponent):
@overload
@classmethod
def create(cls, *children, invalid_children: Optional[List[str]] = None, is_numeric: Optional[Union[Var[bool], bool]] = None, **props) -> "Th": ... # type: ignore
class Td(ChakraComponent):
@overload
@classmethod
def create(cls, *children, invalid_children: Optional[List[str]] = None, is_numeric: Optional[Union[Var[bool], bool]] = None, **props) -> "Td": ... # type: ignore
class TableCaption(ChakraComponent):
@overload
@classmethod
def create(cls, *children, placement: Optional[Union[Var[str], str]] = None, **props) -> "TableCaption": ... # type: ignore
class TableContainer(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TableContainer": ... # type: ignore

View File

@ -0,0 +1,35 @@
"""Stub file for tag.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class TagLabel(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TagLabel": ... # type: ignore
class TagLeftIcon(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TagLeftIcon": ... # type: ignore
class TagRightIcon(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TagRightIcon": ... # type: ignore
class TagCloseButton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TagCloseButton": ... # type: ignore
class Tag(ChakraComponent):
@overload
@classmethod
def create(cls, *children, left_icon: Optional[Component] = None, right_icon: Optional[Component] = None, close_button: Optional[Component] = None, color_scheme: Optional[Union[Var[str], str]] = None, size: Optional[Union[Var[str], str]] = None, variant: Optional[Union[Var[str], str]] = None, **props) -> "Tag": ... # type: ignore

View File

@ -0,0 +1,35 @@
"""Stub file for accordion.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Accordion(ChakraComponent):
@overload
@classmethod
def create(cls, *children, items, icon_pos, allow_multiple: Optional[Union[Var[bool], bool]] = None, allow_toggle: Optional[Union[Var[bool], bool]] = None, default_index: Optional[Union[Var[Optional[List[int]]], Optional[List[int]]]] = None, index: Optional[Union[Var[Union[int, List[int]]], Union[int, List[int]]]] = None, reduce_motion: Optional[Union[Var[bool], bool]] = None, **props) -> "Accordion": ... # type: ignore
class AccordionItem(ChakraComponent):
@overload
@classmethod
def create(cls, *children, id_: Optional[Union[Var[str], str]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_focusable: Optional[Union[Var[bool], bool]] = None, **props) -> "AccordionItem": ... # type: ignore
class AccordionButton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AccordionButton": ... # type: ignore
class AccordionPanel(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AccordionPanel": ... # type: ignore
class AccordionIcon(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AccordionIcon": ... # type: ignore

View File

@ -0,0 +1,35 @@
"""Stub file for tabs.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Tabs(ChakraComponent):
@overload
@classmethod
def create(cls, *children, items, align: Optional[Union[Var[str], str]] = 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[str], str]] = None, **props) -> "Tabs": ... # type: ignore
class Tab(ChakraComponent):
@overload
@classmethod
def create(cls, *children, is_disabled: Optional[Union[Var[bool], bool]] = None, is_selected: Optional[Union[Var[bool], bool]] = None, id_: Optional[Union[Var[str], str]] = None, panel_id: Optional[Union[Var[str], str]] = None, **props) -> "Tab": ... # type: ignore
class TabList(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TabList": ... # type: ignore
class TabPanels(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TabPanels": ... # type: ignore
class TabPanel(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "TabPanel": ... # type: ignore

View File

@ -0,0 +1,40 @@
"""Stub file for transition.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Transition(ChakraComponent):
@overload
@classmethod
def create(cls, *children, in_: Optional[Union[Var[bool], bool]] = None, unmount_on_exit: Optional[Union[Var[bool], bool]] = None, **props) -> "Transition": ... # type: ignore
class Fade(Transition):
@overload
@classmethod
def create(cls, *children, **props) -> "Fade": ... # type: ignore
class ScaleFade(Transition):
@overload
@classmethod
def create(cls, *children, initial_scale: Optional[Union[Var[float], float]] = None, reverse: Optional[Union[Var[bool], bool]] = None, **props) -> "ScaleFade": ... # type: ignore
class Slide(Transition):
@overload
@classmethod
def create(cls, *children, direction: Optional[Union[Var[str], str]] = None, **props) -> "Slide": ... # type: ignore
class SlideFade(Transition):
@overload
@classmethod
def create(cls, *children, offsetX: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None, offsetY: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None, reverse: Optional[Union[Var[bool], bool]] = None, **props) -> "SlideFade": ... # type: ignore
class Collapse(Transition):
@overload
@classmethod
def create(cls, *children, animateOpacity: Optional[Union[Var[bool], bool]] = None, endingHeight: Optional[Union[Var[str], str]] = None, startingHeight: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None, **props) -> "Collapse": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for visuallyhidden.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class VisuallyHidden(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "VisuallyHidden": ... # type: ignore

View File

@ -0,0 +1,30 @@
"""Stub file for alert.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Alert(ChakraComponent):
@overload
@classmethod
def create(cls, *children, icon, title, desc, status: Optional[Union[Var[str], str]] = None, variant: Optional[Union[Var[str], str]] = None, **props) -> "Alert": ... # type: ignore
class AlertIcon(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertIcon": ... # type: ignore
class AlertTitle(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertTitle": ... # type: ignore
class AlertDescription(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertDescription": ... # type: ignore

View File

@ -0,0 +1,20 @@
"""Stub file for circularprogress.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class CircularProgress(ChakraComponent):
@overload
@classmethod
def create(cls, *children, label, 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[int], 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, **props) -> "CircularProgress": ... # type: ignore
class CircularProgressLabel(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "CircularProgressLabel": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for progress.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Progress(ChakraComponent):
@overload
@classmethod
def create(cls, *children, has_stripe: Optional[Union[Var[bool], bool]] = None, is_animated: Optional[Union[Var[bool], bool]] = None, is_indeterminate: Optional[Union[Var[bool], bool]] = None, max_: Optional[Union[Var[int], int]] = None, min_: Optional[Union[Var[int], int]] = None, value: Optional[Union[Var[Union[int, float]], Union[int, float]]] = None, color_scheme: Optional[Union[Var[str], str]] = None, **props) -> "Progress": ... # type: ignore

View File

@ -0,0 +1,25 @@
"""Stub file for skeleton.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Skeleton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, end_color: Optional[Union[Var[str], str]] = None, fade_duration: Optional[Union[Var[float], float]] = None, is_loaded: Optional[Union[Var[bool], bool]] = None, speed: Optional[Union[Var[float], float]] = None, start_color: Optional[Union[Var[str], str]] = None, **props) -> "Skeleton": ... # type: ignore
class SkeletonCircle(ChakraComponent):
@overload
@classmethod
def create(cls, *children, end_color: Optional[Union[Var[str], str]] = None, fade_duration: Optional[Union[Var[float], float]] = None, is_loaded: Optional[Union[Var[bool], bool]] = None, speed: Optional[Union[Var[float], float]] = None, start_color: Optional[Union[Var[str], str]] = None, **props) -> "SkeletonCircle": ... # type: ignore
class SkeletonText(ChakraComponent):
@overload
@classmethod
def create(cls, *children, end_color: Optional[Union[Var[str], str]] = None, fade_duration: Optional[Union[Var[float], float]] = None, is_loaded: Optional[Union[Var[bool], bool]] = None, speed: Optional[Union[Var[float], float]] = None, start_color: Optional[Union[Var[str], str]] = None, no_of_lines: Optional[Union[Var[int], int]] = None, **props) -> "SkeletonText": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for spinner.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Spinner(ChakraComponent):
@overload
@classmethod
def create(cls, *children, empty_color: Optional[Union[Var[str], str]] = None, label: Optional[Union[Var[str], str]] = None, speed: Optional[Union[Var[str], str]] = None, thickness: Optional[Union[Var[int], int]] = None, size: Optional[Union[Var[str], str]] = None, **props) -> "Spinner": ... # type: ignore

View File

@ -0,0 +1,20 @@
"""Stub file for button.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Button(ChakraComponent):
@overload
@classmethod
def create(cls, *children, icon_spacing: Optional[Union[Var[int], int]] = None, is_active: Optional[Union[Var[bool], bool]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_full_width: Optional[Union[Var[bool], bool]] = None, is_loading: Optional[Union[Var[bool], bool]] = None, loading_text: Optional[Union[Var[str], str]] = None, size: Optional[Union[Var[str], str]] = None, variant: Optional[Union[Var[str], str]] = None, color_scheme: Optional[Union[Var[str], str]] = None, type_: Optional[Union[Var[str], str]] = None, invalid_children: Optional[List[str]] = None, **props) -> "Button": ... # type: ignore
class ButtonGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, is_attached: Optional[Union[Var[bool], bool]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, spacing: Optional[Union[Var[int], int]] = None, **props) -> "ButtonGroup": ... # type: ignore

View File

@ -0,0 +1,20 @@
"""Stub file for checkbox.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Checkbox(ChakraComponent):
@overload
@classmethod
def create(cls, *children, color_scheme: Optional[Union[Var[str], str]] = None, size: Optional[Union[Var[str], str]] = 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, spacing: Optional[Union[Var[str], str]] = None, **props) -> "Checkbox": ... # type: ignore
class CheckboxGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, value: Optional[Union[Var[str], str]] = None, default_value: Optional[Union[Var[str], str]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_native: Optional[Union[Var[bool], bool]] = None, **props) -> "CheckboxGroup": ... # type: ignore

View File

@ -27,9 +27,9 @@ from reflex.vars import BaseVar
from .button import Button
from .switch import Switch
DEFAULT_COLOR_MODE = "light"
DEFAULT_LIGHT_ICON = Icon.create(tag="sun")
DEFAULT_DARK_ICON = Icon.create(tag="moon")
DEFAULT_COLOR_MODE: str = "light"
DEFAULT_LIGHT_ICON: Icon = Icon.create(tag="sun")
DEFAULT_DARK_ICON: Icon = Icon.create(tag="moon")
def color_mode_cond(light: Any, dark: Any = None) -> BaseVar | Component:

View File

@ -0,0 +1,34 @@
"""Stub file for colormodeswitch.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional, Any
from reflex.components.component import Component
from reflex.components.media.icon import Icon
from reflex.components.forms.switch import Switch
from reflex.components.forms.button import Button
from reflex.components.layout.cond import Cond
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
DEFAULT_COLOR_MODE: str
DEFAULT_LIGHT_ICON: Icon
DEFAULT_DARK_ICON: Icon
def color_mode_cond(light: Any, dark: Any = None) -> BaseVar | Component: ...
class ColorModeIcon(Cond):
@overload
@classmethod
def create(cls, *children, **props) -> "ColorModeIcon": ... # type: ignore
class ColorModeSwitch(Switch):
@overload
@classmethod
def create(cls, *children, **props) -> "ColorModeSwitch": ... # type: ignore
class ColorModeButton(Button):
@overload
@classmethod
def create(cls, *children, **props) -> "ColorModeButton": ... # type: ignore

View File

@ -0,0 +1,14 @@
"""Stub file for copytoclipboard.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Set, Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class CopyToClipboard(Component):
@overload
@classmethod
def create(cls, *children, text: Optional[Union[Var[str], str]] = None, **props) -> "CopyToClipboard": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for date_picker.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.components.forms.input import Input
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class DatePicker(Input):
@overload
@classmethod
def create(cls, *children, type_: Optional[Union[Var[str], str]] = None, **props) -> "DatePicker": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for date_time_picker.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.components.forms.input import Input
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class DateTimePicker(Input):
@overload
@classmethod
def create(cls, *children, type_: Optional[Union[Var[str], str]] = None, **props) -> "DateTimePicker": ... # type: ignore

View File

@ -0,0 +1,19 @@
"""Stub file for debounce.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional, Any
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
def props_not_none(c: Component) -> dict[str, Any]: ...
def _collect_first_child_and_props(
c: Component,
) -> tuple[Component, dict[str, Any]]: ...
class DebounceInput(Component):
@overload
@classmethod
def create(cls, *children, min_length: Optional[Union[Var[int], int]] = None, debounce_timeout: Optional[Union[Var[int], int]] = None, force_notify_by_enter: Optional[Union[Var[bool], bool]] = None, force_notify_on_blur: Optional[Union[Var[bool], bool]] = None, value: Optional[Union[Var[str], str]] = None, **props) -> "DebounceInput": ... # type: ignore

View File

@ -0,0 +1,30 @@
"""Stub file for editable.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Editable(ChakraComponent):
@overload
@classmethod
def create(cls, *children, is_disabled: Optional[Union[Var[bool], bool]] = None, is_preview_focusable: Optional[Union[Var[bool], bool]] = None, placeholder: Optional[Union[Var[str], str]] = None, select_all_on_focus: Optional[Union[Var[bool], bool]] = None, start_with_edit_view: Optional[Union[Var[bool], bool]] = None, submit_on_blur: Optional[Union[Var[bool], bool]] = None, value: Optional[Union[Var[str], str]] = None, default_value: Optional[Union[Var[str], str]] = None, **props) -> "Editable": ... # type: ignore
class EditableInput(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "EditableInput": ... # type: ignore
class EditableTextarea(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "EditableTextarea": ... # type: ignore
class EditablePreview(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "EditablePreview": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for email.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.components.forms.input import Input
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Email(Input):
@overload
@classmethod
def create(cls, *children, type_: Optional[Union[Var[str], str]] = None, **props) -> "Email": ... # type: ignore

View File

@ -0,0 +1,35 @@
"""Stub file for form.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Form(ChakraComponent):
@overload
@classmethod
def create(cls, *children, as_: Optional[Union[Var[str], str]] = None, **props) -> "Form": ... # type: ignore
class FormControl(ChakraComponent):
@overload
@classmethod
def create(cls, *children, label, input, help_text, error_message, 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, **props) -> "FormControl": ... # type: ignore
class FormHelperText(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "FormHelperText": ... # type: ignore
class FormLabel(ChakraComponent):
@overload
@classmethod
def create(cls, *children, html_for: Optional[Union[Var[str], str]] = None, **props) -> "FormLabel": ... # type: ignore
class FormErrorMessage(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "FormErrorMessage": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for iconbutton.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.typography.text import Text
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class IconButton(Text):
@overload
@classmethod
def create(cls, *children, type: Optional[Union[Var[str], str]] = None, aria_label: Optional[Union[Var[str], str]] = None, icon: Optional[Union[Var[str], str]] = 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, **props) -> "IconButton": ... # type: ignore

View File

@ -0,0 +1,40 @@
"""Stub file for input.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Optional, overload, Union, Dict
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Input(ChakraComponent):
@overload
@classmethod
def create(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[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[str], str]] = None, size: Optional[Union[Var[str], str]] = None, **props) -> "Input": ... # type: ignore
class InputGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "InputGroup": ... # type: ignore
class InputLeftAddon(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "InputLeftAddon": ... # type: ignore
class InputRightAddon(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "InputRightAddon": ... # type: ignore
class InputLeftElement(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "InputLeftElement": ... # type: ignore
class InputRightElement(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "InputRightElement": ... # type: ignore

View File

@ -0,0 +1,35 @@
"""Stub file for numberinput.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class NumberInput(ChakraComponent):
@overload
@classmethod
def create(cls, *children, value: Optional[Union[Var[int], int]] = 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[int], int]] = 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, input_mode: 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, is_valid_character: Optional[Union[Var[str], str]] = None, keep_within_range: Optional[Union[Var[bool], bool]] = None, max_: Optional[Union[Var[int], int]] = None, min_: Optional[Union[Var[int], int]] = None, variant: Optional[Union[Var[str], str]] = None, **props) -> "NumberInput": ... # type: ignore
class NumberInputField(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "NumberInputField": ... # type: ignore
class NumberInputStepper(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "NumberInputStepper": ... # type: ignore
class NumberIncrementStepper(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "NumberIncrementStepper": ... # type: ignore
class NumberDecrementStepper(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "NumberDecrementStepper": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for password.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.components.forms.input import Input
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Password(Input):
@overload
@classmethod
def create(cls, *children, type_: Optional[Union[Var[str], str]] = None, **props) -> "Password": ... # type: ignore

View File

@ -0,0 +1,20 @@
"""Stub file for pininput.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class PinInput(ChakraComponent):
@overload
@classmethod
def create(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[str], str]] = None, **props) -> "PinInput": ... # type: ignore
class PinInputField(ChakraComponent):
@overload
@classmethod
def create(cls, *children, index: Optional[Union[Var[int], int]] = None, **props) -> "PinInputField": ... # type: ignore

View File

@ -0,0 +1,21 @@
"""Stub file for radio.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, List, Any, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.typography.text import Text
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class RadioGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, value: Optional[Union[Var[Any], Any]] = None, default_value: Optional[Union[Var[Any], Any]] = None, **props) -> "RadioGroup": ... # type: ignore
class Radio(Text):
@overload
@classmethod
def create(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, **props) -> "Radio": ... # type: ignore

View File

@ -0,0 +1,30 @@
"""Stub file for rangeslider.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class RangeSlider(ChakraComponent):
@overload
@classmethod
def create(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[str], str]] = 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, **props) -> "RangeSlider": ... # type: ignore
class RangeSliderTrack(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "RangeSliderTrack": ... # type: ignore
class RangeSliderFilledTrack(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "RangeSliderFilledTrack": ... # type: ignore
class RangeSliderThumb(ChakraComponent):
@overload
@classmethod
def create(cls, *children, index: Optional[Union[Var[int], int]] = None, **props) -> "RangeSliderThumb": ... # type: ignore

View File

@ -0,0 +1,21 @@
"""Stub file for select.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, List, Any, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.typography.text import Text
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Select(ChakraComponent):
@overload
@classmethod
def create(cls, *children, value: Optional[Union[Var[str], str]] = None, default_value: Optional[Union[Var[str], str]] = None, placeholder: Optional[Union[Var[str], str]] = None, error_border_color: Optional[Union[Var[str], str]] = None, focus_border_color: Optional[Union[Var[str], str]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_invalid: Optional[Union[Var[bool], bool]] = None, is_read_only: Optional[Union[Var[bool], bool]] = None, is_required: Optional[Union[Var[bool], bool]] = None, variant: Optional[Union[Var[str], str]] = None, size: Optional[Union[Var[str], str]] = None, **props) -> "Select": ... # type: ignore
class Option(Text):
@overload
@classmethod
def create(cls, *children, value: Optional[Union[Var[Any], Any]] = None, **props) -> "Option": ... # type: ignore

View File

@ -0,0 +1,35 @@
"""Stub file for slider.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Slider(ChakraComponent):
@overload
@classmethod
def create(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[str], str]] = 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[str], str]] = 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, **props) -> "Slider": ... # type: ignore
class SliderTrack(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "SliderTrack": ... # type: ignore
class SliderFilledTrack(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "SliderFilledTrack": ... # type: ignore
class SliderThumb(ChakraComponent):
@overload
@classmethod
def create(cls, *children, box_size: Optional[Union[Var[str], str]] = None, **props) -> "SliderThumb": ... # type: ignore
class SliderMark(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "SliderMark": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for switch.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Switch(ChakraComponent):
@overload
@classmethod
def create(cls, *children, is_checked: Optional[Union[Var[bool], bool]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_focusable: Optional[Union[Var[bool], bool]] = None, is_invalid: Optional[Union[Var[bool], bool]] = None, is_read_only: Optional[Union[Var[bool], bool]] = None, is_required: Optional[Union[Var[bool], bool]] = None, name: Optional[Union[Var[str], str]] = None, spacing: Optional[Union[Var[str], str]] = None, placeholder: Optional[Union[Var[str], str]] = None, color_scheme: Optional[Union[Var[str], str]] = None, **props) -> "Switch": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for textarea.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class TextArea(ChakraComponent):
@overload
@classmethod
def create(cls, *children, value: Optional[Union[Var[str], str]] = None, default_value: Optional[Union[Var[str], str]] = None, placeholder: Optional[Union[Var[str], str]] = None, error_border_color: Optional[Union[Var[str], str]] = None, focus_border_color: Optional[Union[Var[str], str]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_invalid: Optional[Union[Var[bool], bool]] = None, is_read_only: Optional[Union[Var[bool], bool]] = None, is_required: Optional[Union[Var[bool], bool]] = None, variant: Optional[Union[Var[str], str]] = None, **props) -> "TextArea": ... # type: ignore

View File

@ -9,13 +9,15 @@ from reflex.components.layout.box import Box
from reflex.event import EventChain
from reflex.vars import BaseVar, Var
files_state = "const [files, setFiles] = useState([]);"
upload_file = BaseVar(name="e => setFiles((files) => e)", type_=EventChain)
files_state: str = "const [files, setFiles] = useState([]);"
upload_file: BaseVar = BaseVar(name="e => setFiles((files) => e)", type_=EventChain)
# Use this var along with the Upload component to render the list of selected files.
selected_files = BaseVar(name="files.map((f) => f.name)", type_=List[str])
selected_files: BaseVar = BaseVar(name="files.map((f) => f.name)", type_=List[str])
clear_selected_files = BaseVar(name="_e => setFiles((files) => [])", type_=EventChain)
clear_selected_files: BaseVar = BaseVar(
name="_e => setFiles((files) => [])", type_=EventChain
)
class Upload(Component):

View File

@ -0,0 +1,21 @@
"""Stub file for upload.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, List, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar
from reflex.event import EventChain
files_state: str
upload_file: BaseVar
selected_files: BaseVar
clear_selected_files: BaseVar
class ComputedVar(Var, property): ...
class Upload(Component):
@overload
@classmethod
def create(cls, *children, accept: Optional[Union[Var[Optional[Dict[str, List]]], Optional[Dict[str, List]]]] = None, disabled: Optional[Union[Var[bool], bool]] = None, max_files: Optional[Union[Var[int], int]] = None, max_size: Optional[Union[Var[int], int]] = None, min_size: Optional[Union[Var[int], int]] = None, multiple: Optional[Union[Var[bool], bool]] = None, no_click: Optional[Union[Var[bool], bool]] = None, no_drag: Optional[Union[Var[bool], bool]] = None, no_keyboard: Optional[Union[Var[bool], bool]] = None, **props) -> "Upload": ... # type: ignore

View File

@ -0,0 +1,20 @@
"""Stub file for plotly.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, Optional
from reflex.components.component import NoSSRComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class PlotlyLib(NoSSRComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PlotlyLib": ... # type: ignore
class Plotly(PlotlyLib):
@overload
@classmethod
def create(cls, *children, data: Optional[Union[Var[Figure], Figure]] = None, layout: Optional[Union[Var[Dict], Dict]] = None, width: Optional[Union[Var[str], str]] = None, height: Optional[Union[Var[str], str]] = None, use_resize_handler: Optional[Union[Var[bool], bool]] = None, **props) -> "Plotly": ... # type: ignore

View File

@ -0,0 +1,107 @@
"""Stub file for victory.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, Optional, Dict, overload, List, Any
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
def format_xy(x: List, y: List) -> List: ...
def format_line(x: List, y: List) -> List: ...
def format_scatter(x: List, y: List, amount: Optional[List] = None) -> List: ...
def format_area(x: List, y: List, y0: Optional[List] = None) -> List: ...
def format_bar(x: List, y: List, y0: Optional[List] = None) -> List: ...
def format_box_plot(
x: List,
y: Optional[List[Any]] = None,
min_: Optional[List[Any]] = None,
max_: Optional[List[Any]] = None,
median: Optional[List[Any]] = None,
q1: Optional[List[Any]] = None,
q3: Optional[List[Any]] = None,
) -> List: ...
def format_histogram(x: List) -> List: ...
def format_pie(x: List, y: List, label: Optional[List] = None) -> List: ...
def format_voronoi(x: List, y: List) -> List: ...
def format_candlestick(
x: List, open: List, close: List, high: List, low: List
) -> List: ...
def format_error_bar(x: List, y: List, error_x: List, error_y: List) -> List: ...
def data(graph: str, x: List, y: Optional[List] = None, **kwargs) -> List: ...
class Victory(Component):
@overload
@classmethod
def create(cls, *children, data: Optional[Union[Var[List[Dict]], List[Dict]]] = None, height: Optional[Union[Var[str], str]] = None, width: Optional[Union[Var[str], str]] = None, max_domain: Optional[Union[Var[Dict], Dict]] = None, min_domain: Optional[Union[Var[Dict], Dict]] = None, polar: Optional[Union[Var[bool], bool]] = None, scale: Optional[Union[Var[Dict], Dict]] = None, labels: Optional[Union[Var[List], List]] = None, horizontal: Optional[Union[Var[bool], bool]] = None, standalone: Optional[Union[Var[bool], bool]] = None, sort_order: Optional[Union[Var[str], str]] = None, padding: Optional[Union[Var[Dict], Dict]] = None, domain_padding: Optional[Union[Var[Dict], Dict]] = None, custom_style: Optional[Union[Var[Dict[str, str]], Dict[str, str]]] = None, **props) -> "Victory": ... # type: ignore
class Chart(Victory):
@overload
@classmethod
def create(cls, *children, start_angle: Optional[Union[Var[int], int]] = None, end_angle: Optional[Union[Var[int], int]] = None, domain_padding: Optional[Union[Var[Dict], Dict]] = None, **props) -> "Chart": ... # type: ignore
class Line(Victory):
@overload
@classmethod
def create(cls, *children, interpolation: Optional[Union[Var[str], str]] = None, **props) -> "Line": ... # type: ignore
class Bar(Victory):
@overload
@classmethod
def create(cls, *children, alignment: Optional[Union[Var[str], str]] = None, bar_ratio: Optional[Union[Var[float], float]] = None, bar_width: Optional[Union[Var[int], int]] = None, corner_radius: Optional[Union[Var[float], float]] = None, **props) -> "Bar": ... # type: ignore
class Area(Victory):
@overload
@classmethod
def create(cls, *children, interpolation: Optional[Union[Var[str], str]] = None, **props) -> "Area": ... # type: ignore
class Pie(Victory):
@overload
@classmethod
def create(cls, *children, color_scale: Optional[Union[Var[Union[str, List[str]]], Union[str, List[str]]]] = None, corner_radius: Optional[Union[Var[float], float]] = None, label_placement: Optional[Union[Var[str], str]] = None, label_position: Optional[Union[Var[str], str]] = None, label_radius: Optional[Union[Var[float], float]] = None, pad_angle: Optional[Union[Var[float], float]] = None, radius: Optional[Union[Var[float], float]] = None, inner_radius: Optional[Union[Var[float], float]] = None, start_angle: Optional[Union[Var[float], float]] = None, end_angle: Optional[Union[Var[float], float]] = None, **props) -> "Pie": ... # type: ignore
class Candlestick(Victory):
@overload
@classmethod
def create(cls, *children, candle_colors: Optional[Union[Var[Dict], Dict]] = None, candle_ratio: Optional[Union[Var[float], float]] = None, candle_width: Optional[Union[Var[float], float]] = None, close_labels: Optional[Union[Var[List], List]] = None, **props) -> "Candlestick": ... # type: ignore
class Scatter(Victory):
@overload
@classmethod
def create(cls, *children, bubble_property: Optional[Union[Var[str], str]] = None, min_bubble_size: Optional[Union[Var[float], float]] = None, max_bubble_size: Optional[Union[Var[float], float]] = None, **props) -> "Scatter": ... # type: ignore
class BoxPlot(Victory):
@overload
@classmethod
def create(cls, *children, box_width: Optional[Union[Var[float], float]] = None, **props) -> "BoxPlot": ... # type: ignore
class Histogram(Victory):
@overload
@classmethod
def create(cls, *children, bins: Optional[Union[Var[List], List]] = None, bin_spacing: Optional[Union[Var[float], float]] = None, corner_radius: Optional[Union[Var[float], float]] = None, **props) -> "Histogram": ... # type: ignore
class ErrorBar(Victory):
@overload
@classmethod
def create(cls, *children, border_width: Optional[Union[Var[float], float]] = None, **props) -> "ErrorBar": ... # type: ignore
class ChartGroup(Victory):
@overload
@classmethod
def create(cls, *children, color_scale: Optional[Union[Var[Union[str, List[str]]], Union[str, List[str]]]] = None, color: Optional[Union[Var[str], str]] = None, offset: Optional[Union[Var[float], float]] = None, **props) -> "ChartGroup": ... # type: ignore
class ChartStack(Victory):
@overload
@classmethod
def create(cls, *children, categories: Optional[Union[Var[int], int]] = None, color_scale: Optional[Union[Var[Union[str, List[str]]], Union[str, List[str]]]] = None, **props) -> "ChartStack": ... # type: ignore
class Voronoi(Victory):
@overload
@classmethod
def create(cls, *children, **props) -> "Voronoi": ... # type: ignore
class Polar(Victory):
@overload
@classmethod
def create(cls, *children, dependent_axis: Optional[Union[Var[bool], bool]] = None, **props) -> "Polar": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for aspect_ratio.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class AspectRatio(ChakraComponent):
@overload
@classmethod
def create(cls, *children, ratio: Optional[Union[Var[float], float]] = None, **props) -> "AspectRatio": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for box.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Box(ChakraComponent):
@overload
@classmethod
def create(cls, *children, element: Optional[Union[Var[str], str]] = None, src: Optional[Union[Var[str], str]] = None, alt: Optional[Union[Var[str], str]] = None, **props) -> "Box": ... # type: ignore

View File

@ -0,0 +1,30 @@
"""Stub file for card.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class CardHeader(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "CardHeader": ... # type: ignore
class CardBody(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "CardBody": ... # type: ignore
class CardFooter(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "CardFooter": ... # type: ignore
class Card(ChakraComponent):
@overload
@classmethod
def create(cls, *children, header: Optional[Component] = None, footer: Optional[Component] = None, align: Optional[Union[Var[str], str]] = None, direction: Optional[Union[Var[str], str]] = None, justify: Optional[Union[Var[str], str]] = None, color_scheme: Optional[Union[Var[str], str]] = None, size: Optional[Union[Var[str], str]] = None, variant: Optional[Union[Var[str], str]] = None, **props) -> "Card": ... # type: ignore

View File

@ -0,0 +1,25 @@
"""Stub file for center.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Center(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Center": ... # type: ignore
class Square(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Square": ... # type: ignore
class Circle(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Circle": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for container.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Container(ChakraComponent):
@overload
@classmethod
def create(cls, *children, center_content: Optional[Union[Var[bool], bool]] = None, **props) -> "Container": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for flex.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Flex(ChakraComponent):
@overload
@classmethod
def create(cls, *children, align: Optional[Union[Var[str], str]] = None, basis: Optional[Union[Var[str], str]] = None, direction: Optional[Union[Var[Union[str, List[str]]], Union[str, List[str]]]] = None, grow: Optional[Union[Var[str], str]] = None, justify: Optional[Union[Var[str], str]] = None, wrap: Optional[Union[Var[Union[str, List[str]]], Union[str, List[str]]]] = None, shrink: Optional[Union[Var[str], str]] = None, **props) -> "Flex": ... # type: ignore

View File

@ -0,0 +1,14 @@
"""Stub file for fragment.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Fragment(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "Fragment": ... # type: ignore

View File

@ -0,0 +1,25 @@
"""Stub file for grid.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Grid(ChakraComponent):
@overload
@classmethod
def create(cls, *children, auto_columns: Optional[Union[Var[str], str]] = None, auto_flow: Optional[Union[Var[str], str]] = None, auto_rows: Optional[Union[Var[str], str]] = None, column: Optional[Union[Var[str], str]] = None, row: Optional[Union[Var[str], str]] = None, template_columns: Optional[Union[Var[str], str]] = None, template_rows: Optional[Union[Var[str], str]] = None, **props) -> "Grid": ... # type: ignore
class GridItem(ChakraComponent):
@overload
@classmethod
def create(cls, *children, area: Optional[Union[Var[str], str]] = None, col_end: Optional[Union[Var[str], str]] = None, col_start: Optional[Union[Var[int], int]] = None, col_span: Optional[Union[Var[int], int]] = None, row_end: Optional[Union[Var[str], str]] = None, row_start: Optional[Union[Var[int], int]] = None, row_span: Optional[Union[Var[int], int]] = None, **props) -> "GridItem": ... # type: ignore
class ResponsiveGrid(ChakraComponent):
@overload
@classmethod
def create(cls, *children, auto_columns: Optional[Union[Var[str], str]] = None, auto_flow: Optional[Union[Var[str], str]] = None, auto_rows: Optional[Union[Var[str], str]] = None, column: Optional[Union[Var[str], str]] = None, row: Optional[Union[Var[str], str]] = None, columns: Optional[Union[Var[List[int]], List[int]]] = None, min_child_width: Optional[Union[Var[str], str]] = None, spacing: Optional[Union[Var[str], str]] = None, spacing_x: Optional[Union[Var[str], str]] = None, spacing_y: Optional[Union[Var[str], str]] = None, template_areas: Optional[Union[Var[str], str]] = None, template_columns: Optional[Union[Var[str], str]] = None, template_rows: Optional[Union[Var[str], str]] = None, **props) -> "ResponsiveGrid": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for html.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional, Any
from reflex.components.component import Component
from reflex.components.layout.box import Box
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Html(Box):
@overload
@classmethod
def create(cls, *children, dangerouslySetInnerHTML: Optional[Any] = None, **props) -> "Html": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for spacer.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Spacer(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Spacer": ... # type: ignore

View File

@ -0,0 +1,25 @@
"""Stub file for stack.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Stack(ChakraComponent):
@overload
@classmethod
def create(cls, *children, align_items: Optional[Union[Var[str], str]] = None, direction: Optional[Union[Var[str], str]] = None, is_inline: Optional[Union[Var[bool], bool]] = None, justify_content: Optional[Union[Var[str], str]] = None, should_wrap_children: Optional[Union[Var[bool], bool]] = None, spacing: Optional[Union[Var[str], str]] = None, wrap: Optional[Union[Var[str], str]] = None, justify: Optional[Union[Var[str], str]] = None, **props) -> "Stack": ... # type: ignore
class Hstack(Stack):
@overload
@classmethod
def create(cls, *children, **props) -> "Hstack": ... # type: ignore
class Vstack(Stack):
@overload
@classmethod
def create(cls, *children, **props) -> "Vstack": ... # type: ignore

View File

@ -0,0 +1,20 @@
"""Stub file for wrap.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Wrap(ChakraComponent):
@overload
@classmethod
def create(cls, *children, items, align: Optional[Union[Var[str], str]] = None, direction: Optional[Union[Var[str], str]] = None, justify: Optional[Union[Var[str], str]] = None, should_wrap_children: Optional[Union[Var[bool], bool]] = None, spacing: Optional[Union[Var[str], str]] = None, spacing_x: Optional[Union[Var[str], str]] = None, spacing_y: Optional[Union[Var[str], str]] = None, **props) -> "Wrap": ... # type: ignore
class WrapItem(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "WrapItem": ... # type: ignore

View File

@ -0,0 +1,14 @@
"""Stub file for chakra.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class ChakraComponent(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "ChakraComponent": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for react_player.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import NoSSRComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class ReactPlayerComponent(NoSSRComponent):
@overload
@classmethod
def create(cls, *children, url: Optional[Union[Var[str], str]] = None, playing: Optional[Union[Var[str], str]] = None, loop: Optional[Union[Var[bool], bool]] = None, controls: Optional[Union[Var[bool], bool]] = None, light: Optional[Union[Var[bool], bool]] = None, volume: Optional[Union[Var[float], float]] = None, muted: Optional[Union[Var[bool], bool]] = None, width: Optional[Union[Var[str], str]] = None, height: Optional[Union[Var[str], str]] = None, **props) -> "ReactPlayerComponent": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for audio.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.react_player import ReactPlayerComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Audio(ReactPlayerComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Audio": ... # type: ignore

View File

@ -0,0 +1,25 @@
"""Stub file for avatar.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Set, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Avatar(ChakraComponent):
@overload
@classmethod
def create(cls, *children, icon: Optional[Union[Var[str], str]] = None, icon_label: Optional[Union[Var[str], str]] = None, ignore_fallback: Optional[Union[Var[bool], bool]] = None, name: Optional[Union[Var[str], str]] = None, show_border: Optional[Union[Var[bool], bool]] = None, src: Optional[Union[Var[str], str]] = None, src_set: Optional[Union[Var[str], str]] = None, size: Optional[Union[Var[str], str]] = None, **props) -> "Avatar": ... # type: ignore
class AvatarBadge(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AvatarBadge": ... # type: ignore
class AvatarGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, max_: Optional[Union[Var[int], int]] = None, spacing: Optional[Union[Var[int], int]] = None, **props) -> "AvatarGroup": ... # type: ignore

View File

@ -1,4 +1,5 @@
"""An icon component."""
from typing import List
from reflex.components.component import Component
from reflex.utils import format
@ -47,7 +48,7 @@ class Icon(ChakraIconComponent):
# List of all icons.
ICON_LIST = [
ICON_LIST: List[str] = [
"add",
"arrow_back",
"arrow_down",

View File

@ -0,0 +1,21 @@
"""Stub file for icon.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, List, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
ICON_LIST: List[str]
class ChakraIconComponent(Component):
@overload
@classmethod
def create(cls, *children, **props) -> "ChakraIconComponent": ... # type: ignore
class Icon(ChakraIconComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Icon": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for image.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Set, Any, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Image(ChakraComponent):
@overload
@classmethod
def create(cls, *children, align: Optional[Union[Var[str], str]] = None, fallback: Optional[Component] = None, fallback_src: Optional[Union[Var[str], str]] = None, fit: Optional[Union[Var[str], str]] = None, html_height: Optional[Union[Var[str], str]] = None, html_width: Optional[Union[Var[str], str]] = None, ignore_fallback: Optional[Union[Var[bool], bool]] = None, loading: Optional[Union[Var[str], str]] = None, src: Optional[Union[Var[Any], Any]] = None, alt: Optional[Union[Var[str], str]] = None, src_set: Optional[Union[Var[str], str]] = None, **props) -> "Image": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for video.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.react_player import ReactPlayerComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Video(ReactPlayerComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Video": ... # type: ignore

View File

@ -0,0 +1,31 @@
"""Stub file for breadcrumb.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.navigation.link import Link
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Breadcrumb(ChakraComponent):
@overload
@classmethod
def create(cls, *children, items, separator: Optional[Union[Var[str], str]] = None, separator_margin: Optional[Union[Var[str], str]] = None, **props) -> "Breadcrumb": ... # type: ignore
class BreadcrumbItem(ChakraComponent):
@overload
@classmethod
def create(cls, *children, label, href, is_current_page: Optional[Union[Var[bool], bool]] = None, is_last_child: Optional[Union[Var[bool], bool]] = None, separator: Optional[Union[Var[str], str]] = None, spacing: Optional[Union[Var[str], str]] = None, **props) -> "BreadcrumbItem": ... # type: ignore
class BreadcrumbSeparator(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "BreadcrumbSeparator": ... # type: ignore
class BreadcrumbLink(Link):
@overload
@classmethod
def create(cls, *children, is_current_page: Optional[Union[Var[bool], bool]] = None, **props) -> "BreadcrumbLink": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for link.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Link(ChakraComponent):
@overload
@classmethod
def create(cls, *children, rel: Optional[Union[Var[str], str]] = None, href: Optional[Union[Var[str], str]] = None, text: Optional[Union[Var[str], str]] = None, as_: Optional[Union[Var[str], str]] = None, is_external: Optional[Union[Var[bool], bool]] = None, **props) -> "Link": ... # type: ignore

View File

@ -0,0 +1,20 @@
"""Stub file for linkoverlay.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class LinkOverlay(ChakraComponent):
@overload
@classmethod
def create(cls, *children, is_external: Optional[Union[Var[bool], bool]] = None, href: Optional[Union[Var[str], str]] = None, **props) -> "LinkOverlay": ... # type: ignore
class LinkBox(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "LinkBox": ... # type: ignore

View File

@ -0,0 +1,14 @@
"""Stub file for nextlink.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class NextLink(Component):
@overload
@classmethod
def create(cls, *children, href: Optional[Union[Var[str], str]] = None, pass_href: Optional[Union[Var[bool], bool]] = None, **props) -> "NextLink": ... # type: ignore

View File

@ -0,0 +1,55 @@
"""Stub file for stepper.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Tuple, Union, overload, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Stepper(ChakraComponent):
@overload
@classmethod
def create(cls, *children, items: Optional[List[Tuple]] = None, colorScheme: Optional[Union[Var[str], str]] = None, index: Optional[Union[Var[int], int]] = None, size: Optional[Union[Var[str], str]] = None, **props) -> "Stepper": ... # type: ignore
class Step(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "Step": ... # type: ignore
class StepDescription(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StepDescription": ... # type: ignore
class StepIcon(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StepIcon": ... # type: ignore
class StepIndicator(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StepIndicator": ... # type: ignore
class StepNumber(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StepNumber": ... # type: ignore
class StepSeparator(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StepSeparator": ... # type: ignore
class StepStatus(ChakraComponent):
@overload
@classmethod
def create(cls, *children, active: Optional[Union[Var[str], str]] = None, complete: Optional[Union[Var[str], str]] = None, incomplete: Optional[Union[Var[str], str]] = None, **props) -> "StepStatus": ... # type: ignore
class StepTitle(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "StepTitle": ... # type: ignore

View File

@ -0,0 +1,45 @@
"""Stub file for alertdialog.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Set, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class AlertDialog(ChakraComponent):
@overload
@classmethod
def create(cls, *children, header, body, footer, close_button, is_open: Optional[Union[Var[bool], bool]] = None, least_destructive_ref: Optional[Union[Var[str], str]] = None, allow_pinch_zoom: Optional[Union[Var[bool], bool]] = None, auto_focus: Optional[Union[Var[bool], bool]] = None, block_scroll_on_mount: Optional[Union[Var[bool], bool]] = None, close_on_esc: Optional[Union[Var[bool], bool]] = None, close_on_overlay_click: Optional[Union[Var[bool], bool]] = None, is_centered: Optional[Union[Var[bool], bool]] = None, lock_focus_across_frames: Optional[Union[Var[bool], bool]] = None, preserve_scroll_bar_gap: Optional[Union[Var[bool], bool]] = None, return_focus_on_close: Optional[Union[Var[bool], bool]] = None, size: Optional[Union[Var[str], str]] = None, use_inert: Optional[Union[Var[bool], bool]] = None, **props) -> "AlertDialog": ... # type: ignore
class AlertDialogBody(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertDialogBody": ... # type: ignore
class AlertDialogHeader(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertDialogHeader": ... # type: ignore
class AlertDialogFooter(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertDialogFooter": ... # type: ignore
class AlertDialogContent(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertDialogContent": ... # type: ignore
class AlertDialogOverlay(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertDialogOverlay": ... # type: ignore
class AlertDialogCloseButton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "AlertDialogCloseButton": ... # type: ignore

View File

@ -9,12 +9,12 @@ from reflex.components.overlay.modal import Modal
from reflex.components.typography import Text
from reflex.vars import Var
connection_error = Var.create_safe(
connection_error: Var = Var.create_safe(
value="(connectError !== null) ? connectError.message : ''",
is_local=False,
is_string=False,
)
has_connection_error = Var.create_safe(
has_connection_error: Var = Var.create_safe(
value="connectError !== null",
is_string=False,
)

View File

@ -0,0 +1,27 @@
"""Stub file for banner.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.component import Component
from reflex.components.overlay.modal import Modal
from reflex.components.layout.cond import Cond
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
connection_error: Var
has_connection_error: Var
has_connection_error.type_
def default_connection_error() -> list[str | Var]: ...
class ConnectionBanner(Cond):
@overload
@classmethod
def create(cls, *children, **props) -> "ConnectionBanner": ... # type: ignore
class ConnectionModal(Modal):
@overload
@classmethod
def create(cls, *children, **props) -> "ConnectionModal": ... # type: ignore

View File

@ -0,0 +1,45 @@
"""Stub file for drawer.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Set, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Drawer(ChakraComponent):
@overload
@classmethod
def create(cls, *children, header, body, footer, close_button, is_open: Optional[Union[Var[bool], bool]] = None, allow_pinch_zoom: Optional[Union[Var[bool], bool]] = None, auto_focus: Optional[Union[Var[bool], bool]] = None, block_scroll_on_mount: Optional[Union[Var[bool], bool]] = None, close_on_esc: Optional[Union[Var[bool], bool]] = None, close_on_overlay_click: Optional[Union[Var[bool], bool]] = None, is_centered: Optional[Union[Var[bool], bool]] = None, is_full_height: Optional[Union[Var[bool], bool]] = None, lock_focus_across_frames: Optional[Union[Var[bool], bool]] = None, placement: Optional[Union[Var[str], str]] = None, preserve_scroll_bar_gap: Optional[Union[Var[bool], bool]] = None, return_focus_on_close: Optional[Union[Var[bool], bool]] = None, size: Optional[Union[Var[str], str]] = None, use_inert: Optional[Union[Var[bool], bool]] = None, variant: Optional[Union[Var[str], str]] = None, **props) -> "Drawer": ... # type: ignore
class DrawerBody(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "DrawerBody": ... # type: ignore
class DrawerHeader(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "DrawerHeader": ... # type: ignore
class DrawerFooter(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "DrawerFooter": ... # type: ignore
class DrawerOverlay(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "DrawerOverlay": ... # type: ignore
class DrawerContent(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "DrawerContent": ... # type: ignore
class DrawerCloseButton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "DrawerCloseButton": ... # type: ignore

View File

@ -0,0 +1,50 @@
"""Stub file for menu.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Set, List, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Menu(ChakraComponent):
@overload
@classmethod
def create(cls, *children, button, items, arrow_padding: Optional[Union[Var[int], int]] = None, auto_select: Optional[Union[Var[bool], bool]] = None, boundary: Optional[Union[Var[str], str]] = None, close_on_blur: Optional[Union[Var[bool], bool]] = None, close_on_select: Optional[Union[Var[bool], bool]] = None, default_is_open: Optional[Union[Var[bool], bool]] = None, direction: Optional[Union[Var[str], str]] = None, flip: Optional[Union[Var[bool], bool]] = None, gutter: Optional[Union[Var[int], int]] = None, is_lazy: Optional[Union[Var[bool], bool]] = None, lazy_behavior: Optional[Union[Var[str], str]] = None, is_open: Optional[Union[Var[bool], bool]] = None, match_width: Optional[Union[Var[bool], bool]] = None, placement: Optional[Union[Var[str], str]] = None, prevent_overflow: Optional[Union[Var[bool], bool]] = None, strategy: Optional[Union[Var[str], str]] = None, **props) -> "Menu": ... # type: ignore
class MenuButton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, variant: Optional[Union[Var[str], str]] = None, invalid_children: Optional[List[str]] = None, as_: Optional[Union[Var[str], str]] = None, **props) -> "MenuButton": ... # type: ignore
class MenuList(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "MenuList": ... # type: ignore
class MenuItem(ChakraComponent):
@overload
@classmethod
def create(cls, *children, close_on_select: Optional[Union[Var[bool], bool]] = None, command: Optional[Union[Var[str], str]] = None, command_spacing: Optional[Union[Var[int], int]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_focusable: Optional[Union[Var[bool], bool]] = None, **props) -> "MenuItem": ... # type: ignore
class MenuItemOption(ChakraComponent):
@overload
@classmethod
def create(cls, *children, close_on_select: Optional[Union[Var[bool], bool]] = None, command: Optional[Union[Var[str], str]] = None, command_spacing: Optional[Union[Var[int], int]] = None, is_checked: Optional[Union[Var[bool], bool]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_focusable: Optional[Union[Var[bool], bool]] = None, type_: Optional[Union[Var[str], str]] = None, value: Optional[Union[Var[str], str]] = None, **props) -> "MenuItemOption": ... # type: ignore
class MenuGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "MenuGroup": ... # type: ignore
class MenuOptionGroup(ChakraComponent):
@overload
@classmethod
def create(cls, *children, type_: Optional[Union[Var[str], str]] = None, value: Optional[Union[Var[str], str]] = None, **props) -> "MenuOptionGroup": ... # type: ignore
class MenuDivider(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "MenuDivider": ... # type: ignore

View File

@ -1,6 +1,6 @@
"""Modal components."""
from typing import Set
from typing import Optional, Set, Union
from reflex.components.component import Component
from reflex.components.libs.chakra import ChakraComponent
@ -67,7 +67,13 @@ class Modal(ChakraComponent):
@classmethod
def create(
cls, *children, header=None, body=None, footer=None, close_button=None, **props
cls,
*children,
header: Optional[Union[Component, str]] = None,
body: Optional[Union[Component, str]] = None,
footer: Optional[Union[Component, str]] = None,
close_button: Optional[Component] = None,
**props
) -> Component:
"""Create a modal component.

View File

@ -0,0 +1,45 @@
"""Stub file for modal.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Set, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Modal(ChakraComponent):
@overload
@classmethod
def create(cls, *children, header: Optional[Union[Component, str]] = None, body: Optional[Union[Component, str]] = None, footer: Optional[Union[Component, str]] = None, close_button: Optional[Component] = None, is_open: Optional[Union[Var[bool], bool]] = None, allow_pinch_zoom: Optional[Union[Var[bool], bool]] = None, auto_focus: Optional[Union[Var[bool], bool]] = None, block_scroll_on_mount: Optional[Union[Var[bool], bool]] = None, close_on_esc: Optional[Union[Var[bool], bool]] = None, close_on_overlay_click: Optional[Union[Var[bool], bool]] = None, is_centered: Optional[Union[Var[bool], bool]] = None, lock_focus_across_frames: Optional[Union[Var[bool], bool]] = None, motion_preset: Optional[Union[Var[str], str]] = None, preserve_scroll_bar_gap: Optional[Union[Var[bool], bool]] = None, return_focus_on_close: Optional[Union[Var[bool], bool]] = None, size: Optional[Union[Var[str], str]] = None, use_inert: Optional[Union[Var[bool], bool]] = None, **props) -> "Modal": ... # type: ignore
class ModalOverlay(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ModalOverlay": ... # type: ignore
class ModalHeader(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ModalHeader": ... # type: ignore
class ModalFooter(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ModalFooter": ... # type: ignore
class ModalContent(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ModalContent": ... # type: ignore
class ModalBody(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ModalBody": ... # type: ignore
class ModalCloseButton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "ModalCloseButton": ... # type: ignore

View File

@ -0,0 +1,55 @@
"""Stub file for popover.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Set, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Popover(ChakraComponent):
@overload
@classmethod
def create(cls, *children, trigger, header, body, footer, use_close_button, arrow_padding: Optional[Union[Var[int], int]] = None, arrow_shadow_color: Optional[Union[Var[str], str]] = None, arrow_size: Optional[Union[Var[int], int]] = None, auto_focus: Optional[Union[Var[bool], bool]] = None, boundary: Optional[Union[Var[str], str]] = None, close_on_blur: Optional[Union[Var[bool], bool]] = None, close_on_esc: Optional[Union[Var[bool], bool]] = None, default_is_open: Optional[Union[Var[bool], bool]] = None, direction: Optional[Union[Var[str], str]] = None, flip: Optional[Union[Var[bool], bool]] = None, gutter: Optional[Union[Var[int], int]] = None, id_: Optional[Union[Var[str], str]] = None, is_lazy: Optional[Union[Var[bool], bool]] = None, lazy_behavior: Optional[Union[Var[str], str]] = None, is_open: Optional[Union[Var[bool], bool]] = None, match_width: Optional[Union[Var[bool], bool]] = None, placement: Optional[Union[Var[str], str]] = None, prevent_overflow: Optional[Union[Var[bool], bool]] = None, return_focus_on_close: Optional[Union[Var[bool], bool]] = None, strategy: Optional[Union[Var[str], str]] = None, **props) -> "Popover": ... # type: ignore
class PopoverContent(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverContent": ... # type: ignore
class PopoverHeader(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverHeader": ... # type: ignore
class PopoverFooter(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverFooter": ... # type: ignore
class PopoverBody(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverBody": ... # type: ignore
class PopoverArrow(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverArrow": ... # type: ignore
class PopoverCloseButton(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverCloseButton": ... # type: ignore
class PopoverAnchor(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverAnchor": ... # type: ignore
class PopoverTrigger(ChakraComponent):
@overload
@classmethod
def create(cls, *children, **props) -> "PopoverTrigger": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for tooltip.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Set, Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Tooltip(ChakraComponent):
@overload
@classmethod
def create(cls, *children, arrow_padding: Optional[Union[Var[int], int]] = None, arrow_shadow_color: Optional[Union[Var[str], str]] = None, arrow_size: Optional[Union[Var[int], int]] = None, delay: Optional[Union[Var[int], int]] = None, close_on_click: Optional[Union[Var[bool], bool]] = None, close_on_esc: Optional[Union[Var[bool], bool]] = None, close_on_mouse_down: Optional[Union[Var[bool], bool]] = None, default_is_open: Optional[Union[Var[bool], bool]] = None, direction: Optional[Union[Var[str], str]] = None, gutter: Optional[Union[Var[int], int]] = None, has_arrow: Optional[Union[Var[bool], bool]] = None, is_disabled: Optional[Union[Var[bool], bool]] = None, is_open: Optional[Union[Var[bool], bool]] = None, label: Optional[Union[Var[str], str]] = None, open_delay: Optional[Union[Var[int], int]] = None, placement: Optional[Union[Var[str], str]] = None, should_wrap_children: Optional[Union[Var[bool], bool]] = None, **props) -> "Tooltip": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for heading.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Heading(ChakraComponent):
@overload
@classmethod
def create(cls, *children, as_: Optional[Union[Var[str], str]] = None, size: Optional[Union[Var[str], str]] = None, **props) -> "Heading": ... # type: ignore

View File

@ -1,10 +1,10 @@
"""A highlight component."""
from typing import List
from typing import Dict, List
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.tags import Tag
from reflex.vars import Dict, Var
from reflex.vars import Var
class Highlight(ChakraComponent):

View File

@ -0,0 +1,15 @@
"""Stub file for highlight.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, List, Optional, overload, Union
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Highlight(ChakraComponent):
@overload
@classmethod
def create(cls, *children, query: Optional[Union[Var[List[str]], List[str]]] = None, styles: Optional[Union[Var[Dict], Dict]] = None, **props) -> "Highlight": ... # type: ignore

View File

@ -0,0 +1,16 @@
"""Stub file for markdown.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Dict, Union, overload, List, Callable, Optional
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
components_by_tag: Dict[str, Callable]
class Markdown(Component):
@overload
@classmethod
def create(cls, *children, custom_styles: Optional[Dict[str, Style]] = None, **props) -> "Markdown": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for span.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Span(ChakraComponent):
@overload
@classmethod
def create(cls, *children, as_: Optional[Union[Var[str], str]] = None, **props) -> "Span": ... # type: ignore

View File

@ -0,0 +1,15 @@
"""Stub file for text.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `scripts/pyi_generator.py`!
# ------------------------------------------------------
from typing import Union, overload, Optional
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.component import Component
from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain
class Text(ChakraComponent):
@overload
@classmethod
def create(cls, *children, as_: Optional[Union[Var[str], str]] = None, **props) -> "Text": ... # type: ignore

View File

@ -479,7 +479,7 @@ def fix_events(
e = e()
assert isinstance(e, EventSpec), f"Unexpected event type, {type(e)}."
name = format.format_event_handler(e.handler)
payload = {k.name: v._decode() for k, v in e.args}
payload = {k.name: v._decode() for k, v in e.args} # type: ignore
# Create an event and append it to the list.
out.append(

View File

@ -607,7 +607,7 @@ class State(Base, ABC, extra=pydantic.Extra.allow):
func = arglist_factory(param)
else:
continue
func.fget.__name__ = param # to allow passing as a prop
func.fget.__name__ = param # to allow passing as a prop # type: ignore
cls.vars[param] = cls.computed_vars[param] = func.set_state(cls) # type: ignore
setattr(cls, param, func)

163
reflex/vars.pyi Normal file
View File

@ -0,0 +1,163 @@
""" Generated with stubgen from mypy, then manually edited, do not regen."""
from _typeshed import Incomplete
from abc import ABC
from reflex import constants as constants
from reflex.base import Base as Base
from reflex.state import State as State
from reflex.utils import console as console, format as format, types as types
from types import FunctionType
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Set,
Type,
Union,
_GenericAlias, # type: ignore
)
USED_VARIABLES: Incomplete
def get_unique_variable_name() -> str: ...
class Var(ABC):
name: str
type_: Type
state: str = ""
is_local: bool = False
is_string: bool = False
@classmethod
def create(
cls, value: Any, is_local: bool = False, is_string: bool = False
) -> Optional[Var]: ...
@classmethod
def create_safe(
cls, value: Any, is_local: bool = False, is_string: bool = False
) -> Var: ...
@classmethod
def __class_getitem__(cls, type_: str) -> _GenericAlias: ...
def equals(self, other: Var) -> bool: ...
def to_string(self) -> Var: ...
def __hash__(self) -> int: ...
def __format__(self, format_spec: str) -> str: ...
def __getitem__(self, i: Any) -> Var: ...
def __getattribute__(self, name: str) -> Var: ...
def operation(
self,
op: str = ...,
other: Optional[Var] = ...,
type_: Optional[Type] = ...,
flip: bool = ...,
fn: Optional[str] = ...,
) -> Var: ...
def compare(self, op: str, other: Var) -> Var: ...
def __invert__(self) -> Var: ...
def __neg__(self) -> Var: ...
def __abs__(self) -> Var: ...
def length(self) -> Var: ...
def __eq__(self, other: Var) -> Var: ...
def __ne__(self, other: Var) -> Var: ...
def __gt__(self, other: Var) -> Var: ...
def __ge__(self, other: Var) -> Var: ...
def __lt__(self, other: Var) -> Var: ...
def __le__(self, other: Var) -> Var: ...
def __add__(self, other: Var) -> Var: ...
def __radd__(self, other: Var) -> Var: ...
def __sub__(self, other: Var) -> Var: ...
def __rsub__(self, other: Var) -> Var: ...
def __mul__(self, other: Var) -> Var: ...
def __rmul__(self, other: Var) -> Var: ...
def __pow__(self, other: Var) -> Var: ...
def __rpow__(self, other: Var) -> Var: ...
def __truediv__(self, other: Var) -> Var: ...
def __rtruediv__(self, other: Var) -> Var: ...
def __floordiv__(self, other: Var) -> Var: ...
def __mod__(self, other: Var) -> Var: ...
def __rmod__(self, other: Var) -> Var: ...
def __and__(self, other: Var) -> Var: ...
def __rand__(self, other: Var) -> Var: ...
def __or__(self, other: Var) -> Var: ...
def __ror__(self, other: Var) -> Var: ...
def __contains__(self, _: Any) -> Var: ...
def contains(self, other: Any) -> Var: ...
def reverse(self) -> Var: ...
def foreach(self, fn: Callable) -> Var: ...
def to(self, type_: Type) -> Var: ...
@property
def full_name(self) -> str: ...
def set_state(self, state: Type[State]) -> Any: ...
class BaseVar(Var, Base):
name: str
type_: Any
state: str = ""
is_local: bool = False
is_string: bool = False
def __hash__(self) -> int: ...
def get_default_value(self) -> Any: ...
def get_setter_name(self, include_state: bool = ...) -> str: ...
def get_setter(self) -> Callable[[State, Any], None]: ...
class ComputedVar(Var):
cache: bool
@property
def name(self) -> str: ...
@property
def cache_attr(self) -> str: ...
def __get__(self, instance, owner): ...
def deps(self, objclass: Type, obj: Optional[FunctionType] = ...) -> Set[str]: ...
def mark_dirty(self, instance) -> None: ...
@property
def type_(self): ...
def __init__(self, func) -> None: ...
def cached_var(fget: Callable[[Any], Any]) -> ComputedVar: ...
class ReflexList(list):
def __init__(
self, original_list: List, reassign_field: Callable = ..., field_name: str = ...
) -> None: ...
def append(self, *args, **kwargs) -> None: ...
def insert(self, *args, **kwargs) -> None: ...
def __setitem__(self, *args, **kwargs) -> None: ...
def __delitem__(self, *args, **kwargs) -> None: ...
def clear(self, *args, **kwargs) -> None: ...
def extend(self, *args, **kwargs) -> None: ...
def pop(self, *args, **kwargs) -> None: ...
def remove(self, *args, **kwargs) -> None: ...
class ReflexDict(dict):
def __init__(
self, original_dict: Dict, reassign_field: Callable = ..., field_name: str = ...
) -> None: ...
def clear(self) -> None: ...
def setdefault(self, *args, **kwargs) -> None: ...
def popitem(self) -> None: ...
def pop(self, k, d: Incomplete | None = ...) -> None: ...
def update(self, *args, **kwargs) -> None: ...
def __setitem__(self, *args, **kwargs) -> None: ...
def __delitem__(self, *args, **kwargs) -> None: ...
class ReflexSet(set):
def __init__(
self, original_set: Set, reassign_field: Callable = ..., field_name: str = ...
) -> None: ...
def add(self, *args, **kwargs) -> None: ...
def remove(self, *args, **kwargs) -> None: ...
def discard(self, *args, **kwargs) -> None: ...
def pop(self, *args, **kwargs) -> None: ...
def clear(self, *args, **kwargs) -> None: ...
def update(self, *args, **kwargs) -> None: ...
class ImportVar(Base):
tag: Optional[str]
is_default: Optional[bool] = False
alias: Optional[str] = None
@property
def name(self) -> str: ...
def __hash__(self) -> int: ...
def get_local_storage(key: Optional[Union[Var, str]] = ...) -> BaseVar: ...

238
scripts/pyi_generator.py Normal file
View File

@ -0,0 +1,238 @@
"""The pyi generator module."""
import importlib
import inspect
import os
import sys
from inspect import getfullargspec
from pathlib import Path
from typing import Any, Dict, List, Optional, get_args
import black
from reflex.components.component import Component
from reflex.vars import Var
ruff_dont_remove = [Var, Optional, Dict, List]
EXCLUDED_FILES = [
"__init__.py",
"component.py",
"bare.py",
"foreach.py",
"cond.py",
"multiselect.py",
]
DEFAULT_TYPING_IMPORTS = {"overload", "Optional", "Union"}
def _get_type_hint(value, top_level=True, no_union=False):
res = ""
args = get_args(value)
if args:
res = f"{value.__name__}[{', '.join([_get_type_hint(arg, top_level=False) for arg in args if arg is not type(None)])}]"
if value.__name__ == "Var":
types = [res] + [
_get_type_hint(arg, top_level=False)
for arg in args
if arg is not type(None)
]
if len(types) > 1 and not no_union:
res = ", ".join(types)
res = f"Union[{res}]"
elif isinstance(value, str):
ev = eval(value)
res = _get_type_hint(ev, top_level=False) if ev.__name__ == "Var" else value
else:
res = value.__name__
if top_level and not res.startswith("Optional"):
res = f"Optional[{res}]"
return res
def _get_typing_import(_module):
src = [
line
for line in inspect.getsource(_module).split("\n")
if line.startswith("from typing")
]
if len(src):
return set(src[0].rpartition("from typing import ")[-1].split(", "))
return set()
def _get_var_definition(_module, _var_name):
return [
line.split(" = ")[0]
for line in inspect.getsource(_module).splitlines()
if line.startswith(_var_name)
]
class PyiGenerator:
"""A .pyi file generator that will scan all defined Component in Reflex and
generate the approriate stub.
"""
modules: list = []
root: str = ""
current_module: Any = {}
default_typing_imports: set = DEFAULT_TYPING_IMPORTS
def _generate_imports(self, variables, classes):
variables_imports = {
type(_var) for _, _var in variables if isinstance(_var, Component)
}
bases = {
base
for _, _class in classes
for base in _class.__bases__
if inspect.getmodule(base) != self.current_module
} | variables_imports
bases.add(Component)
typing_imports = self.default_typing_imports | _get_typing_import(
self.current_module
)
return [
f"from typing import {','.join(typing_imports)}",
*[f"from {base.__module__} import {base.__name__}" for base in bases],
"from reflex.vars import Var, BaseVar, ComputedVar",
"from reflex.event import EventChain",
]
def _generate_pyi_class(self, _class):
create_spec = getfullargspec(_class.create)
lines = [
"",
f"class {_class.__name__}({', '.join([base.__name__ for base in _class.__bases__])}):",
]
definition = f" @overload\n @classmethod\n def create(cls, *children, "
for kwarg in create_spec.kwonlyargs:
if kwarg in create_spec.annotations:
definition += f"{kwarg}: {_get_type_hint(create_spec.annotations[kwarg])} = None, "
else:
definition += f"{kwarg}, "
for name, value in _class.__annotations__.items():
if name in create_spec.kwonlyargs:
continue
definition += f"{name}: {_get_type_hint(value)} = None, "
definition = definition.rstrip(", ")
definition += f", **props) -> '{_class.__name__}': ... # type: ignore"
lines.append(definition)
return lines
def _generate_pyi_variable(self, _name, _var):
return _get_var_definition(self.current_module, _name)
def _generate_function(self, _name, _func):
definition = "".join(inspect.getsource(_func).split(":\n")[0].split("\n"))
return [f"{definition}:", " ..."]
def _write_pyi_file(self, variables, functions, classes):
pyi_content = [
f'"""Stub file for {self.current_module_path}.py"""',
"# ------------------- DO NOT EDIT ----------------------",
"# This file was generated by `scripts/pyi_generator.py`!",
"# ------------------------------------------------------",
"",
]
pyi_content.extend(self._generate_imports(variables, classes))
for _name, _var in variables:
pyi_content.extend(self._generate_pyi_variable(_name, _var))
for _fname, _func in functions:
pyi_content.extend(self._generate_function(_fname, _func))
for _, _class in classes:
pyi_content.extend(self._generate_pyi_class(_class))
pyi_filename = f"{self.current_module_path}.pyi"
pyi_path = os.path.join(self.root, pyi_filename)
with open(pyi_path, "w") as pyi_file:
pyi_file.write("\n".join(pyi_content))
black.format_file_in_place(
src=Path(pyi_path),
fast=True,
mode=black.FileMode(),
write_back=black.WriteBack.YES,
)
def _scan_file(self, file):
self.current_module_path = os.path.splitext(file)[0]
module_import = os.path.splitext(os.path.join(self.root, file))[0].replace(
"/", "."
)
self.current_module = importlib.import_module(module_import)
local_variables = [
(name, obj)
for name, obj in vars(self.current_module).items()
if not name.startswith("__")
# and (
# not inspect.getmodule(obj)
# or inspect.getmodule(obj) == self.current_module
# )
and not inspect.isclass(obj) and not inspect.isfunction(obj)
]
functions = [
(name, obj)
for name, obj in vars(self.current_module).items()
if not name.startswith("__")
and (
not inspect.getmodule(obj)
or inspect.getmodule(obj) == self.current_module
)
and inspect.isfunction(obj)
]
class_names = [
(name, obj)
for name, obj in vars(self.current_module).items()
if inspect.isclass(obj)
and issubclass(obj, Component)
and obj != Component
and inspect.getmodule(obj) == self.current_module
]
if not class_names:
return
print(f"Parsed {file}: Found {[n for n,_ in class_names]}")
self._write_pyi_file(local_variables, functions, class_names)
def _scan_folder(self, folder):
for root, _, files in os.walk(folder):
self.root = root
for file in files:
if file in EXCLUDED_FILES:
continue
if file.endswith(".py"):
self._scan_file(file)
def scan_all(self, targets):
"""Scan all targets for class inheriting Component and generate the .pyi files.
Args:
targets: the list of file/folders to scan.
"""
for target in targets:
if target.endswith(".py"):
self.root, _, file = target.rpartition("/")
self._scan_file(file)
else:
self._scan_folder(target)
if __name__ == "__main__":
targets = sys.argv[1:] if len(sys.argv) > 1 else ["reflex/components"]
print(f"Running .pyi generator for {targets}")
gen = PyiGenerator()
gen.scan_all(targets)