reflex 0.7.8a1__py3-none-any.whl → 0.7.9a2__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 (44) hide show
  1. reflex/.templates/jinja/web/tailwind.config.js.jinja2 +65 -31
  2. reflex/.templates/web/utils/state.js +11 -1
  3. reflex/app.py +191 -87
  4. reflex/app_mixins/lifespan.py +2 -2
  5. reflex/compiler/compiler.py +31 -4
  6. reflex/components/base/body.pyi +3 -197
  7. reflex/components/base/link.pyi +4 -392
  8. reflex/components/base/meta.pyi +28 -608
  9. reflex/components/component.py +39 -57
  10. reflex/components/core/upload.py +8 -0
  11. reflex/components/dynamic.py +9 -1
  12. reflex/components/el/elements/metadata.pyi +0 -1
  13. reflex/components/markdown/markdown.py +0 -21
  14. reflex/components/markdown/markdown.pyi +2 -2
  15. reflex/components/radix/primitives/accordion.py +1 -1
  16. reflex/components/radix/primitives/form.py +1 -1
  17. reflex/components/radix/primitives/progress.py +1 -1
  18. reflex/components/radix/primitives/slider.py +1 -1
  19. reflex/components/radix/themes/color_mode.py +1 -1
  20. reflex/components/radix/themes/color_mode.pyi +1 -1
  21. reflex/components/radix/themes/layout/list.pyi +2 -391
  22. reflex/components/recharts/recharts.py +2 -2
  23. reflex/components/sonner/toast.py +1 -1
  24. reflex/config.py +4 -7
  25. reflex/constants/base.py +21 -0
  26. reflex/constants/installer.py +6 -6
  27. reflex/custom_components/custom_components.py +67 -64
  28. reflex/event.py +2 -0
  29. reflex/page.py +8 -0
  30. reflex/reflex.py +277 -265
  31. reflex/testing.py +30 -24
  32. reflex/utils/codespaces.py +6 -2
  33. reflex/utils/console.py +4 -3
  34. reflex/utils/exec.py +60 -24
  35. reflex/utils/format.py +17 -2
  36. reflex/utils/prerequisites.py +43 -30
  37. reflex/utils/processes.py +6 -6
  38. reflex/utils/types.py +11 -6
  39. reflex/vars/base.py +19 -1
  40. {reflex-0.7.8a1.dist-info → reflex-0.7.9a2.dist-info}/METADATA +6 -9
  41. {reflex-0.7.8a1.dist-info → reflex-0.7.9a2.dist-info}/RECORD +44 -44
  42. {reflex-0.7.8a1.dist-info → reflex-0.7.9a2.dist-info}/WHEEL +0 -0
  43. {reflex-0.7.8a1.dist-info → reflex-0.7.9a2.dist-info}/entry_points.txt +0 -0
  44. {reflex-0.7.8a1.dist-info → reflex-0.7.9a2.dist-info}/licenses/LICENSE +0 -0
@@ -6,9 +6,8 @@
6
6
  from collections.abc import Iterable, Mapping, Sequence
7
7
  from typing import Any, Literal, overload
8
8
 
9
- from reflex.components.component import ComponentNamespace
9
+ from reflex.components.component import Component, ComponentNamespace
10
10
  from reflex.components.core.breakpoints import Breakpoints
11
- from reflex.components.el.elements.base import BaseHTML
12
11
  from reflex.components.el.elements.typography import Li, Ol, Ul
13
12
  from reflex.components.markdown.markdown import MarkdownComponentMap
14
13
  from reflex.event import EventType
@@ -32,7 +31,7 @@ LiteralListStyleTypeOrdered = Literal[
32
31
  "katakana",
33
32
  ]
34
33
 
35
- class BaseList(BaseHTML, MarkdownComponentMap):
34
+ class BaseList(Component, MarkdownComponentMap):
36
35
  @overload
37
36
  @classmethod
38
37
  def create( # type: ignore
@@ -76,184 +75,6 @@ class BaseList(BaseHTML, MarkdownComponentMap):
76
75
  ]
77
76
  | None = None,
78
77
  items: Iterable | Var[Iterable] | None = None,
79
- access_key: Var[str] | str | None = None,
80
- auto_capitalize: Literal[
81
- "characters", "none", "off", "on", "sentences", "words"
82
- ]
83
- | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
84
- | None = None,
85
- content_editable: Literal["inherit", "plaintext-only", False, True]
86
- | Var[Literal["inherit", "plaintext-only", False, True]]
87
- | None = None,
88
- context_menu: Var[str] | str | None = None,
89
- dir: Var[str] | str | None = None,
90
- draggable: Var[bool] | bool | None = None,
91
- enter_key_hint: Literal[
92
- "done", "enter", "go", "next", "previous", "search", "send"
93
- ]
94
- | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
95
- | None = None,
96
- hidden: Var[bool] | bool | None = None,
97
- input_mode: Literal[
98
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
99
- ]
100
- | Var[
101
- Literal[
102
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
103
- ]
104
- ]
105
- | None = None,
106
- item_prop: Var[str] | str | None = None,
107
- lang: Var[str] | str | None = None,
108
- role: Literal[
109
- "alert",
110
- "alertdialog",
111
- "application",
112
- "article",
113
- "banner",
114
- "button",
115
- "cell",
116
- "checkbox",
117
- "columnheader",
118
- "combobox",
119
- "complementary",
120
- "contentinfo",
121
- "definition",
122
- "dialog",
123
- "directory",
124
- "document",
125
- "feed",
126
- "figure",
127
- "form",
128
- "grid",
129
- "gridcell",
130
- "group",
131
- "heading",
132
- "img",
133
- "link",
134
- "list",
135
- "listbox",
136
- "listitem",
137
- "log",
138
- "main",
139
- "marquee",
140
- "math",
141
- "menu",
142
- "menubar",
143
- "menuitem",
144
- "menuitemcheckbox",
145
- "menuitemradio",
146
- "navigation",
147
- "none",
148
- "note",
149
- "option",
150
- "presentation",
151
- "progressbar",
152
- "radio",
153
- "radiogroup",
154
- "region",
155
- "row",
156
- "rowgroup",
157
- "rowheader",
158
- "scrollbar",
159
- "search",
160
- "searchbox",
161
- "separator",
162
- "slider",
163
- "spinbutton",
164
- "status",
165
- "switch",
166
- "tab",
167
- "table",
168
- "tablist",
169
- "tabpanel",
170
- "term",
171
- "textbox",
172
- "timer",
173
- "toolbar",
174
- "tooltip",
175
- "tree",
176
- "treegrid",
177
- "treeitem",
178
- ]
179
- | Var[
180
- Literal[
181
- "alert",
182
- "alertdialog",
183
- "application",
184
- "article",
185
- "banner",
186
- "button",
187
- "cell",
188
- "checkbox",
189
- "columnheader",
190
- "combobox",
191
- "complementary",
192
- "contentinfo",
193
- "definition",
194
- "dialog",
195
- "directory",
196
- "document",
197
- "feed",
198
- "figure",
199
- "form",
200
- "grid",
201
- "gridcell",
202
- "group",
203
- "heading",
204
- "img",
205
- "link",
206
- "list",
207
- "listbox",
208
- "listitem",
209
- "log",
210
- "main",
211
- "marquee",
212
- "math",
213
- "menu",
214
- "menubar",
215
- "menuitem",
216
- "menuitemcheckbox",
217
- "menuitemradio",
218
- "navigation",
219
- "none",
220
- "note",
221
- "option",
222
- "presentation",
223
- "progressbar",
224
- "radio",
225
- "radiogroup",
226
- "region",
227
- "row",
228
- "rowgroup",
229
- "rowheader",
230
- "scrollbar",
231
- "search",
232
- "searchbox",
233
- "separator",
234
- "slider",
235
- "spinbutton",
236
- "status",
237
- "switch",
238
- "tab",
239
- "table",
240
- "tablist",
241
- "tabpanel",
242
- "term",
243
- "textbox",
244
- "timer",
245
- "toolbar",
246
- "tooltip",
247
- "tree",
248
- "treegrid",
249
- "treeitem",
250
- ]
251
- ]
252
- | None = None,
253
- slot: Var[str] | str | None = None,
254
- spell_check: Var[bool] | bool | None = None,
255
- tab_index: Var[int] | int | None = None,
256
- title: Var[str] | str | None = None,
257
78
  style: Sequence[Mapping[str, Any]]
258
79
  | Mapping[str, Any]
259
80
  | Var[Mapping[str, Any]]
@@ -287,22 +108,6 @@ class BaseList(BaseHTML, MarkdownComponentMap):
287
108
  *children: The children of the component.
288
109
  list_style_type: The style of the list. Default to "none".
289
110
  items: A list of items to add to the list.
290
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
291
- auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
292
- content_editable: Indicates whether the element's content is editable.
293
- context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
294
- dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
295
- draggable: Defines whether the element can be dragged.
296
- enter_key_hint: Hints what media types the media element is able to play.
297
- hidden: Defines whether the element is hidden.
298
- input_mode: Defines the type of the element.
299
- item_prop: Defines the name of the element for metadata purposes.
300
- lang: Defines the language used in the element.
301
- role: Defines the role of the element.
302
- slot: Assigns a slot in a shadow DOM shadow tree to an element.
303
- spell_check: Defines whether the element may be checked for spelling errors.
304
- tab_index: Defines the position of the current element in the tabbing order.
305
- title: Defines a tooltip for the element.
306
111
  style: The style of the component.
307
112
  key: A unique key for the component.
308
113
  id: The id for the component.
@@ -1184,184 +989,6 @@ class List(ComponentNamespace):
1184
989
  ]
1185
990
  | None = None,
1186
991
  items: Iterable | Var[Iterable] | None = None,
1187
- access_key: Var[str] | str | None = None,
1188
- auto_capitalize: Literal[
1189
- "characters", "none", "off", "on", "sentences", "words"
1190
- ]
1191
- | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
1192
- | None = None,
1193
- content_editable: Literal["inherit", "plaintext-only", False, True]
1194
- | Var[Literal["inherit", "plaintext-only", False, True]]
1195
- | None = None,
1196
- context_menu: Var[str] | str | None = None,
1197
- dir: Var[str] | str | None = None,
1198
- draggable: Var[bool] | bool | None = None,
1199
- enter_key_hint: Literal[
1200
- "done", "enter", "go", "next", "previous", "search", "send"
1201
- ]
1202
- | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
1203
- | None = None,
1204
- hidden: Var[bool] | bool | None = None,
1205
- input_mode: Literal[
1206
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
1207
- ]
1208
- | Var[
1209
- Literal[
1210
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
1211
- ]
1212
- ]
1213
- | None = None,
1214
- item_prop: Var[str] | str | None = None,
1215
- lang: Var[str] | str | None = None,
1216
- role: Literal[
1217
- "alert",
1218
- "alertdialog",
1219
- "application",
1220
- "article",
1221
- "banner",
1222
- "button",
1223
- "cell",
1224
- "checkbox",
1225
- "columnheader",
1226
- "combobox",
1227
- "complementary",
1228
- "contentinfo",
1229
- "definition",
1230
- "dialog",
1231
- "directory",
1232
- "document",
1233
- "feed",
1234
- "figure",
1235
- "form",
1236
- "grid",
1237
- "gridcell",
1238
- "group",
1239
- "heading",
1240
- "img",
1241
- "link",
1242
- "list",
1243
- "listbox",
1244
- "listitem",
1245
- "log",
1246
- "main",
1247
- "marquee",
1248
- "math",
1249
- "menu",
1250
- "menubar",
1251
- "menuitem",
1252
- "menuitemcheckbox",
1253
- "menuitemradio",
1254
- "navigation",
1255
- "none",
1256
- "note",
1257
- "option",
1258
- "presentation",
1259
- "progressbar",
1260
- "radio",
1261
- "radiogroup",
1262
- "region",
1263
- "row",
1264
- "rowgroup",
1265
- "rowheader",
1266
- "scrollbar",
1267
- "search",
1268
- "searchbox",
1269
- "separator",
1270
- "slider",
1271
- "spinbutton",
1272
- "status",
1273
- "switch",
1274
- "tab",
1275
- "table",
1276
- "tablist",
1277
- "tabpanel",
1278
- "term",
1279
- "textbox",
1280
- "timer",
1281
- "toolbar",
1282
- "tooltip",
1283
- "tree",
1284
- "treegrid",
1285
- "treeitem",
1286
- ]
1287
- | Var[
1288
- Literal[
1289
- "alert",
1290
- "alertdialog",
1291
- "application",
1292
- "article",
1293
- "banner",
1294
- "button",
1295
- "cell",
1296
- "checkbox",
1297
- "columnheader",
1298
- "combobox",
1299
- "complementary",
1300
- "contentinfo",
1301
- "definition",
1302
- "dialog",
1303
- "directory",
1304
- "document",
1305
- "feed",
1306
- "figure",
1307
- "form",
1308
- "grid",
1309
- "gridcell",
1310
- "group",
1311
- "heading",
1312
- "img",
1313
- "link",
1314
- "list",
1315
- "listbox",
1316
- "listitem",
1317
- "log",
1318
- "main",
1319
- "marquee",
1320
- "math",
1321
- "menu",
1322
- "menubar",
1323
- "menuitem",
1324
- "menuitemcheckbox",
1325
- "menuitemradio",
1326
- "navigation",
1327
- "none",
1328
- "note",
1329
- "option",
1330
- "presentation",
1331
- "progressbar",
1332
- "radio",
1333
- "radiogroup",
1334
- "region",
1335
- "row",
1336
- "rowgroup",
1337
- "rowheader",
1338
- "scrollbar",
1339
- "search",
1340
- "searchbox",
1341
- "separator",
1342
- "slider",
1343
- "spinbutton",
1344
- "status",
1345
- "switch",
1346
- "tab",
1347
- "table",
1348
- "tablist",
1349
- "tabpanel",
1350
- "term",
1351
- "textbox",
1352
- "timer",
1353
- "toolbar",
1354
- "tooltip",
1355
- "tree",
1356
- "treegrid",
1357
- "treeitem",
1358
- ]
1359
- ]
1360
- | None = None,
1361
- slot: Var[str] | str | None = None,
1362
- spell_check: Var[bool] | bool | None = None,
1363
- tab_index: Var[int] | int | None = None,
1364
- title: Var[str] | str | None = None,
1365
992
  style: Sequence[Mapping[str, Any]]
1366
993
  | Mapping[str, Any]
1367
994
  | Var[Mapping[str, Any]]
@@ -1395,22 +1022,6 @@ class List(ComponentNamespace):
1395
1022
  *children: The children of the component.
1396
1023
  list_style_type: The style of the list. Default to "none".
1397
1024
  items: A list of items to add to the list.
1398
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
1399
- auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
1400
- content_editable: Indicates whether the element's content is editable.
1401
- context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
1402
- dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
1403
- draggable: Defines whether the element can be dragged.
1404
- enter_key_hint: Hints what media types the media element is able to play.
1405
- hidden: Defines whether the element is hidden.
1406
- input_mode: Defines the type of the element.
1407
- item_prop: Defines the name of the element for metadata purposes.
1408
- lang: Defines the language used in the element.
1409
- role: Defines the role of the element.
1410
- slot: Assigns a slot in a shadow DOM shadow tree to an element.
1411
- spell_check: Defines whether the element may be checked for spelling errors.
1412
- tab_index: Defines the position of the current element in the tabbing order.
1413
- title: Defines a tooltip for the element.
1414
1025
  style: The style of the component.
1415
1026
  key: A unique key for the component.
1416
1027
  id: The id for the component.
@@ -8,7 +8,7 @@ from reflex.components.component import Component, MemoizationLeaf, NoSSRCompone
8
8
  class Recharts(Component):
9
9
  """A component that wraps a recharts lib."""
10
10
 
11
- library = "recharts@2.15.1"
11
+ library = "recharts@2.15.3"
12
12
 
13
13
  def _get_style(self) -> dict:
14
14
  return {"wrapperStyle": self.style}
@@ -17,7 +17,7 @@ class Recharts(Component):
17
17
  class RechartsCharts(NoSSRComponent, MemoizationLeaf):
18
18
  """A component that wraps a recharts lib."""
19
19
 
20
- library = "recharts@2.15.1"
20
+ library = "recharts@2.15.3"
21
21
 
22
22
 
23
23
  LiteralAnimationEasing = Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]
@@ -172,7 +172,7 @@ class ToastProps(PropsBase, NoExtrasAllowedProps):
172
172
  class Toaster(Component):
173
173
  """A Toaster Component for displaying toast notifications."""
174
174
 
175
- library: str | None = "sonner@2.0.1"
175
+ library: str | None = "sonner@2.0.3"
176
176
 
177
177
  tag = "Toaster"
178
178
 
reflex/config.py CHANGED
@@ -392,7 +392,7 @@ class EnvVar(Generic[T]):
392
392
  The environment variable value.
393
393
  """
394
394
  env_value = os.getenv(self.name, None)
395
- if env_value is not None:
395
+ if env_value and env_value.strip():
396
396
  return self.interpret(env_value)
397
397
  return None
398
398
 
@@ -402,7 +402,7 @@ class EnvVar(Generic[T]):
402
402
  Returns:
403
403
  True if the environment variable is set.
404
404
  """
405
- return self.name in os.environ
405
+ return bool(os.getenv(self.name, "").strip())
406
406
 
407
407
  def get(self) -> T:
408
408
  """Get the interpreted environment variable value or the default value if not set.
@@ -695,9 +695,6 @@ class EnvironmentVariables:
695
695
  # The port to run the backend on.
696
696
  REFLEX_BACKEND_PORT: EnvVar[int | None] = env_var(None)
697
697
 
698
- # Reflex internal env to reload the config.
699
- RELOAD_CONFIG: EnvVar[bool] = env_var(False, internal=True)
700
-
701
698
  # If this env var is set to "yes", App.compile will be a no-op
702
699
  REFLEX_SKIP_COMPILE: EnvVar[bool] = env_var(False, internal=True)
703
700
 
@@ -906,7 +903,7 @@ class Config(Base):
906
903
  # Set the log level for this process
907
904
  env_loglevel = os.environ.get("LOGLEVEL")
908
905
  if env_loglevel is not None:
909
- env_loglevel = LogLevel(env_loglevel)
906
+ env_loglevel = LogLevel(env_loglevel.lower())
910
907
  if env_loglevel or self.loglevel != LogLevel.DEFAULT:
911
908
  console.set_log_level(env_loglevel or self.loglevel)
912
909
 
@@ -969,7 +966,7 @@ class Config(Base):
969
966
  env_var = os.environ.get(key.upper())
970
967
 
971
968
  # If the env var is set, override the config value.
972
- if env_var is not None:
969
+ if env_var and env_var.strip():
973
970
  # Interpret the value.
974
971
  value = interpret_env_var_value(
975
972
  env_var, true_type_for_pydantic_field(field), field.name
reflex/constants/base.py CHANGED
@@ -7,6 +7,7 @@ from enum import Enum
7
7
  from importlib import metadata
8
8
  from pathlib import Path
9
9
  from types import SimpleNamespace
10
+ from typing import Literal
10
11
 
11
12
  from platformdirs import PlatformDirs
12
13
 
@@ -219,6 +220,9 @@ class ColorMode(SimpleNamespace):
219
220
  SET = "setColorMode"
220
221
 
221
222
 
223
+ LITERAL_ENV = Literal["dev", "prod"]
224
+
225
+
222
226
  # Env modes
223
227
  class Env(str, Enum):
224
228
  """The environment modes."""
@@ -238,6 +242,23 @@ class LogLevel(str, Enum):
238
242
  ERROR = "error"
239
243
  CRITICAL = "critical"
240
244
 
245
+ @classmethod
246
+ def from_string(cls, level: str | None) -> LogLevel | None:
247
+ """Convert a string to a log level.
248
+
249
+ Args:
250
+ level: The log level as a string.
251
+
252
+ Returns:
253
+ The log level.
254
+ """
255
+ if not level:
256
+ return None
257
+ try:
258
+ return LogLevel[level.upper()]
259
+ except KeyError:
260
+ return None
261
+
241
262
  def __le__(self, other: LogLevel) -> bool:
242
263
  """Compare log levels.
243
264
 
@@ -14,7 +14,7 @@ class Bun(SimpleNamespace):
14
14
  """Bun constants."""
15
15
 
16
16
  # The Bun version.
17
- VERSION = "1.2.8"
17
+ VERSION = "1.2.10"
18
18
 
19
19
  # Min Bun Version
20
20
  MIN_VERSION = "1.2.8"
@@ -75,7 +75,7 @@ fetch-retries=0
75
75
 
76
76
 
77
77
  def _determine_nextjs_version() -> str:
78
- default_version = "15.3.0"
78
+ default_version = "15.3.1"
79
79
  if (version := os.getenv("NEXTJS_VERSION")) and version != default_version:
80
80
  from reflex.utils import console
81
81
 
@@ -101,13 +101,13 @@ class PackageJson(SimpleNamespace):
101
101
 
102
102
  DEPENDENCIES = {
103
103
  "@emotion/react": "11.14.0",
104
- "axios": "1.8.3",
104
+ "axios": "1.8.4",
105
105
  "json5": "2.2.3",
106
106
  "next": _determine_nextjs_version(),
107
107
  "next-sitemap": "4.2.3",
108
108
  "next-themes": "0.4.6",
109
- "react": "19.0.0",
110
- "react-dom": "19.0.0",
109
+ "react": "19.1.0",
110
+ "react-dom": "19.1.0",
111
111
  "react-focus-lock": "2.13.6",
112
112
  "socket.io-client": "4.8.1",
113
113
  "universal-cookie": "7.2.2",
@@ -119,5 +119,5 @@ class PackageJson(SimpleNamespace):
119
119
  }
120
120
  OVERRIDES = {
121
121
  # This should always match the `react` version in DEPENDENCIES for recharts compatibility.
122
- "react-is": "19.0.0"
122
+ "react-is": "19.1.0"
123
123
  }