reflex 0.3.9a1__py3-none-any.whl → 0.3.9a2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/jinja/web/pages/utils.js.jinja2 +1 -1
- reflex/app.py +3 -4
- reflex/components/component.py +3 -1
- reflex/components/core/match.py +8 -4
- reflex/components/markdown/markdown.py +1 -0
- reflex/components/radix/__init__.py +2 -0
- reflex/components/radix/primitives/__init__.py +14 -1
- reflex/components/radix/primitives/accordion.py +426 -69
- reflex/components/radix/primitives/accordion.pyi +41 -11
- reflex/components/radix/primitives/base.py +4 -0
- reflex/components/radix/primitives/base.pyi +81 -0
- reflex/components/radix/primitives/form.py +4 -2
- reflex/components/radix/primitives/form.pyi +2 -2
- reflex/components/radix/primitives/progress.py +4 -2
- reflex/components/radix/primitives/progress.pyi +2 -2
- reflex/components/radix/primitives/slider.py +7 -5
- reflex/components/radix/primitives/slider.pyi +5 -5
- reflex/components/radix/themes/components/__init__.py +6 -2
- reflex/components/radix/themes/components/callout.py +36 -5
- reflex/components/radix/themes/components/callout.pyi +273 -9
- reflex/components/radix/themes/components/checkbox.py +41 -4
- reflex/components/radix/themes/components/checkbox.pyi +231 -8
- reflex/components/radix/themes/components/icons.py +1 -0
- reflex/components/radix/themes/components/radiogroup.py +65 -1
- reflex/components/radix/themes/components/radiogroup.pyi +252 -2
- reflex/components/radix/themes/components/select.py +81 -1
- reflex/components/radix/themes/components/select.pyi +237 -1
- reflex/state.py +6 -3
- reflex/style.py +15 -0
- reflex/utils/prerequisites.py +3 -1
- reflex/utils/types.py +4 -1
- reflex/vars.py +36 -3
- {reflex-0.3.9a1.dist-info → reflex-0.3.9a2.dist-info}/METADATA +1 -1
- {reflex-0.3.9a1.dist-info → reflex-0.3.9a2.dist-info}/RECORD +37 -37
- {reflex-0.3.9a1.dist-info → reflex-0.3.9a2.dist-info}/LICENSE +0 -0
- {reflex-0.3.9a1.dist-info → reflex-0.3.9a2.dist-info}/WHEEL +0 -0
- {reflex-0.3.9a1.dist-info → reflex-0.3.9a2.dist-info}/entry_points.txt +0 -0
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
{% macro render_match_tag(component) %}
|
|
86
86
|
{
|
|
87
87
|
(() => {
|
|
88
|
-
switch (JSON.stringify({{ component.cond.
|
|
88
|
+
switch (JSON.stringify({{ component.cond._var_name_unwrapped }})) {
|
|
89
89
|
{% for case in component.match_cases %}
|
|
90
90
|
{% for condition in case[:-1] %}
|
|
91
91
|
case JSON.stringify({{ condition._var_name_unwrapped }}):
|
reflex/app.py
CHANGED
|
@@ -46,7 +46,6 @@ from reflex.components.core.client_side_routing import (
|
|
|
46
46
|
Default404Page,
|
|
47
47
|
wait_for_client_redirect,
|
|
48
48
|
)
|
|
49
|
-
from reflex.components.radix import themes
|
|
50
49
|
from reflex.config import get_config
|
|
51
50
|
from reflex.event import Event, EventHandler, EventSpec
|
|
52
51
|
from reflex.middleware import HydrateMiddleware, Middleware
|
|
@@ -132,11 +131,11 @@ class App(Base):
|
|
|
132
131
|
Union[Component, ComponentCallable]
|
|
133
132
|
] = default_overlay_component
|
|
134
133
|
|
|
135
|
-
# Background tasks that are currently running
|
|
134
|
+
# Background tasks that are currently running.
|
|
136
135
|
background_tasks: Set[asyncio.Task] = set()
|
|
137
136
|
|
|
138
|
-
# The radix theme for the entire app
|
|
139
|
-
theme: Optional[Component]
|
|
137
|
+
# The radix theme for the entire app.
|
|
138
|
+
theme: Optional[Component]
|
|
140
139
|
|
|
141
140
|
def __init__(self, *args, **kwargs):
|
|
142
141
|
"""Initialize the app.
|
reflex/components/component.py
CHANGED
|
@@ -623,6 +623,8 @@ class Component(BaseComponent, ABC):
|
|
|
623
623
|
Returns:
|
|
624
624
|
The dictionary of the component style as value and the style notation as key.
|
|
625
625
|
"""
|
|
626
|
+
if isinstance(self.style, Var):
|
|
627
|
+
return {"css": self.style}
|
|
626
628
|
return {"css": Var.create(format_as_emotion(self.style))}
|
|
627
629
|
|
|
628
630
|
def render(self) -> Dict:
|
|
@@ -721,7 +723,7 @@ class Component(BaseComponent, ABC):
|
|
|
721
723
|
vars.append(prop_var)
|
|
722
724
|
|
|
723
725
|
# Style keeps track of its own VarData instance, so embed in a temp Var that is yielded.
|
|
724
|
-
if self.style:
|
|
726
|
+
if isinstance(self.style, dict) and self.style or isinstance(self.style, Var):
|
|
725
727
|
vars.append(
|
|
726
728
|
BaseVar(
|
|
727
729
|
_var_name="style",
|
reflex/components/core/match.py
CHANGED
|
@@ -64,7 +64,8 @@ class Match(MemoizationLeaf):
|
|
|
64
64
|
Raises:
|
|
65
65
|
ValueError: If the condition is not provided.
|
|
66
66
|
"""
|
|
67
|
-
match_cond_var = Var.create(cond)
|
|
67
|
+
match_cond_var = Var.create(cond, _var_is_string=type(cond) is str)
|
|
68
|
+
|
|
68
69
|
if match_cond_var is None:
|
|
69
70
|
raise ValueError("The condition must be set")
|
|
70
71
|
return match_cond_var # type: ignore
|
|
@@ -216,13 +217,14 @@ class Match(MemoizationLeaf):
|
|
|
216
217
|
|
|
217
218
|
return match_cond_var._replace(
|
|
218
219
|
_var_name=format.format_match(
|
|
219
|
-
cond=match_cond_var.
|
|
220
|
+
cond=match_cond_var._var_name_unwrapped,
|
|
220
221
|
match_cases=match_cases, # type: ignore
|
|
221
222
|
default=default, # type: ignore
|
|
222
223
|
),
|
|
223
224
|
_var_type=default._var_type, # type: ignore
|
|
224
225
|
_var_is_local=False,
|
|
225
226
|
_var_full_name_needs_state_prefix=False,
|
|
227
|
+
_var_is_string=False,
|
|
226
228
|
merge_var_data=VarData.merge(*var_data),
|
|
227
229
|
)
|
|
228
230
|
|
|
@@ -247,11 +249,13 @@ class Match(MemoizationLeaf):
|
|
|
247
249
|
for case in self.match_cases:
|
|
248
250
|
if isinstance(case[-1], BaseComponent):
|
|
249
251
|
merged_imports = imports.merge_imports(
|
|
250
|
-
merged_imports,
|
|
252
|
+
merged_imports,
|
|
253
|
+
case[-1].get_imports(),
|
|
251
254
|
)
|
|
252
255
|
# Get the import of the default case component.
|
|
253
256
|
if isinstance(self.default, BaseComponent):
|
|
254
257
|
merged_imports = imports.merge_imports(
|
|
255
|
-
merged_imports,
|
|
258
|
+
merged_imports,
|
|
259
|
+
self.default.get_imports(),
|
|
256
260
|
)
|
|
257
261
|
return merged_imports
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"""Radix primitive components (https://www.radix-ui.com/primitives)."""
|
|
2
2
|
|
|
3
|
-
from .accordion import
|
|
3
|
+
from .accordion import (
|
|
4
|
+
AccordionContent,
|
|
5
|
+
AccordionHeader,
|
|
6
|
+
AccordionRoot,
|
|
7
|
+
AccordionTrigger,
|
|
8
|
+
accordion_item,
|
|
9
|
+
)
|
|
4
10
|
from .form import (
|
|
5
11
|
form_control,
|
|
6
12
|
form_field,
|
|
@@ -12,3 +18,10 @@ from .form import (
|
|
|
12
18
|
)
|
|
13
19
|
from .progress import progress
|
|
14
20
|
from .slider import slider
|
|
21
|
+
|
|
22
|
+
# accordion
|
|
23
|
+
accordion = AccordionRoot.create
|
|
24
|
+
accordion_root = AccordionRoot.create
|
|
25
|
+
accordion_header = AccordionHeader.create
|
|
26
|
+
accordion_trigger = AccordionTrigger.create
|
|
27
|
+
accordion_content = AccordionContent.create
|