reflex 0.7.0a4__py3-none-any.whl → 0.7.1a1__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 (127) hide show
  1. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +3 -1
  2. reflex/__init__.py +1 -0
  3. reflex/__init__.pyi +1 -0
  4. reflex/app.py +251 -68
  5. reflex/base.py +4 -10
  6. reflex/compiler/compiler.py +46 -12
  7. reflex/compiler/templates.py +1 -2
  8. reflex/compiler/utils.py +23 -14
  9. reflex/components/base/bare.py +109 -16
  10. reflex/components/component.py +179 -124
  11. reflex/components/core/__init__.py +1 -0
  12. reflex/components/core/__init__.pyi +1 -0
  13. reflex/components/core/auto_scroll.py +111 -0
  14. reflex/components/core/auto_scroll.pyi +284 -0
  15. reflex/components/core/banner.py +35 -5
  16. reflex/components/core/banner.pyi +398 -36
  17. reflex/components/core/breakpoints.py +1 -1
  18. reflex/components/core/cond.py +0 -8
  19. reflex/components/core/foreach.py +12 -2
  20. reflex/components/core/html.pyi +200 -19
  21. reflex/components/core/match.py +4 -4
  22. reflex/components/core/sticky.py +4 -30
  23. reflex/components/core/sticky.pyi +874 -90
  24. reflex/components/core/upload.py +3 -5
  25. reflex/components/core/upload.pyi +2 -4
  26. reflex/components/datadisplay/code.py +36 -10
  27. reflex/components/datadisplay/code.pyi +1 -1
  28. reflex/components/datadisplay/dataeditor.py +1 -3
  29. reflex/components/datadisplay/dataeditor.pyi +1 -3
  30. reflex/components/el/elements/base.py +95 -17
  31. reflex/components/el/elements/base.pyi +278 -19
  32. reflex/components/el/elements/forms.py +124 -102
  33. reflex/components/el/elements/forms.pyi +2787 -365
  34. reflex/components/el/elements/inline.py +24 -15
  35. reflex/components/el/elements/inline.pyi +5655 -546
  36. reflex/components/el/elements/media.py +79 -95
  37. reflex/components/el/elements/media.pyi +5167 -565
  38. reflex/components/el/elements/metadata.py +19 -17
  39. reflex/components/el/elements/metadata.pyi +841 -89
  40. reflex/components/el/elements/other.py +3 -5
  41. reflex/components/el/elements/other.pyi +1404 -137
  42. reflex/components/el/elements/scripts.py +10 -13
  43. reflex/components/el/elements/scripts.pyi +634 -65
  44. reflex/components/el/elements/sectioning.pyi +3001 -286
  45. reflex/components/el/elements/tables.py +14 -35
  46. reflex/components/el/elements/tables.pyi +2029 -218
  47. reflex/components/el/elements/typography.py +10 -13
  48. reflex/components/el/elements/typography.pyi +3014 -297
  49. reflex/components/lucide/icon.py +22 -6
  50. reflex/components/markdown/markdown.py +30 -10
  51. reflex/components/markdown/markdown.pyi +3 -2
  52. reflex/components/plotly/plotly.py +1 -3
  53. reflex/components/plotly/plotly.pyi +1 -3
  54. reflex/components/radix/primitives/form.pyi +624 -93
  55. reflex/components/radix/themes/color_mode.py +1 -1
  56. reflex/components/radix/themes/color_mode.pyi +213 -31
  57. reflex/components/radix/themes/components/alert_dialog.pyi +199 -18
  58. reflex/components/radix/themes/components/badge.pyi +199 -18
  59. reflex/components/radix/themes/components/button.pyi +213 -31
  60. reflex/components/radix/themes/components/callout.pyi +1000 -95
  61. reflex/components/radix/themes/components/card.pyi +199 -18
  62. reflex/components/radix/themes/components/context_menu.py +79 -1
  63. reflex/components/radix/themes/components/context_menu.pyi +320 -1
  64. reflex/components/radix/themes/components/dialog.pyi +199 -18
  65. reflex/components/radix/themes/components/hover_card.pyi +199 -18
  66. reflex/components/radix/themes/components/icon_button.pyi +213 -31
  67. reflex/components/radix/themes/components/inset.pyi +199 -18
  68. reflex/components/radix/themes/components/popover.pyi +199 -18
  69. reflex/components/radix/themes/components/table.pyi +1437 -154
  70. reflex/components/radix/themes/components/text_area.py +2 -2
  71. reflex/components/radix/themes/components/text_area.pyi +201 -20
  72. reflex/components/radix/themes/components/text_field.py +1 -1
  73. reflex/components/radix/themes/components/text_field.pyi +444 -88
  74. reflex/components/radix/themes/layout/box.pyi +200 -19
  75. reflex/components/radix/themes/layout/center.pyi +199 -18
  76. reflex/components/radix/themes/layout/container.pyi +199 -18
  77. reflex/components/radix/themes/layout/flex.pyi +199 -18
  78. reflex/components/radix/themes/layout/grid.pyi +199 -18
  79. reflex/components/radix/themes/layout/list.pyi +604 -57
  80. reflex/components/radix/themes/layout/section.pyi +199 -18
  81. reflex/components/radix/themes/layout/spacer.pyi +199 -18
  82. reflex/components/radix/themes/layout/stack.pyi +597 -54
  83. reflex/components/radix/themes/typography/blockquote.pyi +200 -19
  84. reflex/components/radix/themes/typography/code.pyi +199 -18
  85. reflex/components/radix/themes/typography/heading.pyi +199 -18
  86. reflex/components/radix/themes/typography/link.pyi +238 -28
  87. reflex/components/radix/themes/typography/text.pyi +1394 -127
  88. reflex/components/react_player/react_player.py +1 -1
  89. reflex/components/react_player/react_player.pyi +1 -3
  90. reflex/components/sonner/toast.py +19 -1
  91. reflex/components/sonner/toast.pyi +10 -1
  92. reflex/components/tags/iter_tag.py +4 -0
  93. reflex/components/tags/tag.py +3 -3
  94. reflex/config.py +187 -28
  95. reflex/constants/__init__.py +2 -0
  96. reflex/constants/base.py +6 -0
  97. reflex/constants/compiler.py +9 -0
  98. reflex/constants/event.py +1 -0
  99. reflex/constants/installer.py +4 -5
  100. reflex/constants/utils.py +1 -3
  101. reflex/event.py +7 -16
  102. reflex/experimental/layout.pyi +597 -54
  103. reflex/py.typed +0 -0
  104. reflex/reflex.py +44 -48
  105. reflex/state.py +49 -44
  106. reflex/style.py +6 -4
  107. reflex/testing.py +2 -0
  108. reflex/utils/build.py +12 -0
  109. reflex/utils/console.py +4 -0
  110. reflex/utils/decorator.py +25 -0
  111. reflex/utils/exec.py +92 -34
  112. reflex/utils/format.py +35 -6
  113. reflex/utils/path_ops.py +32 -1
  114. reflex/utils/prerequisites.py +54 -10
  115. reflex/utils/processes.py +12 -13
  116. reflex/utils/serializers.py +20 -43
  117. reflex/utils/telemetry.py +4 -15
  118. reflex/utils/types.py +36 -66
  119. reflex/vars/base.py +53 -76
  120. reflex/vars/function.py +17 -5
  121. reflex/vars/number.py +1 -1
  122. reflex/vars/sequence.py +80 -4
  123. {reflex-0.7.0a4.dist-info → reflex-0.7.1a1.dist-info}/METADATA +4 -5
  124. {reflex-0.7.0a4.dist-info → reflex-0.7.1a1.dist-info}/RECORD +127 -123
  125. {reflex-0.7.0a4.dist-info → reflex-0.7.1a1.dist-info}/LICENSE +0 -0
  126. {reflex-0.7.0a4.dist-info → reflex-0.7.1a1.dist-info}/WHEEL +0 -0
  127. {reflex-0.7.0a4.dist-info → reflex-0.7.1a1.dist-info}/entry_points.txt +0 -0
@@ -1,8 +1,9 @@
1
1
  """Media classes."""
2
2
 
3
- from typing import Any, Union
3
+ from typing import Any, Literal, Union
4
4
 
5
5
  from reflex import Component, ComponentNamespace
6
+ from reflex.components.el.elements.inline import ReferrerPolicy
6
7
  from reflex.constants.colors import Color
7
8
  from reflex.vars.base import Var
8
9
 
@@ -15,37 +16,37 @@ class Area(BaseHTML):
15
16
  tag = "area"
16
17
 
17
18
  # Alternate text for the area, used for accessibility
18
- alt: Var[Union[str, int, bool]]
19
+ alt: Var[str]
19
20
 
20
21
  # Coordinates to define the shape of the area
21
- coords: Var[Union[str, int, bool]]
22
+ coords: Var[str]
22
23
 
23
24
  # Specifies that the target will be downloaded when clicked
24
- download: Var[Union[str, int, bool]]
25
+ download: Var[Union[str, bool]]
25
26
 
26
27
  # Hyperlink reference for the area
27
- href: Var[Union[str, int, bool]]
28
+ href: Var[str]
28
29
 
29
30
  # Language of the linked resource
30
- href_lang: Var[Union[str, int, bool]]
31
+ href_lang: Var[str]
31
32
 
32
33
  # Specifies what media/device the linked resource is optimized for
33
- media: Var[Union[str, int, bool]]
34
-
35
- # A list of URLs to be notified if the user follows the hyperlink
36
- ping: Var[Union[str, int, bool]]
34
+ media: Var[str]
37
35
 
38
36
  # Specifies which referrer information to send with the link
39
- referrer_policy: Var[Union[str, int, bool]]
37
+ referrer_policy: Var[ReferrerPolicy]
40
38
 
41
39
  # Specifies the relationship of the target object to the link object
42
- rel: Var[Union[str, int, bool]]
40
+ rel: Var[str]
43
41
 
44
42
  # Defines the shape of the area (rectangle, circle, polygon)
45
- shape: Var[Union[str, int, bool]]
43
+ shape: Var[str]
46
44
 
47
45
  # Specifies where to open the linked document
48
- target: Var[Union[str, int, bool]]
46
+ target: Var[str]
47
+
48
+
49
+ CrossOrigin = Literal["anonymous", "use-credentials", ""]
49
50
 
50
51
 
51
52
  class Audio(BaseHTML):
@@ -54,28 +55,29 @@ class Audio(BaseHTML):
54
55
  tag = "audio"
55
56
 
56
57
  # Specifies that the audio will start playing as soon as it is ready
57
- auto_play: Var[Union[str, int, bool]]
58
-
59
- # Represents the time range of the buffered media
60
- buffered: Var[Union[str, int, bool]]
58
+ auto_play: Var[bool]
61
59
 
62
60
  # Displays the standard audio controls
63
- controls: Var[Union[str, int, bool]]
61
+ controls: Var[bool]
64
62
 
65
63
  # Configures the CORS requests for the element
66
- cross_origin: Var[Union[str, int, bool]]
64
+ cross_origin: Var[CrossOrigin]
67
65
 
68
66
  # Specifies that the audio will loop
69
- loop: Var[Union[str, int, bool]]
67
+ loop: Var[bool]
70
68
 
71
69
  # Indicates whether the audio is muted by default
72
- muted: Var[Union[str, int, bool]]
70
+ muted: Var[bool]
73
71
 
74
72
  # Specifies how the audio file should be preloaded
75
- preload: Var[Union[str, int, bool]]
73
+ preload: Var[str]
76
74
 
77
75
  # URL of the audio to play
78
- src: Var[Union[str, int, bool]]
76
+ src: Var[str]
77
+
78
+
79
+ ImageDecoding = Literal["async", "auto", "sync"]
80
+ ImageLoading = Literal["eager", "lazy"]
79
81
 
80
82
 
81
83
  class Img(BaseHTML):
@@ -83,41 +85,32 @@ class Img(BaseHTML):
83
85
 
84
86
  tag = "img"
85
87
 
86
- # Image alignment with respect to its surrounding elements
87
- align: Var[Union[str, int, bool]]
88
-
89
88
  # Alternative text for the image
90
- alt: Var[Union[str, int, bool]]
89
+ alt: Var[str]
91
90
 
92
91
  # Configures the CORS requests for the image
93
- cross_origin: Var[Union[str, int, bool]]
92
+ cross_origin: Var[CrossOrigin]
94
93
 
95
94
  # How the image should be decoded
96
- decoding: Var[Union[str, int, bool]]
97
-
98
- # Specifies an intrinsic size for the image
99
- intrinsicsize: Var[Union[str, int, bool]]
100
-
101
- # Whether the image is a server-side image map
102
- ismap: Var[Union[str, int, bool]]
95
+ decoding: Var[ImageDecoding]
103
96
 
104
97
  # Specifies the loading behavior of the image
105
- loading: Var[Union[str, int, bool]]
98
+ loading: Var[ImageLoading]
106
99
 
107
100
  # Referrer policy for the image
108
- referrer_policy: Var[Union[str, int, bool]]
101
+ referrer_policy: Var[ReferrerPolicy]
109
102
 
110
103
  # Sizes of the image for different layouts
111
- sizes: Var[Union[str, int, bool]]
104
+ sizes: Var[str]
112
105
 
113
106
  # URL of the image to display
114
107
  src: Var[Any]
115
108
 
116
109
  # A set of source sizes and URLs for responsive images
117
- src_set: Var[Union[str, int, bool]]
110
+ src_set: Var[str]
118
111
 
119
112
  # The name of the map to use with the image
120
- use_map: Var[Union[str, int, bool]]
113
+ use_map: Var[str]
121
114
 
122
115
  @classmethod
123
116
  def create(cls, *children, **props) -> Component:
@@ -143,7 +136,7 @@ class Map(BaseHTML):
143
136
  tag = "map"
144
137
 
145
138
  # Name of the map, referenced by the 'usemap' attribute in 'img' and 'object' elements
146
- name: Var[Union[str, int, bool]]
139
+ name: Var[str]
147
140
 
148
141
 
149
142
  class Track(BaseHTML):
@@ -152,19 +145,19 @@ class Track(BaseHTML):
152
145
  tag = "track"
153
146
 
154
147
  # Indicates that the track should be enabled unless the user's preferences indicate otherwise
155
- default: Var[Union[str, int, bool]]
148
+ default: Var[bool]
156
149
 
157
150
  # Specifies the kind of text track
158
- kind: Var[Union[str, int, bool]]
151
+ kind: Var[str]
159
152
 
160
153
  # Title of the text track, used by the browser when listing available text tracks
161
- label: Var[Union[str, int, bool]]
154
+ label: Var[str]
162
155
 
163
156
  # URL of the track file
164
- src: Var[Union[str, int, bool]]
157
+ src: Var[str]
165
158
 
166
159
  # Language of the track text data
167
- src_lang: Var[Union[str, int, bool]]
160
+ src_lang: Var[str]
168
161
 
169
162
 
170
163
  class Video(BaseHTML):
@@ -173,34 +166,31 @@ class Video(BaseHTML):
173
166
  tag = "video"
174
167
 
175
168
  # Specifies that the video will start playing as soon as it is ready
176
- auto_play: Var[Union[str, int, bool]]
177
-
178
- # Represents the time range of the buffered media
179
- buffered: Var[Union[str, int, bool]]
169
+ auto_play: Var[bool]
180
170
 
181
171
  # Displays the standard video controls
182
- controls: Var[Union[str, int, bool]]
172
+ controls: Var[bool]
183
173
 
184
174
  # Configures the CORS requests for the video
185
- cross_origin: Var[Union[str, int, bool]]
175
+ cross_origin: Var[CrossOrigin]
186
176
 
187
177
  # Specifies that the video will loop
188
- loop: Var[Union[str, int, bool]]
178
+ loop: Var[bool]
189
179
 
190
180
  # Indicates whether the video is muted by default
191
- muted: Var[Union[str, int, bool]]
181
+ muted: Var[bool]
192
182
 
193
183
  # Indicates that the video should play 'inline', inside its element's playback area
194
- plays_inline: Var[Union[str, int, bool]]
184
+ plays_inline: Var[bool]
195
185
 
196
186
  # URL of an image to show while the video is downloading, or until the user hits the play button
197
- poster: Var[Union[str, int, bool]]
187
+ poster: Var[str]
198
188
 
199
189
  # Specifies how the video file should be preloaded
200
- preload: Var[Union[str, int, bool]]
190
+ preload: Var[str]
201
191
 
202
192
  # URL of the video to play
203
- src: Var[Union[str, int, bool]]
193
+ src: Var[str]
204
194
 
205
195
 
206
196
  class Embed(BaseHTML):
@@ -209,10 +199,10 @@ class Embed(BaseHTML):
209
199
  tag = "embed"
210
200
 
211
201
  # URL of the embedded content
212
- src: Var[Union[str, int, bool]]
202
+ src: Var[str]
213
203
 
214
204
  # Media type of the embedded content
215
- type: Var[Union[str, int, bool]]
205
+ type: Var[str]
216
206
 
217
207
 
218
208
  class Iframe(BaseHTML):
@@ -220,32 +210,26 @@ class Iframe(BaseHTML):
220
210
 
221
211
  tag = "iframe"
222
212
 
223
- # Alignment of the iframe within the page or surrounding elements
224
- align: Var[Union[str, int, bool]]
225
-
226
213
  # Permissions policy for the iframe
227
- allow: Var[Union[str, int, bool]]
228
-
229
- # Content Security Policy to apply to the iframe's content
230
- csp: Var[Union[str, int, bool]]
214
+ allow: Var[str]
231
215
 
232
216
  # Specifies the loading behavior of the iframe
233
- loading: Var[Union[str, int, bool]]
217
+ loading: Var[Literal["eager", "lazy"]]
234
218
 
235
219
  # Name of the iframe, used as a target for hyperlinks and forms
236
- name: Var[Union[str, int, bool]]
220
+ name: Var[str]
237
221
 
238
222
  # Referrer policy for the iframe
239
- referrer_policy: Var[Union[str, int, bool]]
223
+ referrer_policy: Var[ReferrerPolicy]
240
224
 
241
225
  # Security restrictions for the content in the iframe
242
- sandbox: Var[Union[str, int, bool]]
226
+ sandbox: Var[str]
243
227
 
244
228
  # URL of the document to display in the iframe
245
- src: Var[Union[str, int, bool]]
229
+ src: Var[str]
246
230
 
247
231
  # HTML content to embed directly within the iframe
248
- src_doc: Var[Union[str, int, bool]]
232
+ src_doc: Var[str]
249
233
 
250
234
 
251
235
  class Object(BaseHTML):
@@ -254,19 +238,19 @@ class Object(BaseHTML):
254
238
  tag = "object"
255
239
 
256
240
  # URL of the data to be used by the object
257
- data: Var[Union[str, int, bool]]
241
+ data: Var[str]
258
242
 
259
243
  # Associates the object with a form element
260
- form: Var[Union[str, int, bool]]
244
+ form: Var[str]
261
245
 
262
246
  # Name of the object, used for scripting or as a target for forms and links
263
- name: Var[Union[str, int, bool]]
247
+ name: Var[str]
264
248
 
265
249
  # Media type of the data specified in the data attribute
266
- type: Var[Union[str, int, bool]]
250
+ type: Var[str]
267
251
 
268
252
  # Name of an image map to use with the object
269
- use_map: Var[Union[str, int, bool]]
253
+ use_map: Var[str]
270
254
 
271
255
 
272
256
  class Picture(BaseHTML):
@@ -287,19 +271,19 @@ class Source(BaseHTML):
287
271
  tag = "source"
288
272
 
289
273
  # Media query indicating what device the linked resource is optimized for
290
- media: Var[Union[str, int, bool]]
274
+ media: Var[str]
291
275
 
292
276
  # Sizes of the source for different layouts
293
- sizes: Var[Union[str, int, bool]]
277
+ sizes: Var[str]
294
278
 
295
279
  # URL of the media file or an image for the element to use
296
- src: Var[Union[str, int, bool]]
280
+ src: Var[str]
297
281
 
298
282
  # A set of source sizes and URLs for responsive images
299
- src_set: Var[Union[str, int, bool]]
283
+ src_set: Var[str]
300
284
 
301
285
  # Media type of the source
302
- type: Var[Union[str, int, bool]]
286
+ type: Var[str]
303
287
 
304
288
 
305
289
  class Svg(BaseHTML):
@@ -431,16 +415,16 @@ class LinearGradient(BaseHTML):
431
415
  spread_method: Var[Union[str, bool]]
432
416
 
433
417
  # X coordinate of the starting point of the gradient.
434
- x1: Var[Union[str, int, bool]]
418
+ x1: Var[Union[str, int, float]]
435
419
 
436
420
  # X coordinate of the ending point of the gradient.
437
- x2: Var[Union[str, int, bool]]
421
+ x2: Var[Union[str, int, float]]
438
422
 
439
423
  # Y coordinate of the starting point of the gradient.
440
- y1: Var[Union[str, int, bool]]
424
+ y1: Var[Union[str, int, float]]
441
425
 
442
426
  # Y coordinate of the ending point of the gradient.
443
- y2: Var[Union[str, int, bool]]
427
+ y2: Var[Union[str, int, float]]
444
428
 
445
429
 
446
430
  class RadialGradient(BaseHTML):
@@ -449,19 +433,19 @@ class RadialGradient(BaseHTML):
449
433
  tag = "radialGradient"
450
434
 
451
435
  # The x coordinate of the end circle of the radial gradient.
452
- cx: Var[Union[str, int, bool]]
436
+ cx: Var[Union[str, int, float]]
453
437
 
454
438
  # The y coordinate of the end circle of the radial gradient.
455
- cy: Var[Union[str, int, bool]]
439
+ cy: Var[Union[str, int, float]]
456
440
 
457
441
  # The radius of the start circle of the radial gradient.
458
- fr: Var[Union[str, int, bool]]
442
+ fr: Var[Union[str, int, float]]
459
443
 
460
444
  # The x coordinate of the start circle of the radial gradient.
461
- fx: Var[Union[str, int, bool]]
445
+ fx: Var[Union[str, int, float]]
462
446
 
463
447
  # The y coordinate of the start circle of the radial gradient.
464
- fy: Var[Union[str, int, bool]]
448
+ fy: Var[Union[str, int, float]]
465
449
 
466
450
  # Units for the gradient.
467
451
  gradient_units: Var[Union[str, bool]]
@@ -470,7 +454,7 @@ class RadialGradient(BaseHTML):
470
454
  gradient_transform: Var[Union[str, bool]]
471
455
 
472
456
  # The radius of the end circle of the radial gradient.
473
- r: Var[Union[str, int, bool]]
457
+ r: Var[Union[str, int, float]]
474
458
 
475
459
  # Method used to spread the gradient.
476
460
  spread_method: Var[Union[str, bool]]
@@ -497,7 +481,7 @@ class Path(BaseHTML):
497
481
  tag = "path"
498
482
 
499
483
  # Defines the shape of the path.
500
- d: Var[Union[str, int, bool]]
484
+ d: Var[Union[str, int, float]]
501
485
 
502
486
 
503
487
  class SVG(ComponentNamespace):