reflex 0.7.4a2__py3-none-any.whl → 0.7.5__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 (162) hide show
  1. reflex/__init__.py +1 -0
  2. reflex/__init__.pyi +1 -0
  3. reflex/app.py +10 -8
  4. reflex/app_mixins/middleware.py +13 -20
  5. reflex/compiler/compiler.py +10 -3
  6. reflex/compiler/utils.py +4 -4
  7. reflex/components/base/app_wrap.pyi +7 -3
  8. reflex/components/base/body.pyi +7 -3
  9. reflex/components/base/document.pyi +27 -7
  10. reflex/components/base/error_boundary.pyi +7 -3
  11. reflex/components/base/fragment.pyi +7 -3
  12. reflex/components/base/head.pyi +12 -4
  13. reflex/components/base/link.pyi +12 -4
  14. reflex/components/base/meta.pyi +22 -6
  15. reflex/components/base/script.pyi +7 -3
  16. reflex/components/base/strict_mode.pyi +7 -3
  17. reflex/components/component.py +64 -23
  18. reflex/components/core/auto_scroll.pyi +7 -3
  19. reflex/components/core/banner.py +6 -2
  20. reflex/components/core/banner.pyi +32 -8
  21. reflex/components/core/client_side_routing.pyi +12 -4
  22. reflex/components/core/clipboard.pyi +7 -3
  23. reflex/components/core/debounce.pyi +7 -3
  24. reflex/components/core/foreach.py +5 -1
  25. reflex/components/core/html.pyi +7 -3
  26. reflex/components/core/match.py +5 -5
  27. reflex/components/core/sticky.pyi +21 -6
  28. reflex/components/core/upload.pyi +27 -7
  29. reflex/components/datadisplay/code.pyi +12 -4
  30. reflex/components/datadisplay/dataeditor.py +2 -2
  31. reflex/components/datadisplay/dataeditor.pyi +17 -3
  32. reflex/components/datadisplay/shiki_code_block.pyi +17 -4
  33. reflex/components/el/__init__.pyi +1 -1
  34. reflex/components/el/element.pyi +7 -3
  35. reflex/components/el/elements/__init__.py +3 -1
  36. reflex/components/el/elements/__init__.pyi +3 -2
  37. reflex/components/el/elements/base.pyi +7 -3
  38. reflex/components/el/elements/forms.py +1 -1
  39. reflex/components/el/elements/forms.pyi +72 -16
  40. reflex/components/el/elements/inline.pyi +142 -30
  41. reflex/components/el/elements/media.pyi +127 -27
  42. reflex/components/el/elements/metadata.pyi +32 -8
  43. reflex/components/el/elements/other.pyi +37 -9
  44. reflex/components/el/elements/scripts.pyi +17 -5
  45. reflex/components/el/elements/sectioning.pyi +77 -17
  46. reflex/components/el/elements/tables.pyi +52 -12
  47. reflex/components/el/elements/typography.pyi +77 -17
  48. reflex/components/gridjs/datatable.py +2 -2
  49. reflex/components/gridjs/datatable.pyi +12 -4
  50. reflex/components/lucide/icon.py +7 -6
  51. reflex/components/lucide/icon.pyi +22 -7
  52. reflex/components/markdown/markdown.py +1 -1
  53. reflex/components/markdown/markdown.pyi +7 -3
  54. reflex/components/moment/moment.pyi +7 -3
  55. reflex/components/next/base.pyi +7 -3
  56. reflex/components/next/image.pyi +7 -3
  57. reflex/components/next/link.pyi +7 -3
  58. reflex/components/next/video.pyi +7 -3
  59. reflex/components/plotly/plotly.pyi +47 -11
  60. reflex/components/radix/primitives/accordion.pyi +37 -9
  61. reflex/components/radix/primitives/base.pyi +12 -4
  62. reflex/components/radix/primitives/drawer.pyi +57 -13
  63. reflex/components/radix/primitives/form.pyi +52 -12
  64. reflex/components/radix/primitives/progress.pyi +27 -7
  65. reflex/components/radix/primitives/slider.pyi +27 -7
  66. reflex/components/radix/themes/base.pyi +41 -10
  67. reflex/components/radix/themes/color_mode.py +2 -2
  68. reflex/components/radix/themes/color_mode.pyi +17 -5
  69. reflex/components/radix/themes/components/alert_dialog.pyi +36 -9
  70. reflex/components/radix/themes/components/aspect_ratio.pyi +7 -3
  71. reflex/components/radix/themes/components/avatar.pyi +6 -3
  72. reflex/components/radix/themes/components/badge.pyi +6 -3
  73. reflex/components/radix/themes/components/button.pyi +6 -3
  74. reflex/components/radix/themes/components/callout.pyi +26 -7
  75. reflex/components/radix/themes/components/card.pyi +6 -3
  76. reflex/components/radix/themes/components/checkbox.pyi +16 -5
  77. reflex/components/radix/themes/components/checkbox_cards.pyi +11 -4
  78. reflex/components/radix/themes/components/checkbox_group.pyi +11 -4
  79. reflex/components/radix/themes/components/context_menu.pyi +66 -15
  80. reflex/components/radix/themes/components/data_list.pyi +21 -6
  81. reflex/components/radix/themes/components/dialog.pyi +36 -9
  82. reflex/components/radix/themes/components/dropdown_menu.pyi +41 -10
  83. reflex/components/radix/themes/components/hover_card.pyi +21 -6
  84. reflex/components/radix/themes/components/icon_button.pyi +6 -3
  85. reflex/components/radix/themes/components/inset.pyi +6 -3
  86. reflex/components/radix/themes/components/popover.pyi +21 -6
  87. reflex/components/radix/themes/components/progress.pyi +6 -3
  88. reflex/components/radix/themes/components/radio.pyi +6 -3
  89. reflex/components/radix/themes/components/radio_cards.pyi +11 -4
  90. reflex/components/radix/themes/components/radio_group.py +6 -1
  91. reflex/components/radix/themes/components/radio_group.pyi +21 -6
  92. reflex/components/radix/themes/components/scroll_area.pyi +7 -3
  93. reflex/components/radix/themes/components/segmented_control.pyi +11 -4
  94. reflex/components/radix/themes/components/select.pyi +46 -11
  95. reflex/components/radix/themes/components/separator.pyi +6 -3
  96. reflex/components/radix/themes/components/skeleton.pyi +6 -3
  97. reflex/components/radix/themes/components/slider.pyi +6 -3
  98. reflex/components/radix/themes/components/spinner.pyi +6 -3
  99. reflex/components/radix/themes/components/switch.pyi +6 -3
  100. reflex/components/radix/themes/components/table.pyi +36 -9
  101. reflex/components/radix/themes/components/tabs.pyi +26 -7
  102. reflex/components/radix/themes/components/text_area.pyi +6 -3
  103. reflex/components/radix/themes/components/text_field.py +3 -2
  104. reflex/components/radix/themes/components/text_field.pyi +16 -5
  105. reflex/components/radix/themes/components/tooltip.pyi +7 -3
  106. reflex/components/radix/themes/layout/base.pyi +6 -3
  107. reflex/components/radix/themes/layout/box.pyi +7 -3
  108. reflex/components/radix/themes/layout/center.pyi +6 -3
  109. reflex/components/radix/themes/layout/container.pyi +6 -3
  110. reflex/components/radix/themes/layout/flex.pyi +6 -3
  111. reflex/components/radix/themes/layout/grid.pyi +6 -3
  112. reflex/components/radix/themes/layout/list.pyi +27 -7
  113. reflex/components/radix/themes/layout/section.pyi +6 -3
  114. reflex/components/radix/themes/layout/spacer.pyi +6 -3
  115. reflex/components/radix/themes/layout/stack.pyi +16 -5
  116. reflex/components/radix/themes/typography/blockquote.pyi +6 -3
  117. reflex/components/radix/themes/typography/code.pyi +6 -3
  118. reflex/components/radix/themes/typography/heading.pyi +6 -3
  119. reflex/components/radix/themes/typography/link.pyi +6 -3
  120. reflex/components/radix/themes/typography/text.pyi +36 -9
  121. reflex/components/react_player/audio.pyi +7 -3
  122. reflex/components/react_player/react_player.pyi +7 -3
  123. reflex/components/react_player/video.pyi +7 -3
  124. reflex/components/recharts/cartesian.pyi +97 -21
  125. reflex/components/recharts/charts.pyi +62 -14
  126. reflex/components/recharts/general.pyi +32 -8
  127. reflex/components/recharts/polar.py +1 -1
  128. reflex/components/recharts/polar.pyi +33 -9
  129. reflex/components/recharts/recharts.pyi +12 -4
  130. reflex/components/sonner/toast.pyi +7 -2
  131. reflex/components/suneditor/editor.pyi +7 -3
  132. reflex/config.py +18 -1
  133. reflex/constants/installer.py +22 -1
  134. reflex/custom_components/custom_components.py +12 -7
  135. reflex/event.py +26 -10
  136. reflex/experimental/__init__.py +17 -6
  137. reflex/experimental/layout.pyi +27 -7
  138. reflex/model.py +3 -3
  139. reflex/reflex.py +33 -18
  140. reflex/state.py +4 -4
  141. reflex/style.py +2 -2
  142. reflex/testing.py +17 -5
  143. reflex/utils/console.py +2 -3
  144. reflex/utils/exec.py +4 -0
  145. reflex/utils/imports.py +14 -7
  146. reflex/utils/net.py +107 -18
  147. reflex/utils/prerequisites.py +92 -13
  148. reflex/utils/processes.py +52 -19
  149. reflex/utils/pyi_generator.py +66 -53
  150. reflex/utils/redir.py +3 -1
  151. reflex/utils/registry.py +15 -5
  152. reflex/utils/serializers.py +1 -2
  153. reflex/utils/types.py +4 -4
  154. reflex/vars/base.py +58 -22
  155. reflex/vars/number.py +23 -6
  156. reflex/vars/sequence.py +2 -0
  157. {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/METADATA +2 -2
  158. {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/RECORD +162 -162
  159. /reflex/{experimental → utils}/misc.py +0 -0
  160. {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/WHEEL +0 -0
  161. {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/entry_points.txt +0 -0
  162. {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/licenses/LICENSE +0 -0
@@ -18,17 +18,18 @@ from typing import (
18
18
  ClassVar,
19
19
  Iterator,
20
20
  List,
21
+ Mapping,
21
22
  Sequence,
22
23
  Set,
23
24
  Type,
24
25
  TypeVar,
25
26
  Union,
27
+ cast,
26
28
  get_args,
27
29
  get_origin,
28
30
  )
29
31
 
30
32
  import pydantic.v1
31
- import pydantic.v1.fields
32
33
 
33
34
  import reflex.state
34
35
  from reflex.base import Base
@@ -48,12 +49,13 @@ from reflex.constants import (
48
49
  from reflex.constants.compiler import SpecialAttributes
49
50
  from reflex.constants.state import FRONTEND_EVENT_STATE
50
51
  from reflex.event import (
51
- EventActionsMixin,
52
52
  EventCallback,
53
53
  EventChain,
54
54
  EventHandler,
55
55
  EventSpec,
56
56
  no_args_event_spec,
57
+ parse_args_spec,
58
+ run_script,
57
59
  )
58
60
  from reflex.style import Style, format_as_emotion
59
61
  from reflex.utils import console, format, imports, types
@@ -65,7 +67,7 @@ from reflex.vars.base import (
65
67
  Var,
66
68
  cached_property_no_lock,
67
69
  )
68
- from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar
70
+ from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar, FunctionVar
69
71
  from reflex.vars.number import ternary_operation
70
72
  from reflex.vars.object import ObjectVar
71
73
  from reflex.vars.sequence import LiteralArrayVar
@@ -179,7 +181,7 @@ def evaluate_style_namespaces(style: ComponentStyle) -> dict:
179
181
  # Map from component to styling.
180
182
  ComponentStyle = dict[str | Type[BaseComponent] | Callable | ComponentNamespace, Any]
181
183
  ComponentChild = types.PrimitiveType | Var | BaseComponent
182
- ComponentChildTypes = (*types.PrimitiveTypes, Var, BaseComponent)
184
+ ComponentChildTypes = (*types.PrimitiveTypes, Var, BaseComponent, type(None))
183
185
 
184
186
 
185
187
  def _satisfies_type_hint(obj: Any, type_hint: Any) -> bool:
@@ -576,9 +578,15 @@ class Component(BaseComponent, ABC):
576
578
 
577
579
  # Add style props to the component.
578
580
  style = kwargs.get("style", {})
579
- if isinstance(style, List):
581
+ if isinstance(style, Sequence):
582
+ if any(not isinstance(s, Mapping) for s in style):
583
+ raise TypeError("Style must be a dictionary or a list of dictionaries.")
580
584
  # Merge styles, the later ones overriding keys in the earlier ones.
581
- style = {k: v for style_dict in style for k, v in style_dict.items()}
585
+ style = {
586
+ k: v
587
+ for style_dict in style
588
+ for k, v in cast(Mapping, style_dict).items()
589
+ }
582
590
 
583
591
  if isinstance(style, (Breakpoints, Var)):
584
592
  style = {
@@ -886,7 +894,7 @@ class Component(BaseComponent, ABC):
886
894
  _style.update(s)
887
895
  return _style
888
896
 
889
- def _get_component_style(self, styles: ComponentStyle) -> Style | None:
897
+ def _get_component_style(self, styles: ComponentStyle | Style) -> Style | None:
890
898
  """Get the style to the component from `App.style`.
891
899
 
892
900
  Args:
@@ -896,14 +904,14 @@ class Component(BaseComponent, ABC):
896
904
  The style of the component.
897
905
  """
898
906
  component_style = None
899
- if type(self) in styles:
900
- component_style = Style(styles[type(self)])
901
- if self.create in styles:
902
- component_style = Style(styles[self.create])
907
+ if (style := styles.get(type(self))) is not None: # pyright: ignore [reportArgumentType]
908
+ component_style = Style(style)
909
+ if (style := styles.get(self.create)) is not None: # pyright: ignore [reportArgumentType]
910
+ component_style = Style(style)
903
911
  return component_style
904
912
 
905
913
  def _add_style_recursive(
906
- self, style: ComponentStyle, theme: Component | None = None
914
+ self, style: ComponentStyle | Style, theme: Component | None = None
907
915
  ) -> Component:
908
916
  """Add additional style to the component and its children.
909
917
 
@@ -1228,7 +1236,9 @@ class Component(BaseComponent, ABC):
1228
1236
  Yields:
1229
1237
  The parent classes that define the method (differently than the base).
1230
1238
  """
1231
- seen_methods = {getattr(Component, method)}
1239
+ seen_methods = (
1240
+ {getattr(Component, method)} if hasattr(Component, method) else set()
1241
+ )
1232
1242
  for clz in cls.mro():
1233
1243
  if clz is Component:
1234
1244
  break
@@ -1893,7 +1903,44 @@ class CustomComponent(Component):
1893
1903
 
1894
1904
  return custom_components
1895
1905
 
1896
- def get_prop_vars(self) -> List[Var]:
1906
+ @staticmethod
1907
+ def _get_event_spec_from_args_spec(name: str, event: EventChain) -> Callable:
1908
+ """Get the event spec from the args spec.
1909
+
1910
+ Args:
1911
+ name: The name of the event
1912
+ event: The args spec.
1913
+
1914
+ Returns:
1915
+ The event spec.
1916
+ """
1917
+
1918
+ def fn(*args):
1919
+ return run_script(Var(name).to(FunctionVar).call(*args))
1920
+
1921
+ if event.args_spec:
1922
+ arg_spec = (
1923
+ event.args_spec
1924
+ if not isinstance(event.args_spec, Sequence)
1925
+ else event.args_spec[0]
1926
+ )
1927
+ names = inspect.getfullargspec(arg_spec).args
1928
+ fn.__signature__ = inspect.Signature( # pyright: ignore[reportFunctionMemberAccess]
1929
+ parameters=[
1930
+ inspect.Parameter(
1931
+ name=name,
1932
+ kind=inspect.Parameter.POSITIONAL_ONLY,
1933
+ annotation=arg._var_type,
1934
+ )
1935
+ for name, arg in zip(
1936
+ names, parse_args_spec(event.args_spec), strict=True
1937
+ )
1938
+ ]
1939
+ )
1940
+
1941
+ return fn
1942
+
1943
+ def get_prop_vars(self) -> List[Var | Callable]:
1897
1944
  """Get the prop vars.
1898
1945
 
1899
1946
  Returns:
@@ -1902,16 +1949,10 @@ class CustomComponent(Component):
1902
1949
  return [
1903
1950
  Var(
1904
1951
  _js_expr=name,
1905
- _var_type=(
1906
- prop._var_type
1907
- if isinstance(prop, Var)
1908
- else (
1909
- type(prop)
1910
- if not isinstance(prop, EventActionsMixin)
1911
- else EventChain
1912
- )
1913
- ),
1952
+ _var_type=(prop._var_type if isinstance(prop, Var) else type(prop)),
1914
1953
  ).guess_type()
1954
+ if isinstance(prop, Var) or not isinstance(prop, EventChain)
1955
+ else CustomComponent._get_event_spec_from_args_spec(name, prop)
1915
1956
  for name, prop in self.props.items()
1916
1957
  ]
1917
1958
 
@@ -3,11 +3,11 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- from typing import Any, Literal, Optional, overload
6
+ from typing import Any, Literal, Mapping, Optional, Sequence, overload
7
7
 
8
+ from reflex.components.core.breakpoints import Breakpoints
8
9
  from reflex.components.el.elements.typography import Div
9
10
  from reflex.event import EventType
10
- from reflex.style import Style
11
11
  from reflex.utils.imports import ImportDict
12
12
  from reflex.vars.base import Var
13
13
 
@@ -195,7 +195,11 @@ class AutoScroll(Div):
195
195
  spell_check: Var[bool] | bool | None = None,
196
196
  tab_index: Var[int] | int | None = None,
197
197
  title: Var[str] | str | None = None,
198
- style: Style | None = None,
198
+ style: Sequence[Mapping[str, Any]]
199
+ | Mapping[str, Any]
200
+ | Var[Mapping[str, Any]]
201
+ | Breakpoints
202
+ | None = None,
199
203
  key: Any | None = None,
200
204
  id: Any | None = None,
201
205
  class_name: Any | None = None,
@@ -149,8 +149,12 @@ setTimeout(() => {{
149
149
  "useEffect",
150
150
  _var_data=VarData(
151
151
  imports={
152
- "react": ["useEffect", "useState"],
153
- **dict(target_url._get_all_var_data().imports), # pyright: ignore [reportArgumentType, reportOptionalMemberAccess]
152
+ "react": ("useEffect", "useState"),
153
+ **(
154
+ dict(var_data.imports)
155
+ if (var_data := target_url._get_all_var_data()) is not None
156
+ else {}
157
+ ),
154
158
  }
155
159
  ),
156
160
  ).call(
@@ -3,15 +3,15 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- from typing import Any, Literal, Optional, overload
6
+ from typing import Any, Literal, Mapping, Optional, Sequence, overload
7
7
 
8
8
  from reflex.components.base.fragment import Fragment
9
9
  from reflex.components.component import Component
10
+ from reflex.components.core.breakpoints import Breakpoints
10
11
  from reflex.components.el.elements.typography import Div
11
12
  from reflex.components.lucide.icon import Icon
12
13
  from reflex.constants.compiler import CompileVars
13
14
  from reflex.event import EventType
14
- from reflex.style import Style
15
15
  from reflex.utils.imports import ImportVar
16
16
  from reflex.vars import VarData
17
17
  from reflex.vars.base import Var
@@ -48,7 +48,11 @@ class ConnectionToaster(Fragment):
48
48
  def create( # type: ignore
49
49
  cls,
50
50
  *children,
51
- style: Style | None = None,
51
+ style: Sequence[Mapping[str, Any]]
52
+ | Mapping[str, Any]
53
+ | Var[Mapping[str, Any]]
54
+ | Breakpoints
55
+ | None = None,
52
56
  key: Any | None = None,
53
57
  id: Any | None = None,
54
58
  class_name: Any | None = None,
@@ -94,7 +98,11 @@ class ConnectionBanner(Component):
94
98
  def create( # type: ignore
95
99
  cls,
96
100
  *children,
97
- style: Style | None = None,
101
+ style: Sequence[Mapping[str, Any]]
102
+ | Mapping[str, Any]
103
+ | Var[Mapping[str, Any]]
104
+ | Breakpoints
105
+ | None = None,
98
106
  key: Any | None = None,
99
107
  id: Any | None = None,
100
108
  class_name: Any | None = None,
@@ -133,7 +141,11 @@ class ConnectionModal(Component):
133
141
  def create( # type: ignore
134
142
  cls,
135
143
  *children,
136
- style: Style | None = None,
144
+ style: Sequence[Mapping[str, Any]]
145
+ | Mapping[str, Any]
146
+ | Var[Mapping[str, Any]]
147
+ | Breakpoints
148
+ | None = None,
137
149
  key: Any | None = None,
138
150
  id: Any | None = None,
139
151
  class_name: Any | None = None,
@@ -173,7 +185,11 @@ class WifiOffPulse(Icon):
173
185
  cls,
174
186
  *children,
175
187
  size: Var[int] | int | None = None,
176
- style: Style | None = None,
188
+ style: Sequence[Mapping[str, Any]]
189
+ | Mapping[str, Any]
190
+ | Var[Mapping[str, Any]]
191
+ | Breakpoints
192
+ | None = None,
177
193
  key: Any | None = None,
178
194
  id: Any | None = None,
179
195
  class_name: Any | None = None,
@@ -400,7 +416,11 @@ class ConnectionPulser(Div):
400
416
  spell_check: Var[bool] | bool | None = None,
401
417
  tab_index: Var[int] | int | None = None,
402
418
  title: Var[str] | str | None = None,
403
- style: Style | None = None,
419
+ style: Sequence[Mapping[str, Any]]
420
+ | Mapping[str, Any]
421
+ | Var[Mapping[str, Any]]
422
+ | Breakpoints
423
+ | None = None,
404
424
  key: Any | None = None,
405
425
  id: Any | None = None,
406
426
  class_name: Any | None = None,
@@ -639,7 +659,11 @@ class BackendDisabled(Div):
639
659
  spell_check: Var[bool] | bool | None = None,
640
660
  tab_index: Var[int] | int | None = None,
641
661
  title: Var[str] | str | None = None,
642
- style: Style | None = None,
662
+ style: Sequence[Mapping[str, Any]]
663
+ | Mapping[str, Any]
664
+ | Var[Mapping[str, Any]]
665
+ | Breakpoints
666
+ | None = None,
643
667
  key: Any | None = None,
644
668
  id: Any | None = None,
645
669
  class_name: Any | None = None,
@@ -3,11 +3,11 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- from typing import Any, Optional, overload
6
+ from typing import Any, Mapping, Optional, Sequence, overload
7
7
 
8
8
  from reflex.components.component import Component
9
+ from reflex.components.core.breakpoints import Breakpoints
9
10
  from reflex.event import EventType
10
- from reflex.style import Style
11
11
  from reflex.vars.base import Var
12
12
 
13
13
  route_not_found: Var
@@ -20,7 +20,11 @@ class ClientSideRouting(Component):
20
20
  def create( # type: ignore
21
21
  cls,
22
22
  *children,
23
- style: Style | None = None,
23
+ style: Sequence[Mapping[str, Any]]
24
+ | Mapping[str, Any]
25
+ | Var[Mapping[str, Any]]
26
+ | Breakpoints
27
+ | None = None,
24
28
  key: Any | None = None,
25
29
  id: Any | None = None,
26
30
  class_name: Any | None = None,
@@ -69,7 +73,11 @@ class Default404Page(Component):
69
73
  cls,
70
74
  *children,
71
75
  status_code: Var[int] | int | None = None,
72
- style: Style | None = None,
76
+ style: Sequence[Mapping[str, Any]]
77
+ | Mapping[str, Any]
78
+ | Var[Mapping[str, Any]]
79
+ | Breakpoints
80
+ | None = None,
73
81
  key: Any | None = None,
74
82
  id: Any | None = None,
75
83
  class_name: Any | None = None,
@@ -3,11 +3,11 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- from typing import Any, Optional, Sequence, overload
6
+ from typing import Any, Mapping, Optional, Sequence, overload
7
7
 
8
8
  from reflex.components.base.fragment import Fragment
9
+ from reflex.components.core.breakpoints import Breakpoints
9
10
  from reflex.event import EventType
10
- from reflex.style import Style
11
11
  from reflex.utils.imports import ImportVar
12
12
  from reflex.vars.base import Var
13
13
 
@@ -21,7 +21,11 @@ class Clipboard(Fragment):
21
21
  on_paste_event_actions: Var[dict[str, bool | int]]
22
22
  | dict[str, bool | int]
23
23
  | None = None,
24
- style: Style | None = None,
24
+ style: Sequence[Mapping[str, Any]]
25
+ | Mapping[str, Any]
26
+ | Var[Mapping[str, Any]]
27
+ | Breakpoints
28
+ | None = None,
25
29
  key: Any | None = None,
26
30
  id: Any | None = None,
27
31
  class_name: Any | None = None,
@@ -3,11 +3,11 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- from typing import Any, Optional, Type, overload
6
+ from typing import Any, Mapping, Optional, Sequence, Type, overload
7
7
 
8
8
  from reflex.components.component import Component
9
+ from reflex.components.core.breakpoints import Breakpoints
9
10
  from reflex.event import EventType
10
- from reflex.style import Style
11
11
  from reflex.vars.base import Var
12
12
 
13
13
  DEFAULT_DEBOUNCE_TIMEOUT = 300
@@ -25,7 +25,11 @@ class DebounceInput(Component):
25
25
  value: Var[float | int | str] | float | int | str | None = None,
26
26
  input_ref: Var[str] | str | None = None,
27
27
  element: Type[Component] | Var[Type[Component]] | None = None,
28
- style: Style | None = None,
28
+ style: Sequence[Mapping[str, Any]]
29
+ | Mapping[str, Any]
30
+ | Var[Mapping[str, Any]]
31
+ | Breakpoints
32
+ | None = None,
29
33
  key: Any | None = None,
30
34
  id: Any | None = None,
31
35
  class_name: Any | None = None,
@@ -58,7 +58,11 @@ class Foreach(Component):
58
58
  """
59
59
  from reflex.vars import ArrayVar, ObjectVar, StringVar
60
60
 
61
- iterable = LiteralVar.create(iterable).guess_type()
61
+ iterable = (
62
+ LiteralVar.create(iterable).guess_type()
63
+ if not isinstance(iterable, Var)
64
+ else iterable.guess_type()
65
+ )
62
66
 
63
67
  if iterable._var_type == Any:
64
68
  raise ForeachVarError(
@@ -3,11 +3,11 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- from typing import Any, Literal, Optional, overload
6
+ from typing import Any, Literal, Mapping, Optional, Sequence, overload
7
7
 
8
+ from reflex.components.core.breakpoints import Breakpoints
8
9
  from reflex.components.el.elements.typography import Div
9
10
  from reflex.event import EventType
10
- from reflex.style import Style
11
11
  from reflex.vars.base import Var
12
12
 
13
13
  class Html(Div):
@@ -195,7 +195,11 @@ class Html(Div):
195
195
  spell_check: Var[bool] | bool | None = None,
196
196
  tab_index: Var[int] | int | None = None,
197
197
  title: Var[str] | str | None = None,
198
- style: Style | None = None,
198
+ style: Sequence[Mapping[str, Any]]
199
+ | Mapping[str, Any]
200
+ | Var[Mapping[str, Any]]
201
+ | Breakpoints
202
+ | None = None,
199
203
  key: Any | None = None,
200
204
  id: Any | None = None,
201
205
  class_name: Any | None = None,
@@ -1,7 +1,7 @@
1
1
  """rx.match."""
2
2
 
3
3
  import textwrap
4
- from typing import Any, Dict, List
4
+ from typing import Any, Dict
5
5
 
6
6
  from reflex.components.base import Fragment
7
7
  from reflex.components.component import BaseComponent, Component, MemoizationLeaf
@@ -123,7 +123,7 @@ class Match(MemoizationLeaf):
123
123
  return case_element
124
124
 
125
125
  @classmethod
126
- def _process_match_cases(cls, cases: List) -> list[list[Var]]:
126
+ def _process_match_cases(cls, cases: list) -> list[list[Var]]:
127
127
  """Process the individual match cases.
128
128
 
129
129
  Args:
@@ -232,13 +232,13 @@ class Match(MemoizationLeaf):
232
232
  _js_expr=format.format_match(
233
233
  cond=str(match_cond_var),
234
234
  match_cases=match_cases,
235
- default=default, # pyright: ignore [reportArgumentType]
235
+ default=default,
236
236
  ),
237
- _var_type=default._var_type, # pyright: ignore [reportAttributeAccessIssue,reportOptionalMemberAccess]
237
+ _var_type=default._var_type,
238
238
  _var_data=VarData.merge(
239
239
  match_cond_var._get_all_var_data(),
240
240
  *[el._get_all_var_data() for case in match_cases for el in case],
241
- default._get_all_var_data(), # pyright: ignore [reportAttributeAccessIssue, reportOptionalMemberAccess]
241
+ default._get_all_var_data(),
242
242
  ),
243
243
  )
244
244
 
@@ -3,7 +3,7 @@
3
3
  # ------------------- DO NOT EDIT ----------------------
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
- from typing import Any, Literal, Optional, overload
6
+ from typing import Any, Literal, Mapping, Optional, Sequence, overload
7
7
 
8
8
  from reflex.components.component import ComponentNamespace
9
9
  from reflex.components.core.breakpoints import Breakpoints
@@ -11,7 +11,6 @@ from reflex.components.el.elements.inline import A
11
11
  from reflex.components.el.elements.media import Svg
12
12
  from reflex.components.radix.themes.typography.text import Text
13
13
  from reflex.event import EventType
14
- from reflex.style import Style
15
14
  from reflex.vars.base import Var
16
15
 
17
16
  class StickyLogo(Svg):
@@ -201,7 +200,11 @@ class StickyLogo(Svg):
201
200
  spell_check: Var[bool] | bool | None = None,
202
201
  tab_index: Var[int] | int | None = None,
203
202
  title: Var[str] | str | None = None,
204
- style: Style | None = None,
203
+ style: Sequence[Mapping[str, Any]]
204
+ | Mapping[str, Any]
205
+ | Var[Mapping[str, Any]]
206
+ | Breakpoints
207
+ | None = None,
205
208
  key: Any | None = None,
206
209
  id: Any | None = None,
207
210
  class_name: Any | None = None,
@@ -549,7 +552,11 @@ class StickyLabel(Text):
549
552
  spell_check: Var[bool] | bool | None = None,
550
553
  tab_index: Var[int] | int | None = None,
551
554
  title: Var[str] | str | None = None,
552
- style: Style | None = None,
555
+ style: Sequence[Mapping[str, Any]]
556
+ | Mapping[str, Any]
557
+ | Var[Mapping[str, Any]]
558
+ | Breakpoints
559
+ | None = None,
553
560
  key: Any | None = None,
554
561
  id: Any | None = None,
555
562
  class_name: Any | None = None,
@@ -800,7 +807,11 @@ class StickyBadge(A):
800
807
  spell_check: Var[bool] | bool | None = None,
801
808
  tab_index: Var[int] | int | None = None,
802
809
  title: Var[str] | str | None = None,
803
- style: Style | None = None,
810
+ style: Sequence[Mapping[str, Any]]
811
+ | Mapping[str, Any]
812
+ | Var[Mapping[str, Any]]
813
+ | Breakpoints
814
+ | None = None,
804
815
  key: Any | None = None,
805
816
  id: Any | None = None,
806
817
  class_name: Any | None = None,
@@ -1052,7 +1063,11 @@ class StickyNamespace(ComponentNamespace):
1052
1063
  spell_check: Var[bool] | bool | None = None,
1053
1064
  tab_index: Var[int] | int | None = None,
1054
1065
  title: Var[str] | str | None = None,
1055
- style: Style | None = None,
1066
+ style: Sequence[Mapping[str, Any]]
1067
+ | Mapping[str, Any]
1068
+ | Var[Mapping[str, Any]]
1069
+ | Breakpoints
1070
+ | None = None,
1056
1071
  key: Any | None = None,
1057
1072
  id: Any | None = None,
1058
1073
  class_name: Any | None = None,
@@ -4,13 +4,13 @@
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
6
  from pathlib import Path
7
- from typing import Any, ClassVar, Optional, Sequence, overload
7
+ from typing import Any, ClassVar, Mapping, Optional, Sequence, overload
8
8
 
9
9
  from reflex.components.base.fragment import Fragment
10
10
  from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
11
+ from reflex.components.core.breakpoints import Breakpoints
11
12
  from reflex.constants import Dirs
12
13
  from reflex.event import CallableEventSpec, EventSpec, EventType
13
- from reflex.style import Style
14
14
  from reflex.utils.imports import ImportVar
15
15
  from reflex.vars import VarData
16
16
  from reflex.vars.base import Var
@@ -43,7 +43,11 @@ class UploadFilesProvider(Component):
43
43
  def create( # type: ignore
44
44
  cls,
45
45
  *children,
46
- style: Style | None = None,
46
+ style: Sequence[Mapping[str, Any]]
47
+ | Mapping[str, Any]
48
+ | Var[Mapping[str, Any]]
49
+ | Breakpoints
50
+ | None = None,
47
51
  key: Any | None = None,
48
52
  id: Any | None = None,
49
53
  class_name: Any | None = None,
@@ -89,7 +93,11 @@ class GhostUpload(Fragment):
89
93
  def create( # type: ignore
90
94
  cls,
91
95
  *children,
92
- style: Style | None = None,
96
+ style: Sequence[Mapping[str, Any]]
97
+ | Mapping[str, Any]
98
+ | Var[Mapping[str, Any]]
99
+ | Breakpoints
100
+ | None = None,
93
101
  key: Any | None = None,
94
102
  id: Any | None = None,
95
103
  class_name: Any | None = None,
@@ -148,7 +156,11 @@ class Upload(MemoizationLeaf):
148
156
  no_click: Var[bool] | bool | None = None,
149
157
  no_drag: Var[bool] | bool | None = None,
150
158
  no_keyboard: Var[bool] | bool | None = None,
151
- style: Style | None = None,
159
+ style: Sequence[Mapping[str, Any]]
160
+ | Mapping[str, Any]
161
+ | Var[Mapping[str, Any]]
162
+ | Breakpoints
163
+ | None = None,
152
164
  key: Any | None = None,
153
165
  id: Any | None = None,
154
166
  class_name: Any | None = None,
@@ -214,7 +226,11 @@ class StyledUpload(Upload):
214
226
  no_click: Var[bool] | bool | None = None,
215
227
  no_drag: Var[bool] | bool | None = None,
216
228
  no_keyboard: Var[bool] | bool | None = None,
217
- style: Style | None = None,
229
+ style: Sequence[Mapping[str, Any]]
230
+ | Mapping[str, Any]
231
+ | Var[Mapping[str, Any]]
232
+ | Breakpoints
233
+ | None = None,
218
234
  key: Any | None = None,
219
235
  id: Any | None = None,
220
236
  class_name: Any | None = None,
@@ -280,7 +296,11 @@ class UploadNamespace(ComponentNamespace):
280
296
  no_click: Var[bool] | bool | None = None,
281
297
  no_drag: Var[bool] | bool | None = None,
282
298
  no_keyboard: Var[bool] | bool | None = None,
283
- style: Style | None = None,
299
+ style: Sequence[Mapping[str, Any]]
300
+ | Mapping[str, Any]
301
+ | Var[Mapping[str, Any]]
302
+ | Breakpoints
303
+ | None = None,
284
304
  key: Any | None = None,
285
305
  id: Any | None = None,
286
306
  class_name: Any | None = None,
@@ -4,13 +4,13 @@
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
6
  import dataclasses
7
- from typing import Any, ClassVar, Literal, Optional, overload
7
+ from typing import Any, ClassVar, Literal, Mapping, Optional, Sequence, overload
8
8
 
9
9
  from reflex.components.component import Component, ComponentNamespace
10
+ from reflex.components.core.breakpoints import Breakpoints
10
11
  from reflex.components.markdown.markdown import MarkdownComponentMap
11
12
  from reflex.constants.colors import Color
12
13
  from reflex.event import EventType
13
- from reflex.style import Style
14
14
  from reflex.vars.base import Var
15
15
 
16
16
  LiteralCodeLanguage = Literal[
@@ -929,7 +929,11 @@ class CodeBlock(Component, MarkdownComponentMap):
929
929
  code_tag_props: Var[dict[str, str]] | dict[str, str] | None = None,
930
930
  can_copy: bool | None = None,
931
931
  copy_button: Component | bool | None = None,
932
- style: Style | None = None,
932
+ style: Sequence[Mapping[str, Any]]
933
+ | Mapping[str, Any]
934
+ | Var[Mapping[str, Any]]
935
+ | Breakpoints
936
+ | None = None,
933
937
  key: Any | None = None,
934
938
  id: Any | None = None,
935
939
  class_name: Any | None = None,
@@ -1564,7 +1568,11 @@ class CodeblockNamespace(ComponentNamespace):
1564
1568
  code_tag_props: Var[dict[str, str]] | dict[str, str] | None = None,
1565
1569
  can_copy: bool | None = None,
1566
1570
  copy_button: Component | bool | None = None,
1567
- style: Style | None = None,
1571
+ style: Sequence[Mapping[str, Any]]
1572
+ | Mapping[str, Any]
1573
+ | Var[Mapping[str, Any]]
1574
+ | Breakpoints
1575
+ | None = None,
1568
1576
  key: Any | None = None,
1569
1577
  id: Any | None = None,
1570
1578
  class_name: Any | None = None,