reflex 0.3.5a4__py3-none-any.whl → 0.3.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/jinja/web/pages/base_page.js.jinja2 +2 -0
- reflex/.templates/web/utils/state.js +1 -1
- reflex/__init__.py +29 -6
- reflex/__init__.pyi +2 -0
- reflex/app.py +3 -0
- reflex/components/__init__.py +2 -0
- reflex/components/chakra/__init__.py +23 -0
- reflex/components/{media → chakra/media}/image.py +1 -28
- reflex/components/chakra/media/image.pyi +120 -0
- reflex/components/component.py +32 -4
- reflex/components/datadisplay/datatable.py +1 -37
- reflex/components/datadisplay/datatable.pyi +1 -11
- reflex/components/el/elements/forms.py +43 -1
- reflex/components/el/elements/forms.pyi +26 -1
- reflex/components/graphing/plotly.py +0 -22
- reflex/components/graphing/plotly.pyi +0 -12
- reflex/components/media/__init__.py +0 -1
- reflex/components/media/image.pyi +0 -9
- reflex/components/next/__init__.py +8 -0
- reflex/components/next/base.py +8 -0
- reflex/components/next/base.pyi +91 -0
- reflex/components/next/image.py +114 -0
- reflex/components/next/image.pyi +122 -0
- reflex/components/next/video.py +33 -0
- reflex/components/next/video.pyi +92 -0
- reflex/components/radix/primitives/__init__.py +3 -0
- reflex/components/radix/primitives/accordion.py +279 -0
- reflex/components/radix/primitives/accordion.pyi +619 -0
- reflex/components/radix/themes/__init__.py +4 -73
- reflex/components/radix/themes/base.py +7 -7
- reflex/components/radix/themes/base.pyi +21 -21
- reflex/components/radix/themes/components/__init__.py +193 -0
- reflex/components/radix/themes/components/alertdialog.py +72 -0
- reflex/components/radix/themes/components/alertdialog.pyi +733 -0
- reflex/components/radix/themes/components/aspectratio.py +20 -0
- reflex/components/radix/themes/components/aspectratio.pyi +144 -0
- reflex/components/radix/themes/components/avatar.py +38 -0
- reflex/components/radix/themes/components/avatar.pyi +233 -0
- reflex/components/radix/themes/components/badge.py +38 -0
- reflex/components/radix/themes/components/badge.pyi +291 -0
- reflex/components/radix/themes/components/button.py +39 -0
- reflex/components/radix/themes/components/button.pyi +330 -0
- reflex/components/radix/themes/components/callout.py +49 -0
- reflex/components/radix/themes/components/callout.pyi +668 -0
- reflex/components/radix/themes/components/card.py +25 -0
- reflex/components/radix/themes/components/card.pyi +214 -0
- reflex/components/radix/themes/components/checkbox.py +67 -0
- reflex/components/radix/themes/components/checkbox.pyi +249 -0
- reflex/components/radix/themes/components/contextmenu.py +134 -0
- reflex/components/radix/themes/{typography.pyi → components/contextmenu.pyi} +182 -602
- reflex/components/radix/themes/components/dialog.py +75 -0
- reflex/components/radix/themes/components/dialog.pyi +739 -0
- reflex/components/radix/themes/components/dropdownmenu.py +101 -0
- reflex/components/radix/themes/components/dropdownmenu.pyi +1065 -0
- reflex/components/radix/themes/components/hovercard.py +63 -0
- reflex/components/radix/themes/components/hovercard.pyi +487 -0
- reflex/components/radix/themes/components/iconbutton.py +39 -0
- reflex/components/radix/themes/components/iconbutton.pyi +332 -0
- reflex/components/radix/themes/components/icons.py +400 -0
- reflex/components/radix/themes/components/icons.pyi +185 -0
- reflex/components/radix/themes/components/inset.py +44 -0
- reflex/components/radix/themes/components/inset.pyi +230 -0
- reflex/components/radix/themes/components/popover.py +85 -0
- reflex/components/radix/themes/components/popover.pyi +634 -0
- reflex/components/radix/themes/components/radiogroup.py +72 -0
- reflex/components/radix/themes/components/radiogroup.pyi +369 -0
- reflex/components/radix/themes/components/scrollarea.py +31 -0
- reflex/components/radix/themes/components/scrollarea.pyi +165 -0
- reflex/components/radix/themes/components/select.py +137 -0
- reflex/components/radix/themes/{layout.pyi → components/select.pyi} +422 -418
- reflex/components/radix/themes/components/separator.py +30 -0
- reflex/components/radix/themes/components/separator.pyi +218 -0
- reflex/components/radix/themes/components/slider.py +68 -0
- reflex/components/radix/themes/components/slider.pyi +254 -0
- reflex/components/radix/themes/components/switch.py +68 -0
- reflex/components/radix/themes/components/switch.pyi +250 -0
- reflex/components/radix/themes/components/table.py +79 -0
- reflex/components/radix/themes/components/table.pyi +1485 -0
- reflex/components/radix/themes/components/tabs.py +65 -0
- reflex/components/radix/themes/components/tabs.pyi +549 -0
- reflex/components/radix/themes/components/textarea.py +68 -0
- reflex/components/radix/themes/components/textarea.pyi +333 -0
- reflex/components/radix/themes/{components.py → components/textfield.py} +3 -87
- reflex/components/radix/themes/{components.pyi → components/textfield.pyi} +202 -591
- reflex/components/radix/themes/layout/__init__.py +13 -0
- reflex/components/radix/themes/layout/base.py +48 -0
- reflex/components/radix/themes/layout/base.pyi +195 -0
- reflex/components/radix/themes/layout/box.py +12 -0
- reflex/components/radix/themes/layout/box.pyi +252 -0
- reflex/components/radix/themes/layout/container.py +23 -0
- reflex/components/radix/themes/layout/container.pyi +260 -0
- reflex/components/radix/themes/layout/flex.py +45 -0
- reflex/components/radix/themes/layout/flex.pyi +303 -0
- reflex/components/radix/themes/layout/grid.py +53 -0
- reflex/components/radix/themes/layout/grid.pyi +203 -0
- reflex/components/radix/themes/layout/section.py +20 -0
- reflex/components/radix/themes/layout/section.pyi +260 -0
- reflex/components/radix/themes/typography/__init__.py +21 -0
- reflex/components/radix/themes/typography/base.py +12 -0
- reflex/components/radix/themes/typography/blockquote.py +36 -0
- reflex/components/radix/themes/typography/blockquote.pyi +282 -0
- reflex/components/radix/themes/typography/code.py +40 -0
- reflex/components/radix/themes/typography/code.pyi +292 -0
- reflex/components/radix/themes/typography/em.py +18 -0
- reflex/components/radix/themes/typography/em.pyi +199 -0
- reflex/components/radix/themes/typography/heading.py +50 -0
- reflex/components/radix/themes/typography/heading.pyi +298 -0
- reflex/components/radix/themes/typography/kbd.py +25 -0
- reflex/components/radix/themes/typography/kbd.pyi +208 -0
- reflex/components/radix/themes/typography/link.py +49 -0
- reflex/components/radix/themes/typography/link.pyi +238 -0
- reflex/components/radix/themes/typography/quote.py +18 -0
- reflex/components/radix/themes/typography/quote.pyi +200 -0
- reflex/components/radix/themes/typography/strong.py +18 -0
- reflex/components/radix/themes/typography/strong.pyi +199 -0
- reflex/components/radix/themes/typography/text.py +50 -0
- reflex/components/radix/themes/typography/text.pyi +298 -0
- reflex/components/radix/themes/typography.py +1 -1
- reflex/constants/__init__.py +1 -0
- reflex/constants/base.py +7 -0
- reflex/constants/config.py +1 -1
- reflex/model.py +2 -1
- reflex/reflex.py +8 -1
- reflex/state.py +11 -0
- reflex/style.py +120 -10
- reflex/testing.py +4 -4
- reflex/utils/format.py +9 -5
- reflex/utils/prerequisites.py +49 -6
- reflex/utils/processes.py +8 -1
- reflex/utils/serializers.py +83 -0
- reflex/utils/types.py +22 -1
- reflex/vars.py +24 -1
- {reflex-0.3.5a4.dist-info → reflex-0.3.7.dist-info}/METADATA +3 -2
- {reflex-0.3.5a4.dist-info → reflex-0.3.7.dist-info}/RECORD +137 -44
- reflex/components/radix/themes/layout.py +0 -155
- {reflex-0.3.5a4.dist-info → reflex-0.3.7.dist-info}/LICENSE +0 -0
- {reflex-0.3.5a4.dist-info → reflex-0.3.7.dist-info}/WHEEL +0 -0
- {reflex-0.3.5a4.dist-info → reflex-0.3.7.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Interactive components provided by @radix-ui/themes."""
|
|
2
|
+
from typing import Literal, Union
|
|
3
|
+
|
|
4
|
+
from reflex.vars import Var
|
|
5
|
+
|
|
6
|
+
from ..base import (
|
|
7
|
+
CommonMarginProps,
|
|
8
|
+
RadixThemesComponent,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AspectRatio(CommonMarginProps, RadixThemesComponent):
|
|
15
|
+
"""A toggle switch alternative to the checkbox."""
|
|
16
|
+
|
|
17
|
+
tag = "AspectRatio"
|
|
18
|
+
|
|
19
|
+
# The ratio of the width to the height of the element
|
|
20
|
+
ration: Var[Union[float, int]]
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/themes/components/aspectratio.py"""
|
|
2
|
+
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
+
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
+
# ------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
+
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
+
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
+
from reflex.style import Style
|
|
10
|
+
from typing import Literal, Union
|
|
11
|
+
from reflex.vars import Var
|
|
12
|
+
from ..base import CommonMarginProps, RadixThemesComponent
|
|
13
|
+
|
|
14
|
+
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
15
|
+
|
|
16
|
+
class AspectRatio(CommonMarginProps, RadixThemesComponent):
|
|
17
|
+
@overload
|
|
18
|
+
@classmethod
|
|
19
|
+
def create( # type: ignore
|
|
20
|
+
cls,
|
|
21
|
+
*children,
|
|
22
|
+
ration: Optional[Union[Var[Union[float, int]], Union[float, int]]] = None,
|
|
23
|
+
m: Optional[
|
|
24
|
+
Union[
|
|
25
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
26
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
27
|
+
]
|
|
28
|
+
] = None,
|
|
29
|
+
mx: Optional[
|
|
30
|
+
Union[
|
|
31
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
32
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
33
|
+
]
|
|
34
|
+
] = None,
|
|
35
|
+
my: Optional[
|
|
36
|
+
Union[
|
|
37
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
38
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
39
|
+
]
|
|
40
|
+
] = None,
|
|
41
|
+
mt: Optional[
|
|
42
|
+
Union[
|
|
43
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
44
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
45
|
+
]
|
|
46
|
+
] = None,
|
|
47
|
+
mr: Optional[
|
|
48
|
+
Union[
|
|
49
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
50
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
51
|
+
]
|
|
52
|
+
] = None,
|
|
53
|
+
mb: Optional[
|
|
54
|
+
Union[
|
|
55
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
56
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
57
|
+
]
|
|
58
|
+
] = None,
|
|
59
|
+
ml: Optional[
|
|
60
|
+
Union[
|
|
61
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
62
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
63
|
+
]
|
|
64
|
+
] = None,
|
|
65
|
+
style: Optional[Style] = None,
|
|
66
|
+
key: Optional[Any] = None,
|
|
67
|
+
id: Optional[Any] = None,
|
|
68
|
+
class_name: Optional[Any] = None,
|
|
69
|
+
autofocus: Optional[bool] = None,
|
|
70
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
71
|
+
on_blur: Optional[
|
|
72
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
73
|
+
] = None,
|
|
74
|
+
on_click: Optional[
|
|
75
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
76
|
+
] = None,
|
|
77
|
+
on_context_menu: Optional[
|
|
78
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
79
|
+
] = None,
|
|
80
|
+
on_double_click: Optional[
|
|
81
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
82
|
+
] = None,
|
|
83
|
+
on_focus: Optional[
|
|
84
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
85
|
+
] = None,
|
|
86
|
+
on_mount: Optional[
|
|
87
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
88
|
+
] = None,
|
|
89
|
+
on_mouse_down: Optional[
|
|
90
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
91
|
+
] = None,
|
|
92
|
+
on_mouse_enter: Optional[
|
|
93
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
94
|
+
] = None,
|
|
95
|
+
on_mouse_leave: Optional[
|
|
96
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
97
|
+
] = None,
|
|
98
|
+
on_mouse_move: Optional[
|
|
99
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
100
|
+
] = None,
|
|
101
|
+
on_mouse_out: Optional[
|
|
102
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
103
|
+
] = None,
|
|
104
|
+
on_mouse_over: Optional[
|
|
105
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
106
|
+
] = None,
|
|
107
|
+
on_mouse_up: Optional[
|
|
108
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
109
|
+
] = None,
|
|
110
|
+
on_scroll: Optional[
|
|
111
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
112
|
+
] = None,
|
|
113
|
+
on_unmount: Optional[
|
|
114
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
115
|
+
] = None,
|
|
116
|
+
**props
|
|
117
|
+
) -> "AspectRatio":
|
|
118
|
+
"""Create a new component instance.
|
|
119
|
+
|
|
120
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
121
|
+
other UI libraries for common names, like Text and Button.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
*children: Child components.
|
|
125
|
+
ration: The ratio of the width to the height of the element
|
|
126
|
+
m: Margin: "0" - "9"
|
|
127
|
+
mx: Margin horizontal: "0" - "9"
|
|
128
|
+
my: Margin vertical: "0" - "9"
|
|
129
|
+
mt: Margin top: "0" - "9"
|
|
130
|
+
mr: Margin right: "0" - "9"
|
|
131
|
+
mb: Margin bottom: "0" - "9"
|
|
132
|
+
ml: Margin left: "0" - "9"
|
|
133
|
+
style: The style of the component.
|
|
134
|
+
key: A unique key for the component.
|
|
135
|
+
id: The id for the component.
|
|
136
|
+
class_name: The class name for the component.
|
|
137
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
138
|
+
custom_attrs: custom attribute
|
|
139
|
+
**props: Component properties.
|
|
140
|
+
|
|
141
|
+
Returns:
|
|
142
|
+
A new component instance.
|
|
143
|
+
"""
|
|
144
|
+
...
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Interactive components provided by @radix-ui/themes."""
|
|
2
|
+
from typing import Literal
|
|
3
|
+
|
|
4
|
+
from reflex.vars import Var
|
|
5
|
+
|
|
6
|
+
from ..base import (
|
|
7
|
+
CommonMarginProps,
|
|
8
|
+
LiteralAccentColor,
|
|
9
|
+
LiteralRadius,
|
|
10
|
+
LiteralSize,
|
|
11
|
+
RadixThemesComponent,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Avatar(CommonMarginProps, RadixThemesComponent):
|
|
18
|
+
"""A toggle switch alternative to the checkbox."""
|
|
19
|
+
|
|
20
|
+
tag = "Avatar"
|
|
21
|
+
|
|
22
|
+
# The ratio of the width to the height of the element
|
|
23
|
+
ration: Var[float]
|
|
24
|
+
|
|
25
|
+
# The variant of the avatar
|
|
26
|
+
variant: Var[Literal["solid", "soft"]]
|
|
27
|
+
|
|
28
|
+
# The size of the avatar
|
|
29
|
+
size: Var[LiteralSize]
|
|
30
|
+
|
|
31
|
+
# Color theme of the avatar
|
|
32
|
+
color: Var[LiteralAccentColor]
|
|
33
|
+
|
|
34
|
+
# Whether to render the avatar with higher contrast color against background
|
|
35
|
+
high_contrast: Var[bool]
|
|
36
|
+
|
|
37
|
+
# Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
|
38
|
+
radius: Var[LiteralRadius]
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/themes/components/avatar.py"""
|
|
2
|
+
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
+
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
+
# ------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
+
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
+
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
+
from reflex.style import Style
|
|
10
|
+
from typing import Literal
|
|
11
|
+
from reflex.vars import Var
|
|
12
|
+
from ..base import (
|
|
13
|
+
CommonMarginProps,
|
|
14
|
+
LiteralAccentColor,
|
|
15
|
+
LiteralRadius,
|
|
16
|
+
LiteralSize,
|
|
17
|
+
RadixThemesComponent,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
21
|
+
|
|
22
|
+
class Avatar(CommonMarginProps, RadixThemesComponent):
|
|
23
|
+
@overload
|
|
24
|
+
@classmethod
|
|
25
|
+
def create( # type: ignore
|
|
26
|
+
cls,
|
|
27
|
+
*children,
|
|
28
|
+
ration: Optional[Union[Var[float], float]] = None,
|
|
29
|
+
variant: Optional[
|
|
30
|
+
Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]]
|
|
31
|
+
] = None,
|
|
32
|
+
size: Optional[
|
|
33
|
+
Union[
|
|
34
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
35
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
36
|
+
]
|
|
37
|
+
] = None,
|
|
38
|
+
color: Optional[
|
|
39
|
+
Union[
|
|
40
|
+
Var[
|
|
41
|
+
Literal[
|
|
42
|
+
"tomato",
|
|
43
|
+
"red",
|
|
44
|
+
"ruby",
|
|
45
|
+
"crimson",
|
|
46
|
+
"pink",
|
|
47
|
+
"plum",
|
|
48
|
+
"purple",
|
|
49
|
+
"violet",
|
|
50
|
+
"iris",
|
|
51
|
+
"indigo",
|
|
52
|
+
"blue",
|
|
53
|
+
"cyan",
|
|
54
|
+
"teal",
|
|
55
|
+
"jade",
|
|
56
|
+
"green",
|
|
57
|
+
"grass",
|
|
58
|
+
"brown",
|
|
59
|
+
"orange",
|
|
60
|
+
"sky",
|
|
61
|
+
"mint",
|
|
62
|
+
"lime",
|
|
63
|
+
"yellow",
|
|
64
|
+
"amber",
|
|
65
|
+
"gold",
|
|
66
|
+
"bronze",
|
|
67
|
+
"gray",
|
|
68
|
+
]
|
|
69
|
+
],
|
|
70
|
+
Literal[
|
|
71
|
+
"tomato",
|
|
72
|
+
"red",
|
|
73
|
+
"ruby",
|
|
74
|
+
"crimson",
|
|
75
|
+
"pink",
|
|
76
|
+
"plum",
|
|
77
|
+
"purple",
|
|
78
|
+
"violet",
|
|
79
|
+
"iris",
|
|
80
|
+
"indigo",
|
|
81
|
+
"blue",
|
|
82
|
+
"cyan",
|
|
83
|
+
"teal",
|
|
84
|
+
"jade",
|
|
85
|
+
"green",
|
|
86
|
+
"grass",
|
|
87
|
+
"brown",
|
|
88
|
+
"orange",
|
|
89
|
+
"sky",
|
|
90
|
+
"mint",
|
|
91
|
+
"lime",
|
|
92
|
+
"yellow",
|
|
93
|
+
"amber",
|
|
94
|
+
"gold",
|
|
95
|
+
"bronze",
|
|
96
|
+
"gray",
|
|
97
|
+
],
|
|
98
|
+
]
|
|
99
|
+
] = None,
|
|
100
|
+
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
101
|
+
radius: Optional[
|
|
102
|
+
Union[
|
|
103
|
+
Var[Literal["none", "small", "medium", "large", "full"]],
|
|
104
|
+
Literal["none", "small", "medium", "large", "full"],
|
|
105
|
+
]
|
|
106
|
+
] = None,
|
|
107
|
+
m: Optional[
|
|
108
|
+
Union[
|
|
109
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
110
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
111
|
+
]
|
|
112
|
+
] = None,
|
|
113
|
+
mx: Optional[
|
|
114
|
+
Union[
|
|
115
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
116
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
117
|
+
]
|
|
118
|
+
] = None,
|
|
119
|
+
my: Optional[
|
|
120
|
+
Union[
|
|
121
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
122
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
123
|
+
]
|
|
124
|
+
] = None,
|
|
125
|
+
mt: Optional[
|
|
126
|
+
Union[
|
|
127
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
128
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
129
|
+
]
|
|
130
|
+
] = None,
|
|
131
|
+
mr: Optional[
|
|
132
|
+
Union[
|
|
133
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
134
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
135
|
+
]
|
|
136
|
+
] = None,
|
|
137
|
+
mb: Optional[
|
|
138
|
+
Union[
|
|
139
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
140
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
141
|
+
]
|
|
142
|
+
] = None,
|
|
143
|
+
ml: Optional[
|
|
144
|
+
Union[
|
|
145
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
146
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
147
|
+
]
|
|
148
|
+
] = None,
|
|
149
|
+
style: Optional[Style] = None,
|
|
150
|
+
key: Optional[Any] = None,
|
|
151
|
+
id: Optional[Any] = None,
|
|
152
|
+
class_name: Optional[Any] = None,
|
|
153
|
+
autofocus: Optional[bool] = None,
|
|
154
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
155
|
+
on_blur: Optional[
|
|
156
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
157
|
+
] = None,
|
|
158
|
+
on_click: Optional[
|
|
159
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
160
|
+
] = None,
|
|
161
|
+
on_context_menu: Optional[
|
|
162
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
163
|
+
] = None,
|
|
164
|
+
on_double_click: Optional[
|
|
165
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
166
|
+
] = None,
|
|
167
|
+
on_focus: Optional[
|
|
168
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
169
|
+
] = None,
|
|
170
|
+
on_mount: Optional[
|
|
171
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
172
|
+
] = None,
|
|
173
|
+
on_mouse_down: Optional[
|
|
174
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
175
|
+
] = None,
|
|
176
|
+
on_mouse_enter: Optional[
|
|
177
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
178
|
+
] = None,
|
|
179
|
+
on_mouse_leave: Optional[
|
|
180
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
181
|
+
] = None,
|
|
182
|
+
on_mouse_move: Optional[
|
|
183
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
184
|
+
] = None,
|
|
185
|
+
on_mouse_out: Optional[
|
|
186
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
187
|
+
] = None,
|
|
188
|
+
on_mouse_over: Optional[
|
|
189
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
190
|
+
] = None,
|
|
191
|
+
on_mouse_up: Optional[
|
|
192
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
193
|
+
] = None,
|
|
194
|
+
on_scroll: Optional[
|
|
195
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
196
|
+
] = None,
|
|
197
|
+
on_unmount: Optional[
|
|
198
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
199
|
+
] = None,
|
|
200
|
+
**props
|
|
201
|
+
) -> "Avatar":
|
|
202
|
+
"""Create a new component instance.
|
|
203
|
+
|
|
204
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
205
|
+
other UI libraries for common names, like Text and Button.
|
|
206
|
+
|
|
207
|
+
Args:
|
|
208
|
+
*children: Child components.
|
|
209
|
+
ration: The ratio of the width to the height of the element
|
|
210
|
+
variant: The variant of the avatar
|
|
211
|
+
size: The size of the avatar
|
|
212
|
+
color: Color theme of the avatar
|
|
213
|
+
high_contrast: Whether to render the avatar with higher contrast color against background
|
|
214
|
+
radius: Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
|
215
|
+
m: Margin: "0" - "9"
|
|
216
|
+
mx: Margin horizontal: "0" - "9"
|
|
217
|
+
my: Margin vertical: "0" - "9"
|
|
218
|
+
mt: Margin top: "0" - "9"
|
|
219
|
+
mr: Margin right: "0" - "9"
|
|
220
|
+
mb: Margin bottom: "0" - "9"
|
|
221
|
+
ml: Margin left: "0" - "9"
|
|
222
|
+
style: The style of the component.
|
|
223
|
+
key: A unique key for the component.
|
|
224
|
+
id: The id for the component.
|
|
225
|
+
class_name: The class name for the component.
|
|
226
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
227
|
+
custom_attrs: custom attribute
|
|
228
|
+
**props: Component properties.
|
|
229
|
+
|
|
230
|
+
Returns:
|
|
231
|
+
A new component instance.
|
|
232
|
+
"""
|
|
233
|
+
...
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Interactive components provided by @radix-ui/themes."""
|
|
2
|
+
from typing import Literal
|
|
3
|
+
|
|
4
|
+
from reflex import el
|
|
5
|
+
from reflex.vars import Var
|
|
6
|
+
|
|
7
|
+
from ..base import (
|
|
8
|
+
CommonMarginProps,
|
|
9
|
+
LiteralAccentColor,
|
|
10
|
+
LiteralRadius,
|
|
11
|
+
RadixThemesComponent,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Badge(el.Span, CommonMarginProps, RadixThemesComponent):
|
|
18
|
+
"""A toggle switch alternative to the checkbox."""
|
|
19
|
+
|
|
20
|
+
tag = "Badge"
|
|
21
|
+
|
|
22
|
+
# The ratio of the width to the height of the element
|
|
23
|
+
ration: Var[float]
|
|
24
|
+
|
|
25
|
+
# The variant of the avatar
|
|
26
|
+
variant: Var[Literal["solid", "soft", "surface", "outline"]]
|
|
27
|
+
|
|
28
|
+
# The size of the avatar
|
|
29
|
+
size: Var[Literal[1, 2]]
|
|
30
|
+
|
|
31
|
+
# Color theme of the avatar
|
|
32
|
+
color: Var[LiteralAccentColor]
|
|
33
|
+
|
|
34
|
+
# Whether to render the avatar with higher contrast color against background
|
|
35
|
+
high_contrast: Var[bool]
|
|
36
|
+
|
|
37
|
+
# Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
|
38
|
+
radius: Var[LiteralRadius]
|