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
@@ -5,10 +5,10 @@
5
5
  # ------------------------------------------------------
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
7
7
 
8
+ from reflex.components.base.fragment import Fragment
8
9
  from reflex.components.component import Component
9
10
  from reflex.components.el.elements.typography import Div
10
11
  from reflex.components.lucide.icon import Icon
11
- from reflex.components.sonner.toast import Toaster, ToastProps
12
12
  from reflex.constants.compiler import CompileVars
13
13
  from reflex.event import EventType
14
14
  from reflex.style import Style
@@ -41,48 +41,13 @@ class WebsocketTargetURL(Var):
41
41
 
42
42
  def default_connection_error() -> list[str | Var | Component]: ...
43
43
 
44
- class ConnectionToaster(Toaster):
44
+ class ConnectionToaster(Fragment):
45
45
  def add_hooks(self) -> list[str | Var]: ...
46
46
  @overload
47
47
  @classmethod
48
48
  def create( # type: ignore
49
49
  cls,
50
50
  *children,
51
- theme: Optional[Union[Var[str], str]] = None,
52
- rich_colors: Optional[Union[Var[bool], bool]] = None,
53
- expand: Optional[Union[Var[bool], bool]] = None,
54
- visible_toasts: Optional[Union[Var[int], int]] = None,
55
- position: Optional[
56
- Union[
57
- Literal[
58
- "bottom-center",
59
- "bottom-left",
60
- "bottom-right",
61
- "top-center",
62
- "top-left",
63
- "top-right",
64
- ],
65
- Var[
66
- Literal[
67
- "bottom-center",
68
- "bottom-left",
69
- "bottom-right",
70
- "top-center",
71
- "top-left",
72
- "top-right",
73
- ]
74
- ],
75
- ]
76
- ] = None,
77
- close_button: Optional[Union[Var[bool], bool]] = None,
78
- offset: Optional[Union[Var[str], str]] = None,
79
- dir: Optional[Union[Var[str], str]] = None,
80
- hotkey: Optional[Union[Var[str], str]] = None,
81
- invert: Optional[Union[Var[bool], bool]] = None,
82
- toast_options: Optional[Union[ToastProps, Var[ToastProps]]] = None,
83
- gap: Optional[Union[Var[int], int]] = None,
84
- loading_icon: Optional[Union[Icon, Var[Icon]]] = None,
85
- pause_when_page_is_hidden: Optional[Union[Var[bool], bool]] = None,
86
51
  style: Optional[Style] = None,
87
52
  key: Optional[Any] = None,
88
53
  id: Optional[Any] = None,
@@ -110,20 +75,6 @@ class ConnectionToaster(Toaster):
110
75
 
111
76
  Args:
112
77
  *children: The children of the component.
113
- theme: the theme of the toast
114
- rich_colors: whether to show rich colors
115
- expand: whether to expand the toast
116
- visible_toasts: the number of toasts that are currently visible
117
- position: the position of the toast
118
- close_button: whether to show the close button
119
- offset: offset of the toast
120
- dir: directionality of the toast (default: ltr)
121
- hotkey: Keyboard shortcut that will move focus to the toaster area.
122
- invert: Dark toasts in light mode and vice versa.
123
- toast_options: These will act as default options for all toasts. See toast() for all available options.
124
- gap: Gap between toasts when expanded
125
- loading_icon: Changes the default loading icon
126
- pause_when_page_is_hidden: Pauses toast timers when the page is hidden, e.g., when the tab is backgrounded, the browser is minimized, or the OS is locked.
127
78
  style: The style of the component.
128
79
  key: A unique key for the component.
129
80
  id: The id for the component.
@@ -271,30 +222,211 @@ class ConnectionPulser(Div):
271
222
  def create( # type: ignore
272
223
  cls,
273
224
  *children,
274
- access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
225
+ access_key: Optional[Union[Var[str], str]] = None,
275
226
  auto_capitalize: Optional[
276
- Union[Var[Union[bool, int, str]], bool, int, str]
227
+ Union[
228
+ Literal["characters", "none", "off", "on", "sentences", "words"],
229
+ Var[Literal["characters", "none", "off", "on", "sentences", "words"]],
230
+ ]
277
231
  ] = None,
278
232
  content_editable: Optional[
279
- Union[Var[Union[bool, int, str]], bool, int, str]
280
- ] = None,
281
- context_menu: Optional[
282
- Union[Var[Union[bool, int, str]], bool, int, str]
233
+ Union[
234
+ Literal["inherit", "plaintext-only", False, True],
235
+ Var[Literal["inherit", "plaintext-only", False, True]],
236
+ ]
283
237
  ] = None,
284
- dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
285
- draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
238
+ context_menu: Optional[Union[Var[str], str]] = None,
239
+ dir: Optional[Union[Var[str], str]] = None,
240
+ draggable: Optional[Union[Var[bool], bool]] = None,
286
241
  enter_key_hint: Optional[
287
- Union[Var[Union[bool, int, str]], bool, int, str]
242
+ Union[
243
+ Literal["done", "enter", "go", "next", "previous", "search", "send"],
244
+ Var[
245
+ Literal["done", "enter", "go", "next", "previous", "search", "send"]
246
+ ],
247
+ ]
248
+ ] = None,
249
+ hidden: Optional[Union[Var[bool], bool]] = None,
250
+ input_mode: Optional[
251
+ Union[
252
+ Literal[
253
+ "decimal",
254
+ "email",
255
+ "none",
256
+ "numeric",
257
+ "search",
258
+ "tel",
259
+ "text",
260
+ "url",
261
+ ],
262
+ Var[
263
+ Literal[
264
+ "decimal",
265
+ "email",
266
+ "none",
267
+ "numeric",
268
+ "search",
269
+ "tel",
270
+ "text",
271
+ "url",
272
+ ]
273
+ ],
274
+ ]
275
+ ] = None,
276
+ item_prop: Optional[Union[Var[str], str]] = None,
277
+ lang: Optional[Union[Var[str], str]] = None,
278
+ role: Optional[
279
+ Union[
280
+ Literal[
281
+ "alert",
282
+ "alertdialog",
283
+ "application",
284
+ "article",
285
+ "banner",
286
+ "button",
287
+ "cell",
288
+ "checkbox",
289
+ "columnheader",
290
+ "combobox",
291
+ "complementary",
292
+ "contentinfo",
293
+ "definition",
294
+ "dialog",
295
+ "directory",
296
+ "document",
297
+ "feed",
298
+ "figure",
299
+ "form",
300
+ "grid",
301
+ "gridcell",
302
+ "group",
303
+ "heading",
304
+ "img",
305
+ "link",
306
+ "list",
307
+ "listbox",
308
+ "listitem",
309
+ "log",
310
+ "main",
311
+ "marquee",
312
+ "math",
313
+ "menu",
314
+ "menubar",
315
+ "menuitem",
316
+ "menuitemcheckbox",
317
+ "menuitemradio",
318
+ "navigation",
319
+ "none",
320
+ "note",
321
+ "option",
322
+ "presentation",
323
+ "progressbar",
324
+ "radio",
325
+ "radiogroup",
326
+ "region",
327
+ "row",
328
+ "rowgroup",
329
+ "rowheader",
330
+ "scrollbar",
331
+ "search",
332
+ "searchbox",
333
+ "separator",
334
+ "slider",
335
+ "spinbutton",
336
+ "status",
337
+ "switch",
338
+ "tab",
339
+ "table",
340
+ "tablist",
341
+ "tabpanel",
342
+ "term",
343
+ "textbox",
344
+ "timer",
345
+ "toolbar",
346
+ "tooltip",
347
+ "tree",
348
+ "treegrid",
349
+ "treeitem",
350
+ ],
351
+ Var[
352
+ Literal[
353
+ "alert",
354
+ "alertdialog",
355
+ "application",
356
+ "article",
357
+ "banner",
358
+ "button",
359
+ "cell",
360
+ "checkbox",
361
+ "columnheader",
362
+ "combobox",
363
+ "complementary",
364
+ "contentinfo",
365
+ "definition",
366
+ "dialog",
367
+ "directory",
368
+ "document",
369
+ "feed",
370
+ "figure",
371
+ "form",
372
+ "grid",
373
+ "gridcell",
374
+ "group",
375
+ "heading",
376
+ "img",
377
+ "link",
378
+ "list",
379
+ "listbox",
380
+ "listitem",
381
+ "log",
382
+ "main",
383
+ "marquee",
384
+ "math",
385
+ "menu",
386
+ "menubar",
387
+ "menuitem",
388
+ "menuitemcheckbox",
389
+ "menuitemradio",
390
+ "navigation",
391
+ "none",
392
+ "note",
393
+ "option",
394
+ "presentation",
395
+ "progressbar",
396
+ "radio",
397
+ "radiogroup",
398
+ "region",
399
+ "row",
400
+ "rowgroup",
401
+ "rowheader",
402
+ "scrollbar",
403
+ "search",
404
+ "searchbox",
405
+ "separator",
406
+ "slider",
407
+ "spinbutton",
408
+ "status",
409
+ "switch",
410
+ "tab",
411
+ "table",
412
+ "tablist",
413
+ "tabpanel",
414
+ "term",
415
+ "textbox",
416
+ "timer",
417
+ "toolbar",
418
+ "tooltip",
419
+ "tree",
420
+ "treegrid",
421
+ "treeitem",
422
+ ]
423
+ ],
424
+ ]
288
425
  ] = None,
289
- hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
290
- input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
291
- item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
292
- lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
293
- role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
294
- slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
295
- spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
296
- tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
297
- title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
426
+ slot: Optional[Union[Var[str], str]] = None,
427
+ spell_check: Optional[Union[Var[bool], bool]] = None,
428
+ tab_index: Optional[Union[Var[int], int]] = None,
429
+ title: Optional[Union[Var[str], str]] = None,
298
430
  style: Optional[Style] = None,
299
431
  key: Optional[Any] = None,
300
432
  id: Optional[Any] = None,
@@ -356,30 +488,211 @@ class BackendDisabled(Div):
356
488
  def create( # type: ignore
357
489
  cls,
358
490
  *children,
359
- access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
491
+ access_key: Optional[Union[Var[str], str]] = None,
360
492
  auto_capitalize: Optional[
361
- Union[Var[Union[bool, int, str]], bool, int, str]
493
+ Union[
494
+ Literal["characters", "none", "off", "on", "sentences", "words"],
495
+ Var[Literal["characters", "none", "off", "on", "sentences", "words"]],
496
+ ]
362
497
  ] = None,
363
498
  content_editable: Optional[
364
- Union[Var[Union[bool, int, str]], bool, int, str]
365
- ] = None,
366
- context_menu: Optional[
367
- Union[Var[Union[bool, int, str]], bool, int, str]
499
+ Union[
500
+ Literal["inherit", "plaintext-only", False, True],
501
+ Var[Literal["inherit", "plaintext-only", False, True]],
502
+ ]
368
503
  ] = None,
369
- dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
370
- draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
504
+ context_menu: Optional[Union[Var[str], str]] = None,
505
+ dir: Optional[Union[Var[str], str]] = None,
506
+ draggable: Optional[Union[Var[bool], bool]] = None,
371
507
  enter_key_hint: Optional[
372
- Union[Var[Union[bool, int, str]], bool, int, str]
508
+ Union[
509
+ Literal["done", "enter", "go", "next", "previous", "search", "send"],
510
+ Var[
511
+ Literal["done", "enter", "go", "next", "previous", "search", "send"]
512
+ ],
513
+ ]
514
+ ] = None,
515
+ hidden: Optional[Union[Var[bool], bool]] = None,
516
+ input_mode: Optional[
517
+ Union[
518
+ Literal[
519
+ "decimal",
520
+ "email",
521
+ "none",
522
+ "numeric",
523
+ "search",
524
+ "tel",
525
+ "text",
526
+ "url",
527
+ ],
528
+ Var[
529
+ Literal[
530
+ "decimal",
531
+ "email",
532
+ "none",
533
+ "numeric",
534
+ "search",
535
+ "tel",
536
+ "text",
537
+ "url",
538
+ ]
539
+ ],
540
+ ]
541
+ ] = None,
542
+ item_prop: Optional[Union[Var[str], str]] = None,
543
+ lang: Optional[Union[Var[str], str]] = None,
544
+ role: Optional[
545
+ Union[
546
+ Literal[
547
+ "alert",
548
+ "alertdialog",
549
+ "application",
550
+ "article",
551
+ "banner",
552
+ "button",
553
+ "cell",
554
+ "checkbox",
555
+ "columnheader",
556
+ "combobox",
557
+ "complementary",
558
+ "contentinfo",
559
+ "definition",
560
+ "dialog",
561
+ "directory",
562
+ "document",
563
+ "feed",
564
+ "figure",
565
+ "form",
566
+ "grid",
567
+ "gridcell",
568
+ "group",
569
+ "heading",
570
+ "img",
571
+ "link",
572
+ "list",
573
+ "listbox",
574
+ "listitem",
575
+ "log",
576
+ "main",
577
+ "marquee",
578
+ "math",
579
+ "menu",
580
+ "menubar",
581
+ "menuitem",
582
+ "menuitemcheckbox",
583
+ "menuitemradio",
584
+ "navigation",
585
+ "none",
586
+ "note",
587
+ "option",
588
+ "presentation",
589
+ "progressbar",
590
+ "radio",
591
+ "radiogroup",
592
+ "region",
593
+ "row",
594
+ "rowgroup",
595
+ "rowheader",
596
+ "scrollbar",
597
+ "search",
598
+ "searchbox",
599
+ "separator",
600
+ "slider",
601
+ "spinbutton",
602
+ "status",
603
+ "switch",
604
+ "tab",
605
+ "table",
606
+ "tablist",
607
+ "tabpanel",
608
+ "term",
609
+ "textbox",
610
+ "timer",
611
+ "toolbar",
612
+ "tooltip",
613
+ "tree",
614
+ "treegrid",
615
+ "treeitem",
616
+ ],
617
+ Var[
618
+ Literal[
619
+ "alert",
620
+ "alertdialog",
621
+ "application",
622
+ "article",
623
+ "banner",
624
+ "button",
625
+ "cell",
626
+ "checkbox",
627
+ "columnheader",
628
+ "combobox",
629
+ "complementary",
630
+ "contentinfo",
631
+ "definition",
632
+ "dialog",
633
+ "directory",
634
+ "document",
635
+ "feed",
636
+ "figure",
637
+ "form",
638
+ "grid",
639
+ "gridcell",
640
+ "group",
641
+ "heading",
642
+ "img",
643
+ "link",
644
+ "list",
645
+ "listbox",
646
+ "listitem",
647
+ "log",
648
+ "main",
649
+ "marquee",
650
+ "math",
651
+ "menu",
652
+ "menubar",
653
+ "menuitem",
654
+ "menuitemcheckbox",
655
+ "menuitemradio",
656
+ "navigation",
657
+ "none",
658
+ "note",
659
+ "option",
660
+ "presentation",
661
+ "progressbar",
662
+ "radio",
663
+ "radiogroup",
664
+ "region",
665
+ "row",
666
+ "rowgroup",
667
+ "rowheader",
668
+ "scrollbar",
669
+ "search",
670
+ "searchbox",
671
+ "separator",
672
+ "slider",
673
+ "spinbutton",
674
+ "status",
675
+ "switch",
676
+ "tab",
677
+ "table",
678
+ "tablist",
679
+ "tabpanel",
680
+ "term",
681
+ "textbox",
682
+ "timer",
683
+ "toolbar",
684
+ "tooltip",
685
+ "tree",
686
+ "treegrid",
687
+ "treeitem",
688
+ ]
689
+ ],
690
+ ]
373
691
  ] = None,
374
- hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
375
- input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
376
- item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
377
- lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
378
- role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
379
- slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
380
- spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
381
- tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
382
- title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
692
+ slot: Optional[Union[Var[str], str]] = None,
693
+ spell_check: Optional[Union[Var[bool], bool]] = None,
694
+ tab_index: Optional[Union[Var[int], int]] = None,
695
+ title: Optional[Union[Var[str], str]] = None,
383
696
  style: Optional[Style] = None,
384
697
  key: Optional[Any] = None,
385
698
  id: Optional[Any] = None,
@@ -18,7 +18,7 @@ def set_breakpoints(values: Tuple[str, str, str, str, str]):
18
18
  breakpoints_values.extend(values)
19
19
 
20
20
 
21
- K = TypeVar("K")
21
+ K = TypeVar("K", bound=str)
22
22
  V = TypeVar("V")
23
23
 
24
24
 
@@ -61,14 +61,6 @@ class Cond(MemoizationLeaf):
61
61
  )
62
62
  )
63
63
 
64
- def _get_props_imports(self):
65
- """Get the imports needed for component's props.
66
-
67
- Returns:
68
- The imports for the component's props of the component.
69
- """
70
- return []
71
-
72
64
  def _render(self) -> Tag:
73
65
  return CondTag(
74
66
  cond=self.cond,
@@ -54,9 +54,10 @@ class Foreach(Component):
54
54
  TypeError: If the render function is a ComponentState.
55
55
  UntypedVarError: If the iterable is of type Any without a type annotation.
56
56
  """
57
- from reflex.vars.object import ObjectVar
57
+ from reflex.vars import ArrayVar, ObjectVar, StringVar
58
+
59
+ iterable = LiteralVar.create(iterable).guess_type()
58
60
 
59
- iterable = LiteralVar.create(iterable)
60
61
  if iterable._var_type == Any:
61
62
  raise ForeachVarError(
62
63
  f"Could not foreach over var `{iterable!s}` of type Any. "
@@ -75,6 +76,15 @@ class Foreach(Component):
75
76
  if isinstance(iterable, ObjectVar):
76
77
  iterable = iterable.entries()
77
78
 
79
+ if isinstance(iterable, StringVar):
80
+ iterable = iterable.split()
81
+
82
+ if not isinstance(iterable, ArrayVar):
83
+ raise ForeachVarError(
84
+ f"Could not foreach over var `{iterable!s}` of type {iterable._var_type}. "
85
+ "See https://reflex.dev/docs/library/dynamic-rendering/foreach/"
86
+ )
87
+
78
88
  component = cls(
79
89
  iterable=iterable,
80
90
  render_fn=render_fn,