reflex 0.7.0a4__py3-none-any.whl → 0.7.1__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 (128) hide show
  1. reflex/.templates/jinja/web/package.json.jinja2 +7 -1
  2. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +3 -1
  3. reflex/__init__.py +1 -0
  4. reflex/__init__.pyi +1 -0
  5. reflex/app.py +269 -86
  6. reflex/base.py +4 -10
  7. reflex/compiler/compiler.py +46 -12
  8. reflex/compiler/templates.py +1 -2
  9. reflex/compiler/utils.py +23 -14
  10. reflex/components/base/bare.py +109 -16
  11. reflex/components/component.py +179 -124
  12. reflex/components/core/__init__.py +1 -0
  13. reflex/components/core/__init__.pyi +1 -0
  14. reflex/components/core/auto_scroll.py +114 -0
  15. reflex/components/core/auto_scroll.pyi +284 -0
  16. reflex/components/core/banner.py +40 -9
  17. reflex/components/core/banner.pyi +400 -87
  18. reflex/components/core/breakpoints.py +1 -1
  19. reflex/components/core/cond.py +0 -8
  20. reflex/components/core/foreach.py +12 -2
  21. reflex/components/core/html.pyi +200 -19
  22. reflex/components/core/match.py +4 -4
  23. reflex/components/core/sticky.py +4 -30
  24. reflex/components/core/sticky.pyi +874 -90
  25. reflex/components/core/upload.py +3 -5
  26. reflex/components/core/upload.pyi +2 -4
  27. reflex/components/datadisplay/code.py +36 -10
  28. reflex/components/datadisplay/code.pyi +1 -1
  29. reflex/components/datadisplay/dataeditor.py +1 -3
  30. reflex/components/datadisplay/dataeditor.pyi +1 -3
  31. reflex/components/el/elements/base.py +95 -17
  32. reflex/components/el/elements/base.pyi +278 -19
  33. reflex/components/el/elements/forms.py +124 -102
  34. reflex/components/el/elements/forms.pyi +2787 -365
  35. reflex/components/el/elements/inline.py +24 -15
  36. reflex/components/el/elements/inline.pyi +5655 -546
  37. reflex/components/el/elements/media.py +79 -95
  38. reflex/components/el/elements/media.pyi +5167 -565
  39. reflex/components/el/elements/metadata.py +19 -17
  40. reflex/components/el/elements/metadata.pyi +841 -89
  41. reflex/components/el/elements/other.py +3 -5
  42. reflex/components/el/elements/other.pyi +1404 -137
  43. reflex/components/el/elements/scripts.py +10 -13
  44. reflex/components/el/elements/scripts.pyi +634 -65
  45. reflex/components/el/elements/sectioning.pyi +3001 -286
  46. reflex/components/el/elements/tables.py +14 -35
  47. reflex/components/el/elements/tables.pyi +2029 -218
  48. reflex/components/el/elements/typography.py +10 -13
  49. reflex/components/el/elements/typography.pyi +3014 -297
  50. reflex/components/lucide/icon.py +22 -6
  51. reflex/components/markdown/markdown.py +30 -10
  52. reflex/components/markdown/markdown.pyi +3 -2
  53. reflex/components/plotly/plotly.py +1 -3
  54. reflex/components/plotly/plotly.pyi +1 -3
  55. reflex/components/radix/primitives/form.pyi +624 -93
  56. reflex/components/radix/themes/color_mode.py +1 -1
  57. reflex/components/radix/themes/color_mode.pyi +213 -31
  58. reflex/components/radix/themes/components/alert_dialog.pyi +199 -18
  59. reflex/components/radix/themes/components/badge.pyi +199 -18
  60. reflex/components/radix/themes/components/button.pyi +213 -31
  61. reflex/components/radix/themes/components/callout.pyi +1000 -95
  62. reflex/components/radix/themes/components/card.pyi +199 -18
  63. reflex/components/radix/themes/components/context_menu.py +79 -1
  64. reflex/components/radix/themes/components/context_menu.pyi +320 -1
  65. reflex/components/radix/themes/components/dialog.pyi +199 -18
  66. reflex/components/radix/themes/components/hover_card.pyi +199 -18
  67. reflex/components/radix/themes/components/icon_button.pyi +213 -31
  68. reflex/components/radix/themes/components/inset.pyi +199 -18
  69. reflex/components/radix/themes/components/popover.pyi +199 -18
  70. reflex/components/radix/themes/components/table.pyi +1437 -154
  71. reflex/components/radix/themes/components/text_area.py +2 -2
  72. reflex/components/radix/themes/components/text_area.pyi +201 -20
  73. reflex/components/radix/themes/components/text_field.py +1 -1
  74. reflex/components/radix/themes/components/text_field.pyi +444 -88
  75. reflex/components/radix/themes/layout/box.pyi +200 -19
  76. reflex/components/radix/themes/layout/center.pyi +199 -18
  77. reflex/components/radix/themes/layout/container.pyi +199 -18
  78. reflex/components/radix/themes/layout/flex.pyi +199 -18
  79. reflex/components/radix/themes/layout/grid.pyi +199 -18
  80. reflex/components/radix/themes/layout/list.pyi +604 -57
  81. reflex/components/radix/themes/layout/section.pyi +199 -18
  82. reflex/components/radix/themes/layout/spacer.pyi +199 -18
  83. reflex/components/radix/themes/layout/stack.pyi +597 -54
  84. reflex/components/radix/themes/typography/blockquote.pyi +200 -19
  85. reflex/components/radix/themes/typography/code.pyi +199 -18
  86. reflex/components/radix/themes/typography/heading.pyi +199 -18
  87. reflex/components/radix/themes/typography/link.pyi +238 -28
  88. reflex/components/radix/themes/typography/text.pyi +1394 -127
  89. reflex/components/react_player/react_player.py +1 -1
  90. reflex/components/react_player/react_player.pyi +1 -3
  91. reflex/components/sonner/toast.py +41 -12
  92. reflex/components/sonner/toast.pyi +20 -6
  93. reflex/components/tags/iter_tag.py +4 -0
  94. reflex/components/tags/tag.py +3 -3
  95. reflex/config.py +187 -28
  96. reflex/constants/__init__.py +2 -0
  97. reflex/constants/base.py +6 -0
  98. reflex/constants/compiler.py +9 -0
  99. reflex/constants/event.py +1 -0
  100. reflex/constants/installer.py +8 -5
  101. reflex/constants/utils.py +1 -3
  102. reflex/event.py +7 -16
  103. reflex/experimental/layout.pyi +597 -54
  104. reflex/py.typed +0 -0
  105. reflex/reflex.py +44 -48
  106. reflex/state.py +49 -44
  107. reflex/style.py +15 -22
  108. reflex/testing.py +2 -0
  109. reflex/utils/build.py +12 -0
  110. reflex/utils/console.py +4 -0
  111. reflex/utils/decorator.py +25 -0
  112. reflex/utils/exec.py +92 -34
  113. reflex/utils/format.py +35 -6
  114. reflex/utils/path_ops.py +32 -1
  115. reflex/utils/prerequisites.py +45 -35
  116. reflex/utils/processes.py +12 -13
  117. reflex/utils/serializers.py +20 -43
  118. reflex/utils/telemetry.py +4 -15
  119. reflex/utils/types.py +36 -66
  120. reflex/vars/base.py +53 -76
  121. reflex/vars/function.py +17 -5
  122. reflex/vars/number.py +1 -1
  123. reflex/vars/sequence.py +80 -4
  124. {reflex-0.7.0a4.dist-info → reflex-0.7.1.dist-info}/METADATA +4 -5
  125. {reflex-0.7.0a4.dist-info → reflex-0.7.1.dist-info}/RECORD +128 -124
  126. {reflex-0.7.0a4.dist-info → reflex-0.7.1.dist-info}/LICENSE +0 -0
  127. {reflex-0.7.0a4.dist-info → reflex-0.7.1.dist-info}/WHEEL +0 -0
  128. {reflex-0.7.0a4.dist-info → reflex-0.7.1.dist-info}/entry_points.txt +0 -0
@@ -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, Dict, Optional, Union, overload
6
+ from typing import Any, Dict, Literal, Optional, Union, overload
7
7
 
8
8
  from reflex.components.el.elements.typography import Div
9
9
  from reflex.event import EventType
@@ -19,30 +19,211 @@ class Html(Div):
19
19
  dangerouslySetInnerHTML: Optional[
20
20
  Union[Dict[str, str], Var[Dict[str, str]]]
21
21
  ] = None,
22
- access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
22
+ access_key: Optional[Union[Var[str], str]] = None,
23
23
  auto_capitalize: Optional[
24
- Union[Var[Union[bool, int, str]], bool, int, str]
24
+ Union[
25
+ Literal["characters", "none", "off", "on", "sentences", "words"],
26
+ Var[Literal["characters", "none", "off", "on", "sentences", "words"]],
27
+ ]
25
28
  ] = None,
26
29
  content_editable: Optional[
27
- Union[Var[Union[bool, int, str]], bool, int, str]
30
+ Union[
31
+ Literal["inherit", "plaintext-only", False, True],
32
+ Var[Literal["inherit", "plaintext-only", False, True]],
33
+ ]
28
34
  ] = None,
29
- context_menu: Optional[
30
- Union[Var[Union[bool, int, str]], bool, int, str]
31
- ] = None,
32
- dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
33
- draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
35
+ context_menu: Optional[Union[Var[str], str]] = None,
36
+ dir: Optional[Union[Var[str], str]] = None,
37
+ draggable: Optional[Union[Var[bool], bool]] = None,
34
38
  enter_key_hint: Optional[
35
- Union[Var[Union[bool, int, str]], bool, int, str]
39
+ Union[
40
+ Literal["done", "enter", "go", "next", "previous", "search", "send"],
41
+ Var[
42
+ Literal["done", "enter", "go", "next", "previous", "search", "send"]
43
+ ],
44
+ ]
45
+ ] = None,
46
+ hidden: Optional[Union[Var[bool], bool]] = None,
47
+ input_mode: Optional[
48
+ Union[
49
+ Literal[
50
+ "decimal",
51
+ "email",
52
+ "none",
53
+ "numeric",
54
+ "search",
55
+ "tel",
56
+ "text",
57
+ "url",
58
+ ],
59
+ Var[
60
+ Literal[
61
+ "decimal",
62
+ "email",
63
+ "none",
64
+ "numeric",
65
+ "search",
66
+ "tel",
67
+ "text",
68
+ "url",
69
+ ]
70
+ ],
71
+ ]
72
+ ] = None,
73
+ item_prop: Optional[Union[Var[str], str]] = None,
74
+ lang: Optional[Union[Var[str], str]] = None,
75
+ role: Optional[
76
+ Union[
77
+ Literal[
78
+ "alert",
79
+ "alertdialog",
80
+ "application",
81
+ "article",
82
+ "banner",
83
+ "button",
84
+ "cell",
85
+ "checkbox",
86
+ "columnheader",
87
+ "combobox",
88
+ "complementary",
89
+ "contentinfo",
90
+ "definition",
91
+ "dialog",
92
+ "directory",
93
+ "document",
94
+ "feed",
95
+ "figure",
96
+ "form",
97
+ "grid",
98
+ "gridcell",
99
+ "group",
100
+ "heading",
101
+ "img",
102
+ "link",
103
+ "list",
104
+ "listbox",
105
+ "listitem",
106
+ "log",
107
+ "main",
108
+ "marquee",
109
+ "math",
110
+ "menu",
111
+ "menubar",
112
+ "menuitem",
113
+ "menuitemcheckbox",
114
+ "menuitemradio",
115
+ "navigation",
116
+ "none",
117
+ "note",
118
+ "option",
119
+ "presentation",
120
+ "progressbar",
121
+ "radio",
122
+ "radiogroup",
123
+ "region",
124
+ "row",
125
+ "rowgroup",
126
+ "rowheader",
127
+ "scrollbar",
128
+ "search",
129
+ "searchbox",
130
+ "separator",
131
+ "slider",
132
+ "spinbutton",
133
+ "status",
134
+ "switch",
135
+ "tab",
136
+ "table",
137
+ "tablist",
138
+ "tabpanel",
139
+ "term",
140
+ "textbox",
141
+ "timer",
142
+ "toolbar",
143
+ "tooltip",
144
+ "tree",
145
+ "treegrid",
146
+ "treeitem",
147
+ ],
148
+ Var[
149
+ Literal[
150
+ "alert",
151
+ "alertdialog",
152
+ "application",
153
+ "article",
154
+ "banner",
155
+ "button",
156
+ "cell",
157
+ "checkbox",
158
+ "columnheader",
159
+ "combobox",
160
+ "complementary",
161
+ "contentinfo",
162
+ "definition",
163
+ "dialog",
164
+ "directory",
165
+ "document",
166
+ "feed",
167
+ "figure",
168
+ "form",
169
+ "grid",
170
+ "gridcell",
171
+ "group",
172
+ "heading",
173
+ "img",
174
+ "link",
175
+ "list",
176
+ "listbox",
177
+ "listitem",
178
+ "log",
179
+ "main",
180
+ "marquee",
181
+ "math",
182
+ "menu",
183
+ "menubar",
184
+ "menuitem",
185
+ "menuitemcheckbox",
186
+ "menuitemradio",
187
+ "navigation",
188
+ "none",
189
+ "note",
190
+ "option",
191
+ "presentation",
192
+ "progressbar",
193
+ "radio",
194
+ "radiogroup",
195
+ "region",
196
+ "row",
197
+ "rowgroup",
198
+ "rowheader",
199
+ "scrollbar",
200
+ "search",
201
+ "searchbox",
202
+ "separator",
203
+ "slider",
204
+ "spinbutton",
205
+ "status",
206
+ "switch",
207
+ "tab",
208
+ "table",
209
+ "tablist",
210
+ "tabpanel",
211
+ "term",
212
+ "textbox",
213
+ "timer",
214
+ "toolbar",
215
+ "tooltip",
216
+ "tree",
217
+ "treegrid",
218
+ "treeitem",
219
+ ]
220
+ ],
221
+ ]
36
222
  ] = None,
37
- hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
38
- input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
39
- item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
40
- lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
41
- role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
42
- slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
43
- spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
44
- tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
45
- title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
223
+ slot: Optional[Union[Var[str], str]] = None,
224
+ spell_check: Optional[Union[Var[bool], bool]] = None,
225
+ tab_index: Optional[Union[Var[int], int]] = None,
226
+ title: Optional[Union[Var[str], str]] = None,
46
227
  style: Optional[Style] = None,
47
228
  key: Optional[Any] = None,
48
229
  id: Optional[Any] = None,
@@ -178,9 +178,9 @@ class Match(MemoizationLeaf):
178
178
  first_case_return = match_cases[0][-1]
179
179
  return_type = type(first_case_return)
180
180
 
181
- if types._isinstance(first_case_return, BaseComponent):
181
+ if isinstance(first_case_return, BaseComponent):
182
182
  return_type = BaseComponent
183
- elif types._isinstance(first_case_return, Var):
183
+ elif isinstance(first_case_return, Var):
184
184
  return_type = Var
185
185
 
186
186
  for index, case in enumerate(match_cases):
@@ -228,8 +228,8 @@ class Match(MemoizationLeaf):
228
228
 
229
229
  # Validate the match cases (as well as the default case) to have Var return types.
230
230
  if any(
231
- case for case in match_cases if not types._isinstance(case[-1], Var)
232
- ) or not types._isinstance(default, Var):
231
+ case for case in match_cases if not isinstance(case[-1], Var)
232
+ ) or not isinstance(default, Var):
233
233
  raise ValueError("Return types of match cases should be Vars.")
234
234
 
235
235
  return Var(
@@ -2,14 +2,12 @@
2
2
 
3
3
  from reflex.components.component import ComponentNamespace
4
4
  from reflex.components.core.colors import color
5
- from reflex.components.core.cond import color_mode_cond, cond
6
- from reflex.components.core.responsive import tablet_and_desktop
5
+ from reflex.components.core.cond import color_mode_cond
6
+ from reflex.components.core.responsive import desktop_only
7
7
  from reflex.components.el.elements.inline import A
8
8
  from reflex.components.el.elements.media import Path, Rect, Svg
9
9
  from reflex.components.radix.themes.typography.text import Text
10
- from reflex.experimental.client_state import ClientStateVar
11
10
  from reflex.style import Style
12
- from reflex.vars.base import Var, VarData
13
11
 
14
12
 
15
13
  class StickyLogo(Svg):
@@ -87,7 +85,7 @@ class StickyBadge(A):
87
85
  """
88
86
  return super().create(
89
87
  StickyLogo.create(),
90
- tablet_and_desktop(StickyLabel.create()),
88
+ desktop_only(StickyLabel.create()),
91
89
  href="https://reflex.dev",
92
90
  target="_blank",
93
91
  width="auto",
@@ -102,36 +100,12 @@ class StickyBadge(A):
102
100
  Returns:
103
101
  The style of the component.
104
102
  """
105
- is_localhost_cs = ClientStateVar.create(
106
- "is_localhost",
107
- default=True,
108
- global_ref=False,
109
- )
110
- localhost_hostnames = Var.create(
111
- ["localhost", "127.0.0.1", "[::1]"]
112
- ).guess_type()
113
- is_localhost_expr = localhost_hostnames.contains(
114
- Var("window.location.hostname", _var_type=str).guess_type(),
115
- )
116
- check_is_localhost = Var(
117
- f"useEffect(({is_localhost_cs}) => {is_localhost_cs.set}({is_localhost_expr}), [])",
118
- _var_data=VarData(
119
- imports={"react": "useEffect"},
120
- ),
121
- )
122
- is_localhost = is_localhost_cs.value._replace(
123
- merge_var_data=VarData.merge(
124
- check_is_localhost._get_all_var_data(),
125
- VarData(hooks={str(check_is_localhost): None}),
126
- ),
127
- )
128
103
  return Style(
129
104
  {
130
105
  "position": "fixed",
131
106
  "bottom": "1rem",
132
107
  "right": "1rem",
133
- # Do not show the badge on localhost.
134
- "display": cond(is_localhost, "none", "flex"),
108
+ "display": "flex",
135
109
  "flex-direction": "row",
136
110
  "gap": "0.375rem",
137
111
  "align-items": "center",