reflex 0.6.0__py3-none-any.whl → 0.6.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 (253) hide show
  1. reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +2 -2
  2. reflex/.templates/jinja/web/pages/_app.js.jinja2 +1 -1
  3. reflex/.templates/jinja/web/pages/utils.js.jinja2 +2 -2
  4. reflex/.templates/web/components/reflex/chakra_color_mode_provider.js +36 -0
  5. reflex/.templates/web/utils/state.js +1 -3
  6. reflex/__init__.py +2 -8
  7. reflex/__init__.pyi +1 -2
  8. reflex/app.py +2 -4
  9. reflex/app_module_for_backend.py +1 -1
  10. reflex/base.py +1 -1
  11. reflex/compiler/compiler.py +2 -2
  12. reflex/compiler/utils.py +3 -3
  13. reflex/components/base/app_wrap.py +2 -2
  14. reflex/components/base/app_wrap.pyi +27 -17
  15. reflex/components/base/bare.py +5 -4
  16. reflex/components/base/body.pyi +27 -17
  17. reflex/components/base/document.pyi +131 -81
  18. reflex/components/base/error_boundary.py +7 -6
  19. reflex/components/base/error_boundary.pyi +33 -20
  20. reflex/components/base/fragment.pyi +27 -17
  21. reflex/components/base/head.pyi +53 -33
  22. reflex/components/base/link.py +1 -1
  23. reflex/components/base/link.pyi +54 -33
  24. reflex/components/base/meta.pyi +105 -65
  25. reflex/components/base/script.py +2 -1
  26. reflex/components/base/script.pyi +38 -21
  27. reflex/components/component.py +47 -53
  28. reflex/components/core/banner.py +27 -23
  29. reflex/components/core/banner.pyi +171 -134
  30. reflex/components/core/client_side_routing.py +3 -2
  31. reflex/components/core/client_side_routing.pyi +54 -33
  32. reflex/components/core/clipboard.py +1 -2
  33. reflex/components/core/clipboard.pyi +33 -20
  34. reflex/components/core/cond.py +5 -5
  35. reflex/components/core/debounce.py +5 -5
  36. reflex/components/core/debounce.pyi +33 -20
  37. reflex/components/core/foreach.py +4 -3
  38. reflex/components/core/html.py +1 -1
  39. reflex/components/core/html.pyi +46 -35
  40. reflex/components/core/match.py +17 -17
  41. reflex/components/core/upload.py +23 -17
  42. reflex/components/core/upload.pyi +124 -78
  43. reflex/components/datadisplay/code.py +10 -9
  44. reflex/components/datadisplay/code.pyi +409 -299
  45. reflex/components/datadisplay/dataeditor.py +10 -8
  46. reflex/components/datadisplay/dataeditor.pyi +53 -40
  47. reflex/components/el/element.pyi +27 -17
  48. reflex/components/el/elements/base.py +1 -1
  49. reflex/components/el/elements/base.pyi +45 -34
  50. reflex/components/el/elements/forms.py +16 -16
  51. reflex/components/el/elements/forms.pyi +707 -554
  52. reflex/components/el/elements/inline.py +1 -1
  53. reflex/components/el/elements/inline.pyi +1218 -937
  54. reflex/components/el/elements/media.py +1 -1
  55. reflex/components/el/elements/media.pyi +997 -786
  56. reflex/components/el/elements/metadata.py +6 -3
  57. reflex/components/el/elements/metadata.pyi +242 -181
  58. reflex/components/el/elements/other.py +1 -1
  59. reflex/components/el/elements/other.pyi +306 -235
  60. reflex/components/el/elements/scripts.py +1 -1
  61. reflex/components/el/elements/scripts.pyi +140 -109
  62. reflex/components/el/elements/sectioning.py +2 -0
  63. reflex/components/el/elements/sectioning.pyi +647 -496
  64. reflex/components/el/elements/tables.py +1 -1
  65. reflex/components/el/elements/tables.pyi +452 -351
  66. reflex/components/el/elements/typography.py +1 -1
  67. reflex/components/el/elements/typography.pyi +657 -506
  68. reflex/components/gridjs/datatable.py +9 -6
  69. reflex/components/gridjs/datatable.pyi +56 -35
  70. reflex/components/lucide/icon.py +1 -1
  71. reflex/components/lucide/icon.pyi +54 -33
  72. reflex/components/markdown/markdown.py +31 -26
  73. reflex/components/markdown/markdown.pyi +37 -27
  74. reflex/components/moment/moment.py +12 -13
  75. reflex/components/moment/moment.pyi +35 -23
  76. reflex/components/next/base.pyi +27 -17
  77. reflex/components/next/image.py +1 -1
  78. reflex/components/next/image.pyi +37 -22
  79. reflex/components/next/link.py +1 -1
  80. reflex/components/next/link.pyi +28 -17
  81. reflex/components/next/video.py +1 -1
  82. reflex/components/next/video.pyi +28 -17
  83. reflex/components/plotly/plotly.py +13 -12
  84. reflex/components/plotly/plotly.pyi +54 -39
  85. reflex/components/props.py +1 -1
  86. reflex/components/radix/__init__.pyi +0 -1
  87. reflex/components/radix/primitives/__init__.pyi +0 -1
  88. reflex/components/radix/primitives/accordion.py +4 -4
  89. reflex/components/radix/primitives/accordion.pyi +495 -424
  90. reflex/components/radix/primitives/base.py +1 -1
  91. reflex/components/radix/primitives/base.pyi +54 -33
  92. reflex/components/radix/primitives/drawer.py +1 -1
  93. reflex/components/radix/primitives/drawer.pyi +273 -172
  94. reflex/components/radix/primitives/form.py +1 -1
  95. reflex/components/radix/primitives/form.pyi +364 -257
  96. reflex/components/radix/primitives/progress.py +1 -1
  97. reflex/components/radix/primitives/progress.pyi +282 -231
  98. reflex/components/radix/primitives/slider.py +1 -1
  99. reflex/components/radix/primitives/slider.pyi +138 -87
  100. reflex/components/radix/themes/base.py +24 -3
  101. reflex/components/radix/themes/base.pyi +250 -178
  102. reflex/components/radix/themes/color_mode.py +5 -5
  103. reflex/components/radix/themes/color_mode.pyi +220 -187
  104. reflex/components/radix/themes/components/alert_dialog.py +1 -1
  105. reflex/components/radix/themes/components/alert_dialog.pyi +207 -136
  106. reflex/components/radix/themes/components/aspect_ratio.py +1 -1
  107. reflex/components/radix/themes/components/aspect_ratio.pyi +28 -17
  108. reflex/components/radix/themes/components/avatar.py +1 -1
  109. reflex/components/radix/themes/components/avatar.pyi +81 -70
  110. reflex/components/radix/themes/components/badge.py +1 -1
  111. reflex/components/radix/themes/components/badge.pyi +99 -88
  112. reflex/components/radix/themes/components/button.py +1 -1
  113. reflex/components/radix/themes/components/button.pyi +109 -98
  114. reflex/components/radix/themes/components/callout.py +1 -1
  115. reflex/components/radix/themes/components/callout.pyi +373 -322
  116. reflex/components/radix/themes/components/card.py +1 -1
  117. reflex/components/radix/themes/components/card.pyi +49 -38
  118. reflex/components/radix/themes/components/checkbox.py +2 -1
  119. reflex/components/radix/themes/components/checkbox.pyi +245 -208
  120. reflex/components/radix/themes/components/checkbox_cards.py +1 -1
  121. reflex/components/radix/themes/components/checkbox_cards.pyi +115 -94
  122. reflex/components/radix/themes/components/checkbox_group.py +1 -1
  123. reflex/components/radix/themes/components/checkbox_group.pyi +107 -86
  124. reflex/components/radix/themes/components/context_menu.py +1 -1
  125. reflex/components/radix/themes/components/context_menu.pyi +319 -238
  126. reflex/components/radix/themes/components/data_list.py +1 -1
  127. reflex/components/radix/themes/components/data_list.pyi +171 -130
  128. reflex/components/radix/themes/components/dialog.py +1 -1
  129. reflex/components/radix/themes/components/dialog.pyi +210 -139
  130. reflex/components/radix/themes/components/dropdown_menu.py +1 -1
  131. reflex/components/radix/themes/components/dropdown_menu.pyi +332 -249
  132. reflex/components/radix/themes/components/hover_card.py +1 -1
  133. reflex/components/radix/themes/components/hover_card.pyi +131 -90
  134. reflex/components/radix/themes/components/icon_button.py +3 -2
  135. reflex/components/radix/themes/components/icon_button.pyi +109 -98
  136. reflex/components/radix/themes/components/inset.py +1 -1
  137. reflex/components/radix/themes/components/inset.pyi +58 -47
  138. reflex/components/radix/themes/components/popover.py +1 -1
  139. reflex/components/radix/themes/components/popover.pyi +136 -95
  140. reflex/components/radix/themes/components/progress.py +1 -1
  141. reflex/components/radix/themes/components/progress.pyi +82 -71
  142. reflex/components/radix/themes/components/radio.py +1 -1
  143. reflex/components/radix/themes/components/radio.pyi +80 -69
  144. reflex/components/radix/themes/components/radio_cards.py +1 -1
  145. reflex/components/radix/themes/components/radio_cards.pyi +119 -98
  146. reflex/components/radix/themes/components/radio_group.py +11 -8
  147. reflex/components/radix/themes/components/radio_group.pyi +271 -228
  148. reflex/components/radix/themes/components/scroll_area.py +1 -1
  149. reflex/components/radix/themes/components/scroll_area.pyi +32 -21
  150. reflex/components/radix/themes/components/segmented_control.py +1 -1
  151. reflex/components/radix/themes/components/segmented_control.pyi +113 -90
  152. reflex/components/radix/themes/components/select.py +3 -2
  153. reflex/components/radix/themes/components/select.pyi +471 -374
  154. reflex/components/radix/themes/components/separator.py +2 -1
  155. reflex/components/radix/themes/components/separator.pyi +80 -69
  156. reflex/components/radix/themes/components/skeleton.py +1 -1
  157. reflex/components/radix/themes/components/skeleton.pyi +34 -23
  158. reflex/components/radix/themes/components/slider.py +3 -2
  159. reflex/components/radix/themes/components/slider.pyi +88 -75
  160. reflex/components/radix/themes/components/spinner.py +1 -1
  161. reflex/components/radix/themes/components/spinner.pyi +30 -19
  162. reflex/components/radix/themes/components/switch.py +1 -1
  163. reflex/components/radix/themes/components/switch.pyi +84 -71
  164. reflex/components/radix/themes/components/table.py +1 -1
  165. reflex/components/radix/themes/components/table.pyi +332 -261
  166. reflex/components/radix/themes/components/tabs.py +1 -1
  167. reflex/components/radix/themes/components/tabs.pyi +194 -139
  168. reflex/components/radix/themes/components/text_area.py +1 -1
  169. reflex/components/radix/themes/components/text_area.pyi +111 -96
  170. reflex/components/radix/themes/components/text_field.py +1 -1
  171. reflex/components/radix/themes/components/text_field.pyi +286 -247
  172. reflex/components/radix/themes/components/tooltip.py +1 -1
  173. reflex/components/radix/themes/components/tooltip.pyi +37 -26
  174. reflex/components/radix/themes/layout/__init__.pyi +0 -1
  175. reflex/components/radix/themes/layout/base.py +1 -1
  176. reflex/components/radix/themes/layout/base.pyi +67 -56
  177. reflex/components/radix/themes/layout/box.pyi +45 -34
  178. reflex/components/radix/themes/layout/center.pyi +67 -56
  179. reflex/components/radix/themes/layout/container.py +2 -1
  180. reflex/components/radix/themes/layout/container.pyi +47 -36
  181. reflex/components/radix/themes/layout/flex.py +1 -1
  182. reflex/components/radix/themes/layout/flex.pyi +67 -56
  183. reflex/components/radix/themes/layout/grid.py +1 -1
  184. reflex/components/radix/themes/layout/grid.pyi +75 -64
  185. reflex/components/radix/themes/layout/list.py +6 -5
  186. reflex/components/radix/themes/layout/list.pyi +244 -193
  187. reflex/components/radix/themes/layout/section.py +2 -1
  188. reflex/components/radix/themes/layout/section.pyi +47 -36
  189. reflex/components/radix/themes/layout/spacer.pyi +67 -56
  190. reflex/components/radix/themes/layout/stack.py +1 -1
  191. reflex/components/radix/themes/layout/stack.pyi +159 -128
  192. reflex/components/radix/themes/typography/blockquote.py +1 -1
  193. reflex/components/radix/themes/typography/blockquote.pyi +100 -89
  194. reflex/components/radix/themes/typography/code.py +1 -1
  195. reflex/components/radix/themes/typography/code.pyi +101 -90
  196. reflex/components/radix/themes/typography/heading.py +1 -1
  197. reflex/components/radix/themes/typography/heading.pyi +107 -96
  198. reflex/components/radix/themes/typography/link.py +1 -1
  199. reflex/components/radix/themes/typography/link.pyi +113 -102
  200. reflex/components/radix/themes/typography/text.py +1 -1
  201. reflex/components/radix/themes/typography/text.pyi +572 -501
  202. reflex/components/react_player/audio.pyi +60 -33
  203. reflex/components/react_player/react_player.py +1 -1
  204. reflex/components/react_player/react_player.pyi +60 -33
  205. reflex/components/react_player/video.pyi +60 -33
  206. reflex/components/recharts/cartesian.py +3 -2
  207. reflex/components/recharts/cartesian.pyi +861 -678
  208. reflex/components/recharts/charts.py +5 -4
  209. reflex/components/recharts/charts.pyi +357 -252
  210. reflex/components/recharts/general.py +2 -1
  211. reflex/components/recharts/general.pyi +231 -180
  212. reflex/components/recharts/polar.py +5 -4
  213. reflex/components/recharts/polar.pyi +181 -144
  214. reflex/components/recharts/recharts.pyi +53 -33
  215. reflex/components/sonner/toast.py +17 -16
  216. reflex/components/sonner/toast.pyi +47 -36
  217. reflex/components/suneditor/editor.py +3 -2
  218. reflex/components/suneditor/editor.pyi +78 -55
  219. reflex/components/tags/cond_tag.py +4 -6
  220. reflex/components/tags/iter_tag.py +16 -28
  221. reflex/components/tags/match_tag.py +4 -6
  222. reflex/components/tags/tag.py +23 -40
  223. reflex/custom_components/custom_components.py +1 -3
  224. reflex/event.py +65 -113
  225. reflex/experimental/client_state.py +24 -25
  226. reflex/experimental/hooks.py +16 -16
  227. reflex/experimental/layout.py +5 -5
  228. reflex/experimental/layout.pyi +187 -136
  229. reflex/{vars → ivars}/__init__.py +2 -6
  230. reflex/{vars → ivars}/base.py +216 -599
  231. reflex/{vars → ivars}/function.py +19 -15
  232. reflex/{vars → ivars}/number.py +20 -41
  233. reflex/{vars → ivars}/object.py +30 -28
  234. reflex/{vars → ivars}/sequence.py +50 -53
  235. reflex/middleware/hydrate_middleware.py +0 -2
  236. reflex/middleware/middleware.py +3 -3
  237. reflex/state.py +82 -148
  238. reflex/style.py +22 -21
  239. reflex/utils/exceptions.py +0 -20
  240. reflex/utils/format.py +34 -54
  241. reflex/utils/imports.py +73 -16
  242. reflex/utils/prerequisites.py +15 -35
  243. reflex/utils/pyi_generator.py +8 -13
  244. reflex/utils/serializers.py +22 -12
  245. reflex/utils/telemetry.py +2 -3
  246. reflex/utils/types.py +5 -10
  247. reflex/vars.py +501 -0
  248. {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/METADATA +5 -4
  249. reflex-0.6.0a1.dist-info/RECORD +384 -0
  250. reflex-0.6.0.dist-info/RECORD +0 -382
  251. {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/LICENSE +0 -0
  252. {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/WHEEL +0 -0
  253. {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/entry_points.txt +0 -0
@@ -24,6 +24,8 @@ from reflex.components.core.cond import Cond, color_mode_cond, cond
24
24
  from reflex.components.lucide.icon import Icon
25
25
  from reflex.components.radix.themes.components.dropdown_menu import dropdown_menu
26
26
  from reflex.components.radix.themes.components.switch import Switch
27
+ from reflex.ivars.base import ImmutableVar
28
+ from reflex.ivars.sequence import LiteralArrayVar
27
29
  from reflex.style import (
28
30
  LIGHT_COLOR_MODE,
29
31
  color_mode,
@@ -31,8 +33,6 @@ from reflex.style import (
31
33
  set_color_mode,
32
34
  toggle_color_mode,
33
35
  )
34
- from reflex.vars.base import Var
35
- from reflex.vars.sequence import LiteralArrayVar
36
36
 
37
37
  from .components.icon_button import IconButton
38
38
 
@@ -114,7 +114,7 @@ class ColorModeIconButton(IconButton):
114
114
  The button component.
115
115
  """
116
116
  # position is used to set nice defaults for positioning the icon button
117
- if isinstance(position, Var):
117
+ if isinstance(position, ImmutableVar):
118
118
  _set_var_default(props, position, "position", "fixed", position)
119
119
  _set_var_default(props, position, "bottom", "2rem")
120
120
  _set_var_default(props, position, "top", "2rem")
@@ -184,7 +184,7 @@ class ColorModeSwitch(Switch):
184
184
  )
185
185
 
186
186
 
187
- class ColorModeNamespace(Var):
187
+ class ColorModeNamespace(ImmutableVar):
188
188
  """Namespace for color mode components."""
189
189
 
190
190
  icon = staticmethod(ColorModeIcon.create)
@@ -193,7 +193,7 @@ class ColorModeNamespace(Var):
193
193
 
194
194
 
195
195
  color_mode = color_mode_var_and_namespace = ColorModeNamespace(
196
- _js_expr=color_mode._js_expr,
196
+ _var_name=color_mode._var_name,
197
197
  _var_type=color_mode._var_type,
198
198
  _var_data=color_mode.get_default_value(),
199
199
  )
@@ -20,11 +20,12 @@ from reflex.components.core.cond import Cond
20
20
  from reflex.components.lucide.icon import Icon
21
21
  from reflex.components.radix.themes.components.switch import Switch
22
22
  from reflex.event import EventHandler, EventSpec
23
+ from reflex.ivars.base import ImmutableVar
23
24
  from reflex.style import (
24
25
  Style,
25
26
  color_mode,
26
27
  )
27
- from reflex.vars.base import Var
28
+ from reflex.vars import Var
28
29
 
29
30
  from .components.icon_button import IconButton
30
31
 
@@ -37,7 +38,7 @@ class ColorModeIcon(Cond):
37
38
  def create( # type: ignore
38
39
  cls,
39
40
  *children,
40
- cond: Optional[Union[Any, Var[Any]]] = None,
41
+ cond: Optional[Union[Var[Any], Any]] = None,
41
42
  comp1: Optional[BaseComponent] = None,
42
43
  comp2: Optional[BaseComponent] = None,
43
44
  style: Optional[Style] = None,
@@ -45,41 +46,51 @@ class ColorModeIcon(Cond):
45
46
  id: Optional[Any] = None,
46
47
  class_name: Optional[Any] = None,
47
48
  autofocus: Optional[bool] = None,
48
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
49
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
50
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
49
+ custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
50
+ on_blur: Optional[
51
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
52
+ ] = None,
53
+ on_click: Optional[
54
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
55
+ ] = None,
51
56
  on_context_menu: Optional[
52
- Union[EventHandler, EventSpec, list, Callable, Var]
57
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
53
58
  ] = None,
54
59
  on_double_click: Optional[
55
- Union[EventHandler, EventSpec, list, Callable, Var]
60
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
61
+ ] = None,
62
+ on_focus: Optional[
63
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
64
+ ] = None,
65
+ on_mount: Optional[
66
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
56
67
  ] = None,
57
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
58
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
59
68
  on_mouse_down: Optional[
60
- Union[EventHandler, EventSpec, list, Callable, Var]
69
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
61
70
  ] = None,
62
71
  on_mouse_enter: Optional[
63
- Union[EventHandler, EventSpec, list, Callable, Var]
72
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
64
73
  ] = None,
65
74
  on_mouse_leave: Optional[
66
- Union[EventHandler, EventSpec, list, Callable, Var]
75
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
67
76
  ] = None,
68
77
  on_mouse_move: Optional[
69
- Union[EventHandler, EventSpec, list, Callable, Var]
78
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
70
79
  ] = None,
71
80
  on_mouse_out: Optional[
72
- Union[EventHandler, EventSpec, list, Callable, Var]
81
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
73
82
  ] = None,
74
83
  on_mouse_over: Optional[
75
- Union[EventHandler, EventSpec, list, Callable, Var]
84
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
76
85
  ] = None,
77
86
  on_mouse_up: Optional[
78
- Union[EventHandler, EventSpec, list, Callable, Var]
87
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
88
+ ] = None,
89
+ on_scroll: Optional[
90
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
79
91
  ] = None,
80
- on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
81
92
  on_unmount: Optional[
82
- Union[EventHandler, EventSpec, list, Callable, Var]
93
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
83
94
  ] = None,
84
95
  **props,
85
96
  ) -> "ColorModeIcon":
@@ -107,171 +118,181 @@ class ColorModeIconButton(IconButton):
107
118
  as_child: Optional[Union[Var[bool], bool]] = None,
108
119
  size: Optional[
109
120
  Union[
110
- Breakpoints[str, Literal["1", "2", "3", "4"]],
111
- Literal["1", "2", "3", "4"],
112
121
  Var[
113
122
  Union[
114
123
  Breakpoints[str, Literal["1", "2", "3", "4"]],
115
124
  Literal["1", "2", "3", "4"],
116
125
  ]
117
126
  ],
127
+ Literal["1", "2", "3", "4"],
128
+ Breakpoints[str, Literal["1", "2", "3", "4"]],
118
129
  ]
119
130
  ] = None,
120
131
  variant: Optional[
121
132
  Union[
122
- Literal["classic", "ghost", "outline", "soft", "solid", "surface"],
123
- Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]],
133
+ Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]],
134
+ Literal["classic", "solid", "soft", "surface", "outline", "ghost"],
124
135
  ]
125
136
  ] = None,
126
137
  color_scheme: Optional[
127
138
  Union[
128
- Literal[
129
- "amber",
130
- "blue",
131
- "bronze",
132
- "brown",
133
- "crimson",
134
- "cyan",
135
- "gold",
136
- "grass",
137
- "gray",
138
- "green",
139
- "indigo",
140
- "iris",
141
- "jade",
142
- "lime",
143
- "mint",
144
- "orange",
145
- "pink",
146
- "plum",
147
- "purple",
148
- "red",
149
- "ruby",
150
- "sky",
151
- "teal",
152
- "tomato",
153
- "violet",
154
- "yellow",
155
- ],
156
139
  Var[
157
140
  Literal[
158
- "amber",
159
- "blue",
160
- "bronze",
161
- "brown",
141
+ "tomato",
142
+ "red",
143
+ "ruby",
162
144
  "crimson",
163
- "cyan",
164
- "gold",
165
- "grass",
166
- "gray",
167
- "green",
168
- "indigo",
169
- "iris",
170
- "jade",
171
- "lime",
172
- "mint",
173
- "orange",
174
145
  "pink",
175
146
  "plum",
176
147
  "purple",
177
- "red",
178
- "ruby",
179
- "sky",
180
- "teal",
181
- "tomato",
182
148
  "violet",
149
+ "iris",
150
+ "indigo",
151
+ "blue",
152
+ "cyan",
153
+ "teal",
154
+ "jade",
155
+ "green",
156
+ "grass",
157
+ "brown",
158
+ "orange",
159
+ "sky",
160
+ "mint",
161
+ "lime",
183
162
  "yellow",
163
+ "amber",
164
+ "gold",
165
+ "bronze",
166
+ "gray",
184
167
  ]
185
168
  ],
169
+ Literal[
170
+ "tomato",
171
+ "red",
172
+ "ruby",
173
+ "crimson",
174
+ "pink",
175
+ "plum",
176
+ "purple",
177
+ "violet",
178
+ "iris",
179
+ "indigo",
180
+ "blue",
181
+ "cyan",
182
+ "teal",
183
+ "jade",
184
+ "green",
185
+ "grass",
186
+ "brown",
187
+ "orange",
188
+ "sky",
189
+ "mint",
190
+ "lime",
191
+ "yellow",
192
+ "amber",
193
+ "gold",
194
+ "bronze",
195
+ "gray",
196
+ ],
186
197
  ]
187
198
  ] = None,
188
199
  high_contrast: Optional[Union[Var[bool], bool]] = None,
189
200
  radius: Optional[
190
201
  Union[
191
- Literal["full", "large", "medium", "none", "small"],
192
- Var[Literal["full", "large", "medium", "none", "small"]],
202
+ Var[Literal["none", "small", "medium", "large", "full"]],
203
+ Literal["none", "small", "medium", "large", "full"],
193
204
  ]
194
205
  ] = None,
195
- auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
206
+ auto_focus: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
196
207
  disabled: Optional[Union[Var[bool], bool]] = None,
197
- form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
198
- form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
208
+ form: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
209
+ form_action: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
199
210
  form_enc_type: Optional[
200
- Union[Var[Union[bool, int, str]], bool, int, str]
211
+ Union[Var[Union[bool, int, str]], str, int, bool]
201
212
  ] = None,
202
- form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
213
+ form_method: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
203
214
  form_no_validate: Optional[
204
- Union[Var[Union[bool, int, str]], bool, int, str]
215
+ Union[Var[Union[bool, int, str]], str, int, bool]
205
216
  ] = None,
206
- form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
207
- name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
208
- type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
209
- value: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
210
- access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
217
+ form_target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
218
+ name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
219
+ type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
220
+ value: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
221
+ access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
211
222
  auto_capitalize: Optional[
212
- Union[Var[Union[bool, int, str]], bool, int, str]
223
+ Union[Var[Union[bool, int, str]], str, int, bool]
213
224
  ] = None,
214
225
  content_editable: Optional[
215
- Union[Var[Union[bool, int, str]], bool, int, str]
226
+ Union[Var[Union[bool, int, str]], str, int, bool]
216
227
  ] = None,
217
228
  context_menu: Optional[
218
- Union[Var[Union[bool, int, str]], bool, int, str]
229
+ Union[Var[Union[bool, int, str]], str, int, bool]
219
230
  ] = None,
220
- dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
221
- draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
231
+ dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
232
+ draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
222
233
  enter_key_hint: Optional[
223
- Union[Var[Union[bool, int, str]], bool, int, str]
224
- ] = None,
225
- hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
226
- input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
227
- item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
228
- lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
229
- role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
230
- slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
231
- spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
232
- tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
233
- title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
234
+ Union[Var[Union[bool, int, str]], str, int, bool]
235
+ ] = None,
236
+ hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
237
+ input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
238
+ item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
239
+ lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
240
+ role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
241
+ slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
242
+ spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
243
+ tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
244
+ title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
234
245
  loading: Optional[Union[Var[bool], bool]] = None,
235
246
  style: Optional[Style] = None,
236
247
  key: Optional[Any] = None,
237
248
  id: Optional[Any] = None,
238
249
  class_name: Optional[Any] = None,
239
250
  autofocus: Optional[bool] = None,
240
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
241
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
242
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
251
+ custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
252
+ on_blur: Optional[
253
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
254
+ ] = None,
255
+ on_click: Optional[
256
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
257
+ ] = None,
243
258
  on_context_menu: Optional[
244
- Union[EventHandler, EventSpec, list, Callable, Var]
259
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
245
260
  ] = None,
246
261
  on_double_click: Optional[
247
- Union[EventHandler, EventSpec, list, Callable, Var]
262
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
263
+ ] = None,
264
+ on_focus: Optional[
265
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
266
+ ] = None,
267
+ on_mount: Optional[
268
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
248
269
  ] = None,
249
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
250
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
251
270
  on_mouse_down: Optional[
252
- Union[EventHandler, EventSpec, list, Callable, Var]
271
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
253
272
  ] = None,
254
273
  on_mouse_enter: Optional[
255
- Union[EventHandler, EventSpec, list, Callable, Var]
274
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
256
275
  ] = None,
257
276
  on_mouse_leave: Optional[
258
- Union[EventHandler, EventSpec, list, Callable, Var]
277
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
259
278
  ] = None,
260
279
  on_mouse_move: Optional[
261
- Union[EventHandler, EventSpec, list, Callable, Var]
280
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
262
281
  ] = None,
263
282
  on_mouse_out: Optional[
264
- Union[EventHandler, EventSpec, list, Callable, Var]
283
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
265
284
  ] = None,
266
285
  on_mouse_over: Optional[
267
- Union[EventHandler, EventSpec, list, Callable, Var]
286
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
268
287
  ] = None,
269
288
  on_mouse_up: Optional[
270
- Union[EventHandler, EventSpec, list, Callable, Var]
289
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
290
+ ] = None,
291
+ on_scroll: Optional[
292
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
271
293
  ] = None,
272
- on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
273
294
  on_unmount: Optional[
274
- Union[EventHandler, EventSpec, list, Callable, Var]
295
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
275
296
  ] = None,
276
297
  **props,
277
298
  ) -> "ColorModeIconButton":
@@ -342,87 +363,87 @@ class ColorModeSwitch(Switch):
342
363
  value: Optional[Union[Var[str], str]] = None,
343
364
  size: Optional[
344
365
  Union[
345
- Breakpoints[str, Literal["1", "2", "3"]],
346
- Literal["1", "2", "3"],
347
366
  Var[
348
367
  Union[
349
368
  Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"]
350
369
  ]
351
370
  ],
371
+ Literal["1", "2", "3"],
372
+ Breakpoints[str, Literal["1", "2", "3"]],
352
373
  ]
353
374
  ] = None,
354
375
  variant: Optional[
355
376
  Union[
356
- Literal["classic", "soft", "surface"],
357
- Var[Literal["classic", "soft", "surface"]],
377
+ Var[Literal["classic", "surface", "soft"]],
378
+ Literal["classic", "surface", "soft"],
358
379
  ]
359
380
  ] = None,
360
381
  color_scheme: Optional[
361
382
  Union[
362
- Literal[
363
- "amber",
364
- "blue",
365
- "bronze",
366
- "brown",
367
- "crimson",
368
- "cyan",
369
- "gold",
370
- "grass",
371
- "gray",
372
- "green",
373
- "indigo",
374
- "iris",
375
- "jade",
376
- "lime",
377
- "mint",
378
- "orange",
379
- "pink",
380
- "plum",
381
- "purple",
382
- "red",
383
- "ruby",
384
- "sky",
385
- "teal",
386
- "tomato",
387
- "violet",
388
- "yellow",
389
- ],
390
383
  Var[
391
384
  Literal[
392
- "amber",
393
- "blue",
394
- "bronze",
395
- "brown",
385
+ "tomato",
386
+ "red",
387
+ "ruby",
396
388
  "crimson",
397
- "cyan",
398
- "gold",
399
- "grass",
400
- "gray",
401
- "green",
402
- "indigo",
403
- "iris",
404
- "jade",
405
- "lime",
406
- "mint",
407
- "orange",
408
389
  "pink",
409
390
  "plum",
410
391
  "purple",
411
- "red",
412
- "ruby",
413
- "sky",
414
- "teal",
415
- "tomato",
416
392
  "violet",
393
+ "iris",
394
+ "indigo",
395
+ "blue",
396
+ "cyan",
397
+ "teal",
398
+ "jade",
399
+ "green",
400
+ "grass",
401
+ "brown",
402
+ "orange",
403
+ "sky",
404
+ "mint",
405
+ "lime",
417
406
  "yellow",
407
+ "amber",
408
+ "gold",
409
+ "bronze",
410
+ "gray",
418
411
  ]
419
412
  ],
413
+ Literal[
414
+ "tomato",
415
+ "red",
416
+ "ruby",
417
+ "crimson",
418
+ "pink",
419
+ "plum",
420
+ "purple",
421
+ "violet",
422
+ "iris",
423
+ "indigo",
424
+ "blue",
425
+ "cyan",
426
+ "teal",
427
+ "jade",
428
+ "green",
429
+ "grass",
430
+ "brown",
431
+ "orange",
432
+ "sky",
433
+ "mint",
434
+ "lime",
435
+ "yellow",
436
+ "amber",
437
+ "gold",
438
+ "bronze",
439
+ "gray",
440
+ ],
420
441
  ]
421
442
  ] = None,
422
443
  high_contrast: Optional[Union[Var[bool], bool]] = None,
423
444
  radius: Optional[
424
445
  Union[
425
- Literal["full", "none", "small"], Var[Literal["full", "none", "small"]]
446
+ Var[Literal["none", "small", "full"]], Literal["none", "small", "full"]
426
447
  ]
427
448
  ] = None,
428
449
  style: Optional[Style] = None,
@@ -430,42 +451,54 @@ class ColorModeSwitch(Switch):
430
451
  id: Optional[Any] = None,
431
452
  class_name: Optional[Any] = None,
432
453
  autofocus: Optional[bool] = None,
433
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
434
- on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
435
- on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
436
- on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
454
+ custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
455
+ on_blur: Optional[
456
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
457
+ ] = None,
458
+ on_change: Optional[
459
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
460
+ ] = None,
461
+ on_click: Optional[
462
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
463
+ ] = None,
437
464
  on_context_menu: Optional[
438
- Union[EventHandler, EventSpec, list, Callable, Var]
465
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
439
466
  ] = None,
440
467
  on_double_click: Optional[
441
- Union[EventHandler, EventSpec, list, Callable, Var]
468
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
469
+ ] = None,
470
+ on_focus: Optional[
471
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
472
+ ] = None,
473
+ on_mount: Optional[
474
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
442
475
  ] = None,
443
- on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
444
- on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
445
476
  on_mouse_down: Optional[
446
- Union[EventHandler, EventSpec, list, Callable, Var]
477
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
447
478
  ] = None,
448
479
  on_mouse_enter: Optional[
449
- Union[EventHandler, EventSpec, list, Callable, Var]
480
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
450
481
  ] = None,
451
482
  on_mouse_leave: Optional[
452
- Union[EventHandler, EventSpec, list, Callable, Var]
483
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
453
484
  ] = None,
454
485
  on_mouse_move: Optional[
455
- Union[EventHandler, EventSpec, list, Callable, Var]
486
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
456
487
  ] = None,
457
488
  on_mouse_out: Optional[
458
- Union[EventHandler, EventSpec, list, Callable, Var]
489
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
459
490
  ] = None,
460
491
  on_mouse_over: Optional[
461
- Union[EventHandler, EventSpec, list, Callable, Var]
492
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
462
493
  ] = None,
463
494
  on_mouse_up: Optional[
464
- Union[EventHandler, EventSpec, list, Callable, Var]
495
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
496
+ ] = None,
497
+ on_scroll: Optional[
498
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
465
499
  ] = None,
466
- on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
467
500
  on_unmount: Optional[
468
- Union[EventHandler, EventSpec, list, Callable, Var]
501
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
469
502
  ] = None,
470
503
  **props,
471
504
  ) -> "ColorModeSwitch":
@@ -498,13 +531,13 @@ class ColorModeSwitch(Switch):
498
531
  """
499
532
  ...
500
533
 
501
- class ColorModeNamespace(Var):
534
+ class ColorModeNamespace(ImmutableVar):
502
535
  icon = staticmethod(ColorModeIcon.create)
503
536
  button = staticmethod(ColorModeIconButton.create)
504
537
  switch = staticmethod(ColorModeSwitch.create)
505
538
 
506
539
  color_mode = color_mode_var_and_namespace = ColorModeNamespace(
507
- _js_expr=color_mode._js_expr,
540
+ _var_name=color_mode._var_name,
508
541
  _var_type=color_mode._var_type,
509
542
  _var_data=color_mode.get_default_value(),
510
543
  )
@@ -6,7 +6,7 @@ from reflex.components.component import ComponentNamespace
6
6
  from reflex.components.core.breakpoints import Responsive
7
7
  from reflex.components.el import elements
8
8
  from reflex.event import EventHandler
9
- from reflex.vars.base import Var
9
+ from reflex.vars import Var
10
10
 
11
11
  from ..base import RadixThemesComponent, RadixThemesTriggerComponent
12
12