reflex 0.3.5a4__py3-none-any.whl → 0.3.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

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