reflex 0.4.9a2__py3-none-any.whl → 0.5.0a1__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.

Files changed (131) hide show
  1. reflex/.templates/apps/blank/code/blank.py +19 -16
  2. reflex/.templates/apps/demo/code/pages/datatable.py +4 -4
  3. reflex/.templates/apps/demo/code/pages/forms.py +2 -2
  4. reflex/.templates/web/utils/helpers/debounce.js +17 -0
  5. reflex/.templates/web/utils/helpers/throttle.js +22 -0
  6. reflex/.templates/web/utils/state.js +21 -3
  7. reflex/__init__.py +6 -1
  8. reflex/__init__.pyi +4 -1
  9. reflex/app.py +157 -140
  10. reflex/app_module_for_backend.py +1 -1
  11. reflex/base.py +13 -15
  12. reflex/compiler/compiler.py +10 -1
  13. reflex/compiler/utils.py +3 -30
  14. reflex/components/__init__.py +1 -0
  15. reflex/components/chakra/datadisplay/list.py +1 -3
  16. reflex/components/chakra/datadisplay/list.pyi +3 -3
  17. reflex/components/chakra/disclosure/accordion.py +1 -1
  18. reflex/components/chakra/forms/pininput.pyi +1 -1
  19. reflex/components/chakra/media/icon.py +2 -2
  20. reflex/components/component.py +279 -32
  21. reflex/components/core/__init__.py +2 -2
  22. reflex/components/core/cond.py +1 -10
  23. reflex/components/core/debounce.py +5 -2
  24. reflex/components/core/debounce.pyi +4 -2
  25. reflex/components/core/foreach.py +1 -16
  26. reflex/components/core/html.py +6 -0
  27. reflex/components/core/match.py +2 -17
  28. reflex/components/core/upload.py +42 -1
  29. reflex/components/core/upload.pyi +199 -1
  30. reflex/components/datadisplay/code.py +7 -3
  31. reflex/components/datadisplay/code.pyi +3 -1
  32. reflex/components/el/elements/forms.py +1 -1
  33. reflex/components/el/elements/forms.pyi +1 -1
  34. reflex/components/lucide/icon.py +5 -13
  35. reflex/components/lucide/icon.pyi +0 -1
  36. reflex/components/markdown/markdown.py +5 -23
  37. reflex/components/markdown/markdown.pyi +1 -4
  38. reflex/components/radix/primitives/accordion.py +227 -406
  39. reflex/components/radix/primitives/accordion.pyi +369 -28
  40. reflex/components/radix/primitives/form.py +33 -29
  41. reflex/components/radix/primitives/form.pyi +7 -2
  42. reflex/components/radix/primitives/progress.py +17 -9
  43. reflex/components/radix/primitives/progress.pyi +2 -0
  44. reflex/components/radix/primitives/slider.py +30 -18
  45. reflex/components/radix/primitives/slider.pyi +4 -0
  46. reflex/components/radix/themes/base.py +8 -1
  47. reflex/components/radix/themes/base.pyi +79 -1
  48. reflex/components/radix/themes/color_mode.py +74 -30
  49. reflex/components/radix/themes/color_mode.pyi +26 -185
  50. reflex/components/radix/themes/components/__init__.py +17 -0
  51. reflex/components/radix/themes/components/badge.py +2 -1
  52. reflex/components/radix/themes/components/badge.pyi +3 -1
  53. reflex/components/radix/themes/components/button.py +3 -1
  54. reflex/components/radix/themes/components/button.pyi +4 -1
  55. reflex/components/radix/themes/components/checkbox_cards.py +48 -0
  56. reflex/components/radix/themes/components/checkbox_cards.pyi +264 -0
  57. reflex/components/radix/themes/components/checkbox_group.py +42 -0
  58. reflex/components/radix/themes/components/checkbox_group.pyi +253 -0
  59. reflex/components/radix/themes/components/data_list.py +63 -0
  60. reflex/components/radix/themes/components/data_list.pyi +426 -0
  61. reflex/components/radix/themes/components/icon_button.py +20 -17
  62. reflex/components/radix/themes/components/icon_button.pyi +5 -1
  63. reflex/components/radix/themes/components/progress.py +55 -0
  64. reflex/components/radix/themes/components/progress.pyi +180 -0
  65. reflex/components/radix/themes/components/radio.py +31 -0
  66. reflex/components/radix/themes/components/radio.pyi +169 -0
  67. reflex/components/radix/themes/components/radio_cards.py +48 -0
  68. reflex/components/radix/themes/components/radio_cards.pyi +264 -0
  69. reflex/components/radix/themes/components/radio_group.py +2 -4
  70. reflex/components/radix/themes/components/segmented_control.py +48 -0
  71. reflex/components/radix/themes/components/segmented_control.pyi +262 -0
  72. reflex/components/radix/themes/components/skeleton.py +32 -0
  73. reflex/components/radix/themes/components/skeleton.pyi +106 -0
  74. reflex/components/radix/themes/components/spinner.py +26 -0
  75. reflex/components/radix/themes/components/spinner.pyi +101 -0
  76. reflex/components/radix/themes/components/tabs.py +26 -1
  77. reflex/components/radix/themes/components/tabs.pyi +69 -9
  78. reflex/components/radix/themes/components/text_field.py +101 -71
  79. reflex/components/radix/themes/components/text_field.pyi +81 -499
  80. reflex/components/radix/themes/layout/base.py +2 -2
  81. reflex/components/radix/themes/layout/base.pyi +4 -4
  82. reflex/components/radix/themes/layout/center.py +8 -3
  83. reflex/components/radix/themes/layout/center.pyi +2 -1
  84. reflex/components/radix/themes/layout/container.py +30 -2
  85. reflex/components/radix/themes/layout/container.pyi +9 -30
  86. reflex/components/radix/themes/layout/list.py +10 -5
  87. reflex/components/radix/themes/layout/list.pyi +5 -21
  88. reflex/components/radix/themes/layout/spacer.py +8 -3
  89. reflex/components/radix/themes/layout/spacer.pyi +2 -1
  90. reflex/components/radix/themes/layout/stack.py +7 -1
  91. reflex/components/radix/themes/layout/stack.pyi +3 -3
  92. reflex/components/radix/themes/typography/link.py +10 -2
  93. reflex/components/radix/themes/typography/link.pyi +5 -4
  94. reflex/components/sonner/__init__.py +3 -0
  95. reflex/components/sonner/toast.py +267 -0
  96. reflex/components/sonner/toast.pyi +205 -0
  97. reflex/components/tags/iter_tag.py +9 -6
  98. reflex/config.py +30 -54
  99. reflex/constants/__init__.py +0 -2
  100. reflex/constants/base.py +0 -5
  101. reflex/constants/colors.py +2 -0
  102. reflex/constants/installer.py +5 -1
  103. reflex/constants/route.py +4 -0
  104. reflex/custom_components/custom_components.py +22 -1
  105. reflex/event.py +75 -30
  106. reflex/experimental/__init__.py +5 -0
  107. reflex/experimental/layout.py +24 -6
  108. reflex/model.py +2 -1
  109. reflex/page.py +7 -4
  110. reflex/reflex.py +8 -3
  111. reflex/route.py +39 -0
  112. reflex/state.py +128 -131
  113. reflex/style.py +20 -1
  114. reflex/testing.py +10 -6
  115. reflex/utils/console.py +3 -1
  116. reflex/utils/exec.py +20 -7
  117. reflex/utils/format.py +1 -1
  118. reflex/utils/imports.py +3 -1
  119. reflex/utils/prerequisites.py +141 -20
  120. reflex/utils/processes.py +21 -1
  121. reflex/utils/pyi_generator.py +95 -5
  122. reflex/utils/serializers.py +1 -1
  123. reflex/utils/telemetry.py +26 -4
  124. reflex/utils/types.py +62 -18
  125. reflex/vars.py +11 -5
  126. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/METADATA +16 -4
  127. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/RECORD +130 -108
  128. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/WHEEL +1 -1
  129. reflex/app.pyi +0 -149
  130. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/LICENSE +0 -0
  131. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.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
- type(default_value) is str
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."""