reflex 0.3.6__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/__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 +27 -2
- 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/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 +5 -0
- 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.6.dist-info → reflex-0.3.7.dist-info}/METADATA +3 -2
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/RECORD +135 -42
- reflex/components/radix/themes/layout.py +0 -155
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/LICENSE +0 -0
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/WHEEL +0 -0
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
RadixThemesComponent,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
LiteralSeperatorSize = Literal["1", "2", "3", "4"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Separator(CommonMarginProps, RadixThemesComponent):
|
|
16
|
+
"""Trigger an action or event, such as submitting a form or displaying a dialog."""
|
|
17
|
+
|
|
18
|
+
tag = "Separator"
|
|
19
|
+
|
|
20
|
+
# The size of the select: "1" | "2" | "3"
|
|
21
|
+
size: Var[LiteralSeperatorSize]
|
|
22
|
+
|
|
23
|
+
# The color of the select
|
|
24
|
+
color: Var[LiteralAccentColor]
|
|
25
|
+
|
|
26
|
+
# The orientation of the separator.
|
|
27
|
+
orientation: Var[Literal["horizontal", "vertical"]]
|
|
28
|
+
|
|
29
|
+
# When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree.
|
|
30
|
+
decorative: Var[bool]
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/themes/components/separator.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 CommonMarginProps, LiteralAccentColor, RadixThemesComponent
|
|
13
|
+
|
|
14
|
+
LiteralSeperatorSize = Literal["1", "2", "3", "4"]
|
|
15
|
+
|
|
16
|
+
class Separator(CommonMarginProps, RadixThemesComponent):
|
|
17
|
+
@overload
|
|
18
|
+
@classmethod
|
|
19
|
+
def create( # type: ignore
|
|
20
|
+
cls,
|
|
21
|
+
*children,
|
|
22
|
+
size: Optional[
|
|
23
|
+
Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]]
|
|
24
|
+
] = None,
|
|
25
|
+
color: Optional[
|
|
26
|
+
Union[
|
|
27
|
+
Var[
|
|
28
|
+
Literal[
|
|
29
|
+
"tomato",
|
|
30
|
+
"red",
|
|
31
|
+
"ruby",
|
|
32
|
+
"crimson",
|
|
33
|
+
"pink",
|
|
34
|
+
"plum",
|
|
35
|
+
"purple",
|
|
36
|
+
"violet",
|
|
37
|
+
"iris",
|
|
38
|
+
"indigo",
|
|
39
|
+
"blue",
|
|
40
|
+
"cyan",
|
|
41
|
+
"teal",
|
|
42
|
+
"jade",
|
|
43
|
+
"green",
|
|
44
|
+
"grass",
|
|
45
|
+
"brown",
|
|
46
|
+
"orange",
|
|
47
|
+
"sky",
|
|
48
|
+
"mint",
|
|
49
|
+
"lime",
|
|
50
|
+
"yellow",
|
|
51
|
+
"amber",
|
|
52
|
+
"gold",
|
|
53
|
+
"bronze",
|
|
54
|
+
"gray",
|
|
55
|
+
]
|
|
56
|
+
],
|
|
57
|
+
Literal[
|
|
58
|
+
"tomato",
|
|
59
|
+
"red",
|
|
60
|
+
"ruby",
|
|
61
|
+
"crimson",
|
|
62
|
+
"pink",
|
|
63
|
+
"plum",
|
|
64
|
+
"purple",
|
|
65
|
+
"violet",
|
|
66
|
+
"iris",
|
|
67
|
+
"indigo",
|
|
68
|
+
"blue",
|
|
69
|
+
"cyan",
|
|
70
|
+
"teal",
|
|
71
|
+
"jade",
|
|
72
|
+
"green",
|
|
73
|
+
"grass",
|
|
74
|
+
"brown",
|
|
75
|
+
"orange",
|
|
76
|
+
"sky",
|
|
77
|
+
"mint",
|
|
78
|
+
"lime",
|
|
79
|
+
"yellow",
|
|
80
|
+
"amber",
|
|
81
|
+
"gold",
|
|
82
|
+
"bronze",
|
|
83
|
+
"gray",
|
|
84
|
+
],
|
|
85
|
+
]
|
|
86
|
+
] = None,
|
|
87
|
+
orientation: Optional[
|
|
88
|
+
Union[
|
|
89
|
+
Var[Literal["horizontal", "vertical"]],
|
|
90
|
+
Literal["horizontal", "vertical"],
|
|
91
|
+
]
|
|
92
|
+
] = None,
|
|
93
|
+
decorative: Optional[Union[Var[bool], bool]] = None,
|
|
94
|
+
m: Optional[
|
|
95
|
+
Union[
|
|
96
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
97
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
98
|
+
]
|
|
99
|
+
] = None,
|
|
100
|
+
mx: Optional[
|
|
101
|
+
Union[
|
|
102
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
103
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
104
|
+
]
|
|
105
|
+
] = None,
|
|
106
|
+
my: Optional[
|
|
107
|
+
Union[
|
|
108
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
109
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
110
|
+
]
|
|
111
|
+
] = None,
|
|
112
|
+
mt: Optional[
|
|
113
|
+
Union[
|
|
114
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
115
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
116
|
+
]
|
|
117
|
+
] = None,
|
|
118
|
+
mr: Optional[
|
|
119
|
+
Union[
|
|
120
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
121
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
122
|
+
]
|
|
123
|
+
] = None,
|
|
124
|
+
mb: Optional[
|
|
125
|
+
Union[
|
|
126
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
127
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
128
|
+
]
|
|
129
|
+
] = None,
|
|
130
|
+
ml: Optional[
|
|
131
|
+
Union[
|
|
132
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
133
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
134
|
+
]
|
|
135
|
+
] = None,
|
|
136
|
+
style: Optional[Style] = None,
|
|
137
|
+
key: Optional[Any] = None,
|
|
138
|
+
id: Optional[Any] = None,
|
|
139
|
+
class_name: Optional[Any] = None,
|
|
140
|
+
autofocus: Optional[bool] = None,
|
|
141
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
142
|
+
on_blur: Optional[
|
|
143
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
144
|
+
] = None,
|
|
145
|
+
on_click: Optional[
|
|
146
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
147
|
+
] = None,
|
|
148
|
+
on_context_menu: Optional[
|
|
149
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
150
|
+
] = None,
|
|
151
|
+
on_double_click: Optional[
|
|
152
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
153
|
+
] = None,
|
|
154
|
+
on_focus: Optional[
|
|
155
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
156
|
+
] = None,
|
|
157
|
+
on_mount: Optional[
|
|
158
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
159
|
+
] = None,
|
|
160
|
+
on_mouse_down: Optional[
|
|
161
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
162
|
+
] = None,
|
|
163
|
+
on_mouse_enter: Optional[
|
|
164
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
165
|
+
] = None,
|
|
166
|
+
on_mouse_leave: Optional[
|
|
167
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
168
|
+
] = None,
|
|
169
|
+
on_mouse_move: Optional[
|
|
170
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
171
|
+
] = None,
|
|
172
|
+
on_mouse_out: Optional[
|
|
173
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
174
|
+
] = None,
|
|
175
|
+
on_mouse_over: Optional[
|
|
176
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
177
|
+
] = None,
|
|
178
|
+
on_mouse_up: Optional[
|
|
179
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
180
|
+
] = None,
|
|
181
|
+
on_scroll: Optional[
|
|
182
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
183
|
+
] = None,
|
|
184
|
+
on_unmount: Optional[
|
|
185
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
186
|
+
] = None,
|
|
187
|
+
**props
|
|
188
|
+
) -> "Separator":
|
|
189
|
+
"""Create a new component instance.
|
|
190
|
+
|
|
191
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
192
|
+
other UI libraries for common names, like Text and Button.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
*children: Child components.
|
|
196
|
+
size: The size of the select: "1" | "2" | "3"
|
|
197
|
+
color: The color of the select
|
|
198
|
+
orientation: The orientation of the separator.
|
|
199
|
+
decorative: When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree.
|
|
200
|
+
m: Margin: "0" - "9"
|
|
201
|
+
mx: Margin horizontal: "0" - "9"
|
|
202
|
+
my: Margin vertical: "0" - "9"
|
|
203
|
+
mt: Margin top: "0" - "9"
|
|
204
|
+
mr: Margin right: "0" - "9"
|
|
205
|
+
mb: Margin bottom: "0" - "9"
|
|
206
|
+
ml: Margin left: "0" - "9"
|
|
207
|
+
style: The style of the component.
|
|
208
|
+
key: A unique key for the component.
|
|
209
|
+
id: The id for the component.
|
|
210
|
+
class_name: The class name for the component.
|
|
211
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
212
|
+
custom_attrs: custom attribute
|
|
213
|
+
**props: Component properties.
|
|
214
|
+
|
|
215
|
+
Returns:
|
|
216
|
+
A new component instance.
|
|
217
|
+
"""
|
|
218
|
+
...
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Interactive components provided by @radix-ui/themes."""
|
|
2
|
+
from typing import Any, Dict, Literal
|
|
3
|
+
|
|
4
|
+
from reflex.vars import Var
|
|
5
|
+
|
|
6
|
+
from ..base import (
|
|
7
|
+
CommonMarginProps,
|
|
8
|
+
LiteralAccentColor,
|
|
9
|
+
LiteralRadius,
|
|
10
|
+
RadixThemesComponent,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Slider(CommonMarginProps, RadixThemesComponent):
|
|
15
|
+
"""Trigger an action or event, such as submitting a form or displaying a dialog."""
|
|
16
|
+
|
|
17
|
+
tag = "Slider"
|
|
18
|
+
|
|
19
|
+
# Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
20
|
+
as_child: Var[bool]
|
|
21
|
+
|
|
22
|
+
# Button size "1" - "4"
|
|
23
|
+
size: Var[Literal[1, 2, 3]]
|
|
24
|
+
|
|
25
|
+
# Variant of button
|
|
26
|
+
variant: Var[Literal["classic", "surface", "soft"]]
|
|
27
|
+
|
|
28
|
+
# Override theme color for button
|
|
29
|
+
color: Var[LiteralAccentColor]
|
|
30
|
+
|
|
31
|
+
# Whether to render the button with higher contrast color against background
|
|
32
|
+
high_contrast: Var[bool]
|
|
33
|
+
|
|
34
|
+
# Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
|
|
35
|
+
radius: Var[LiteralRadius]
|
|
36
|
+
|
|
37
|
+
# The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
|
38
|
+
default_value: Var[float]
|
|
39
|
+
|
|
40
|
+
# The controlled value of the slider. Must be used in conjunction with onValueChange.
|
|
41
|
+
value: Var[float]
|
|
42
|
+
|
|
43
|
+
# The minimum value of the slider.
|
|
44
|
+
min: Var[float]
|
|
45
|
+
|
|
46
|
+
# The maximum value of the slider.
|
|
47
|
+
max: Var[float]
|
|
48
|
+
|
|
49
|
+
# The step value of the slider.
|
|
50
|
+
step: Var[float]
|
|
51
|
+
|
|
52
|
+
# Whether the slider is disabled
|
|
53
|
+
disabled: Var[bool]
|
|
54
|
+
|
|
55
|
+
# The orientation of the slider.
|
|
56
|
+
orientation: Var[Literal["horizontal", "vertical"]]
|
|
57
|
+
|
|
58
|
+
def get_event_triggers(self) -> Dict[str, Any]:
|
|
59
|
+
"""Get the events triggers signatures for the component.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
The signatures of the event triggers.
|
|
63
|
+
"""
|
|
64
|
+
return {
|
|
65
|
+
**super().get_event_triggers(),
|
|
66
|
+
"on_value_change": lambda e0: [e0],
|
|
67
|
+
"on_value_commit": lambda e0: [e0],
|
|
68
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/themes/components/slider.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 Any, Dict, Literal
|
|
11
|
+
from reflex.vars import Var
|
|
12
|
+
from ..base import (
|
|
13
|
+
CommonMarginProps,
|
|
14
|
+
LiteralAccentColor,
|
|
15
|
+
LiteralRadius,
|
|
16
|
+
RadixThemesComponent,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
class Slider(CommonMarginProps, RadixThemesComponent):
|
|
20
|
+
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
21
|
+
@overload
|
|
22
|
+
@classmethod
|
|
23
|
+
def create( # type: ignore
|
|
24
|
+
cls,
|
|
25
|
+
*children,
|
|
26
|
+
as_child: Optional[Union[Var[bool], bool]] = None,
|
|
27
|
+
size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None,
|
|
28
|
+
variant: Optional[
|
|
29
|
+
Union[
|
|
30
|
+
Var[Literal["classic", "surface", "soft"]],
|
|
31
|
+
Literal["classic", "surface", "soft"],
|
|
32
|
+
]
|
|
33
|
+
] = None,
|
|
34
|
+
color: Optional[
|
|
35
|
+
Union[
|
|
36
|
+
Var[
|
|
37
|
+
Literal[
|
|
38
|
+
"tomato",
|
|
39
|
+
"red",
|
|
40
|
+
"ruby",
|
|
41
|
+
"crimson",
|
|
42
|
+
"pink",
|
|
43
|
+
"plum",
|
|
44
|
+
"purple",
|
|
45
|
+
"violet",
|
|
46
|
+
"iris",
|
|
47
|
+
"indigo",
|
|
48
|
+
"blue",
|
|
49
|
+
"cyan",
|
|
50
|
+
"teal",
|
|
51
|
+
"jade",
|
|
52
|
+
"green",
|
|
53
|
+
"grass",
|
|
54
|
+
"brown",
|
|
55
|
+
"orange",
|
|
56
|
+
"sky",
|
|
57
|
+
"mint",
|
|
58
|
+
"lime",
|
|
59
|
+
"yellow",
|
|
60
|
+
"amber",
|
|
61
|
+
"gold",
|
|
62
|
+
"bronze",
|
|
63
|
+
"gray",
|
|
64
|
+
]
|
|
65
|
+
],
|
|
66
|
+
Literal[
|
|
67
|
+
"tomato",
|
|
68
|
+
"red",
|
|
69
|
+
"ruby",
|
|
70
|
+
"crimson",
|
|
71
|
+
"pink",
|
|
72
|
+
"plum",
|
|
73
|
+
"purple",
|
|
74
|
+
"violet",
|
|
75
|
+
"iris",
|
|
76
|
+
"indigo",
|
|
77
|
+
"blue",
|
|
78
|
+
"cyan",
|
|
79
|
+
"teal",
|
|
80
|
+
"jade",
|
|
81
|
+
"green",
|
|
82
|
+
"grass",
|
|
83
|
+
"brown",
|
|
84
|
+
"orange",
|
|
85
|
+
"sky",
|
|
86
|
+
"mint",
|
|
87
|
+
"lime",
|
|
88
|
+
"yellow",
|
|
89
|
+
"amber",
|
|
90
|
+
"gold",
|
|
91
|
+
"bronze",
|
|
92
|
+
"gray",
|
|
93
|
+
],
|
|
94
|
+
]
|
|
95
|
+
] = None,
|
|
96
|
+
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
97
|
+
radius: Optional[
|
|
98
|
+
Union[
|
|
99
|
+
Var[Literal["none", "small", "medium", "large", "full"]],
|
|
100
|
+
Literal["none", "small", "medium", "large", "full"],
|
|
101
|
+
]
|
|
102
|
+
] = None,
|
|
103
|
+
default_value: Optional[Union[Var[float], float]] = None,
|
|
104
|
+
value: Optional[Union[Var[float], float]] = None,
|
|
105
|
+
min: Optional[Union[Var[float], float]] = None,
|
|
106
|
+
max: Optional[Union[Var[float], float]] = None,
|
|
107
|
+
step: Optional[Union[Var[float], float]] = None,
|
|
108
|
+
disabled: Optional[Union[Var[bool], bool]] = None,
|
|
109
|
+
orientation: Optional[
|
|
110
|
+
Union[
|
|
111
|
+
Var[Literal["horizontal", "vertical"]],
|
|
112
|
+
Literal["horizontal", "vertical"],
|
|
113
|
+
]
|
|
114
|
+
] = None,
|
|
115
|
+
m: Optional[
|
|
116
|
+
Union[
|
|
117
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
118
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
119
|
+
]
|
|
120
|
+
] = None,
|
|
121
|
+
mx: Optional[
|
|
122
|
+
Union[
|
|
123
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
124
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
125
|
+
]
|
|
126
|
+
] = None,
|
|
127
|
+
my: Optional[
|
|
128
|
+
Union[
|
|
129
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
130
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
131
|
+
]
|
|
132
|
+
] = None,
|
|
133
|
+
mt: Optional[
|
|
134
|
+
Union[
|
|
135
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
136
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
137
|
+
]
|
|
138
|
+
] = None,
|
|
139
|
+
mr: Optional[
|
|
140
|
+
Union[
|
|
141
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
142
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
143
|
+
]
|
|
144
|
+
] = None,
|
|
145
|
+
mb: Optional[
|
|
146
|
+
Union[
|
|
147
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
148
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
149
|
+
]
|
|
150
|
+
] = None,
|
|
151
|
+
ml: Optional[
|
|
152
|
+
Union[
|
|
153
|
+
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
154
|
+
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
155
|
+
]
|
|
156
|
+
] = None,
|
|
157
|
+
style: Optional[Style] = None,
|
|
158
|
+
key: Optional[Any] = None,
|
|
159
|
+
id: Optional[Any] = None,
|
|
160
|
+
class_name: Optional[Any] = None,
|
|
161
|
+
autofocus: Optional[bool] = None,
|
|
162
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
163
|
+
on_blur: Optional[
|
|
164
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
165
|
+
] = None,
|
|
166
|
+
on_click: Optional[
|
|
167
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
168
|
+
] = None,
|
|
169
|
+
on_context_menu: Optional[
|
|
170
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
171
|
+
] = None,
|
|
172
|
+
on_double_click: Optional[
|
|
173
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
174
|
+
] = None,
|
|
175
|
+
on_focus: Optional[
|
|
176
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
177
|
+
] = None,
|
|
178
|
+
on_mount: Optional[
|
|
179
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
180
|
+
] = None,
|
|
181
|
+
on_mouse_down: Optional[
|
|
182
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
183
|
+
] = None,
|
|
184
|
+
on_mouse_enter: Optional[
|
|
185
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
186
|
+
] = None,
|
|
187
|
+
on_mouse_leave: Optional[
|
|
188
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
189
|
+
] = None,
|
|
190
|
+
on_mouse_move: Optional[
|
|
191
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
192
|
+
] = None,
|
|
193
|
+
on_mouse_out: Optional[
|
|
194
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
195
|
+
] = None,
|
|
196
|
+
on_mouse_over: Optional[
|
|
197
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
198
|
+
] = None,
|
|
199
|
+
on_mouse_up: Optional[
|
|
200
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
201
|
+
] = None,
|
|
202
|
+
on_scroll: Optional[
|
|
203
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
204
|
+
] = None,
|
|
205
|
+
on_unmount: Optional[
|
|
206
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
207
|
+
] = None,
|
|
208
|
+
on_value_change: Optional[
|
|
209
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
210
|
+
] = None,
|
|
211
|
+
on_value_commit: Optional[
|
|
212
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
213
|
+
] = None,
|
|
214
|
+
**props
|
|
215
|
+
) -> "Slider":
|
|
216
|
+
"""Create a new component instance.
|
|
217
|
+
|
|
218
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
219
|
+
other UI libraries for common names, like Text and Button.
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
*children: Child components.
|
|
223
|
+
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
224
|
+
size: Button size "1" - "4"
|
|
225
|
+
variant: Variant of button
|
|
226
|
+
color: Override theme color for button
|
|
227
|
+
high_contrast: Whether to render the button with higher contrast color against background
|
|
228
|
+
radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
|
|
229
|
+
default_value: The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
|
230
|
+
value: The controlled value of the slider. Must be used in conjunction with onValueChange.
|
|
231
|
+
min: The minimum value of the slider.
|
|
232
|
+
max: The maximum value of the slider.
|
|
233
|
+
step: The step value of the slider.
|
|
234
|
+
disabled: Whether the slider is disabled
|
|
235
|
+
orientation: The orientation of the slider.
|
|
236
|
+
m: Margin: "0" - "9"
|
|
237
|
+
mx: Margin horizontal: "0" - "9"
|
|
238
|
+
my: Margin vertical: "0" - "9"
|
|
239
|
+
mt: Margin top: "0" - "9"
|
|
240
|
+
mr: Margin right: "0" - "9"
|
|
241
|
+
mb: Margin bottom: "0" - "9"
|
|
242
|
+
ml: Margin left: "0" - "9"
|
|
243
|
+
style: The style of the component.
|
|
244
|
+
key: A unique key for the component.
|
|
245
|
+
id: The id for the component.
|
|
246
|
+
class_name: The class name for the component.
|
|
247
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
248
|
+
custom_attrs: custom attribute
|
|
249
|
+
**props: Component properties.
|
|
250
|
+
|
|
251
|
+
Returns:
|
|
252
|
+
A new component instance.
|
|
253
|
+
"""
|
|
254
|
+
...
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Interactive components provided by @radix-ui/themes."""
|
|
2
|
+
from typing import Any, Dict, Literal
|
|
3
|
+
|
|
4
|
+
from reflex.constants import EventTriggers
|
|
5
|
+
from reflex.vars import Var
|
|
6
|
+
|
|
7
|
+
from ..base import (
|
|
8
|
+
CommonMarginProps,
|
|
9
|
+
LiteralAccentColor,
|
|
10
|
+
LiteralRadius,
|
|
11
|
+
LiteralVariant,
|
|
12
|
+
RadixThemesComponent,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Switch(CommonMarginProps, RadixThemesComponent):
|
|
19
|
+
"""A toggle switch alternative to the checkbox."""
|
|
20
|
+
|
|
21
|
+
tag = "Switch"
|
|
22
|
+
|
|
23
|
+
# Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
24
|
+
as_child: Var[bool]
|
|
25
|
+
|
|
26
|
+
# Whether the switch is checked by default
|
|
27
|
+
default_checked: Var[bool]
|
|
28
|
+
|
|
29
|
+
# Whether the switch is checked
|
|
30
|
+
checked: Var[bool]
|
|
31
|
+
|
|
32
|
+
# If true, prevent the user from interacting with the switch
|
|
33
|
+
disabled: Var[bool]
|
|
34
|
+
|
|
35
|
+
# If true, the user must interact with the switch to submit the form
|
|
36
|
+
required: Var[bool]
|
|
37
|
+
|
|
38
|
+
# The name of the switch (when submitting a form)
|
|
39
|
+
name: Var[str]
|
|
40
|
+
|
|
41
|
+
# The value associated with the "on" position
|
|
42
|
+
value: Var[str]
|
|
43
|
+
|
|
44
|
+
# Switch size "1" - "4"
|
|
45
|
+
size: Var[LiteralSwitchSize]
|
|
46
|
+
|
|
47
|
+
# Variant of switch: "solid" | "soft" | "outline" | "ghost"
|
|
48
|
+
variant: Var[LiteralVariant]
|
|
49
|
+
|
|
50
|
+
# Override theme color for switch
|
|
51
|
+
color: Var[LiteralAccentColor]
|
|
52
|
+
|
|
53
|
+
# Whether to render the switch with higher contrast color against background
|
|
54
|
+
high_contrast: Var[bool]
|
|
55
|
+
|
|
56
|
+
# Override theme radius for switch: "none" | "small" | "medium" | "large" | "full"
|
|
57
|
+
radius: Var[LiteralRadius]
|
|
58
|
+
|
|
59
|
+
def get_event_triggers(self) -> Dict[str, Any]:
|
|
60
|
+
"""Get the event triggers that pass the component's value to the handler.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
A dict mapping the event trigger name to the argspec passed to the handler.
|
|
64
|
+
"""
|
|
65
|
+
return {
|
|
66
|
+
**super().get_event_triggers(),
|
|
67
|
+
EventTriggers.ON_CHECKED_CHANGE: lambda checked: [checked],
|
|
68
|
+
}
|