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.

Files changed (136) hide show
  1. reflex/.templates/jinja/web/pages/base_page.js.jinja2 +2 -0
  2. reflex/__init__.py +29 -6
  3. reflex/__init__.pyi +2 -0
  4. reflex/app.py +3 -0
  5. reflex/components/__init__.py +2 -0
  6. reflex/components/chakra/__init__.py +23 -0
  7. reflex/components/{media → chakra/media}/image.py +1 -28
  8. reflex/components/chakra/media/image.pyi +120 -0
  9. reflex/components/component.py +27 -2
  10. reflex/components/datadisplay/datatable.py +1 -37
  11. reflex/components/datadisplay/datatable.pyi +1 -11
  12. reflex/components/el/elements/forms.py +43 -1
  13. reflex/components/el/elements/forms.pyi +26 -1
  14. reflex/components/graphing/plotly.py +0 -22
  15. reflex/components/graphing/plotly.pyi +0 -12
  16. reflex/components/media/__init__.py +0 -1
  17. reflex/components/media/image.pyi +0 -9
  18. reflex/components/next/__init__.py +8 -0
  19. reflex/components/next/base.py +8 -0
  20. reflex/components/next/base.pyi +91 -0
  21. reflex/components/next/image.py +114 -0
  22. reflex/components/next/image.pyi +122 -0
  23. reflex/components/next/video.py +33 -0
  24. reflex/components/next/video.pyi +92 -0
  25. reflex/components/radix/primitives/__init__.py +3 -0
  26. reflex/components/radix/primitives/accordion.py +279 -0
  27. reflex/components/radix/primitives/accordion.pyi +619 -0
  28. reflex/components/radix/themes/__init__.py +4 -73
  29. reflex/components/radix/themes/base.py +7 -7
  30. reflex/components/radix/themes/base.pyi +21 -21
  31. reflex/components/radix/themes/components/__init__.py +193 -0
  32. reflex/components/radix/themes/components/alertdialog.py +72 -0
  33. reflex/components/radix/themes/components/alertdialog.pyi +733 -0
  34. reflex/components/radix/themes/components/aspectratio.py +20 -0
  35. reflex/components/radix/themes/components/aspectratio.pyi +144 -0
  36. reflex/components/radix/themes/components/avatar.py +38 -0
  37. reflex/components/radix/themes/components/avatar.pyi +233 -0
  38. reflex/components/radix/themes/components/badge.py +38 -0
  39. reflex/components/radix/themes/components/badge.pyi +291 -0
  40. reflex/components/radix/themes/components/button.py +39 -0
  41. reflex/components/radix/themes/components/button.pyi +330 -0
  42. reflex/components/radix/themes/components/callout.py +49 -0
  43. reflex/components/radix/themes/components/callout.pyi +668 -0
  44. reflex/components/radix/themes/components/card.py +25 -0
  45. reflex/components/radix/themes/components/card.pyi +214 -0
  46. reflex/components/radix/themes/components/checkbox.py +67 -0
  47. reflex/components/radix/themes/components/checkbox.pyi +249 -0
  48. reflex/components/radix/themes/components/contextmenu.py +134 -0
  49. reflex/components/radix/themes/{typography.pyi → components/contextmenu.pyi} +182 -602
  50. reflex/components/radix/themes/components/dialog.py +75 -0
  51. reflex/components/radix/themes/components/dialog.pyi +739 -0
  52. reflex/components/radix/themes/components/dropdownmenu.py +101 -0
  53. reflex/components/radix/themes/components/dropdownmenu.pyi +1065 -0
  54. reflex/components/radix/themes/components/hovercard.py +63 -0
  55. reflex/components/radix/themes/components/hovercard.pyi +487 -0
  56. reflex/components/radix/themes/components/iconbutton.py +39 -0
  57. reflex/components/radix/themes/components/iconbutton.pyi +332 -0
  58. reflex/components/radix/themes/components/icons.py +400 -0
  59. reflex/components/radix/themes/components/icons.pyi +185 -0
  60. reflex/components/radix/themes/components/inset.py +44 -0
  61. reflex/components/radix/themes/components/inset.pyi +230 -0
  62. reflex/components/radix/themes/components/popover.py +85 -0
  63. reflex/components/radix/themes/components/popover.pyi +634 -0
  64. reflex/components/radix/themes/components/radiogroup.py +72 -0
  65. reflex/components/radix/themes/components/radiogroup.pyi +369 -0
  66. reflex/components/radix/themes/components/scrollarea.py +31 -0
  67. reflex/components/radix/themes/components/scrollarea.pyi +165 -0
  68. reflex/components/radix/themes/components/select.py +137 -0
  69. reflex/components/radix/themes/{layout.pyi → components/select.pyi} +422 -418
  70. reflex/components/radix/themes/components/separator.py +30 -0
  71. reflex/components/radix/themes/components/separator.pyi +218 -0
  72. reflex/components/radix/themes/components/slider.py +68 -0
  73. reflex/components/radix/themes/components/slider.pyi +254 -0
  74. reflex/components/radix/themes/components/switch.py +68 -0
  75. reflex/components/radix/themes/components/switch.pyi +250 -0
  76. reflex/components/radix/themes/components/table.py +79 -0
  77. reflex/components/radix/themes/components/table.pyi +1485 -0
  78. reflex/components/radix/themes/components/tabs.py +65 -0
  79. reflex/components/radix/themes/components/tabs.pyi +549 -0
  80. reflex/components/radix/themes/components/textarea.py +68 -0
  81. reflex/components/radix/themes/components/textarea.pyi +333 -0
  82. reflex/components/radix/themes/{components.py → components/textfield.py} +3 -87
  83. reflex/components/radix/themes/{components.pyi → components/textfield.pyi} +202 -591
  84. reflex/components/radix/themes/layout/__init__.py +13 -0
  85. reflex/components/radix/themes/layout/base.py +48 -0
  86. reflex/components/radix/themes/layout/base.pyi +195 -0
  87. reflex/components/radix/themes/layout/box.py +12 -0
  88. reflex/components/radix/themes/layout/box.pyi +252 -0
  89. reflex/components/radix/themes/layout/container.py +23 -0
  90. reflex/components/radix/themes/layout/container.pyi +260 -0
  91. reflex/components/radix/themes/layout/flex.py +45 -0
  92. reflex/components/radix/themes/layout/flex.pyi +303 -0
  93. reflex/components/radix/themes/layout/grid.py +53 -0
  94. reflex/components/radix/themes/layout/grid.pyi +203 -0
  95. reflex/components/radix/themes/layout/section.py +20 -0
  96. reflex/components/radix/themes/layout/section.pyi +260 -0
  97. reflex/components/radix/themes/typography/__init__.py +21 -0
  98. reflex/components/radix/themes/typography/base.py +12 -0
  99. reflex/components/radix/themes/typography/blockquote.py +36 -0
  100. reflex/components/radix/themes/typography/blockquote.pyi +282 -0
  101. reflex/components/radix/themes/typography/code.py +40 -0
  102. reflex/components/radix/themes/typography/code.pyi +292 -0
  103. reflex/components/radix/themes/typography/em.py +18 -0
  104. reflex/components/radix/themes/typography/em.pyi +199 -0
  105. reflex/components/radix/themes/typography/heading.py +50 -0
  106. reflex/components/radix/themes/typography/heading.pyi +298 -0
  107. reflex/components/radix/themes/typography/kbd.py +25 -0
  108. reflex/components/radix/themes/typography/kbd.pyi +208 -0
  109. reflex/components/radix/themes/typography/link.py +49 -0
  110. reflex/components/radix/themes/typography/link.pyi +238 -0
  111. reflex/components/radix/themes/typography/quote.py +18 -0
  112. reflex/components/radix/themes/typography/quote.pyi +200 -0
  113. reflex/components/radix/themes/typography/strong.py +18 -0
  114. reflex/components/radix/themes/typography/strong.pyi +199 -0
  115. reflex/components/radix/themes/typography/text.py +50 -0
  116. reflex/components/radix/themes/typography/text.pyi +298 -0
  117. reflex/constants/__init__.py +1 -0
  118. reflex/constants/base.py +7 -0
  119. reflex/constants/config.py +1 -1
  120. reflex/model.py +2 -1
  121. reflex/reflex.py +5 -0
  122. reflex/state.py +11 -0
  123. reflex/style.py +120 -10
  124. reflex/testing.py +4 -4
  125. reflex/utils/format.py +9 -5
  126. reflex/utils/prerequisites.py +49 -6
  127. reflex/utils/processes.py +8 -1
  128. reflex/utils/serializers.py +83 -0
  129. reflex/utils/types.py +22 -1
  130. reflex/vars.py +24 -1
  131. {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/METADATA +3 -2
  132. {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/RECORD +135 -42
  133. reflex/components/radix/themes/layout.py +0 -155
  134. {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/LICENSE +0 -0
  135. {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/WHEEL +0 -0
  136. {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,65 @@
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
+ RadixThemesComponent,
9
+ )
10
+
11
+
12
+ class TabsRoot(CommonMarginProps, RadixThemesComponent):
13
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
14
+
15
+ tag = "Tabs.Root"
16
+
17
+ # The size of the table: "1" | "2" | "3"
18
+ size: Var[Literal[1, 2, 3]]
19
+
20
+ # The variant of the table
21
+ variant: Var[Literal["surface", "ghost"]]
22
+
23
+ # The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs.
24
+ default_value: Var[str]
25
+
26
+ # The controlled value of the tab that should be active. Use when you need to control the state of the tabs.
27
+ value: Var[str]
28
+
29
+ # The orientation of the tabs.
30
+ orientation: Var[Literal["horizontal", "vertical"]]
31
+
32
+ def get_event_triggers(self) -> Dict[str, Any]:
33
+ """Get the events triggers signatures for the component.
34
+
35
+ Returns:
36
+ The signatures of the event triggers.
37
+ """
38
+ return {
39
+ **super().get_event_triggers(),
40
+ "on_value_change": lambda e0: [e0],
41
+ }
42
+
43
+
44
+ class TabsList(CommonMarginProps, RadixThemesComponent):
45
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
46
+
47
+ tag = "Tabs.List"
48
+
49
+
50
+ class TabsTrigger(CommonMarginProps, RadixThemesComponent):
51
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
52
+
53
+ tag = "Tabs.Trigger"
54
+
55
+ # The value of the tab. Must be unique for each tab.
56
+ value: Var[str]
57
+
58
+ # Whether the tab is disabled
59
+ disabled: Var[bool]
60
+
61
+
62
+ class TabsContent(CommonMarginProps, RadixThemesComponent):
63
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
64
+
65
+ tag = "Tabs.Content"
@@ -0,0 +1,549 @@
1
+ """Stub file for reflex/components/radix/themes/components/tabs.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 CommonMarginProps, RadixThemesComponent
13
+
14
+ class TabsRoot(CommonMarginProps, RadixThemesComponent):
15
+ def get_event_triggers(self) -> Dict[str, Any]: ...
16
+ @overload
17
+ @classmethod
18
+ def create( # type: ignore
19
+ cls,
20
+ *children,
21
+ size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None,
22
+ variant: Optional[
23
+ Union[Var[Literal["surface", "ghost"]], Literal["surface", "ghost"]]
24
+ ] = None,
25
+ default_value: Optional[Union[Var[str], str]] = None,
26
+ value: Optional[Union[Var[str], str]] = None,
27
+ orientation: Optional[
28
+ Union[
29
+ Var[Literal["horizontal", "vertical"]],
30
+ Literal["horizontal", "vertical"],
31
+ ]
32
+ ] = None,
33
+ m: Optional[
34
+ Union[
35
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
36
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
37
+ ]
38
+ ] = None,
39
+ mx: Optional[
40
+ Union[
41
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
42
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
43
+ ]
44
+ ] = None,
45
+ my: Optional[
46
+ Union[
47
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
48
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
49
+ ]
50
+ ] = None,
51
+ mt: Optional[
52
+ Union[
53
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
54
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
55
+ ]
56
+ ] = None,
57
+ mr: Optional[
58
+ Union[
59
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
60
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
61
+ ]
62
+ ] = None,
63
+ mb: Optional[
64
+ Union[
65
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
66
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
67
+ ]
68
+ ] = None,
69
+ ml: Optional[
70
+ Union[
71
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
72
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
73
+ ]
74
+ ] = None,
75
+ style: Optional[Style] = None,
76
+ key: Optional[Any] = None,
77
+ id: Optional[Any] = None,
78
+ class_name: Optional[Any] = None,
79
+ autofocus: Optional[bool] = None,
80
+ custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
81
+ on_blur: Optional[
82
+ Union[EventHandler, EventSpec, list, function, BaseVar]
83
+ ] = None,
84
+ on_click: Optional[
85
+ Union[EventHandler, EventSpec, list, function, BaseVar]
86
+ ] = None,
87
+ on_context_menu: Optional[
88
+ Union[EventHandler, EventSpec, list, function, BaseVar]
89
+ ] = None,
90
+ on_double_click: Optional[
91
+ Union[EventHandler, EventSpec, list, function, BaseVar]
92
+ ] = None,
93
+ on_focus: Optional[
94
+ Union[EventHandler, EventSpec, list, function, BaseVar]
95
+ ] = None,
96
+ on_mount: Optional[
97
+ Union[EventHandler, EventSpec, list, function, BaseVar]
98
+ ] = None,
99
+ on_mouse_down: Optional[
100
+ Union[EventHandler, EventSpec, list, function, BaseVar]
101
+ ] = None,
102
+ on_mouse_enter: Optional[
103
+ Union[EventHandler, EventSpec, list, function, BaseVar]
104
+ ] = None,
105
+ on_mouse_leave: Optional[
106
+ Union[EventHandler, EventSpec, list, function, BaseVar]
107
+ ] = None,
108
+ on_mouse_move: Optional[
109
+ Union[EventHandler, EventSpec, list, function, BaseVar]
110
+ ] = None,
111
+ on_mouse_out: Optional[
112
+ Union[EventHandler, EventSpec, list, function, BaseVar]
113
+ ] = None,
114
+ on_mouse_over: Optional[
115
+ Union[EventHandler, EventSpec, list, function, BaseVar]
116
+ ] = None,
117
+ on_mouse_up: Optional[
118
+ Union[EventHandler, EventSpec, list, function, BaseVar]
119
+ ] = None,
120
+ on_scroll: Optional[
121
+ Union[EventHandler, EventSpec, list, function, BaseVar]
122
+ ] = None,
123
+ on_unmount: Optional[
124
+ Union[EventHandler, EventSpec, list, function, BaseVar]
125
+ ] = None,
126
+ on_value_change: Optional[
127
+ Union[EventHandler, EventSpec, list, function, BaseVar]
128
+ ] = None,
129
+ **props
130
+ ) -> "TabsRoot":
131
+ """Create a new component instance.
132
+
133
+ Will prepend "RadixThemes" to the component tag to avoid conflicts with
134
+ other UI libraries for common names, like Text and Button.
135
+
136
+ Args:
137
+ *children: Child components.
138
+ size: The size of the table: "1" | "2" | "3"
139
+ variant: The variant of the table
140
+ default_value: The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs.
141
+ value: The controlled value of the tab that should be active. Use when you need to control the state of the tabs.
142
+ orientation: The orientation of the tabs.
143
+ m: Margin: "0" - "9"
144
+ mx: Margin horizontal: "0" - "9"
145
+ my: Margin vertical: "0" - "9"
146
+ mt: Margin top: "0" - "9"
147
+ mr: Margin right: "0" - "9"
148
+ mb: Margin bottom: "0" - "9"
149
+ ml: Margin left: "0" - "9"
150
+ style: The style of the component.
151
+ key: A unique key for the component.
152
+ id: The id for the component.
153
+ class_name: The class name for the component.
154
+ autofocus: Whether the component should take the focus once the page is loaded
155
+ custom_attrs: custom attribute
156
+ **props: Component properties.
157
+
158
+ Returns:
159
+ A new component instance.
160
+ """
161
+ ...
162
+
163
+ class TabsList(CommonMarginProps, RadixThemesComponent):
164
+ @overload
165
+ @classmethod
166
+ def create( # type: ignore
167
+ cls,
168
+ *children,
169
+ m: Optional[
170
+ Union[
171
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
172
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
173
+ ]
174
+ ] = None,
175
+ mx: Optional[
176
+ Union[
177
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
178
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
179
+ ]
180
+ ] = None,
181
+ my: Optional[
182
+ Union[
183
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
184
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
185
+ ]
186
+ ] = None,
187
+ mt: Optional[
188
+ Union[
189
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
190
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
191
+ ]
192
+ ] = None,
193
+ mr: Optional[
194
+ Union[
195
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
196
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
197
+ ]
198
+ ] = None,
199
+ mb: Optional[
200
+ Union[
201
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
202
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
203
+ ]
204
+ ] = None,
205
+ ml: Optional[
206
+ Union[
207
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
208
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
209
+ ]
210
+ ] = None,
211
+ style: Optional[Style] = None,
212
+ key: Optional[Any] = None,
213
+ id: Optional[Any] = None,
214
+ class_name: Optional[Any] = None,
215
+ autofocus: Optional[bool] = None,
216
+ custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
217
+ on_blur: Optional[
218
+ Union[EventHandler, EventSpec, list, function, BaseVar]
219
+ ] = None,
220
+ on_click: Optional[
221
+ Union[EventHandler, EventSpec, list, function, BaseVar]
222
+ ] = None,
223
+ on_context_menu: Optional[
224
+ Union[EventHandler, EventSpec, list, function, BaseVar]
225
+ ] = None,
226
+ on_double_click: Optional[
227
+ Union[EventHandler, EventSpec, list, function, BaseVar]
228
+ ] = None,
229
+ on_focus: Optional[
230
+ Union[EventHandler, EventSpec, list, function, BaseVar]
231
+ ] = None,
232
+ on_mount: Optional[
233
+ Union[EventHandler, EventSpec, list, function, BaseVar]
234
+ ] = None,
235
+ on_mouse_down: Optional[
236
+ Union[EventHandler, EventSpec, list, function, BaseVar]
237
+ ] = None,
238
+ on_mouse_enter: Optional[
239
+ Union[EventHandler, EventSpec, list, function, BaseVar]
240
+ ] = None,
241
+ on_mouse_leave: Optional[
242
+ Union[EventHandler, EventSpec, list, function, BaseVar]
243
+ ] = None,
244
+ on_mouse_move: Optional[
245
+ Union[EventHandler, EventSpec, list, function, BaseVar]
246
+ ] = None,
247
+ on_mouse_out: Optional[
248
+ Union[EventHandler, EventSpec, list, function, BaseVar]
249
+ ] = None,
250
+ on_mouse_over: Optional[
251
+ Union[EventHandler, EventSpec, list, function, BaseVar]
252
+ ] = None,
253
+ on_mouse_up: Optional[
254
+ Union[EventHandler, EventSpec, list, function, BaseVar]
255
+ ] = None,
256
+ on_scroll: Optional[
257
+ Union[EventHandler, EventSpec, list, function, BaseVar]
258
+ ] = None,
259
+ on_unmount: Optional[
260
+ Union[EventHandler, EventSpec, list, function, BaseVar]
261
+ ] = None,
262
+ **props
263
+ ) -> "TabsList":
264
+ """Create a new component instance.
265
+
266
+ Will prepend "RadixThemes" to the component tag to avoid conflicts with
267
+ other UI libraries for common names, like Text and Button.
268
+
269
+ Args:
270
+ *children: Child components.
271
+ m: Margin: "0" - "9"
272
+ mx: Margin horizontal: "0" - "9"
273
+ my: Margin vertical: "0" - "9"
274
+ mt: Margin top: "0" - "9"
275
+ mr: Margin right: "0" - "9"
276
+ mb: Margin bottom: "0" - "9"
277
+ ml: Margin left: "0" - "9"
278
+ style: The style of the component.
279
+ key: A unique key for the component.
280
+ id: The id for the component.
281
+ class_name: The class name for the component.
282
+ autofocus: Whether the component should take the focus once the page is loaded
283
+ custom_attrs: custom attribute
284
+ **props: Component properties.
285
+
286
+ Returns:
287
+ A new component instance.
288
+ """
289
+ ...
290
+
291
+ class TabsTrigger(CommonMarginProps, RadixThemesComponent):
292
+ @overload
293
+ @classmethod
294
+ def create( # type: ignore
295
+ cls,
296
+ *children,
297
+ value: Optional[Union[Var[str], str]] = None,
298
+ disabled: Optional[Union[Var[bool], bool]] = None,
299
+ m: Optional[
300
+ Union[
301
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
302
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
303
+ ]
304
+ ] = None,
305
+ mx: Optional[
306
+ Union[
307
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
308
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
309
+ ]
310
+ ] = None,
311
+ my: Optional[
312
+ Union[
313
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
314
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
315
+ ]
316
+ ] = None,
317
+ mt: Optional[
318
+ Union[
319
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
320
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
321
+ ]
322
+ ] = None,
323
+ mr: Optional[
324
+ Union[
325
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
326
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
327
+ ]
328
+ ] = None,
329
+ mb: Optional[
330
+ Union[
331
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
332
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
333
+ ]
334
+ ] = None,
335
+ ml: Optional[
336
+ Union[
337
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
338
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
339
+ ]
340
+ ] = None,
341
+ style: Optional[Style] = None,
342
+ key: Optional[Any] = None,
343
+ id: Optional[Any] = None,
344
+ class_name: Optional[Any] = None,
345
+ autofocus: Optional[bool] = None,
346
+ custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
347
+ on_blur: Optional[
348
+ Union[EventHandler, EventSpec, list, function, BaseVar]
349
+ ] = None,
350
+ on_click: Optional[
351
+ Union[EventHandler, EventSpec, list, function, BaseVar]
352
+ ] = None,
353
+ on_context_menu: Optional[
354
+ Union[EventHandler, EventSpec, list, function, BaseVar]
355
+ ] = None,
356
+ on_double_click: Optional[
357
+ Union[EventHandler, EventSpec, list, function, BaseVar]
358
+ ] = None,
359
+ on_focus: Optional[
360
+ Union[EventHandler, EventSpec, list, function, BaseVar]
361
+ ] = None,
362
+ on_mount: Optional[
363
+ Union[EventHandler, EventSpec, list, function, BaseVar]
364
+ ] = None,
365
+ on_mouse_down: Optional[
366
+ Union[EventHandler, EventSpec, list, function, BaseVar]
367
+ ] = None,
368
+ on_mouse_enter: Optional[
369
+ Union[EventHandler, EventSpec, list, function, BaseVar]
370
+ ] = None,
371
+ on_mouse_leave: Optional[
372
+ Union[EventHandler, EventSpec, list, function, BaseVar]
373
+ ] = None,
374
+ on_mouse_move: Optional[
375
+ Union[EventHandler, EventSpec, list, function, BaseVar]
376
+ ] = None,
377
+ on_mouse_out: Optional[
378
+ Union[EventHandler, EventSpec, list, function, BaseVar]
379
+ ] = None,
380
+ on_mouse_over: Optional[
381
+ Union[EventHandler, EventSpec, list, function, BaseVar]
382
+ ] = None,
383
+ on_mouse_up: Optional[
384
+ Union[EventHandler, EventSpec, list, function, BaseVar]
385
+ ] = None,
386
+ on_scroll: Optional[
387
+ Union[EventHandler, EventSpec, list, function, BaseVar]
388
+ ] = None,
389
+ on_unmount: Optional[
390
+ Union[EventHandler, EventSpec, list, function, BaseVar]
391
+ ] = None,
392
+ **props
393
+ ) -> "TabsTrigger":
394
+ """Create a new component instance.
395
+
396
+ Will prepend "RadixThemes" to the component tag to avoid conflicts with
397
+ other UI libraries for common names, like Text and Button.
398
+
399
+ Args:
400
+ *children: Child components.
401
+ value: The value of the tab. Must be unique for each tab.
402
+ disabled: Whether the tab is disabled
403
+ m: Margin: "0" - "9"
404
+ mx: Margin horizontal: "0" - "9"
405
+ my: Margin vertical: "0" - "9"
406
+ mt: Margin top: "0" - "9"
407
+ mr: Margin right: "0" - "9"
408
+ mb: Margin bottom: "0" - "9"
409
+ ml: Margin left: "0" - "9"
410
+ style: The style of the component.
411
+ key: A unique key for the component.
412
+ id: The id for the component.
413
+ class_name: The class name for the component.
414
+ autofocus: Whether the component should take the focus once the page is loaded
415
+ custom_attrs: custom attribute
416
+ **props: Component properties.
417
+
418
+ Returns:
419
+ A new component instance.
420
+ """
421
+ ...
422
+
423
+ class TabsContent(CommonMarginProps, RadixThemesComponent):
424
+ @overload
425
+ @classmethod
426
+ def create( # type: ignore
427
+ cls,
428
+ *children,
429
+ m: Optional[
430
+ Union[
431
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
432
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
433
+ ]
434
+ ] = None,
435
+ mx: Optional[
436
+ Union[
437
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
438
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
439
+ ]
440
+ ] = None,
441
+ my: Optional[
442
+ Union[
443
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
444
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
445
+ ]
446
+ ] = None,
447
+ mt: Optional[
448
+ Union[
449
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
450
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
451
+ ]
452
+ ] = None,
453
+ mr: Optional[
454
+ Union[
455
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
456
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
457
+ ]
458
+ ] = None,
459
+ mb: Optional[
460
+ Union[
461
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
462
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
463
+ ]
464
+ ] = None,
465
+ ml: Optional[
466
+ Union[
467
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
468
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
469
+ ]
470
+ ] = None,
471
+ style: Optional[Style] = None,
472
+ key: Optional[Any] = None,
473
+ id: Optional[Any] = None,
474
+ class_name: Optional[Any] = None,
475
+ autofocus: Optional[bool] = None,
476
+ custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
477
+ on_blur: Optional[
478
+ Union[EventHandler, EventSpec, list, function, BaseVar]
479
+ ] = None,
480
+ on_click: Optional[
481
+ Union[EventHandler, EventSpec, list, function, BaseVar]
482
+ ] = None,
483
+ on_context_menu: Optional[
484
+ Union[EventHandler, EventSpec, list, function, BaseVar]
485
+ ] = None,
486
+ on_double_click: Optional[
487
+ Union[EventHandler, EventSpec, list, function, BaseVar]
488
+ ] = None,
489
+ on_focus: Optional[
490
+ Union[EventHandler, EventSpec, list, function, BaseVar]
491
+ ] = None,
492
+ on_mount: Optional[
493
+ Union[EventHandler, EventSpec, list, function, BaseVar]
494
+ ] = None,
495
+ on_mouse_down: Optional[
496
+ Union[EventHandler, EventSpec, list, function, BaseVar]
497
+ ] = None,
498
+ on_mouse_enter: Optional[
499
+ Union[EventHandler, EventSpec, list, function, BaseVar]
500
+ ] = None,
501
+ on_mouse_leave: Optional[
502
+ Union[EventHandler, EventSpec, list, function, BaseVar]
503
+ ] = None,
504
+ on_mouse_move: Optional[
505
+ Union[EventHandler, EventSpec, list, function, BaseVar]
506
+ ] = None,
507
+ on_mouse_out: Optional[
508
+ Union[EventHandler, EventSpec, list, function, BaseVar]
509
+ ] = None,
510
+ on_mouse_over: Optional[
511
+ Union[EventHandler, EventSpec, list, function, BaseVar]
512
+ ] = None,
513
+ on_mouse_up: Optional[
514
+ Union[EventHandler, EventSpec, list, function, BaseVar]
515
+ ] = None,
516
+ on_scroll: Optional[
517
+ Union[EventHandler, EventSpec, list, function, BaseVar]
518
+ ] = None,
519
+ on_unmount: Optional[
520
+ Union[EventHandler, EventSpec, list, function, BaseVar]
521
+ ] = None,
522
+ **props
523
+ ) -> "TabsContent":
524
+ """Create a new component instance.
525
+
526
+ Will prepend "RadixThemes" to the component tag to avoid conflicts with
527
+ other UI libraries for common names, like Text and Button.
528
+
529
+ Args:
530
+ *children: Child components.
531
+ m: Margin: "0" - "9"
532
+ mx: Margin horizontal: "0" - "9"
533
+ my: Margin vertical: "0" - "9"
534
+ mt: Margin top: "0" - "9"
535
+ mr: Margin right: "0" - "9"
536
+ mb: Margin bottom: "0" - "9"
537
+ ml: Margin left: "0" - "9"
538
+ style: The style of the component.
539
+ key: A unique key for the component.
540
+ id: The id for the component.
541
+ class_name: The class name for the component.
542
+ autofocus: Whether the component should take the focus once the page is loaded
543
+ custom_attrs: custom attribute
544
+ **props: Component properties.
545
+
546
+ Returns:
547
+ A new component instance.
548
+ """
549
+ ...
@@ -0,0 +1,68 @@
1
+ """Interactive components provided by @radix-ui/themes."""
2
+ from typing import Any, Dict, Literal
3
+
4
+ from reflex import el
5
+ from reflex.components.component import Component
6
+ from reflex.components.forms.debounce import DebounceInput
7
+ from reflex.constants import EventTriggers
8
+ from reflex.vars import Var
9
+
10
+ from ..base import (
11
+ CommonMarginProps,
12
+ LiteralAccentColor,
13
+ RadixThemesComponent,
14
+ )
15
+
16
+ LiteralTextAreaSize = Literal["1", "2", "3"]
17
+
18
+
19
+ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
20
+ """The input part of a TextArea, may be used by itself."""
21
+
22
+ tag = "TextArea"
23
+
24
+ # The size of the text area: "1" | "2" | "3"
25
+ size: Var[LiteralTextAreaSize]
26
+
27
+ # The variant of the text area
28
+ variant: Var[Literal["classic", "surface", "soft"]]
29
+
30
+ # The color of the text area
31
+ color: Var[LiteralAccentColor]
32
+
33
+ @classmethod
34
+ def create(cls, *children, **props) -> Component:
35
+ """Create an Input component.
36
+
37
+ Args:
38
+ *children: The children of the component.
39
+ **props: The properties of the component.
40
+
41
+ Returns:
42
+ The component.
43
+ """
44
+ if (
45
+ isinstance(props.get("value"), Var) and props.get("on_change")
46
+ ) or "debounce_timeout" in props:
47
+ # Currently default to 50ms, which appears to be a good balance
48
+ debounce_timeout = props.pop("debounce_timeout", 50)
49
+ # create a debounced input if the user requests full control to avoid typing jank
50
+ return DebounceInput.create(
51
+ super().create(*children, **props), debounce_timeout=debounce_timeout
52
+ )
53
+ return super().create(*children, **props)
54
+
55
+ def get_event_triggers(self) -> Dict[str, Any]:
56
+ """Get the event triggers that pass the component's value to the handler.
57
+
58
+ Returns:
59
+ A dict mapping the event trigger to the var that is passed to the handler.
60
+ """
61
+ return {
62
+ **super().get_event_triggers(),
63
+ EventTriggers.ON_CHANGE: lambda e0: [e0.target.value],
64
+ EventTriggers.ON_FOCUS: lambda e0: [e0.target.value],
65
+ EventTriggers.ON_BLUR: lambda e0: [e0.target.value],
66
+ EventTriggers.ON_KEY_DOWN: lambda e0: [e0.key],
67
+ EventTriggers.ON_KEY_UP: lambda e0: [e0.key],
68
+ }