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,25 @@
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
+ RadixThemesComponent,
10
+ )
11
+
12
+
13
+ class Card(el.Div, CommonMarginProps, RadixThemesComponent):
14
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
15
+
16
+ tag = "Card"
17
+
18
+ # Change the default rendered element for the one passed as a child, merging their props and behavior.
19
+ as_child: Var[bool]
20
+
21
+ # Button size "1" - "5"
22
+ size: Var[Literal[1, 2, 3, 4, 5]]
23
+
24
+ # Variant of button: "solid" | "soft" | "outline" | "ghost"
25
+ variant: Var[Literal["surface", "classic", "ghost"]]
@@ -0,0 +1,214 @@
1
+ """Stub file for reflex/components/radix/themes/components/card.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 import el
12
+ from reflex.vars import Var
13
+ from ..base import CommonMarginProps, RadixThemesComponent
14
+
15
+ class Card(el.Div, CommonMarginProps, RadixThemesComponent):
16
+ @overload
17
+ @classmethod
18
+ def create( # type: ignore
19
+ cls,
20
+ *children,
21
+ as_child: Optional[Union[Var[bool], bool]] = None,
22
+ size: Optional[
23
+ Union[Var[Literal[1, 2, 3, 4, 5]], Literal[1, 2, 3, 4, 5]]
24
+ ] = None,
25
+ variant: Optional[
26
+ Union[
27
+ Var[Literal["surface", "classic", "ghost"]],
28
+ Literal["surface", "classic", "ghost"],
29
+ ]
30
+ ] = None,
31
+ access_key: Optional[
32
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
33
+ ] = None,
34
+ auto_capitalize: Optional[
35
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
36
+ ] = None,
37
+ content_editable: Optional[
38
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
39
+ ] = None,
40
+ context_menu: Optional[
41
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
42
+ ] = None,
43
+ dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
44
+ draggable: Optional[
45
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
46
+ ] = None,
47
+ enter_key_hint: Optional[
48
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
49
+ ] = None,
50
+ hidden: Optional[
51
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
52
+ ] = None,
53
+ input_mode: Optional[
54
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
55
+ ] = None,
56
+ item_prop: Optional[
57
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
58
+ ] = None,
59
+ lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
60
+ role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
61
+ slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
62
+ spell_check: Optional[
63
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
64
+ ] = None,
65
+ tab_index: Optional[
66
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
67
+ ] = None,
68
+ title: Optional[
69
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
70
+ ] = None,
71
+ translate: Optional[
72
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
73
+ ] = None,
74
+ m: Optional[
75
+ Union[
76
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
77
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
78
+ ]
79
+ ] = None,
80
+ mx: Optional[
81
+ Union[
82
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
83
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
84
+ ]
85
+ ] = None,
86
+ my: Optional[
87
+ Union[
88
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
89
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
90
+ ]
91
+ ] = None,
92
+ mt: Optional[
93
+ Union[
94
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
95
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
96
+ ]
97
+ ] = None,
98
+ mr: Optional[
99
+ Union[
100
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
101
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
102
+ ]
103
+ ] = None,
104
+ mb: Optional[
105
+ Union[
106
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
107
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
108
+ ]
109
+ ] = None,
110
+ ml: Optional[
111
+ Union[
112
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
113
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
114
+ ]
115
+ ] = None,
116
+ style: Optional[Style] = None,
117
+ key: Optional[Any] = None,
118
+ id: Optional[Any] = None,
119
+ class_name: Optional[Any] = None,
120
+ autofocus: Optional[bool] = None,
121
+ custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
122
+ on_blur: Optional[
123
+ Union[EventHandler, EventSpec, list, function, BaseVar]
124
+ ] = None,
125
+ on_click: Optional[
126
+ Union[EventHandler, EventSpec, list, function, BaseVar]
127
+ ] = None,
128
+ on_context_menu: Optional[
129
+ Union[EventHandler, EventSpec, list, function, BaseVar]
130
+ ] = None,
131
+ on_double_click: Optional[
132
+ Union[EventHandler, EventSpec, list, function, BaseVar]
133
+ ] = None,
134
+ on_focus: Optional[
135
+ Union[EventHandler, EventSpec, list, function, BaseVar]
136
+ ] = None,
137
+ on_mount: Optional[
138
+ Union[EventHandler, EventSpec, list, function, BaseVar]
139
+ ] = None,
140
+ on_mouse_down: Optional[
141
+ Union[EventHandler, EventSpec, list, function, BaseVar]
142
+ ] = None,
143
+ on_mouse_enter: Optional[
144
+ Union[EventHandler, EventSpec, list, function, BaseVar]
145
+ ] = None,
146
+ on_mouse_leave: Optional[
147
+ Union[EventHandler, EventSpec, list, function, BaseVar]
148
+ ] = None,
149
+ on_mouse_move: Optional[
150
+ Union[EventHandler, EventSpec, list, function, BaseVar]
151
+ ] = None,
152
+ on_mouse_out: Optional[
153
+ Union[EventHandler, EventSpec, list, function, BaseVar]
154
+ ] = None,
155
+ on_mouse_over: Optional[
156
+ Union[EventHandler, EventSpec, list, function, BaseVar]
157
+ ] = None,
158
+ on_mouse_up: Optional[
159
+ Union[EventHandler, EventSpec, list, function, BaseVar]
160
+ ] = None,
161
+ on_scroll: Optional[
162
+ Union[EventHandler, EventSpec, list, function, BaseVar]
163
+ ] = None,
164
+ on_unmount: Optional[
165
+ Union[EventHandler, EventSpec, list, function, BaseVar]
166
+ ] = None,
167
+ **props
168
+ ) -> "Card":
169
+ """Create a new component instance.
170
+
171
+ Will prepend "RadixThemes" to the component tag to avoid conflicts with
172
+ other UI libraries for common names, like Text and Button.
173
+
174
+ Args:
175
+ *children: Child components.
176
+ as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
177
+ size: Button size "1" - "5"
178
+ variant: Variant of button: "solid" | "soft" | "outline" | "ghost"
179
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
180
+ auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
181
+ content_editable: Indicates whether the element's content is editable.
182
+ context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
183
+ dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
184
+ draggable: Defines whether the element can be dragged.
185
+ enter_key_hint: Hints what media types the media element is able to play.
186
+ hidden: Defines whether the element is hidden.
187
+ input_mode: Defines the type of the element.
188
+ item_prop: Defines the name of the element for metadata purposes.
189
+ lang: Defines the language used in the element.
190
+ role: Defines the role of the element.
191
+ slot: Assigns a slot in a shadow DOM shadow tree to an element.
192
+ spell_check: Defines whether the element may be checked for spelling errors.
193
+ tab_index: Defines the position of the current element in the tabbing order.
194
+ title: Defines a tooltip for the element.
195
+ translate: Specifies whether the content of an element should be translated or not.
196
+ m: Margin: "0" - "9"
197
+ mx: Margin horizontal: "0" - "9"
198
+ my: Margin vertical: "0" - "9"
199
+ mt: Margin top: "0" - "9"
200
+ mr: Margin right: "0" - "9"
201
+ mb: Margin bottom: "0" - "9"
202
+ ml: Margin left: "0" - "9"
203
+ style: The style of the component.
204
+ key: A unique key for the component.
205
+ id: The id for the component.
206
+ class_name: The class name for the component.
207
+ autofocus: Whether the component should take the focus once the page is loaded
208
+ custom_attrs: custom attribute
209
+ **props: Component properties.
210
+
211
+ Returns:
212
+ A new component instance.
213
+ """
214
+ ...
@@ -0,0 +1,67 @@
1
+ """Interactive components provided by @radix-ui/themes."""
2
+ from typing import Any, Dict, Literal
3
+
4
+ from reflex.vars import Var
5
+
6
+ from ..base import (
7
+ CommonMarginProps,
8
+ LiteralAccentColor,
9
+ LiteralRadius,
10
+ LiteralVariant,
11
+ RadixThemesComponent,
12
+ )
13
+
14
+ LiteralCheckboxSize = Literal["1", "2", "3"]
15
+
16
+
17
+ class Checkbox(CommonMarginProps, RadixThemesComponent):
18
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
19
+
20
+ tag = "Checkbox"
21
+
22
+ # Change the default rendered element for the one passed as a child, merging their props and behavior.
23
+ as_child: Var[bool]
24
+
25
+ # Button size "1" - "3"
26
+ size: Var[LiteralCheckboxSize]
27
+
28
+ # Variant of button: "solid" | "soft" | "outline" | "ghost"
29
+ variant: Var[LiteralVariant]
30
+
31
+ # Override theme color for button
32
+ color: Var[LiteralAccentColor]
33
+
34
+ # Whether to render the button with higher contrast color against background
35
+ high_contrast: Var[bool]
36
+
37
+ # Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
38
+ radius: Var[LiteralRadius]
39
+
40
+ # Whether the checkbox is checked by default
41
+ default_checked: Var[bool]
42
+
43
+ # Whether the checkbox is checked
44
+ checked: Var[bool]
45
+
46
+ # Whether the checkbox is disabled
47
+ disabled: Var[bool]
48
+
49
+ # Whether the checkbox is required
50
+ required: Var[bool]
51
+
52
+ # The name of the checkbox control when submitting the form.
53
+ name: Var[str]
54
+
55
+ # The value of the checkbox control when submitting the form.
56
+ value: Var[str]
57
+
58
+ def get_event_triggers(self) -> Dict[str, Any]:
59
+ """Get the events triggers signatures for the component.
60
+
61
+ Returns:
62
+ The signatures of the event triggers.
63
+ """
64
+ return {
65
+ **super().get_event_triggers(),
66
+ "on_checked_change": lambda e0: [e0],
67
+ }
@@ -0,0 +1,249 @@
1
+ """Stub file for reflex/components/radix/themes/components/checkbox.py"""
2
+ # ------------------- DO NOT EDIT ----------------------
3
+ # This file was generated by `scripts/pyi_generator.py`!
4
+ # ------------------------------------------------------
5
+
6
+ from typing import Any, Dict, Literal, Optional, Union, overload
7
+ from reflex.vars import Var, BaseVar, ComputedVar
8
+ from reflex.event import EventChain, EventHandler, EventSpec
9
+ from reflex.style import Style
10
+ from typing import Any, Dict, Literal
11
+ from reflex.vars import Var
12
+ from ..base import (
13
+ CommonMarginProps,
14
+ LiteralAccentColor,
15
+ LiteralRadius,
16
+ LiteralVariant,
17
+ RadixThemesComponent,
18
+ )
19
+
20
+ LiteralCheckboxSize = Literal["1", "2", "3"]
21
+
22
+ class Checkbox(CommonMarginProps, RadixThemesComponent):
23
+ def get_event_triggers(self) -> Dict[str, Any]: ...
24
+ @overload
25
+ @classmethod
26
+ def create( # type: ignore
27
+ cls,
28
+ *children,
29
+ as_child: Optional[Union[Var[bool], bool]] = None,
30
+ size: Optional[
31
+ Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
32
+ ] = None,
33
+ variant: Optional[
34
+ Union[
35
+ Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]],
36
+ Literal["classic", "solid", "soft", "surface", "outline", "ghost"],
37
+ ]
38
+ ] = None,
39
+ color: Optional[
40
+ Union[
41
+ Var[
42
+ Literal[
43
+ "tomato",
44
+ "red",
45
+ "ruby",
46
+ "crimson",
47
+ "pink",
48
+ "plum",
49
+ "purple",
50
+ "violet",
51
+ "iris",
52
+ "indigo",
53
+ "blue",
54
+ "cyan",
55
+ "teal",
56
+ "jade",
57
+ "green",
58
+ "grass",
59
+ "brown",
60
+ "orange",
61
+ "sky",
62
+ "mint",
63
+ "lime",
64
+ "yellow",
65
+ "amber",
66
+ "gold",
67
+ "bronze",
68
+ "gray",
69
+ ]
70
+ ],
71
+ Literal[
72
+ "tomato",
73
+ "red",
74
+ "ruby",
75
+ "crimson",
76
+ "pink",
77
+ "plum",
78
+ "purple",
79
+ "violet",
80
+ "iris",
81
+ "indigo",
82
+ "blue",
83
+ "cyan",
84
+ "teal",
85
+ "jade",
86
+ "green",
87
+ "grass",
88
+ "brown",
89
+ "orange",
90
+ "sky",
91
+ "mint",
92
+ "lime",
93
+ "yellow",
94
+ "amber",
95
+ "gold",
96
+ "bronze",
97
+ "gray",
98
+ ],
99
+ ]
100
+ ] = None,
101
+ high_contrast: Optional[Union[Var[bool], bool]] = None,
102
+ radius: Optional[
103
+ Union[
104
+ Var[Literal["none", "small", "medium", "large", "full"]],
105
+ Literal["none", "small", "medium", "large", "full"],
106
+ ]
107
+ ] = None,
108
+ default_checked: Optional[Union[Var[bool], bool]] = None,
109
+ checked: Optional[Union[Var[bool], bool]] = None,
110
+ disabled: Optional[Union[Var[bool], bool]] = None,
111
+ required: Optional[Union[Var[bool], bool]] = None,
112
+ name: Optional[Union[Var[str], str]] = None,
113
+ value: Optional[Union[Var[str], str]] = None,
114
+ m: Optional[
115
+ Union[
116
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
117
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
118
+ ]
119
+ ] = None,
120
+ mx: Optional[
121
+ Union[
122
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
123
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
124
+ ]
125
+ ] = None,
126
+ my: Optional[
127
+ Union[
128
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
129
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
130
+ ]
131
+ ] = None,
132
+ mt: Optional[
133
+ Union[
134
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
135
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
136
+ ]
137
+ ] = None,
138
+ mr: Optional[
139
+ Union[
140
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
141
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
142
+ ]
143
+ ] = None,
144
+ mb: Optional[
145
+ Union[
146
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
147
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
148
+ ]
149
+ ] = None,
150
+ ml: Optional[
151
+ Union[
152
+ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
153
+ Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
154
+ ]
155
+ ] = None,
156
+ style: Optional[Style] = None,
157
+ key: Optional[Any] = None,
158
+ id: Optional[Any] = None,
159
+ class_name: Optional[Any] = None,
160
+ autofocus: Optional[bool] = None,
161
+ custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
162
+ on_blur: Optional[
163
+ Union[EventHandler, EventSpec, list, function, BaseVar]
164
+ ] = None,
165
+ on_checked_change: Optional[
166
+ Union[EventHandler, EventSpec, list, function, BaseVar]
167
+ ] = None,
168
+ on_click: Optional[
169
+ Union[EventHandler, EventSpec, list, function, BaseVar]
170
+ ] = None,
171
+ on_context_menu: Optional[
172
+ Union[EventHandler, EventSpec, list, function, BaseVar]
173
+ ] = None,
174
+ on_double_click: Optional[
175
+ Union[EventHandler, EventSpec, list, function, BaseVar]
176
+ ] = None,
177
+ on_focus: Optional[
178
+ Union[EventHandler, EventSpec, list, function, BaseVar]
179
+ ] = None,
180
+ on_mount: Optional[
181
+ Union[EventHandler, EventSpec, list, function, BaseVar]
182
+ ] = None,
183
+ on_mouse_down: Optional[
184
+ Union[EventHandler, EventSpec, list, function, BaseVar]
185
+ ] = None,
186
+ on_mouse_enter: Optional[
187
+ Union[EventHandler, EventSpec, list, function, BaseVar]
188
+ ] = None,
189
+ on_mouse_leave: Optional[
190
+ Union[EventHandler, EventSpec, list, function, BaseVar]
191
+ ] = None,
192
+ on_mouse_move: Optional[
193
+ Union[EventHandler, EventSpec, list, function, BaseVar]
194
+ ] = None,
195
+ on_mouse_out: Optional[
196
+ Union[EventHandler, EventSpec, list, function, BaseVar]
197
+ ] = None,
198
+ on_mouse_over: Optional[
199
+ Union[EventHandler, EventSpec, list, function, BaseVar]
200
+ ] = None,
201
+ on_mouse_up: Optional[
202
+ Union[EventHandler, EventSpec, list, function, BaseVar]
203
+ ] = None,
204
+ on_scroll: Optional[
205
+ Union[EventHandler, EventSpec, list, function, BaseVar]
206
+ ] = None,
207
+ on_unmount: Optional[
208
+ Union[EventHandler, EventSpec, list, function, BaseVar]
209
+ ] = None,
210
+ **props
211
+ ) -> "Checkbox":
212
+ """Create a new component instance.
213
+
214
+ Will prepend "RadixThemes" to the component tag to avoid conflicts with
215
+ other UI libraries for common names, like Text and Button.
216
+
217
+ Args:
218
+ *children: Child components.
219
+ as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
220
+ size: Button size "1" - "3"
221
+ variant: Variant of button: "solid" | "soft" | "outline" | "ghost"
222
+ color: Override theme color for button
223
+ high_contrast: Whether to render the button with higher contrast color against background
224
+ radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
225
+ default_checked: Whether the checkbox is checked by default
226
+ checked: Whether the checkbox is checked
227
+ disabled: Whether the checkbox is disabled
228
+ required: Whether the checkbox is required
229
+ name: The name of the checkbox control when submitting the form.
230
+ value: The value of the checkbox control when submitting the form.
231
+ m: Margin: "0" - "9"
232
+ mx: Margin horizontal: "0" - "9"
233
+ my: Margin vertical: "0" - "9"
234
+ mt: Margin top: "0" - "9"
235
+ mr: Margin right: "0" - "9"
236
+ mb: Margin bottom: "0" - "9"
237
+ ml: Margin left: "0" - "9"
238
+ style: The style of the component.
239
+ key: A unique key for the component.
240
+ id: The id for the component.
241
+ class_name: The class name for the component.
242
+ autofocus: Whether the component should take the focus once the page is loaded
243
+ custom_attrs: custom attribute
244
+ **props: Component properties.
245
+
246
+ Returns:
247
+ A new component instance.
248
+ """
249
+ ...
@@ -0,0 +1,134 @@
1
+ """Interactive components provided by @radix-ui/themes."""
2
+ from typing import Any, Dict, Literal
3
+
4
+ from reflex.vars import Var
5
+
6
+ from ..base import (
7
+ CommonMarginProps,
8
+ LiteralAccentColor,
9
+ RadixThemesComponent,
10
+ )
11
+
12
+
13
+ class ContextMenuRoot(CommonMarginProps, RadixThemesComponent):
14
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
15
+
16
+ tag = "ContextMenu.Root"
17
+
18
+ # The modality of the context menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
19
+ modal: Var[bool]
20
+
21
+ def get_event_triggers(self) -> Dict[str, Any]:
22
+ """Get the events triggers signatures for the component.
23
+
24
+ Returns:
25
+ The signatures of the event triggers.
26
+ """
27
+ return {
28
+ **super().get_event_triggers(),
29
+ "on_open_change": lambda e0: [e0],
30
+ }
31
+
32
+
33
+ class ContextMenuTrigger(CommonMarginProps, RadixThemesComponent):
34
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
35
+
36
+ tag = "ContextMenu.Trigger"
37
+
38
+ # Whether the trigger is disabled
39
+ disabled: Var[bool]
40
+
41
+
42
+ class ContextMenuContent(CommonMarginProps, RadixThemesComponent):
43
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
44
+
45
+ tag = "ContextMenu.Content"
46
+
47
+ # Button size "1" - "4"
48
+ size: Var[Literal["1", "2"]]
49
+
50
+ # Variant of button: "solid" | "soft" | "outline" | "ghost"
51
+ variant: Var[Literal["solid", "soft"]]
52
+
53
+ # Override theme color for button
54
+ color: Var[LiteralAccentColor]
55
+
56
+ # Whether to render the button with higher contrast color against background
57
+ high_contrast: Var[bool]
58
+
59
+ # The vertical distance in pixels from the anchor.
60
+ align_offset: Var[int]
61
+
62
+ # When true, overrides the side andalign preferences to prevent collisions with boundary edges.
63
+ avoid_collisions: Var[bool]
64
+
65
+ def get_event_triggers(self) -> Dict[str, Any]:
66
+ """Get the events triggers signatures for the component.
67
+
68
+ Returns:
69
+ The signatures of the event triggers.
70
+ """
71
+ return {
72
+ **super().get_event_triggers(),
73
+ "on_close_auto_focus": lambda e0: [e0],
74
+ "on_escape_key_down": lambda e0: [e0],
75
+ "on_pointer_down_outside": lambda e0: [e0],
76
+ "on_focus_outside": lambda e0: [e0],
77
+ "on_interact_outside": lambda e0: [e0],
78
+ }
79
+
80
+
81
+ class ContextMenuSub(CommonMarginProps, RadixThemesComponent):
82
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
83
+
84
+ tag = "ContextMenu.Sub"
85
+
86
+
87
+ class ContextMenuSubTrigger(CommonMarginProps, RadixThemesComponent):
88
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
89
+
90
+ tag = "ContextMenu.SubTrigger"
91
+
92
+ # Whether the trigger is disabled
93
+ disabled: Var[bool]
94
+
95
+
96
+ class ContextMenuSubContent(CommonMarginProps, RadixThemesComponent):
97
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
98
+
99
+ tag = "ContextMenu.SubContent"
100
+
101
+ # When true, keyboard navigation will loop from last item to first, and vice versa.
102
+ loop: Var[bool]
103
+
104
+ def get_event_triggers(self) -> Dict[str, Any]:
105
+ """Get the events triggers signatures for the component.
106
+
107
+ Returns:
108
+ The signatures of the event triggers.
109
+ """
110
+ return {
111
+ **super().get_event_triggers(),
112
+ "on_escape_key_down": lambda e0: [e0],
113
+ "on_pointer_down_outside": lambda e0: [e0],
114
+ "on_focus_outside": lambda e0: [e0],
115
+ "on_interact_outside": lambda e0: [e0],
116
+ }
117
+
118
+
119
+ class ContextMenuItem(CommonMarginProps, RadixThemesComponent):
120
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
121
+
122
+ tag = "ContextMenu.Item"
123
+
124
+ # Override theme color for button
125
+ color: Var[LiteralAccentColor]
126
+
127
+ # Shortcut to render a menu item as a link
128
+ shortcut: Var[str]
129
+
130
+
131
+ class ContextMenuSeparator(CommonMarginProps, RadixThemesComponent):
132
+ """Trigger an action or event, such as submitting a form or displaying a dialog."""
133
+
134
+ tag = "ContextMenu.Separator"