reflex 0.8.1a1__py3-none-any.whl → 0.8.1.post1__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.

@@ -15,6 +15,7 @@ from . import (
15
15
  plotly,
16
16
  radix,
17
17
  react_player,
18
+ react_router,
18
19
  recharts,
19
20
  sonner,
20
21
  )
@@ -34,6 +35,7 @@ __all__ = [
34
35
  "plotly",
35
36
  "radix",
36
37
  "react_player",
38
+ "react_router",
37
39
  "recharts",
38
40
  "sonner",
39
41
  ]
@@ -268,7 +268,9 @@ class WifiOffPulse(Icon):
268
268
  Returns:
269
269
  The icon component with default props applied.
270
270
  """
271
- pulse_var = Var(_js_expr="pulse")
271
+ pulse_var = Var(r"keyframes({ from: { opacity: 0 }, to: { opacity: 1 } })").to(
272
+ str
273
+ )
272
274
  return super().create(
273
275
  "wifi_off",
274
276
  color=props.pop("color", "crimson"),
@@ -289,18 +291,6 @@ class WifiOffPulse(Icon):
289
291
  """
290
292
  return {"@emotion/react": [ImportVar(tag="keyframes")]}
291
293
 
292
- def _get_custom_code(self) -> str | None:
293
- return """
294
- const pulse = keyframes`
295
- 0% {
296
- opacity: 0;
297
- }
298
- 100% {
299
- opacity: 1;
300
- }
301
- `
302
- """
303
-
304
294
 
305
295
  class ConnectionPulser(Div):
306
296
  """A connection pulser component."""
@@ -20,8 +20,8 @@ from reflex.vars.base import Var
20
20
  DEFAULT_UPLOAD_ID: str
21
21
  upload_files_context_var_data: VarData
22
22
 
23
- def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> Var: ...
24
- def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> Var: ...
23
+ def upload_file(id_: str | Var[str] = DEFAULT_UPLOAD_ID) -> Var: ...
24
+ def selected_files(id_: str | Var[str] = DEFAULT_UPLOAD_ID) -> Var: ...
25
25
  @CallableEventSpec
26
26
  def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec: ...
27
27
  def cancel_upload(upload_id: str) -> EventSpec: ...
@@ -3,6 +3,8 @@
3
3
  # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
+ from reflex.components.react_router import link as a
7
+
6
8
  from . import elements
7
9
  from .elements.forms import (
8
10
  Button,
@@ -63,7 +65,6 @@ from .elements.inline import (
63
65
  Time,
64
66
  U,
65
67
  Wbr,
66
- a,
67
68
  abbr,
68
69
  b,
69
70
  bdi,
@@ -431,6 +431,14 @@ class AccordionIcon(Icon):
431
431
  return super().create(tag="chevron_down", class_name=cls_name, **props)
432
432
 
433
433
 
434
+ SLIDE_DOWN = Var(
435
+ r'keyframes({ from: { height: 0 }, to: { height: "var(--radix-accordion-content-height)" } })'
436
+ )
437
+ SLIDE_UP = Var(
438
+ r'keyframes({ from: { height: "var(--radix-accordion-content-height)" }, to: { height: 0 } })'
439
+ )
440
+
441
+
434
442
  class AccordionContent(AccordionComponent):
435
443
  """An accordion component."""
436
444
 
@@ -464,44 +472,17 @@ class AccordionContent(AccordionComponent):
464
472
 
465
473
  return super().create(*children, class_name=cls_name, **props)
466
474
 
467
- def add_custom_code(self) -> list[str]:
468
- """Add custom code to the component.
469
-
470
- Returns:
471
- The custom code of the component.
472
- """
473
- return [
474
- """
475
- const slideDown = keyframes`
476
- from {
477
- height: 0;
478
- }
479
- to {
480
- height: var(--radix-accordion-content-height);
481
- }
482
- `
483
- const slideUp = keyframes`
484
- from {
485
- height: var(--radix-accordion-content-height);
486
- }
487
- to {
488
- height: 0;
489
- }
490
- `
491
- """
492
- ]
493
-
494
475
  def add_style(self) -> dict[str, Any] | None:
495
476
  """Add style to the component.
496
477
 
497
478
  Returns:
498
479
  The style of the component.
499
480
  """
500
- slide_down = Var("slideDown").to(str) + Var.create(
481
+ slide_down = SLIDE_DOWN.to(str) + Var.create(
501
482
  " var(--animation-duration) var(--animation-easing)",
502
483
  )
503
484
 
504
- slide_up = Var("slideUp").to(str) + Var.create(
485
+ slide_up = SLIDE_UP.to(str) + Var.create(
505
486
  " var(--animation-duration) var(--animation-easing)",
506
487
  )
507
488
 
@@ -706,6 +706,13 @@ class AccordionIcon(Icon):
706
706
  The Accordion icon Component.
707
707
  """
708
708
 
709
+ SLIDE_DOWN = Var(
710
+ 'keyframes({ from: { height: 0 }, to: { height: "var(--radix-accordion-content-height)" } })'
711
+ )
712
+ SLIDE_UP = Var(
713
+ 'keyframes({ from: { height: "var(--radix-accordion-content-height)" }, to: { height: 0 } })'
714
+ )
715
+
709
716
  class AccordionContent(AccordionComponent):
710
717
  def add_imports(self) -> dict: ...
711
718
  @classmethod
@@ -824,7 +831,6 @@ class AccordionContent(AccordionComponent):
824
831
  The Accordion content Component.
825
832
  """
826
833
 
827
- def add_custom_code(self) -> list[str]: ...
828
834
  def add_style(self) -> dict[str, Any] | None: ...
829
835
 
830
836
  class Accordion(ComponentNamespace):
@@ -11,315 +11,12 @@ from reflex.components.core.breakpoints import Breakpoints
11
11
  from reflex.components.el.elements.inline import A
12
12
  from reflex.components.markdown.markdown import MarkdownComponentMap
13
13
  from reflex.components.radix.themes.base import RadixThemesComponent
14
+ from reflex.components.react_router.dom import ReactRouterLink
14
15
  from reflex.event import EventType, PointerEventInfo
15
16
  from reflex.utils.imports import ImportDict
16
17
  from reflex.vars.base import Var
17
18
 
18
19
  LiteralLinkUnderline = Literal["auto", "hover", "always", "none"]
19
- LiteralLinkDiscover = Literal["none", "render"]
20
-
21
- class ReactRouterLink(A):
22
- @classmethod
23
- def create(
24
- cls,
25
- *children,
26
- to: Var[str] | str | None = None,
27
- replace: Var[bool] | bool | None = None,
28
- reload_document: Var[bool] | bool | None = None,
29
- prevent_scroll_reset: Var[bool] | bool | None = None,
30
- discover: Literal["none", "render"]
31
- | Var[Literal["none", "render"]]
32
- | None = None,
33
- view_transition: Var[bool] | bool | None = None,
34
- download: Var[bool | str] | bool | str | None = None,
35
- href: Var[str] | str | None = None,
36
- href_lang: Var[str] | str | None = None,
37
- media: Var[str] | str | None = None,
38
- ping: Var[str] | str | None = None,
39
- referrer_policy: Literal[
40
- "",
41
- "no-referrer",
42
- "no-referrer-when-downgrade",
43
- "origin",
44
- "origin-when-cross-origin",
45
- "same-origin",
46
- "strict-origin",
47
- "strict-origin-when-cross-origin",
48
- "unsafe-url",
49
- ]
50
- | Var[
51
- Literal[
52
- "",
53
- "no-referrer",
54
- "no-referrer-when-downgrade",
55
- "origin",
56
- "origin-when-cross-origin",
57
- "same-origin",
58
- "strict-origin",
59
- "strict-origin-when-cross-origin",
60
- "unsafe-url",
61
- ]
62
- ]
63
- | None = None,
64
- rel: Var[str] | str | None = None,
65
- target: Literal["_blank", "_parent", "_self", "_top"]
66
- | Var[Literal["_blank", "_parent", "_self", "_top"] | str]
67
- | str
68
- | None = None,
69
- access_key: Var[str] | str | None = None,
70
- auto_capitalize: Literal[
71
- "characters", "none", "off", "on", "sentences", "words"
72
- ]
73
- | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
74
- | None = None,
75
- content_editable: Literal["inherit", "plaintext-only", False, True]
76
- | Var[Literal["inherit", "plaintext-only", False, True]]
77
- | None = None,
78
- context_menu: Var[str] | str | None = None,
79
- dir: Var[str] | str | None = None,
80
- draggable: Var[bool] | bool | None = None,
81
- enter_key_hint: Literal[
82
- "done", "enter", "go", "next", "previous", "search", "send"
83
- ]
84
- | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
85
- | None = None,
86
- hidden: Var[bool] | bool | None = None,
87
- input_mode: Literal[
88
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
89
- ]
90
- | Var[
91
- Literal[
92
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
93
- ]
94
- ]
95
- | None = None,
96
- item_prop: Var[str] | str | None = None,
97
- lang: Var[str] | str | None = None,
98
- role: Literal[
99
- "alert",
100
- "alertdialog",
101
- "application",
102
- "article",
103
- "banner",
104
- "button",
105
- "cell",
106
- "checkbox",
107
- "columnheader",
108
- "combobox",
109
- "complementary",
110
- "contentinfo",
111
- "definition",
112
- "dialog",
113
- "directory",
114
- "document",
115
- "feed",
116
- "figure",
117
- "form",
118
- "grid",
119
- "gridcell",
120
- "group",
121
- "heading",
122
- "img",
123
- "link",
124
- "list",
125
- "listbox",
126
- "listitem",
127
- "log",
128
- "main",
129
- "marquee",
130
- "math",
131
- "menu",
132
- "menubar",
133
- "menuitem",
134
- "menuitemcheckbox",
135
- "menuitemradio",
136
- "navigation",
137
- "none",
138
- "note",
139
- "option",
140
- "presentation",
141
- "progressbar",
142
- "radio",
143
- "radiogroup",
144
- "region",
145
- "row",
146
- "rowgroup",
147
- "rowheader",
148
- "scrollbar",
149
- "search",
150
- "searchbox",
151
- "separator",
152
- "slider",
153
- "spinbutton",
154
- "status",
155
- "switch",
156
- "tab",
157
- "table",
158
- "tablist",
159
- "tabpanel",
160
- "term",
161
- "textbox",
162
- "timer",
163
- "toolbar",
164
- "tooltip",
165
- "tree",
166
- "treegrid",
167
- "treeitem",
168
- ]
169
- | Var[
170
- Literal[
171
- "alert",
172
- "alertdialog",
173
- "application",
174
- "article",
175
- "banner",
176
- "button",
177
- "cell",
178
- "checkbox",
179
- "columnheader",
180
- "combobox",
181
- "complementary",
182
- "contentinfo",
183
- "definition",
184
- "dialog",
185
- "directory",
186
- "document",
187
- "feed",
188
- "figure",
189
- "form",
190
- "grid",
191
- "gridcell",
192
- "group",
193
- "heading",
194
- "img",
195
- "link",
196
- "list",
197
- "listbox",
198
- "listitem",
199
- "log",
200
- "main",
201
- "marquee",
202
- "math",
203
- "menu",
204
- "menubar",
205
- "menuitem",
206
- "menuitemcheckbox",
207
- "menuitemradio",
208
- "navigation",
209
- "none",
210
- "note",
211
- "option",
212
- "presentation",
213
- "progressbar",
214
- "radio",
215
- "radiogroup",
216
- "region",
217
- "row",
218
- "rowgroup",
219
- "rowheader",
220
- "scrollbar",
221
- "search",
222
- "searchbox",
223
- "separator",
224
- "slider",
225
- "spinbutton",
226
- "status",
227
- "switch",
228
- "tab",
229
- "table",
230
- "tablist",
231
- "tabpanel",
232
- "term",
233
- "textbox",
234
- "timer",
235
- "toolbar",
236
- "tooltip",
237
- "tree",
238
- "treegrid",
239
- "treeitem",
240
- ]
241
- ]
242
- | None = None,
243
- slot: Var[str] | str | None = None,
244
- spell_check: Var[bool] | bool | None = None,
245
- tab_index: Var[int] | int | None = None,
246
- title: Var[str] | str | None = None,
247
- style: Sequence[Mapping[str, Any]]
248
- | Mapping[str, Any]
249
- | Var[Mapping[str, Any]]
250
- | Breakpoints
251
- | None = None,
252
- key: Any | None = None,
253
- id: Any | None = None,
254
- ref: Var | None = None,
255
- class_name: Any | None = None,
256
- autofocus: bool | None = None,
257
- custom_attrs: dict[str, Var | Any] | None = None,
258
- on_blur: EventType[()] | None = None,
259
- on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
260
- on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
261
- on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
262
- on_focus: EventType[()] | None = None,
263
- on_mount: EventType[()] | None = None,
264
- on_mouse_down: EventType[()] | None = None,
265
- on_mouse_enter: EventType[()] | None = None,
266
- on_mouse_leave: EventType[()] | None = None,
267
- on_mouse_move: EventType[()] | None = None,
268
- on_mouse_out: EventType[()] | None = None,
269
- on_mouse_over: EventType[()] | None = None,
270
- on_mouse_up: EventType[()] | None = None,
271
- on_scroll: EventType[()] | None = None,
272
- on_scroll_end: EventType[()] | None = None,
273
- on_unmount: EventType[()] | None = None,
274
- **props,
275
- ) -> ReactRouterLink:
276
- """Create the component.
277
-
278
- Args:
279
- *children: The children of the component.
280
- to: The page to link to.
281
- replace: Replaces the current entry in the history stack instead of pushing a new one onto it.
282
- reload_document: Will use document navigation instead of client side routing when the link is clicked: the browser will handle the transition normally (as if it were an <a href>).
283
- prevent_scroll_reset: Prevents the scroll position from being reset to the top of the window when the link is clicked and the app is using ScrollRestoration. This only prevents new locations resetting scroll to the top, scroll position will be restored for back/forward button navigation.
284
- discover: Defines the link discovery behavior
285
- view_transition: Enables a View Transition for this navigation.
286
- download: Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
287
- href: Specifies the URL of the page the link goes to
288
- href_lang: Specifies the language of the linked document
289
- media: Specifies what media/device the linked document is optimized for
290
- ping: Specifies which referrer is sent when fetching the resource
291
- referrer_policy: Specifies the relationship between the current document and the linked document
292
- rel: Specifies the relationship between the linked document and the current document
293
- target: Specifies where to open the linked document
294
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
295
- auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
296
- content_editable: Indicates whether the element's content is editable.
297
- context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
298
- dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
299
- draggable: Defines whether the element can be dragged.
300
- enter_key_hint: Hints what media types the media element is able to play.
301
- hidden: Defines whether the element is hidden.
302
- input_mode: Defines the type of the element.
303
- item_prop: Defines the name of the element for metadata purposes.
304
- lang: Defines the language used in the element.
305
- role: Defines the role of the element.
306
- slot: Assigns a slot in a shadow DOM shadow tree to an element.
307
- spell_check: Defines whether the element may be checked for spelling errors.
308
- tab_index: Defines the position of the current element in the tabbing order.
309
- title: Defines a tooltip for the element.
310
- style: The style of the component.
311
- key: A unique key for the component.
312
- id: The id for the component.
313
- ref: The Var to pass as the ref to the component.
314
- class_name: The class name for the component.
315
- autofocus: Whether the component should take the focus once the page is loaded
316
- custom_attrs: custom attribute
317
- **props: The props of the component.
318
-
319
- Returns:
320
- The component.
321
- """
322
-
323
20
  _KNOWN_REACT_ROUTER_LINK_PROPS = frozenset(ReactRouterLink.get_props())
324
21
 
325
22
  class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap):
@@ -0,0 +1,321 @@
1
+ """Stub file for reflex/components/react_router/dom.py"""
2
+
3
+ # ------------------- DO NOT EDIT ----------------------
4
+ # This file was generated by `reflex/utils/pyi_generator.py`!
5
+ # ------------------------------------------------------
6
+ from collections.abc import Mapping, Sequence
7
+ from typing import Any, Literal, TypedDict
8
+
9
+ from reflex.components.core.breakpoints import Breakpoints
10
+ from reflex.components.el.elements.inline import A
11
+ from reflex.event import EventType, PointerEventInfo
12
+ from reflex.vars.base import Var
13
+
14
+ LiteralLinkDiscover = Literal["none", "render"]
15
+
16
+ class To(TypedDict):
17
+ pathname: str
18
+ search: str
19
+ hash: str
20
+
21
+ class ReactRouterLink(A):
22
+ @classmethod
23
+ def create(
24
+ cls,
25
+ *children,
26
+ to: To | Var[To | str] | str | None = None,
27
+ replace: Var[bool] | bool | None = None,
28
+ reload_document: Var[bool] | bool | None = None,
29
+ prevent_scroll_reset: Var[bool] | bool | None = None,
30
+ discover: Literal["none", "render"]
31
+ | Var[Literal["none", "render"]]
32
+ | None = None,
33
+ view_transition: Var[bool] | bool | None = None,
34
+ download: Var[bool | str] | bool | str | None = None,
35
+ href: Var[str] | str | None = None,
36
+ href_lang: Var[str] | str | None = None,
37
+ media: Var[str] | str | None = None,
38
+ ping: Var[str] | str | None = None,
39
+ referrer_policy: Literal[
40
+ "",
41
+ "no-referrer",
42
+ "no-referrer-when-downgrade",
43
+ "origin",
44
+ "origin-when-cross-origin",
45
+ "same-origin",
46
+ "strict-origin",
47
+ "strict-origin-when-cross-origin",
48
+ "unsafe-url",
49
+ ]
50
+ | Var[
51
+ Literal[
52
+ "",
53
+ "no-referrer",
54
+ "no-referrer-when-downgrade",
55
+ "origin",
56
+ "origin-when-cross-origin",
57
+ "same-origin",
58
+ "strict-origin",
59
+ "strict-origin-when-cross-origin",
60
+ "unsafe-url",
61
+ ]
62
+ ]
63
+ | None = None,
64
+ rel: Var[str] | str | None = None,
65
+ target: Literal["_blank", "_parent", "_self", "_top"]
66
+ | Var[Literal["_blank", "_parent", "_self", "_top"] | str]
67
+ | str
68
+ | None = None,
69
+ access_key: Var[str] | str | None = None,
70
+ auto_capitalize: Literal[
71
+ "characters", "none", "off", "on", "sentences", "words"
72
+ ]
73
+ | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
74
+ | None = None,
75
+ content_editable: Literal["inherit", "plaintext-only", False, True]
76
+ | Var[Literal["inherit", "plaintext-only", False, True]]
77
+ | None = None,
78
+ context_menu: Var[str] | str | None = None,
79
+ dir: Var[str] | str | None = None,
80
+ draggable: Var[bool] | bool | None = None,
81
+ enter_key_hint: Literal[
82
+ "done", "enter", "go", "next", "previous", "search", "send"
83
+ ]
84
+ | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
85
+ | None = None,
86
+ hidden: Var[bool] | bool | None = None,
87
+ input_mode: Literal[
88
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
89
+ ]
90
+ | Var[
91
+ Literal[
92
+ "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
93
+ ]
94
+ ]
95
+ | None = None,
96
+ item_prop: Var[str] | str | None = None,
97
+ lang: Var[str] | str | None = None,
98
+ role: Literal[
99
+ "alert",
100
+ "alertdialog",
101
+ "application",
102
+ "article",
103
+ "banner",
104
+ "button",
105
+ "cell",
106
+ "checkbox",
107
+ "columnheader",
108
+ "combobox",
109
+ "complementary",
110
+ "contentinfo",
111
+ "definition",
112
+ "dialog",
113
+ "directory",
114
+ "document",
115
+ "feed",
116
+ "figure",
117
+ "form",
118
+ "grid",
119
+ "gridcell",
120
+ "group",
121
+ "heading",
122
+ "img",
123
+ "link",
124
+ "list",
125
+ "listbox",
126
+ "listitem",
127
+ "log",
128
+ "main",
129
+ "marquee",
130
+ "math",
131
+ "menu",
132
+ "menubar",
133
+ "menuitem",
134
+ "menuitemcheckbox",
135
+ "menuitemradio",
136
+ "navigation",
137
+ "none",
138
+ "note",
139
+ "option",
140
+ "presentation",
141
+ "progressbar",
142
+ "radio",
143
+ "radiogroup",
144
+ "region",
145
+ "row",
146
+ "rowgroup",
147
+ "rowheader",
148
+ "scrollbar",
149
+ "search",
150
+ "searchbox",
151
+ "separator",
152
+ "slider",
153
+ "spinbutton",
154
+ "status",
155
+ "switch",
156
+ "tab",
157
+ "table",
158
+ "tablist",
159
+ "tabpanel",
160
+ "term",
161
+ "textbox",
162
+ "timer",
163
+ "toolbar",
164
+ "tooltip",
165
+ "tree",
166
+ "treegrid",
167
+ "treeitem",
168
+ ]
169
+ | Var[
170
+ Literal[
171
+ "alert",
172
+ "alertdialog",
173
+ "application",
174
+ "article",
175
+ "banner",
176
+ "button",
177
+ "cell",
178
+ "checkbox",
179
+ "columnheader",
180
+ "combobox",
181
+ "complementary",
182
+ "contentinfo",
183
+ "definition",
184
+ "dialog",
185
+ "directory",
186
+ "document",
187
+ "feed",
188
+ "figure",
189
+ "form",
190
+ "grid",
191
+ "gridcell",
192
+ "group",
193
+ "heading",
194
+ "img",
195
+ "link",
196
+ "list",
197
+ "listbox",
198
+ "listitem",
199
+ "log",
200
+ "main",
201
+ "marquee",
202
+ "math",
203
+ "menu",
204
+ "menubar",
205
+ "menuitem",
206
+ "menuitemcheckbox",
207
+ "menuitemradio",
208
+ "navigation",
209
+ "none",
210
+ "note",
211
+ "option",
212
+ "presentation",
213
+ "progressbar",
214
+ "radio",
215
+ "radiogroup",
216
+ "region",
217
+ "row",
218
+ "rowgroup",
219
+ "rowheader",
220
+ "scrollbar",
221
+ "search",
222
+ "searchbox",
223
+ "separator",
224
+ "slider",
225
+ "spinbutton",
226
+ "status",
227
+ "switch",
228
+ "tab",
229
+ "table",
230
+ "tablist",
231
+ "tabpanel",
232
+ "term",
233
+ "textbox",
234
+ "timer",
235
+ "toolbar",
236
+ "tooltip",
237
+ "tree",
238
+ "treegrid",
239
+ "treeitem",
240
+ ]
241
+ ]
242
+ | None = None,
243
+ slot: Var[str] | str | None = None,
244
+ spell_check: Var[bool] | bool | None = None,
245
+ tab_index: Var[int] | int | None = None,
246
+ title: Var[str] | str | None = None,
247
+ style: Sequence[Mapping[str, Any]]
248
+ | Mapping[str, Any]
249
+ | Var[Mapping[str, Any]]
250
+ | Breakpoints
251
+ | None = None,
252
+ key: Any | None = None,
253
+ id: Any | None = None,
254
+ ref: Var | None = None,
255
+ class_name: Any | None = None,
256
+ autofocus: bool | None = None,
257
+ custom_attrs: dict[str, Var | Any] | None = None,
258
+ on_blur: EventType[()] | None = None,
259
+ on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
260
+ on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
261
+ on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
262
+ on_focus: EventType[()] | None = None,
263
+ on_mount: EventType[()] | None = None,
264
+ on_mouse_down: EventType[()] | None = None,
265
+ on_mouse_enter: EventType[()] | None = None,
266
+ on_mouse_leave: EventType[()] | None = None,
267
+ on_mouse_move: EventType[()] | None = None,
268
+ on_mouse_out: EventType[()] | None = None,
269
+ on_mouse_over: EventType[()] | None = None,
270
+ on_mouse_up: EventType[()] | None = None,
271
+ on_scroll: EventType[()] | None = None,
272
+ on_scroll_end: EventType[()] | None = None,
273
+ on_unmount: EventType[()] | None = None,
274
+ **props,
275
+ ) -> ReactRouterLink:
276
+ """Create a ReactRouterLink component for client-side navigation.
277
+
278
+ Args:
279
+ *children: The children of the component.
280
+ to: The page to link to.
281
+ replace: Replaces the current entry in the history stack instead of pushing a new one onto it.
282
+ reload_document: Will use document navigation instead of client side routing when the link is clicked: the browser will handle the transition normally (as if it were an <a href>).
283
+ prevent_scroll_reset: Prevents the scroll position from being reset to the top of the window when the link is clicked and the app is using ScrollRestoration. This only prevents new locations resetting scroll to the top, scroll position will be restored for back/forward button navigation.
284
+ discover: Defines the link discovery behavior
285
+ view_transition: Enables a View Transition for this navigation.
286
+ download: Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
287
+ href: Specifies the URL of the page the link goes to
288
+ href_lang: Specifies the language of the linked document
289
+ media: Specifies what media/device the linked document is optimized for
290
+ ping: Specifies which referrer is sent when fetching the resource
291
+ referrer_policy: Specifies the relationship between the current document and the linked document
292
+ rel: Specifies the relationship between the linked document and the current document
293
+ target: Specifies where to open the linked document
294
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
295
+ auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
296
+ content_editable: Indicates whether the element's content is editable.
297
+ context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
298
+ dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
299
+ draggable: Defines whether the element can be dragged.
300
+ enter_key_hint: Hints what media types the media element is able to play.
301
+ hidden: Defines whether the element is hidden.
302
+ input_mode: Defines the type of the element.
303
+ item_prop: Defines the name of the element for metadata purposes.
304
+ lang: Defines the language used in the element.
305
+ role: Defines the role of the element.
306
+ slot: Assigns a slot in a shadow DOM shadow tree to an element.
307
+ spell_check: Defines whether the element may be checked for spelling errors.
308
+ tab_index: Defines the position of the current element in the tabbing order.
309
+ title: Defines a tooltip for the element.
310
+ style: The style of the component.
311
+ key: A unique key for the component.
312
+ id: The id for the component.
313
+ ref: The Var to pass as the ref to the component.
314
+ class_name: The class name for the component.
315
+ autofocus: Whether the component should take the focus once the page is loaded
316
+ custom_attrs: custom attribute
317
+ **props: The props of the component.
318
+
319
+ Returns:
320
+ The ReactRouterLink component.
321
+ """
@@ -85,7 +85,7 @@ class PageNames(SimpleNamespace):
85
85
  # The name of the index page.
86
86
  INDEX_ROUTE = "index"
87
87
  # The name of the app root page.
88
- APP_ROOT = "root.js"
88
+ APP_ROOT = "root.jsx"
89
89
  # The root stylesheet filename.
90
90
  STYLESHEET_ROOT = "__reflex_global_styles"
91
91
  # The name of the document root page.
@@ -143,10 +143,11 @@ class PackageJson(SimpleNamespace):
143
143
  "postcss-import": "16.1.1",
144
144
  "@react-router/dev": _react_router_version,
145
145
  "@react-router/fs-routes": _react_router_version,
146
- "rolldown-vite": "7.0.3",
146
+ "rolldown-vite": "7.0.5",
147
147
  }
148
148
  OVERRIDES = {
149
149
  # This should always match the `react` version in DEPENDENCIES for recharts compatibility.
150
150
  "react-is": _react_version,
151
151
  "cookie": "1.0.2",
152
+ "rollup": "4.44.2",
152
153
  }
reflex/utils/processes.py CHANGED
@@ -53,6 +53,26 @@ def get_num_workers() -> int:
53
53
  return (os.cpu_count() or 1) * 2 + 1
54
54
 
55
55
 
56
+ def _is_address_responsive(
57
+ address_family: socket.AddressFamily | int, address: str, port: int
58
+ ) -> bool:
59
+ """Check if a given address and port are responsive.
60
+
61
+ Args:
62
+ address_family: The address family (e.g., socket.AF_INET or socket.AF_INET6).
63
+ address: The address to check.
64
+ port: The port to check.
65
+
66
+ Returns:
67
+ Whether the address and port are responsive.
68
+ """
69
+ try:
70
+ with closing(socket.socket(address_family, socket.SOCK_STREAM)) as sock:
71
+ return sock.connect_ex((address, port)) == 0
72
+ except OSError:
73
+ return False
74
+
75
+
56
76
  def is_process_on_port(port: int) -> bool:
57
77
  """Check if a process is running on the given port.
58
78
 
@@ -62,16 +82,11 @@ def is_process_on_port(port: int) -> bool:
62
82
  Returns:
63
83
  Whether a process is running on the given port.
64
84
  """
65
- # Test IPv4 localhost (127.0.0.1)
66
- with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
67
- ipv4_result = sock.connect_ex(("127.0.0.1", port)) == 0
68
-
69
- # Test IPv6 localhost (::1)
70
- with closing(socket.socket(socket.AF_INET6, socket.SOCK_STREAM)) as sock:
71
- ipv6_result = sock.connect_ex(("::1", port)) == 0
72
-
73
- # Port is in use if either IPv4 or IPv6 is listening
74
- return ipv4_result or ipv6_result
85
+ return _is_address_responsive( # Test IPv4 localhost (127.0.0.1)
86
+ socket.AF_INET, "127.0.0.1", port
87
+ ) or _is_address_responsive(
88
+ socket.AF_INET6, "::1", port
89
+ ) # Test IPv6 localhost (::1)
75
90
 
76
91
 
77
92
  def change_port(port: int, _type: str) -> int:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reflex
3
- Version: 0.8.1a1
3
+ Version: 0.8.1.post1
4
4
  Summary: Web apps in pure Python.
5
5
  Project-URL: homepage, https://reflex.dev
6
6
  Project-URL: repository, https://github.com/reflex-dev/reflex
@@ -67,7 +67,7 @@ reflex/compiler/compiler.py,sha256=p-8xacPH7kCjE6tpW1AzbfNQJsF0033yXMpu03Exti4,2
67
67
  reflex/compiler/templates.py,sha256=mQifVgvE7cKyzMFL9F5jxdJb9KFxucWJa7nuOp09ZUo,6002
68
68
  reflex/compiler/utils.py,sha256=v2LGz6WAFOSRpn3H0l215E94R7r7hB3s9vseWrQiXUQ,19045
69
69
  reflex/components/__init__.py,sha256=eWpgWFbSQDj2TpGp6StEbxU7roQgzY7ZM0XIcIc5RE8,588
70
- reflex/components/__init__.pyi,sha256=ZqnBIRh1UuLSwAk6wLFmHlexyZ-6SNGo7AGJjWI7aGQ,698
70
+ reflex/components/__init__.pyi,sha256=7VFHtJGIjvGtD3IiPk848IPWYSCcPRT1EyPGljLhYlU,736
71
71
  reflex/components/component.py,sha256=0ZouhQgfO5hAbKu3Z4ytM0jvaz70U0Uab9SrIewdUbQ,99431
72
72
  reflex/components/dynamic.py,sha256=AyOjAW5LQZlDShIFJ7d9P2dFTI-1pr1tZR32E2Rhr9s,7422
73
73
  reflex/components/field.py,sha256=j5JZFzNlET3GAIW91m1L31RypXylMAxJNm0-CJbtykM,5745
@@ -98,7 +98,7 @@ reflex/components/core/__init__.py,sha256=81araQcvIlVNXr1h-kQHaUK46sV0lfJrAlZbis
98
98
  reflex/components/core/__init__.pyi,sha256=3IZ4XbJAHFR0aKTo3FhF3-t_qJVyfGmFK3GU_IIxLGs,1865
99
99
  reflex/components/core/auto_scroll.py,sha256=3jtFUqMUM1R_YyxWjbNVLiLktw6HHp50EzIFTkFtgto,3616
100
100
  reflex/components/core/auto_scroll.pyi,sha256=bZvBS6HBGMZrN8sZIuJs2jaW2efN0yIr_Pd-C0cxgO0,9019
101
- reflex/components/core/banner.py,sha256=DIjy4-qydJuLYVDKJYtrIeO4HFLdbgpXDVF4o2sRkDs,18568
101
+ reflex/components/core/banner.py,sha256=JEutUBT1UfpgnaDJthE2BoSzpIEE-cSHoQZlEvQb0dw,18471
102
102
  reflex/components/core/banner.pyi,sha256=WRU-jleR0jIy-yVG8Wcqraj30DQ3lj3CI2gxoumuTt0,26078
103
103
  reflex/components/core/breakpoints.py,sha256=7nNG9Ewjvbk1hB0VoFiQxlDR333Mq2y977CNWjslAWA,2692
104
104
  reflex/components/core/client_side_routing.py,sha256=D5LWLTVW8WEuV17nNe14RKmuDhJegam0eYvOoHxh2Ts,1893
@@ -119,7 +119,7 @@ reflex/components/core/responsive.py,sha256=ACZdtJ4a4F8B3dm1k8h6J2_UJx0Z5LDB7XHQ
119
119
  reflex/components/core/sticky.py,sha256=2B3TxrwG2Rtp_lv1VkMOIF2bqSiT7qYGbqbiZiMKxKY,3856
120
120
  reflex/components/core/sticky.pyi,sha256=U3VyCnx4hWWORd4yIiIe-mu_IdsPry2iMXrGMw2tLgQ,32906
121
121
  reflex/components/core/upload.py,sha256=b4-ubt4dznL5LDA7UCKNdWcdCX9aLOX2vNFdv4GlRdg,13544
122
- reflex/components/core/upload.pyi,sha256=q88GncKmdgG9s1PQkEs0SWGEdzpxdr31UXmDIYq9qhQ,16385
122
+ reflex/components/core/upload.pyi,sha256=mLJsrIXETKfwqO1nEpoE0yVrGIFXdadx9k745KyyBms,16407
123
123
  reflex/components/core/layout/__init__.py,sha256=znldZaj_NGt8qCZDG70GMwjMTskcvCf_2N_EjCAHwdc,30
124
124
  reflex/components/datadisplay/__init__.py,sha256=L8pWWKNHWdUD2fbZRoEKjd_8c_hpDdGYO463hwkoIi4,438
125
125
  reflex/components/datadisplay/__init__.pyi,sha256=H3LZkWdrw3RTv_csaIT8qoClgAJTonlGZ5ZMeGMV0Bs,551
@@ -131,7 +131,7 @@ reflex/components/datadisplay/logo.py,sha256=xvg5TRVRSi2IKn7Kg4oYzWcaFMHfXxUaCp0
131
131
  reflex/components/datadisplay/shiki_code_block.py,sha256=qCp4jZO3Ek4mR_1Qs4oxLh-GCEo6VBlpb8B9MDDdw4Y,24503
132
132
  reflex/components/datadisplay/shiki_code_block.pyi,sha256=FXGWyG7u3RZQIwhK4M0YAYXRaJ-Pd-Aof_wjrlG7SrY,57323
133
133
  reflex/components/el/__init__.py,sha256=JJHaCMvCh5_nsuyaWRVQ8d75A13lvaq4cpm6HoxUYuM,607
134
- reflex/components/el/__init__.pyi,sha256=7P6mNFbjiPyE0vNwUO4B5i-a2cqhjNRSJ7YNL7xKa7E,6194
134
+ reflex/components/el/__init__.pyi,sha256=DlqLHC_TT0lbUhPCrMFi3SKgRCUSMYu-h-V0KkaUP5E,6241
135
135
  reflex/components/el/element.py,sha256=stGVO6A2waCHq2CGQqR_g798hDKkuSZerwB0tYfZpRE,582
136
136
  reflex/components/el/element.pyi,sha256=z8WHnR-wzs3XGaqJpS6Gj02S_MMljLYp9F3fn6F3DYA,2498
137
137
  reflex/components/el/constants/__init__.py,sha256=9h2hdnOSltQLDEM6w1nGmv1B8Bf0tMquTCi5RhvBT6c,113
@@ -179,8 +179,8 @@ reflex/components/radix/__init__.py,sha256=fRsLvIO3MrTtPOXtmnxYDB9phvzlcbyB_utgp
179
179
  reflex/components/radix/__init__.pyi,sha256=ke_dGrpFMNHd3MgQ9qiStSQDlGcJ39KVSrpIxayBU3c,3927
180
180
  reflex/components/radix/primitives/__init__.py,sha256=R2sdZJqQCYaLScGkXnXDKAjVgV5MidceemooEUtvBt4,443
181
181
  reflex/components/radix/primitives/__init__.pyi,sha256=kOCtVqDuSsBt5-lCcqM-3CBJsv-QokWIfkq0_iyqVDU,413
182
- reflex/components/radix/primitives/accordion.py,sha256=wTg7MwVzQLG3LZHNvbSGeF3R55JKpo3LEr8QsQwxs_0,16394
183
- reflex/components/radix/primitives/accordion.pyi,sha256=f9R1ZqOFl0E5oqzvcVF3XBitmSJvw7CS1JZ5e-48LF0,28942
182
+ reflex/components/radix/primitives/accordion.py,sha256=vAhTGNxdeqPjD3O-rYj4fHvt0V0hPBA06qczjX9hAm0,16191
183
+ reflex/components/radix/primitives/accordion.pyi,sha256=XL7uvoSqNJIAEM-dHll_xbhHGLgrlWok_o6Y6v64L0M,29129
184
184
  reflex/components/radix/primitives/base.py,sha256=9OvGDI1to8XL_a2hr3fNBQUwTHZBUO424ea2-UTKD18,770
185
185
  reflex/components/radix/primitives/base.pyi,sha256=qM7wN2OVEYJ9FvuYQ3_mT9kxFIko9AVpvl652BMV81w,4895
186
186
  reflex/components/radix/primitives/drawer.py,sha256=Nxd745cuNFsiZIZh33gJjm5RfGwrbv-yeSEkHa6OI-8,9262
@@ -301,7 +301,7 @@ reflex/components/radix/themes/typography/code.pyi,sha256=0iuE24yCemd2u__-SBcB33
301
301
  reflex/components/radix/themes/typography/heading.py,sha256=YVoQu9cLx5SJSNkliNp5UyVhrwu7vgpIMj1X43jifd0,1575
302
302
  reflex/components/radix/themes/typography/heading.pyi,sha256=bfhGqJJU_MW5WRXc5hZElJmrVnKseBnKLOmefyIB_FE,12558
303
303
  reflex/components/radix/themes/typography/link.py,sha256=UpjiOLMiJTlra5bY3UAF1iC0faU2F7hpxUP527n-jao,3928
304
- reflex/components/radix/themes/typography/link.pyi,sha256=uLdbyTjmc-vlxOnnj9knnP3RsMT_7WkhdiDskKVsiYM,25886
304
+ reflex/components/radix/themes/typography/link.pyi,sha256=nHg1e9dUk19K2DFbHdSzgq5b6AIW5G5egeOtfGEO8DM,14572
305
305
  reflex/components/radix/themes/typography/text.py,sha256=qnpZuqyabh-VuKGBtlOmu3dfZloBXehjCtEk4AmZQLg,2843
306
306
  reflex/components/radix/themes/typography/text.pyi,sha256=exTgSHtho1PIDMsT46dNyRmXb2kOH7x8eiryfbmHMlA,73279
307
307
  reflex/components/react_player/__init__.py,sha256=1OTHeZkuefi-zIVXc_QZMTBg4_RsGrMaJHducUuZQCU,171
@@ -313,6 +313,7 @@ reflex/components/react_player/video.py,sha256=WmdxzLtrZNNm9Nals5IpYUGhm45P14hR7
313
313
  reflex/components/react_player/video.pyi,sha256=wdleNz97WblmeMU9qtJV77OH6urmgtiQacddc6H3lmg,5814
314
314
  reflex/components/react_router/__init__.py,sha256=ittQ4lHlEsjDneYXODIjz3U0Z8jjtD6xjQuQNDd2MOQ,105
315
315
  reflex/components/react_router/dom.py,sha256=1Aw6UfojyO1EmylyNX_ozxqhGUqfjrgWki8zN_d5QqM,2298
316
+ reflex/components/react_router/dom.pyi,sha256=cjg3myflPogTW3HHBOPURY_b92bKnkaiFmVCyB5Bh-4,12035
316
317
  reflex/components/recharts/__init__.py,sha256=M8Xa0KVrwloklxPHqZCEBF8HaDluK4w5brXnlIrdNHI,2696
317
318
  reflex/components/recharts/__init__.pyi,sha256=MnpXChZwm3DYprV7Ufc-yOptpqKpzRT_sou3oRk11jk,4080
318
319
  reflex/components/recharts/cartesian.py,sha256=o0PYn-EwW1UcGDM5eXBcPnzNGFgzphjis_HeQ9-5Sew,34234
@@ -337,11 +338,11 @@ reflex/components/tags/tagless.py,sha256=qO7Gm4V0ITDyymHkyltfz53155ZBt-W_WIPDYy9
337
338
  reflex/constants/__init__.py,sha256=q2Jf-LBbNcGrOmx5M7QotIAYW_t3m02TsmmdtJ5_IhM,2190
338
339
  reflex/constants/base.py,sha256=sFv9DhRZtEM2fix6U8SwTcBn05zl5Z_X8X-bqr3fh2E,9065
339
340
  reflex/constants/colors.py,sha256=n-FN7stNrvk5rCN0TAvE28dqwUeQZHue-b5q1CO0EyQ,2048
340
- reflex/constants/compiler.py,sha256=y72_HbyHGyCVv_Xqr3hB3_Nu1p8NA4gUebBqL8cxY6Y,5987
341
+ reflex/constants/compiler.py,sha256=VoA1vWZpl-2EdIOhAiOLwSX4S-bFLbkiESlNBmN08NQ,5988
341
342
  reflex/constants/config.py,sha256=8OIjiBdZZJrRVHsNBheMwopE9AwBFFzau0SXqXKcrPg,1715
342
343
  reflex/constants/custom_components.py,sha256=joJt4CEt1yKy7wsBH6vYo7_QRW0O_fWXrrTf0VY2q14,1317
343
344
  reflex/constants/event.py,sha256=tgoynWQi2L0_Kqc3XhXo7XXL76A-OKhJGHRrNjm7gFw,2885
344
- reflex/constants/installer.py,sha256=5PeqMLsQRlUTNG2JXXyoukIc2Qpz55rVJTaySiqq_Js,4106
345
+ reflex/constants/installer.py,sha256=HXmzzfCaAD8a11n2GqQ8Caw5v9pjvXjAdOblo3vSMgk,4134
345
346
  reflex/constants/route.py,sha256=UBjqaAOxiUxlDZCSY4O2JJChKvA4MZrhUU0E5rNvKbM,2682
346
347
  reflex/constants/state.py,sha256=uF_7-M9Gid-P3DjAOq4F1ERplyZhiNccowo_jLrdJrg,323
347
348
  reflex/constants/utils.py,sha256=e1ChEvbHfmE_V2UJvCSUhD_qTVAIhEGPpRJSqdSd6PA,780
@@ -382,7 +383,7 @@ reflex/utils/misc.py,sha256=zbYIl7mI08is9enr851sj7PnDaNeVVvq5jDmQ4wdlCE,2879
382
383
  reflex/utils/net.py,sha256=HEHA8L5g7L9s0fFG4dTiZzB9PFO_0WRrlbMgpZr_GAQ,4093
383
384
  reflex/utils/path_ops.py,sha256=_RS17IQDNr5vcoLLGZx2-z1E5WP-JgDHvaRAOgqrZiU,8154
384
385
  reflex/utils/prerequisites.py,sha256=L2tCFqqiYqygRbQ0JMMBduMdsMkKJLDvzGKZnvI1Enc,66001
385
- reflex/utils/processes.py,sha256=eYzdfFhhnGnPxWN5USxdoLaYA8m8UEOOuxwxRRtLMW0,16196
386
+ reflex/utils/processes.py,sha256=lvr44qQpSsJvZjqoE1h1HBLjseEifM1goXrU-UUpAKA,16571
386
387
  reflex/utils/pyi_generator.py,sha256=HdmUVs50Bk7MAMFSvpATRhH--_50w-9URMFnjLlwT40,46086
387
388
  reflex/utils/redir.py,sha256=3JG0cRdfIZnFIBHHN32ynD5cfbUZa7gLRxzrxRGGl5I,1751
388
389
  reflex/utils/registry.py,sha256=DEF7csYQ5VnrZhy6ULVfMlceh7XVH0pks96lIyyThuc,1882
@@ -398,8 +399,8 @@ reflex/vars/number.py,sha256=tO7pnvFaBsedq1HWT4skytnSqHWMluGEhUbjAUMx8XQ,28190
398
399
  reflex/vars/object.py,sha256=BDmeiwG8v97s_BnR1Egq3NxOKVjv9TfnREB3cz0zZtk,17322
399
400
  reflex/vars/sequence.py,sha256=1kBrqihspyjyQ1XDqFPC8OpVGtZs_EVkOdIKBro5ilA,55249
400
401
  scripts/hatch_build.py,sha256=-4pxcLSFmirmujGpQX9UUxjhIC03tQ_fIQwVbHu9kc0,1861
401
- reflex-0.8.1a1.dist-info/METADATA,sha256=oBA8su-NDM7o_4kCnWj_BiHrr3bqA6xYd0lW0EskyWU,12371
402
- reflex-0.8.1a1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
403
- reflex-0.8.1a1.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
404
- reflex-0.8.1a1.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
405
- reflex-0.8.1a1.dist-info/RECORD,,
402
+ reflex-0.8.1.post1.dist-info/METADATA,sha256=awUYyxhxVyEDh27nzaCnybdpDXtVlT8wJy3pmmvhvQo,12375
403
+ reflex-0.8.1.post1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
404
+ reflex-0.8.1.post1.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
405
+ reflex-0.8.1.post1.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
406
+ reflex-0.8.1.post1.dist-info/RECORD,,