reflex 0.4.9a1__py3-none-any.whl → 0.5.0__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/apps/blank/code/blank.py +19 -16
- reflex/.templates/apps/demo/code/demo.py +1 -1
- reflex/.templates/apps/demo/code/pages/datatable.py +4 -4
- reflex/.templates/apps/demo/code/pages/forms.py +2 -2
- reflex/.templates/jinja/web/tailwind.config.js.jinja2 +12 -0
- reflex/.templates/web/utils/helpers/debounce.js +17 -0
- reflex/.templates/web/utils/helpers/throttle.js +22 -0
- reflex/.templates/web/utils/state.js +21 -3
- reflex/__init__.py +6 -1
- reflex/__init__.pyi +4 -1
- reflex/app.py +160 -140
- reflex/app_module_for_backend.py +1 -1
- reflex/base.py +13 -15
- reflex/compiler/compiler.py +10 -1
- reflex/compiler/utils.py +3 -30
- reflex/components/__init__.py +1 -0
- reflex/components/chakra/datadisplay/list.py +1 -3
- reflex/components/chakra/datadisplay/list.pyi +3 -3
- reflex/components/chakra/disclosure/accordion.py +1 -1
- reflex/components/chakra/forms/pininput.pyi +1 -1
- reflex/components/chakra/media/icon.py +2 -2
- reflex/components/component.py +275 -32
- reflex/components/core/__init__.py +2 -2
- reflex/components/core/cond.py +1 -10
- reflex/components/core/debounce.py +5 -2
- reflex/components/core/debounce.pyi +4 -2
- reflex/components/core/foreach.py +60 -49
- reflex/components/core/html.py +6 -0
- reflex/components/core/match.py +2 -17
- reflex/components/core/upload.py +42 -1
- reflex/components/core/upload.pyi +199 -1
- reflex/components/datadisplay/code.py +7 -3
- reflex/components/datadisplay/code.pyi +3 -1
- reflex/components/el/elements/forms.py +1 -1
- reflex/components/el/elements/forms.pyi +1 -1
- reflex/components/lucide/icon.py +5 -13
- reflex/components/lucide/icon.pyi +0 -1
- reflex/components/markdown/markdown.py +5 -23
- reflex/components/markdown/markdown.pyi +1 -4
- reflex/components/radix/primitives/accordion.py +265 -410
- reflex/components/radix/primitives/accordion.pyi +390 -36
- reflex/components/radix/primitives/form.py +33 -29
- reflex/components/radix/primitives/form.pyi +7 -2
- reflex/components/radix/primitives/progress.py +17 -9
- reflex/components/radix/primitives/progress.pyi +2 -0
- reflex/components/radix/primitives/slider.py +30 -18
- reflex/components/radix/primitives/slider.pyi +4 -0
- reflex/components/radix/themes/base.py +8 -1
- reflex/components/radix/themes/base.pyi +79 -1
- reflex/components/radix/themes/color_mode.py +88 -20
- reflex/components/radix/themes/color_mode.pyi +157 -139
- reflex/components/radix/themes/components/__init__.py +17 -0
- reflex/components/radix/themes/components/badge.py +2 -1
- reflex/components/radix/themes/components/badge.pyi +3 -1
- reflex/components/radix/themes/components/button.py +3 -1
- reflex/components/radix/themes/components/button.pyi +4 -1
- reflex/components/radix/themes/components/checkbox_cards.py +48 -0
- reflex/components/radix/themes/components/checkbox_cards.pyi +264 -0
- reflex/components/radix/themes/components/checkbox_group.py +42 -0
- reflex/components/radix/themes/components/checkbox_group.pyi +253 -0
- reflex/components/radix/themes/components/data_list.py +63 -0
- reflex/components/radix/themes/components/data_list.pyi +426 -0
- reflex/components/radix/themes/components/icon_button.py +20 -17
- reflex/components/radix/themes/components/icon_button.pyi +5 -1
- reflex/components/radix/themes/components/progress.py +55 -0
- reflex/components/radix/themes/components/progress.pyi +180 -0
- reflex/components/radix/themes/components/radio.py +31 -0
- reflex/components/radix/themes/components/radio.pyi +169 -0
- reflex/components/radix/themes/components/radio_cards.py +48 -0
- reflex/components/radix/themes/components/radio_cards.pyi +264 -0
- reflex/components/radix/themes/components/radio_group.py +2 -4
- reflex/components/radix/themes/components/segmented_control.py +48 -0
- reflex/components/radix/themes/components/segmented_control.pyi +262 -0
- reflex/components/radix/themes/components/skeleton.py +32 -0
- reflex/components/radix/themes/components/skeleton.pyi +106 -0
- reflex/components/radix/themes/components/spinner.py +26 -0
- reflex/components/radix/themes/components/spinner.pyi +101 -0
- reflex/components/radix/themes/components/tabs.py +26 -1
- reflex/components/radix/themes/components/tabs.pyi +69 -9
- reflex/components/radix/themes/components/text_field.py +101 -71
- reflex/components/radix/themes/components/text_field.pyi +81 -499
- reflex/components/radix/themes/layout/base.py +2 -2
- reflex/components/radix/themes/layout/base.pyi +4 -4
- reflex/components/radix/themes/layout/center.py +8 -3
- reflex/components/radix/themes/layout/center.pyi +2 -1
- reflex/components/radix/themes/layout/container.py +30 -2
- reflex/components/radix/themes/layout/container.pyi +9 -30
- reflex/components/radix/themes/layout/list.py +10 -5
- reflex/components/radix/themes/layout/list.pyi +5 -21
- reflex/components/radix/themes/layout/spacer.py +8 -3
- reflex/components/radix/themes/layout/spacer.pyi +2 -1
- reflex/components/radix/themes/layout/stack.py +7 -1
- reflex/components/radix/themes/layout/stack.pyi +3 -3
- reflex/components/radix/themes/typography/link.py +10 -2
- reflex/components/radix/themes/typography/link.pyi +5 -4
- reflex/components/sonner/__init__.py +3 -0
- reflex/components/sonner/toast.py +267 -0
- reflex/components/sonner/toast.pyi +205 -0
- reflex/components/tags/iter_tag.py +9 -6
- reflex/config.py +30 -54
- reflex/constants/__init__.py +0 -2
- reflex/constants/base.py +0 -5
- reflex/constants/colors.py +2 -0
- reflex/constants/installer.py +6 -1
- reflex/constants/route.py +4 -0
- reflex/custom_components/custom_components.py +24 -2
- reflex/event.py +75 -30
- reflex/experimental/__init__.py +5 -0
- reflex/experimental/layout.py +24 -6
- reflex/model.py +2 -1
- reflex/page.py +7 -4
- reflex/reflex.py +8 -3
- reflex/route.py +39 -0
- reflex/state.py +128 -131
- reflex/style.py +25 -3
- reflex/testing.py +10 -6
- reflex/utils/console.py +3 -1
- reflex/utils/exec.py +20 -7
- reflex/utils/format.py +1 -1
- reflex/utils/imports.py +3 -1
- reflex/utils/prerequisites.py +141 -20
- reflex/utils/processes.py +21 -1
- reflex/utils/pyi_generator.py +100 -5
- reflex/utils/serializers.py +1 -1
- reflex/utils/telemetry.py +26 -4
- reflex/utils/types.py +62 -18
- reflex/vars.py +11 -5
- {reflex-0.4.9a1.dist-info → reflex-0.5.0.dist-info}/METADATA +16 -4
- {reflex-0.4.9a1.dist-info → reflex-0.5.0.dist-info}/RECORD +132 -110
- {reflex-0.4.9a1.dist-info → reflex-0.5.0.dist-info}/WHEEL +1 -1
- reflex/app.pyi +0 -149
- {reflex-0.4.9a1.dist-info → reflex-0.5.0.dist-info}/LICENSE +0 -0
- {reflex-0.4.9a1.dist-info → reflex-0.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -145,10 +145,8 @@ class HighLevelRadioGroup(RadixThemesComponent):
|
|
|
145
145
|
|
|
146
146
|
# convert only non-strings to json(JSON.stringify) so quotes are not rendered
|
|
147
147
|
# for string literal types.
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
or isinstance(default_value, Var)
|
|
151
|
-
and default_value._var_type is str
|
|
148
|
+
if isinstance(default_value, str) or (
|
|
149
|
+
isinstance(default_value, Var) and default_value._var_type is str
|
|
152
150
|
):
|
|
153
151
|
default_value = Var.create(default_value, _var_is_string=True) # type: ignore
|
|
154
152
|
else:
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""SegmentedControl from Radix Themes."""
|
|
2
|
+
|
|
3
|
+
from types import SimpleNamespace
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
6
|
+
from reflex.vars import Var
|
|
7
|
+
|
|
8
|
+
from ..base import LiteralAccentColor, RadixThemesComponent
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SegmentedControlRoot(RadixThemesComponent):
|
|
12
|
+
"""Root element for a SegmentedControl component."""
|
|
13
|
+
|
|
14
|
+
tag = "SegmentedControl"
|
|
15
|
+
|
|
16
|
+
# The size of the segmented control: "1" | "2" | "3"
|
|
17
|
+
size: Var[Literal["1", "2", "3"]]
|
|
18
|
+
|
|
19
|
+
# Variant of button: "classic" | "surface" | "soft"
|
|
20
|
+
variant: Var[Literal["classic", "surface", "soft"]]
|
|
21
|
+
|
|
22
|
+
# Override theme color for button
|
|
23
|
+
color_scheme: Var[LiteralAccentColor]
|
|
24
|
+
|
|
25
|
+
# The radius of the segmented control: "none" | "small" | "medium" | "large" | "full"
|
|
26
|
+
radius: Var[Literal["none", "small", "medium", "large", "full"]]
|
|
27
|
+
|
|
28
|
+
# The default value of the segmented control.
|
|
29
|
+
default_value: Var[str]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class SegmentedControlItem(RadixThemesComponent):
|
|
33
|
+
"""An item in the SegmentedControl component."""
|
|
34
|
+
|
|
35
|
+
tag = "SegmentedControl.Item"
|
|
36
|
+
|
|
37
|
+
# The value of the item.
|
|
38
|
+
value: Var[str]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class SegmentedControl(SimpleNamespace):
|
|
42
|
+
"""SegmentedControl components namespace."""
|
|
43
|
+
|
|
44
|
+
root = staticmethod(SegmentedControlRoot.create)
|
|
45
|
+
item = staticmethod(SegmentedControlItem.create)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
segmented_control = SegmentedControl()
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/themes/components/segmented_control.py"""
|
|
2
|
+
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
+
# This file was generated by `reflex/utils/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 types import SimpleNamespace
|
|
11
|
+
from typing import Literal
|
|
12
|
+
from reflex.vars import Var
|
|
13
|
+
from ..base import LiteralAccentColor, RadixThemesComponent
|
|
14
|
+
|
|
15
|
+
class SegmentedControlRoot(RadixThemesComponent):
|
|
16
|
+
@overload
|
|
17
|
+
@classmethod
|
|
18
|
+
def create( # type: ignore
|
|
19
|
+
cls,
|
|
20
|
+
*children,
|
|
21
|
+
size: Optional[
|
|
22
|
+
Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
|
|
23
|
+
] = None,
|
|
24
|
+
variant: Optional[
|
|
25
|
+
Union[
|
|
26
|
+
Var[Literal["classic", "surface", "soft"]],
|
|
27
|
+
Literal["classic", "surface", "soft"],
|
|
28
|
+
]
|
|
29
|
+
] = None,
|
|
30
|
+
color_scheme: Optional[
|
|
31
|
+
Union[
|
|
32
|
+
Var[
|
|
33
|
+
Literal[
|
|
34
|
+
"tomato",
|
|
35
|
+
"red",
|
|
36
|
+
"ruby",
|
|
37
|
+
"crimson",
|
|
38
|
+
"pink",
|
|
39
|
+
"plum",
|
|
40
|
+
"purple",
|
|
41
|
+
"violet",
|
|
42
|
+
"iris",
|
|
43
|
+
"indigo",
|
|
44
|
+
"blue",
|
|
45
|
+
"cyan",
|
|
46
|
+
"teal",
|
|
47
|
+
"jade",
|
|
48
|
+
"green",
|
|
49
|
+
"grass",
|
|
50
|
+
"brown",
|
|
51
|
+
"orange",
|
|
52
|
+
"sky",
|
|
53
|
+
"mint",
|
|
54
|
+
"lime",
|
|
55
|
+
"yellow",
|
|
56
|
+
"amber",
|
|
57
|
+
"gold",
|
|
58
|
+
"bronze",
|
|
59
|
+
"gray",
|
|
60
|
+
]
|
|
61
|
+
],
|
|
62
|
+
Literal[
|
|
63
|
+
"tomato",
|
|
64
|
+
"red",
|
|
65
|
+
"ruby",
|
|
66
|
+
"crimson",
|
|
67
|
+
"pink",
|
|
68
|
+
"plum",
|
|
69
|
+
"purple",
|
|
70
|
+
"violet",
|
|
71
|
+
"iris",
|
|
72
|
+
"indigo",
|
|
73
|
+
"blue",
|
|
74
|
+
"cyan",
|
|
75
|
+
"teal",
|
|
76
|
+
"jade",
|
|
77
|
+
"green",
|
|
78
|
+
"grass",
|
|
79
|
+
"brown",
|
|
80
|
+
"orange",
|
|
81
|
+
"sky",
|
|
82
|
+
"mint",
|
|
83
|
+
"lime",
|
|
84
|
+
"yellow",
|
|
85
|
+
"amber",
|
|
86
|
+
"gold",
|
|
87
|
+
"bronze",
|
|
88
|
+
"gray",
|
|
89
|
+
],
|
|
90
|
+
]
|
|
91
|
+
] = None,
|
|
92
|
+
radius: Optional[
|
|
93
|
+
Union[
|
|
94
|
+
Var[Literal["none", "small", "medium", "large", "full"]],
|
|
95
|
+
Literal["none", "small", "medium", "large", "full"],
|
|
96
|
+
]
|
|
97
|
+
] = None,
|
|
98
|
+
default_value: Optional[Union[Var[str], str]] = None,
|
|
99
|
+
style: Optional[Style] = None,
|
|
100
|
+
key: Optional[Any] = None,
|
|
101
|
+
id: Optional[Any] = None,
|
|
102
|
+
class_name: Optional[Any] = None,
|
|
103
|
+
autofocus: Optional[bool] = None,
|
|
104
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
105
|
+
on_blur: Optional[
|
|
106
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
107
|
+
] = None,
|
|
108
|
+
on_click: Optional[
|
|
109
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
110
|
+
] = None,
|
|
111
|
+
on_context_menu: Optional[
|
|
112
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
113
|
+
] = None,
|
|
114
|
+
on_double_click: Optional[
|
|
115
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
116
|
+
] = None,
|
|
117
|
+
on_focus: Optional[
|
|
118
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
119
|
+
] = None,
|
|
120
|
+
on_mount: Optional[
|
|
121
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
122
|
+
] = None,
|
|
123
|
+
on_mouse_down: Optional[
|
|
124
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
125
|
+
] = None,
|
|
126
|
+
on_mouse_enter: Optional[
|
|
127
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
128
|
+
] = None,
|
|
129
|
+
on_mouse_leave: Optional[
|
|
130
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
131
|
+
] = None,
|
|
132
|
+
on_mouse_move: Optional[
|
|
133
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
134
|
+
] = None,
|
|
135
|
+
on_mouse_out: Optional[
|
|
136
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
137
|
+
] = None,
|
|
138
|
+
on_mouse_over: Optional[
|
|
139
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
140
|
+
] = None,
|
|
141
|
+
on_mouse_up: Optional[
|
|
142
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
143
|
+
] = None,
|
|
144
|
+
on_scroll: Optional[
|
|
145
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
146
|
+
] = None,
|
|
147
|
+
on_unmount: Optional[
|
|
148
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
149
|
+
] = None,
|
|
150
|
+
**props
|
|
151
|
+
) -> "SegmentedControlRoot":
|
|
152
|
+
"""Create a new component instance.
|
|
153
|
+
|
|
154
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
155
|
+
other UI libraries for common names, like Text and Button.
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
*children: Child components.
|
|
159
|
+
size: The size of the segmented control: "1" | "2" | "3"
|
|
160
|
+
variant: Variant of button: "classic" | "surface" | "soft"
|
|
161
|
+
color_scheme: Override theme color for button
|
|
162
|
+
radius: The radius of the segmented control: "none" | "small" | "medium" | "large" | "full"
|
|
163
|
+
default_value: The default value of the segmented control.
|
|
164
|
+
style: The style of the component.
|
|
165
|
+
key: A unique key for the component.
|
|
166
|
+
id: The id for the component.
|
|
167
|
+
class_name: The class name for the component.
|
|
168
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
169
|
+
custom_attrs: custom attribute
|
|
170
|
+
**props: Component properties.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
A new component instance.
|
|
174
|
+
"""
|
|
175
|
+
...
|
|
176
|
+
|
|
177
|
+
class SegmentedControlItem(RadixThemesComponent):
|
|
178
|
+
@overload
|
|
179
|
+
@classmethod
|
|
180
|
+
def create( # type: ignore
|
|
181
|
+
cls,
|
|
182
|
+
*children,
|
|
183
|
+
value: Optional[Union[Var[str], str]] = None,
|
|
184
|
+
style: Optional[Style] = None,
|
|
185
|
+
key: Optional[Any] = None,
|
|
186
|
+
id: Optional[Any] = None,
|
|
187
|
+
class_name: Optional[Any] = None,
|
|
188
|
+
autofocus: Optional[bool] = None,
|
|
189
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
190
|
+
on_blur: Optional[
|
|
191
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
192
|
+
] = None,
|
|
193
|
+
on_click: Optional[
|
|
194
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
195
|
+
] = None,
|
|
196
|
+
on_context_menu: Optional[
|
|
197
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
198
|
+
] = None,
|
|
199
|
+
on_double_click: Optional[
|
|
200
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
201
|
+
] = None,
|
|
202
|
+
on_focus: Optional[
|
|
203
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
204
|
+
] = None,
|
|
205
|
+
on_mount: Optional[
|
|
206
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
207
|
+
] = None,
|
|
208
|
+
on_mouse_down: Optional[
|
|
209
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
210
|
+
] = None,
|
|
211
|
+
on_mouse_enter: Optional[
|
|
212
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
213
|
+
] = None,
|
|
214
|
+
on_mouse_leave: Optional[
|
|
215
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
216
|
+
] = None,
|
|
217
|
+
on_mouse_move: Optional[
|
|
218
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
219
|
+
] = None,
|
|
220
|
+
on_mouse_out: Optional[
|
|
221
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
222
|
+
] = None,
|
|
223
|
+
on_mouse_over: Optional[
|
|
224
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
225
|
+
] = None,
|
|
226
|
+
on_mouse_up: Optional[
|
|
227
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
228
|
+
] = None,
|
|
229
|
+
on_scroll: Optional[
|
|
230
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
231
|
+
] = None,
|
|
232
|
+
on_unmount: Optional[
|
|
233
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
234
|
+
] = None,
|
|
235
|
+
**props
|
|
236
|
+
) -> "SegmentedControlItem":
|
|
237
|
+
"""Create a new component instance.
|
|
238
|
+
|
|
239
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
240
|
+
other UI libraries for common names, like Text and Button.
|
|
241
|
+
|
|
242
|
+
Args:
|
|
243
|
+
*children: Child components.
|
|
244
|
+
value: The value of the item.
|
|
245
|
+
style: The style of the component.
|
|
246
|
+
key: A unique key for the component.
|
|
247
|
+
id: The id for the component.
|
|
248
|
+
class_name: The class name for the component.
|
|
249
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
250
|
+
custom_attrs: custom attribute
|
|
251
|
+
**props: Component properties.
|
|
252
|
+
|
|
253
|
+
Returns:
|
|
254
|
+
A new component instance.
|
|
255
|
+
"""
|
|
256
|
+
...
|
|
257
|
+
|
|
258
|
+
class SegmentedControl(SimpleNamespace):
|
|
259
|
+
root = staticmethod(SegmentedControlRoot.create)
|
|
260
|
+
item = staticmethod(SegmentedControlItem.create)
|
|
261
|
+
|
|
262
|
+
segmented_control = SegmentedControl()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Skeleton theme from Radix components."""
|
|
2
|
+
|
|
3
|
+
from reflex.vars import Var
|
|
4
|
+
|
|
5
|
+
from ..base import RadixLoadingProp, RadixThemesComponent
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Skeleton(RadixLoadingProp, RadixThemesComponent):
|
|
9
|
+
"""Skeleton component."""
|
|
10
|
+
|
|
11
|
+
tag = "Skeleton"
|
|
12
|
+
|
|
13
|
+
# The width of the skeleton
|
|
14
|
+
width: Var[str]
|
|
15
|
+
|
|
16
|
+
# The minimum width of the skeleton
|
|
17
|
+
min_width: Var[str]
|
|
18
|
+
|
|
19
|
+
# The maximum width of the skeleton
|
|
20
|
+
max_width: Var[str]
|
|
21
|
+
|
|
22
|
+
# The height of the skeleton
|
|
23
|
+
height: Var[str]
|
|
24
|
+
|
|
25
|
+
# The minimum height of the skeleton
|
|
26
|
+
min_height: Var[str]
|
|
27
|
+
|
|
28
|
+
# The maximum height of the skeleton
|
|
29
|
+
max_height: Var[str]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
skeleton = Skeleton.create
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/themes/components/skeleton.py"""
|
|
2
|
+
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
+
# This file was generated by `reflex/utils/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 reflex.vars import Var
|
|
11
|
+
from ..base import RadixLoadingProp, RadixThemesComponent
|
|
12
|
+
|
|
13
|
+
class Skeleton(RadixLoadingProp, RadixThemesComponent):
|
|
14
|
+
@overload
|
|
15
|
+
@classmethod
|
|
16
|
+
def create( # type: ignore
|
|
17
|
+
cls,
|
|
18
|
+
*children,
|
|
19
|
+
width: Optional[Union[Var[str], str]] = None,
|
|
20
|
+
min_width: Optional[Union[Var[str], str]] = None,
|
|
21
|
+
max_width: Optional[Union[Var[str], str]] = None,
|
|
22
|
+
height: Optional[Union[Var[str], str]] = None,
|
|
23
|
+
min_height: Optional[Union[Var[str], str]] = None,
|
|
24
|
+
max_height: Optional[Union[Var[str], str]] = None,
|
|
25
|
+
loading: Optional[Union[Var[bool], bool]] = None,
|
|
26
|
+
style: Optional[Style] = None,
|
|
27
|
+
key: Optional[Any] = None,
|
|
28
|
+
id: Optional[Any] = None,
|
|
29
|
+
class_name: Optional[Any] = None,
|
|
30
|
+
autofocus: Optional[bool] = None,
|
|
31
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
32
|
+
on_blur: Optional[
|
|
33
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
34
|
+
] = None,
|
|
35
|
+
on_click: Optional[
|
|
36
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
37
|
+
] = None,
|
|
38
|
+
on_context_menu: Optional[
|
|
39
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
40
|
+
] = None,
|
|
41
|
+
on_double_click: Optional[
|
|
42
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
43
|
+
] = None,
|
|
44
|
+
on_focus: Optional[
|
|
45
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
46
|
+
] = None,
|
|
47
|
+
on_mount: Optional[
|
|
48
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
49
|
+
] = None,
|
|
50
|
+
on_mouse_down: Optional[
|
|
51
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
52
|
+
] = None,
|
|
53
|
+
on_mouse_enter: Optional[
|
|
54
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
55
|
+
] = None,
|
|
56
|
+
on_mouse_leave: Optional[
|
|
57
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
58
|
+
] = None,
|
|
59
|
+
on_mouse_move: Optional[
|
|
60
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
61
|
+
] = None,
|
|
62
|
+
on_mouse_out: Optional[
|
|
63
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
64
|
+
] = None,
|
|
65
|
+
on_mouse_over: Optional[
|
|
66
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
67
|
+
] = None,
|
|
68
|
+
on_mouse_up: Optional[
|
|
69
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
70
|
+
] = None,
|
|
71
|
+
on_scroll: Optional[
|
|
72
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
73
|
+
] = None,
|
|
74
|
+
on_unmount: Optional[
|
|
75
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
76
|
+
] = None,
|
|
77
|
+
**props
|
|
78
|
+
) -> "Skeleton":
|
|
79
|
+
"""Create a new component instance.
|
|
80
|
+
|
|
81
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
82
|
+
other UI libraries for common names, like Text and Button.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
*children: Child components.
|
|
86
|
+
width: The width of the skeleton
|
|
87
|
+
min_width: The minimum width of the skeleton
|
|
88
|
+
max_width: The maximum width of the skeleton
|
|
89
|
+
height: The height of the skeleton
|
|
90
|
+
min_height: The minimum height of the skeleton
|
|
91
|
+
max_height: The maximum height of the skeleton
|
|
92
|
+
loading: If set, show an rx.spinner instead of the component children.
|
|
93
|
+
style: The style of the component.
|
|
94
|
+
key: A unique key for the component.
|
|
95
|
+
id: The id for the component.
|
|
96
|
+
class_name: The class name for the component.
|
|
97
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
98
|
+
custom_attrs: custom attribute
|
|
99
|
+
**props: Component properties.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
A new component instance.
|
|
103
|
+
"""
|
|
104
|
+
...
|
|
105
|
+
|
|
106
|
+
skeleton = Skeleton.create
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Radix Spinner Component."""
|
|
2
|
+
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
from reflex.vars import Var
|
|
6
|
+
|
|
7
|
+
from ..base import (
|
|
8
|
+
RadixLoadingProp,
|
|
9
|
+
RadixThemesComponent,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
LiteralSpinnerSize = Literal["1", "2", "3"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Spinner(RadixLoadingProp, RadixThemesComponent):
|
|
16
|
+
"""A spinner component."""
|
|
17
|
+
|
|
18
|
+
tag = "Spinner"
|
|
19
|
+
|
|
20
|
+
is_default = False
|
|
21
|
+
|
|
22
|
+
# The size of the spinner.
|
|
23
|
+
size: Var[LiteralSpinnerSize]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
spinner = Spinner.create
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/themes/components/spinner.py"""
|
|
2
|
+
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
+
# This file was generated by `reflex/utils/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 RadixLoadingProp, RadixThemesComponent
|
|
13
|
+
|
|
14
|
+
LiteralSpinnerSize = Literal["1", "2", "3"]
|
|
15
|
+
|
|
16
|
+
class Spinner(RadixLoadingProp, RadixThemesComponent):
|
|
17
|
+
@overload
|
|
18
|
+
@classmethod
|
|
19
|
+
def create( # type: ignore
|
|
20
|
+
cls,
|
|
21
|
+
*children,
|
|
22
|
+
size: Optional[
|
|
23
|
+
Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
|
|
24
|
+
] = None,
|
|
25
|
+
loading: Optional[Union[Var[bool], bool]] = None,
|
|
26
|
+
style: Optional[Style] = None,
|
|
27
|
+
key: Optional[Any] = None,
|
|
28
|
+
id: Optional[Any] = None,
|
|
29
|
+
class_name: Optional[Any] = None,
|
|
30
|
+
autofocus: Optional[bool] = None,
|
|
31
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
32
|
+
on_blur: Optional[
|
|
33
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
34
|
+
] = None,
|
|
35
|
+
on_click: Optional[
|
|
36
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
37
|
+
] = None,
|
|
38
|
+
on_context_menu: Optional[
|
|
39
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
40
|
+
] = None,
|
|
41
|
+
on_double_click: Optional[
|
|
42
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
43
|
+
] = None,
|
|
44
|
+
on_focus: Optional[
|
|
45
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
46
|
+
] = None,
|
|
47
|
+
on_mount: Optional[
|
|
48
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
49
|
+
] = None,
|
|
50
|
+
on_mouse_down: Optional[
|
|
51
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
52
|
+
] = None,
|
|
53
|
+
on_mouse_enter: Optional[
|
|
54
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
55
|
+
] = None,
|
|
56
|
+
on_mouse_leave: Optional[
|
|
57
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
58
|
+
] = None,
|
|
59
|
+
on_mouse_move: Optional[
|
|
60
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
61
|
+
] = None,
|
|
62
|
+
on_mouse_out: Optional[
|
|
63
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
64
|
+
] = None,
|
|
65
|
+
on_mouse_over: Optional[
|
|
66
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
67
|
+
] = None,
|
|
68
|
+
on_mouse_up: Optional[
|
|
69
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
70
|
+
] = None,
|
|
71
|
+
on_scroll: Optional[
|
|
72
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
73
|
+
] = None,
|
|
74
|
+
on_unmount: Optional[
|
|
75
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
76
|
+
] = None,
|
|
77
|
+
**props
|
|
78
|
+
) -> "Spinner":
|
|
79
|
+
"""Create a new component instance.
|
|
80
|
+
|
|
81
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
82
|
+
other UI libraries for common names, like Text and Button.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
*children: Child components.
|
|
86
|
+
size: The size of the spinner.
|
|
87
|
+
loading: If set, show an rx.spinner instead of the component children.
|
|
88
|
+
style: The style of the component.
|
|
89
|
+
key: A unique key for the component.
|
|
90
|
+
id: The id for the component.
|
|
91
|
+
class_name: The class name for the component.
|
|
92
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
93
|
+
custom_attrs: custom attribute
|
|
94
|
+
**props: Component properties.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
A new component instance.
|
|
98
|
+
"""
|
|
99
|
+
...
|
|
100
|
+
|
|
101
|
+
spinner = Spinner.create
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"""Interactive components provided by @radix-ui/themes."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
2
4
|
from typing import Any, Dict, List, Literal
|
|
3
5
|
|
|
4
|
-
from reflex.components.component import ComponentNamespace
|
|
6
|
+
from reflex.components.component import Component, ComponentNamespace
|
|
5
7
|
from reflex.constants import EventTriggers
|
|
6
8
|
from reflex.vars import Var
|
|
7
9
|
|
|
8
10
|
from ..base import (
|
|
11
|
+
LiteralAccentColor,
|
|
9
12
|
RadixThemesComponent,
|
|
10
13
|
)
|
|
11
14
|
|
|
@@ -59,8 +62,30 @@ class TabsTrigger(RadixThemesComponent):
|
|
|
59
62
|
# Whether the tab is disabled
|
|
60
63
|
disabled: Var[bool]
|
|
61
64
|
|
|
65
|
+
# The color of the line under the tab when active.
|
|
66
|
+
color_scheme: Var[LiteralAccentColor]
|
|
67
|
+
|
|
62
68
|
_valid_parents: List[str] = ["TabsList"]
|
|
63
69
|
|
|
70
|
+
@classmethod
|
|
71
|
+
def create(self, *children, **props) -> Component:
|
|
72
|
+
"""Create a TabsTrigger component.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
*children: The children of the component.
|
|
76
|
+
**props: The properties of the component.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
The TabsTrigger Component.
|
|
80
|
+
"""
|
|
81
|
+
if "color_scheme" in props:
|
|
82
|
+
custom_attrs = props.setdefault("custom_attrs", {})
|
|
83
|
+
custom_attrs["data-accent-color"] = props["color_scheme"]
|
|
84
|
+
return super().create(*children, **props)
|
|
85
|
+
|
|
86
|
+
def _exclude_props(self) -> list[str]:
|
|
87
|
+
return ["color_scheme"]
|
|
88
|
+
|
|
64
89
|
|
|
65
90
|
class TabsContent(RadixThemesComponent):
|
|
66
91
|
"""Contains the content associated with each trigger."""
|