reflex 0.5.0a2__py3-none-any.whl → 0.5.0a3__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.
- reflex/.templates/apps/demo/code/demo.py +1 -1
- reflex/components/radix/primitives/accordion.py +4 -4
- reflex/components/radix/themes/color_mode.py +25 -1
- reflex/components/radix/themes/color_mode.pyi +178 -1
- reflex/custom_components/custom_components.py +2 -1
- {reflex-0.5.0a2.dist-info → reflex-0.5.0a3.dist-info}/METADATA +1 -1
- {reflex-0.5.0a2.dist-info → reflex-0.5.0a3.dist-info}/RECORD +10 -10
- {reflex-0.5.0a2.dist-info → reflex-0.5.0a3.dist-info}/LICENSE +0 -0
- {reflex-0.5.0a2.dist-info → reflex-0.5.0a3.dist-info}/WHEEL +0 -0
- {reflex-0.5.0a2.dist-info → reflex-0.5.0a3.dist-info}/entry_points.txt +0 -0
|
@@ -44,7 +44,7 @@ def template(main_content: Callable[[], rx.Component]) -> rx.Component:
|
|
|
44
44
|
),
|
|
45
45
|
rx.chakra.menu_item(
|
|
46
46
|
rx.chakra.link(
|
|
47
|
-
"Contact", href="mailto:founders
|
|
47
|
+
"Contact", href="mailto:founders@reflex.dev", width="100%"
|
|
48
48
|
)
|
|
49
49
|
),
|
|
50
50
|
),
|
|
@@ -266,12 +266,12 @@ class AccordionItem(AccordionComponent):
|
|
|
266
266
|
"&:first-child": {
|
|
267
267
|
"margin_top": 0,
|
|
268
268
|
"border_top": 0,
|
|
269
|
-
"border_top_left_radius": "
|
|
270
|
-
"border_top_right_radius": "
|
|
269
|
+
"border_top_left_radius": "var(--radius-4)",
|
|
270
|
+
"border_top_right_radius": "var(--radius-4)",
|
|
271
271
|
},
|
|
272
272
|
"&:last-child": {
|
|
273
|
-
"border_bottom_left_radius": "
|
|
274
|
-
"border_bottom_right_radius": "
|
|
273
|
+
"border_bottom_left_radius": "var(--radius-4)",
|
|
274
|
+
"border_bottom_right_radius": "var(--radius-4)",
|
|
275
275
|
},
|
|
276
276
|
"&:focus-within": {
|
|
277
277
|
"position": "relative",
|
|
@@ -23,7 +23,8 @@ from typing import Literal, get_args
|
|
|
23
23
|
from reflex.components.component import BaseComponent
|
|
24
24
|
from reflex.components.core.cond import Cond, color_mode_cond, cond
|
|
25
25
|
from reflex.components.lucide.icon import Icon
|
|
26
|
-
from reflex.
|
|
26
|
+
from reflex.components.radix.themes.components.switch import Switch
|
|
27
|
+
from reflex.style import LIGHT_COLOR_MODE, color_mode, toggle_color_mode
|
|
27
28
|
from reflex.utils import console
|
|
28
29
|
from reflex.vars import BaseVar, Var
|
|
29
30
|
|
|
@@ -143,11 +144,34 @@ class ColorModeIconButton(IconButton):
|
|
|
143
144
|
)
|
|
144
145
|
|
|
145
146
|
|
|
147
|
+
class ColorModeSwitch(Switch):
|
|
148
|
+
"""Switch for toggling light / dark mode via toggle_color_mode."""
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def create(cls, *children, **props):
|
|
152
|
+
"""Create a switch component bound to color_mode.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
*children: The children of the component.
|
|
156
|
+
**props: The props to pass to the component.
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
The switch component.
|
|
160
|
+
"""
|
|
161
|
+
return Switch.create(
|
|
162
|
+
*children,
|
|
163
|
+
checked=color_mode != LIGHT_COLOR_MODE,
|
|
164
|
+
on_change=toggle_color_mode,
|
|
165
|
+
**props,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
|
|
146
169
|
class ColorModeNamespace(BaseVar):
|
|
147
170
|
"""Namespace for color mode components."""
|
|
148
171
|
|
|
149
172
|
icon = staticmethod(ColorModeIcon.create)
|
|
150
173
|
button = staticmethod(ColorModeIconButton.create)
|
|
174
|
+
switch = staticmethod(ColorModeSwitch.create)
|
|
151
175
|
|
|
152
176
|
|
|
153
177
|
color_mode_var_and_namespace = ColorModeNamespace(**dataclasses.asdict(color_mode))
|
|
@@ -12,7 +12,8 @@ from typing import Literal, get_args
|
|
|
12
12
|
from reflex.components.component import BaseComponent
|
|
13
13
|
from reflex.components.core.cond import Cond, color_mode_cond, cond
|
|
14
14
|
from reflex.components.lucide.icon import Icon
|
|
15
|
-
from reflex.
|
|
15
|
+
from reflex.components.radix.themes.components.switch import Switch
|
|
16
|
+
from reflex.style import LIGHT_COLOR_MODE, color_mode, toggle_color_mode
|
|
16
17
|
from reflex.utils import console
|
|
17
18
|
from reflex.vars import BaseVar, Var
|
|
18
19
|
from .components.icon_button import IconButton
|
|
@@ -362,8 +363,184 @@ class ColorModeIconButton(IconButton):
|
|
|
362
363
|
"""
|
|
363
364
|
...
|
|
364
365
|
|
|
366
|
+
class ColorModeSwitch(Switch):
|
|
367
|
+
@overload
|
|
368
|
+
@classmethod
|
|
369
|
+
def create( # type: ignore
|
|
370
|
+
cls,
|
|
371
|
+
*children,
|
|
372
|
+
as_child: Optional[Union[Var[bool], bool]] = None,
|
|
373
|
+
default_checked: Optional[Union[Var[bool], bool]] = None,
|
|
374
|
+
checked: Optional[Union[Var[bool], bool]] = None,
|
|
375
|
+
disabled: Optional[Union[Var[bool], bool]] = None,
|
|
376
|
+
required: Optional[Union[Var[bool], bool]] = None,
|
|
377
|
+
name: Optional[Union[Var[str], str]] = None,
|
|
378
|
+
value: Optional[Union[Var[str], str]] = None,
|
|
379
|
+
size: Optional[
|
|
380
|
+
Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
|
|
381
|
+
] = None,
|
|
382
|
+
variant: Optional[
|
|
383
|
+
Union[
|
|
384
|
+
Var[Literal["classic", "surface", "soft"]],
|
|
385
|
+
Literal["classic", "surface", "soft"],
|
|
386
|
+
]
|
|
387
|
+
] = None,
|
|
388
|
+
color_scheme: Optional[
|
|
389
|
+
Union[
|
|
390
|
+
Var[
|
|
391
|
+
Literal[
|
|
392
|
+
"tomato",
|
|
393
|
+
"red",
|
|
394
|
+
"ruby",
|
|
395
|
+
"crimson",
|
|
396
|
+
"pink",
|
|
397
|
+
"plum",
|
|
398
|
+
"purple",
|
|
399
|
+
"violet",
|
|
400
|
+
"iris",
|
|
401
|
+
"indigo",
|
|
402
|
+
"blue",
|
|
403
|
+
"cyan",
|
|
404
|
+
"teal",
|
|
405
|
+
"jade",
|
|
406
|
+
"green",
|
|
407
|
+
"grass",
|
|
408
|
+
"brown",
|
|
409
|
+
"orange",
|
|
410
|
+
"sky",
|
|
411
|
+
"mint",
|
|
412
|
+
"lime",
|
|
413
|
+
"yellow",
|
|
414
|
+
"amber",
|
|
415
|
+
"gold",
|
|
416
|
+
"bronze",
|
|
417
|
+
"gray",
|
|
418
|
+
]
|
|
419
|
+
],
|
|
420
|
+
Literal[
|
|
421
|
+
"tomato",
|
|
422
|
+
"red",
|
|
423
|
+
"ruby",
|
|
424
|
+
"crimson",
|
|
425
|
+
"pink",
|
|
426
|
+
"plum",
|
|
427
|
+
"purple",
|
|
428
|
+
"violet",
|
|
429
|
+
"iris",
|
|
430
|
+
"indigo",
|
|
431
|
+
"blue",
|
|
432
|
+
"cyan",
|
|
433
|
+
"teal",
|
|
434
|
+
"jade",
|
|
435
|
+
"green",
|
|
436
|
+
"grass",
|
|
437
|
+
"brown",
|
|
438
|
+
"orange",
|
|
439
|
+
"sky",
|
|
440
|
+
"mint",
|
|
441
|
+
"lime",
|
|
442
|
+
"yellow",
|
|
443
|
+
"amber",
|
|
444
|
+
"gold",
|
|
445
|
+
"bronze",
|
|
446
|
+
"gray",
|
|
447
|
+
],
|
|
448
|
+
]
|
|
449
|
+
] = None,
|
|
450
|
+
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
451
|
+
radius: Optional[
|
|
452
|
+
Union[
|
|
453
|
+
Var[Literal["none", "small", "full"]], Literal["none", "small", "full"]
|
|
454
|
+
]
|
|
455
|
+
] = None,
|
|
456
|
+
style: Optional[Style] = None,
|
|
457
|
+
key: Optional[Any] = None,
|
|
458
|
+
id: Optional[Any] = None,
|
|
459
|
+
class_name: Optional[Any] = None,
|
|
460
|
+
autofocus: Optional[bool] = None,
|
|
461
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
462
|
+
on_blur: Optional[
|
|
463
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
464
|
+
] = None,
|
|
465
|
+
on_change: Optional[
|
|
466
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
467
|
+
] = None,
|
|
468
|
+
on_click: Optional[
|
|
469
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
470
|
+
] = None,
|
|
471
|
+
on_context_menu: Optional[
|
|
472
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
473
|
+
] = None,
|
|
474
|
+
on_double_click: Optional[
|
|
475
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
476
|
+
] = None,
|
|
477
|
+
on_focus: Optional[
|
|
478
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
479
|
+
] = None,
|
|
480
|
+
on_mount: Optional[
|
|
481
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
482
|
+
] = None,
|
|
483
|
+
on_mouse_down: Optional[
|
|
484
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
485
|
+
] = None,
|
|
486
|
+
on_mouse_enter: Optional[
|
|
487
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
488
|
+
] = None,
|
|
489
|
+
on_mouse_leave: Optional[
|
|
490
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
491
|
+
] = None,
|
|
492
|
+
on_mouse_move: Optional[
|
|
493
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
494
|
+
] = None,
|
|
495
|
+
on_mouse_out: Optional[
|
|
496
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
497
|
+
] = None,
|
|
498
|
+
on_mouse_over: Optional[
|
|
499
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
500
|
+
] = None,
|
|
501
|
+
on_mouse_up: Optional[
|
|
502
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
503
|
+
] = None,
|
|
504
|
+
on_scroll: Optional[
|
|
505
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
506
|
+
] = None,
|
|
507
|
+
on_unmount: Optional[
|
|
508
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
509
|
+
] = None,
|
|
510
|
+
**props
|
|
511
|
+
) -> "ColorModeSwitch":
|
|
512
|
+
"""Create a switch component bound to color_mode.
|
|
513
|
+
|
|
514
|
+
Args:
|
|
515
|
+
*children: The children of the component.
|
|
516
|
+
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
517
|
+
default_checked: Whether the switch is checked by default
|
|
518
|
+
checked: Whether the switch is checked
|
|
519
|
+
disabled: If true, prevent the user from interacting with the switch
|
|
520
|
+
required: If true, the user must interact with the switch to submit the form
|
|
521
|
+
name: The name of the switch (when submitting a form)
|
|
522
|
+
value: The value associated with the "on" position
|
|
523
|
+
size: Switch size "1" - "4"
|
|
524
|
+
variant: Variant of switch: "classic" | "surface" | "soft"
|
|
525
|
+
color_scheme: Override theme color for switch
|
|
526
|
+
high_contrast: Whether to render the switch with higher contrast color against background
|
|
527
|
+
radius: Override theme radius for switch: "none" | "small" | "full"
|
|
528
|
+
style: The style of the component.
|
|
529
|
+
key: A unique key for the component.
|
|
530
|
+
id: The id for the component.
|
|
531
|
+
class_name: The class name for the component.
|
|
532
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
533
|
+
custom_attrs: custom attribute
|
|
534
|
+
**props: The props to pass to the component.
|
|
535
|
+
|
|
536
|
+
Returns:
|
|
537
|
+
The switch component.
|
|
538
|
+
"""
|
|
539
|
+
...
|
|
540
|
+
|
|
365
541
|
class ColorModeNamespace(BaseVar):
|
|
366
542
|
icon = staticmethod(ColorModeIcon.create)
|
|
367
543
|
button = staticmethod(ColorModeIconButton.create)
|
|
544
|
+
switch = staticmethod(ColorModeSwitch.create)
|
|
368
545
|
|
|
369
546
|
color_mode_var_and_namespace = ColorModeNamespace(**dataclasses.asdict(color_mode))
|
|
@@ -20,7 +20,6 @@ from reflex import constants
|
|
|
20
20
|
from reflex.config import get_config
|
|
21
21
|
from reflex.constants import CustomComponents
|
|
22
22
|
from reflex.utils import console
|
|
23
|
-
from reflex.utils.pyi_generator import PyiGenerator
|
|
24
23
|
|
|
25
24
|
config = get_config()
|
|
26
25
|
custom_components_cli = typer.Typer()
|
|
@@ -438,6 +437,8 @@ def _run_commands_in_subprocess(cmds: list[str]) -> bool:
|
|
|
438
437
|
|
|
439
438
|
def _make_pyi_files():
|
|
440
439
|
"""Create pyi files for the custom component."""
|
|
440
|
+
from reflex.utils.pyi_generator import PyiGenerator
|
|
441
|
+
|
|
441
442
|
package_name = _get_package_config()["project"]["name"]
|
|
442
443
|
|
|
443
444
|
for dir, _, _ in os.walk(f"./{package_name}"):
|
|
@@ -8,7 +8,7 @@ reflex/.templates/apps/demo/assets/icon.svg,sha256=3EnRAihBIXdNZIf5cuFystIyoV6en
|
|
|
8
8
|
reflex/.templates/apps/demo/assets/logo.svg,sha256=f_YiqcSiX3jtK3j43YmEZK6z9f-KPCXcZN6vU71wgeQ,5403
|
|
9
9
|
reflex/.templates/apps/demo/assets/paneleft.svg,sha256=yXj0tH-VpnQaEwriXmb9ar2HgeXcGU5W6d4buKDUkA4,807
|
|
10
10
|
reflex/.templates/apps/demo/code/__init__.py,sha256=kYpJ6_dYllTemD8RF6s_LH8zL10PuK4Zuogutt1oeAI,32
|
|
11
|
-
reflex/.templates/apps/demo/code/demo.py,sha256=
|
|
11
|
+
reflex/.templates/apps/demo/code/demo.py,sha256=pm6jro3v-fKbvkWvKDm2CAW2OLa18vd5oaSCO_sfxPU,2927
|
|
12
12
|
reflex/.templates/apps/demo/code/pages/__init__.py,sha256=iHhkpNuJcB_j9A54SSpIcbWAt89PpoLbNIWCs0Sk2ac,194
|
|
13
13
|
reflex/.templates/apps/demo/code/pages/chatapp.py,sha256=1LQt8idpMfryzvblpg2iaOwhcLIXhUO9yVrt0KmFWCg,706
|
|
14
14
|
reflex/.templates/apps/demo/code/pages/datatable.py,sha256=7h7uOdMs93YGHjcUPUqhqjz0c2ZFhD-1KulVuQa6_q4,10906
|
|
@@ -314,7 +314,7 @@ reflex/components/plotly/plotly.py,sha256=GVExqrdSIfXngDFZATjjkomrwx97UM8F2W56rd
|
|
|
314
314
|
reflex/components/plotly/plotly.pyi,sha256=FrY0iQX7elz2ZWKW-DXdg8cz_v7bB7QqkZkpUZ1-oj8,6865
|
|
315
315
|
reflex/components/radix/__init__.py,sha256=5BGBr3z1_GcgCbNXUqAlK5AR13J7fxzFn4Wj-nTDNa4,112
|
|
316
316
|
reflex/components/radix/primitives/__init__.py,sha256=wkbCDG6q2MuZobhD6FeH9PgLXKZhb6cImguCV4n-aGs,214
|
|
317
|
-
reflex/components/radix/primitives/accordion.py,sha256=
|
|
317
|
+
reflex/components/radix/primitives/accordion.py,sha256=aOj_p-MpKq4vcRgVpDyO6bOWXIbKbSAycfGyHP9iOZs,16159
|
|
318
318
|
reflex/components/radix/primitives/accordion.pyi,sha256=GtWMMaWHXW0kjFmXJCWz37rmhq9AnlyIcrj3JovwmjA,37999
|
|
319
319
|
reflex/components/radix/primitives/base.py,sha256=s3OX4V2pNl6AQ3H9rz-pkE-2TNuNrqj0Mn2mOItF0eM,869
|
|
320
320
|
reflex/components/radix/primitives/base.pyi,sha256=_SqXWZfCB80_VHW-jO33WhoRunUpiUcUIxziG9Fb2fw,6478
|
|
@@ -329,8 +329,8 @@ reflex/components/radix/primitives/slider.pyi,sha256=mgVdvP64yRKgLe_Zxi1z2Q5o7Bg
|
|
|
329
329
|
reflex/components/radix/themes/__init__.py,sha256=G7nHi3YqfM17fVE_XycJYapjB6en3wCcuwFz6xci45Q,292
|
|
330
330
|
reflex/components/radix/themes/base.py,sha256=RepABp4uqffOZhzmFd210BgMcyXmsQrWTQXKqyjR5o8,8294
|
|
331
331
|
reflex/components/radix/themes/base.pyi,sha256=zAo0VQcLpSU4sxGT0DX6TaUF0IAjIei8IM04IgZFsHE,26971
|
|
332
|
-
reflex/components/radix/themes/color_mode.py,sha256=
|
|
333
|
-
reflex/components/radix/themes/color_mode.pyi,sha256=
|
|
332
|
+
reflex/components/radix/themes/color_mode.py,sha256=EREBySHvdxViFxXIggySSZeDkfGe4bs1XWmtGwIBRs0,5543
|
|
333
|
+
reflex/components/radix/themes/color_mode.pyi,sha256=4vL-az_AAulTiKOyY0_H3EyFMR_pxAB-EN50EEz7Oyc,22145
|
|
334
334
|
reflex/components/radix/themes/components/__init__.py,sha256=YNqd2CzuNp794X_12iVLC2b8HRDiyIDuwZWiS_bu620,2440
|
|
335
335
|
reflex/components/radix/themes/components/alert_dialog.py,sha256=QNxRfqZZQb5oYG1or68cYOYH5NaSuy3RK03QrLyfhuA,3267
|
|
336
336
|
reflex/components/radix/themes/components/alert_dialog.pyi,sha256=gVA8HRj4a_BmioWMIK8u6Xo4jO8QtwOcn7rKJtnmTlk,24434
|
|
@@ -479,7 +479,7 @@ reflex/constants/installer.py,sha256=NoxgxmrAeYMIclYe81yIXdltL38YqdKq0ty-tIEvZrQ
|
|
|
479
479
|
reflex/constants/route.py,sha256=fu1jp9MoIriUJ8Cu4gLeinTxkyVBbRPs8Bkt35vqYOM,2144
|
|
480
480
|
reflex/constants/style.py,sha256=gSzu0sQEQjW81PekxJnwRs7SXQQVco-LxtVjCi0IQZc,636
|
|
481
481
|
reflex/custom_components/__init__.py,sha256=R4zsvOi4dfPmHc18KEphohXnQFBPnUCb50cMR5hSLDE,36
|
|
482
|
-
reflex/custom_components/custom_components.py,sha256=
|
|
482
|
+
reflex/custom_components/custom_components.py,sha256=IAy_9dhH7XHPMO3VBZK70c-9Sv0rkzT4ckLPcKDQ0xs,32298
|
|
483
483
|
reflex/event.py,sha256=IJLjI9EdN64OJqOVllNppApZO8oAqMx0F0VyLegf4HQ,27893
|
|
484
484
|
reflex/experimental/__init__.py,sha256=sE-g9y56aC2pQxyMGvbm2-_hPKa4e1YBjrQ3cRhiRis,608
|
|
485
485
|
reflex/experimental/hooks.py,sha256=ruqdKV3smQT53vVwYvs8Zx4RyTy6nY00rD0Loe1gWdU,2196
|
|
@@ -514,8 +514,8 @@ reflex/utils/types.py,sha256=NVdeZIQZTrrUCJMmlRSzQ8ZvCdAnQPQWCLBQioR4aQg,14842
|
|
|
514
514
|
reflex/utils/watch.py,sha256=HzGrHQIZ_62Di0BO46kd2AZktNA3A6nFIBuf8c6ip30,2609
|
|
515
515
|
reflex/vars.py,sha256=1IboqkSJYh_z-XlWAPzfcCaX-5imVdv6QSrpUAXBWNg,67317
|
|
516
516
|
reflex/vars.pyi,sha256=7sVCLoLg9Y7QAmXWz6FCtVmScpSV84u0yQ3ZBImb_Bk,5583
|
|
517
|
-
reflex-0.5.
|
|
518
|
-
reflex-0.5.
|
|
519
|
-
reflex-0.5.
|
|
520
|
-
reflex-0.5.
|
|
521
|
-
reflex-0.5.
|
|
517
|
+
reflex-0.5.0a3.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
|
|
518
|
+
reflex-0.5.0a3.dist-info/METADATA,sha256=tAfeyCujv-w1HyQvj9FTyKfepts3VYNw2YLpnl-_dLE,12089
|
|
519
|
+
reflex-0.5.0a3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
520
|
+
reflex-0.5.0a3.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
|
|
521
|
+
reflex-0.5.0a3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|