reflex 0.3.7a1__py3-none-any.whl → 0.3.8__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/blank/code/blank.py +0 -1
- reflex/.templates/apps/demo/code/demo.py +0 -1
- reflex/.templates/apps/sidebar/code/sidebar.py +6 -2
- reflex/.templates/jinja/web/pages/_app.js.jinja2 +4 -1
- reflex/.templates/jinja/web/pages/base_page.js.jinja2 +4 -1
- reflex/.templates/jinja/web/pages/utils.js.jinja2 +24 -0
- reflex/.templates/jinja/web/tailwind.config.js.jinja2 +4 -1
- reflex/.templates/web/utils/helpers/dataeditor.js +56 -54
- reflex/__init__.py +4 -2
- reflex/__init__.pyi +6 -2
- reflex/app.py +43 -9
- reflex/app.pyi +2 -1
- reflex/app_module_for_backend.py +13 -0
- reflex/compiler/compiler.py +19 -0
- reflex/components/__init__.py +9 -232
- reflex/components/base/__init__.py +5 -1
- reflex/components/base/app_wrap.py +1 -1
- reflex/components/base/app_wrap.pyi +1 -1
- reflex/components/base/document.py +0 -8
- reflex/components/base/document.pyi +0 -80
- reflex/components/{layout → base}/fragment.pyi +1 -1
- reflex/components/chakra/__init__.py +202 -19
- reflex/components/{libs/chakra.pyi → chakra/base.pyi} +1 -1
- reflex/components/chakra/datadisplay/__init__.py +12 -0
- reflex/components/{datadisplay → chakra/datadisplay}/badge.py +1 -1
- reflex/components/{datadisplay → chakra/datadisplay}/badge.pyi +2 -2
- reflex/components/{datadisplay → chakra/datadisplay}/code.py +5 -5
- reflex/components/{datadisplay → chakra/datadisplay}/code.pyi +5 -5
- reflex/components/{datadisplay → chakra/datadisplay}/divider.py +4 -2
- reflex/components/{datadisplay → chakra/datadisplay}/divider.pyi +5 -3
- reflex/components/{datadisplay → chakra/datadisplay}/keyboard_key.py +1 -1
- reflex/components/{datadisplay → chakra/datadisplay}/keyboard_key.pyi +2 -2
- reflex/components/{datadisplay → chakra/datadisplay}/list.py +3 -3
- reflex/components/{datadisplay → chakra/datadisplay}/list.pyi +4 -4
- reflex/components/{datadisplay → chakra/datadisplay}/stat.py +1 -1
- reflex/components/{datadisplay → chakra/datadisplay}/stat.pyi +2 -2
- reflex/components/{datadisplay → chakra/datadisplay}/table.py +2 -2
- reflex/components/{datadisplay → chakra/datadisplay}/table.pyi +3 -3
- reflex/components/{datadisplay → chakra/datadisplay}/tag.py +2 -2
- reflex/components/{datadisplay → chakra/datadisplay}/tag.pyi +3 -3
- reflex/components/{disclosure → chakra/disclosure}/accordion.py +1 -1
- reflex/components/{disclosure → chakra/disclosure}/accordion.pyi +2 -2
- reflex/components/{disclosure → chakra/disclosure}/tabs.py +2 -2
- reflex/components/{disclosure → chakra/disclosure}/tabs.pyi +3 -3
- reflex/components/{disclosure → chakra/disclosure}/transition.py +1 -1
- reflex/components/{disclosure → chakra/disclosure}/transition.pyi +2 -2
- reflex/components/{disclosure → chakra/disclosure}/visuallyhidden.py +1 -1
- reflex/components/{disclosure → chakra/disclosure}/visuallyhidden.pyi +2 -2
- reflex/components/{feedback → chakra/feedback}/alert.py +2 -2
- reflex/components/{feedback → chakra/feedback}/alert.pyi +2 -6
- reflex/components/{feedback → chakra/feedback}/circularprogress.py +1 -1
- reflex/components/{feedback → chakra/feedback}/circularprogress.pyi +2 -2
- reflex/components/{feedback → chakra/feedback}/progress.py +1 -1
- reflex/components/{feedback → chakra/feedback}/progress.pyi +2 -2
- reflex/components/{feedback → chakra/feedback}/skeleton.py +1 -1
- reflex/components/{feedback → chakra/feedback}/skeleton.pyi +2 -2
- reflex/components/{feedback → chakra/feedback}/spinner.py +1 -1
- reflex/components/{feedback → chakra/feedback}/spinner.pyi +2 -2
- reflex/components/{forms → chakra/forms}/__init__.py +2 -11
- reflex/components/{forms → chakra/forms}/button.py +3 -1
- reflex/components/{forms → chakra/forms}/button.pyi +2 -2
- reflex/components/{forms → chakra/forms}/checkbox.py +1 -1
- reflex/components/{forms → chakra/forms}/checkbox.pyi +2 -6
- reflex/components/{forms → chakra/forms}/colormodeswitch.py +10 -2
- reflex/components/{forms → chakra/forms}/colormodeswitch.pyi +83 -3
- reflex/components/{forms → chakra/forms}/date_picker.py +1 -1
- reflex/components/{forms → chakra/forms}/date_picker.pyi +2 -2
- reflex/components/{forms → chakra/forms}/date_time_picker.py +1 -1
- reflex/components/{forms → chakra/forms}/date_time_picker.pyi +2 -2
- reflex/components/{forms → chakra/forms}/editable.py +1 -1
- reflex/components/{forms → chakra/forms}/editable.pyi +2 -2
- reflex/components/{forms → chakra/forms}/email.py +1 -1
- reflex/components/{forms → chakra/forms}/email.pyi +2 -2
- reflex/components/{forms → chakra/forms}/form.py +1 -1
- reflex/components/{forms → chakra/forms}/form.pyi +2 -2
- reflex/components/{forms → chakra/forms}/iconbutton.py +1 -1
- reflex/components/{forms → chakra/forms}/iconbutton.pyi +2 -2
- reflex/components/{forms → chakra/forms}/input.py +5 -4
- reflex/components/{forms → chakra/forms}/input.pyi +59 -5
- reflex/components/{forms → chakra/forms}/numberinput.py +6 -2
- reflex/components/{forms → chakra/forms}/numberinput.pyi +10 -2
- reflex/components/{forms → chakra/forms}/password.py +1 -1
- reflex/components/{forms → chakra/forms}/password.pyi +2 -2
- reflex/components/{forms → chakra/forms}/pininput.py +1 -1
- reflex/components/{forms → chakra/forms}/pininput.pyi +2 -2
- reflex/components/{forms → chakra/forms}/radio.py +3 -3
- reflex/components/{forms → chakra/forms}/radio.pyi +4 -4
- reflex/components/{forms → chakra/forms}/rangeslider.py +1 -1
- reflex/components/{forms → chakra/forms}/rangeslider.pyi +2 -2
- reflex/components/{forms → chakra/forms}/select.py +3 -3
- reflex/components/{forms → chakra/forms}/select.pyi +4 -4
- reflex/components/{forms → chakra/forms}/slider.py +4 -3
- reflex/components/{forms → chakra/forms}/slider.pyi +5 -4
- reflex/components/{forms → chakra/forms}/switch.py +1 -1
- reflex/components/{forms → chakra/forms}/switch.pyi +2 -2
- reflex/components/{forms → chakra/forms}/textarea.py +2 -2
- reflex/components/{forms → chakra/forms}/textarea.pyi +3 -3
- reflex/components/chakra/forms/time_picker.py +11 -0
- reflex/components/chakra/forms/time_picker.pyi +129 -0
- reflex/components/{layout → chakra/layout}/__init__.py +1 -20
- reflex/components/{layout → chakra/layout}/aspect_ratio.py +1 -1
- reflex/components/{layout → chakra/layout}/aspect_ratio.pyi +2 -2
- reflex/components/{layout → chakra/layout}/box.py +1 -1
- reflex/components/{layout → chakra/layout}/box.pyi +2 -2
- reflex/components/{layout → chakra/layout}/card.py +2 -2
- reflex/components/{layout → chakra/layout}/card.pyi +3 -3
- reflex/components/{layout → chakra/layout}/center.py +1 -1
- reflex/components/{layout → chakra/layout}/center.pyi +2 -2
- reflex/components/{layout → chakra/layout}/container.py +1 -1
- reflex/components/{layout → chakra/layout}/container.pyi +2 -2
- reflex/components/{layout → chakra/layout}/flex.py +1 -1
- reflex/components/{layout → chakra/layout}/flex.pyi +2 -2
- reflex/components/{layout → chakra/layout}/grid.py +1 -1
- reflex/components/{layout → chakra/layout}/grid.pyi +2 -2
- reflex/components/{layout → chakra/layout}/html.py +1 -1
- reflex/components/{layout → chakra/layout}/html.pyi +2 -2
- reflex/components/{layout → chakra/layout}/spacer.py +1 -1
- reflex/components/{layout → chakra/layout}/spacer.pyi +2 -2
- reflex/components/{layout → chakra/layout}/stack.py +1 -1
- reflex/components/{layout → chakra/layout}/stack.pyi +2 -2
- reflex/components/{layout → chakra/layout}/wrap.py +1 -1
- reflex/components/{layout → chakra/layout}/wrap.pyi +2 -2
- reflex/components/chakra/media/__init__.py +7 -0
- reflex/components/{media → chakra/media}/avatar.py +1 -1
- reflex/components/{media → chakra/media}/avatar.pyi +2 -2
- reflex/components/chakra/media/icon.py +110 -0
- reflex/components/{media → chakra/media}/icon.pyi +2 -2
- reflex/components/chakra/media/image.py +1 -1
- reflex/components/chakra/media/image.pyi +1 -1
- reflex/components/{navigation → chakra/navigation}/__init__.py +0 -1
- reflex/components/{navigation → chakra/navigation}/breadcrumb.py +3 -3
- reflex/components/{navigation → chakra/navigation}/breadcrumb.pyi +4 -4
- reflex/components/{navigation → chakra/navigation}/link.py +2 -2
- reflex/components/{navigation → chakra/navigation}/link.pyi +3 -3
- reflex/components/{navigation → chakra/navigation}/linkoverlay.py +1 -1
- reflex/components/{navigation → chakra/navigation}/linkoverlay.pyi +2 -2
- reflex/components/{navigation → chakra/navigation}/stepper.py +1 -1
- reflex/components/{navigation → chakra/navigation}/stepper.pyi +2 -2
- reflex/components/{overlay → chakra/overlay}/__init__.py +0 -1
- reflex/components/{overlay → chakra/overlay}/alertdialog.py +2 -2
- reflex/components/{overlay → chakra/overlay}/alertdialog.pyi +3 -3
- reflex/components/{overlay → chakra/overlay}/drawer.py +3 -3
- reflex/components/{overlay → chakra/overlay}/drawer.pyi +4 -4
- reflex/components/{overlay → chakra/overlay}/menu.py +4 -6
- reflex/components/{overlay → chakra/overlay}/menu.pyi +4 -4
- reflex/components/{overlay → chakra/overlay}/modal.py +2 -2
- reflex/components/{overlay → chakra/overlay}/modal.pyi +3 -3
- reflex/components/{overlay → chakra/overlay}/popover.py +2 -2
- reflex/components/{overlay → chakra/overlay}/popover.pyi +3 -3
- reflex/components/{overlay → chakra/overlay}/tooltip.py +1 -1
- reflex/components/{overlay → chakra/overlay}/tooltip.pyi +2 -2
- reflex/components/{typography → chakra/typography}/__init__.py +0 -1
- reflex/components/{typography → chakra/typography}/heading.py +1 -1
- reflex/components/{typography → chakra/typography}/heading.pyi +2 -2
- reflex/components/{typography → chakra/typography}/highlight.py +1 -1
- reflex/components/{typography → chakra/typography}/highlight.pyi +2 -2
- reflex/components/{typography → chakra/typography}/span.py +1 -1
- reflex/components/{typography → chakra/typography}/span.pyi +2 -2
- reflex/components/{typography → chakra/typography}/text.py +1 -1
- reflex/components/{typography → chakra/typography}/text.pyi +2 -2
- reflex/components/component.py +7 -8
- reflex/components/core/__init__.py +22 -0
- reflex/components/{overlay → core}/banner.py +4 -3
- reflex/components/{overlay → core}/banner.pyi +5 -4
- reflex/components/{navigation → core}/client_side_routing.py +1 -1
- reflex/components/{navigation → core}/client_side_routing.pyi +2 -2
- reflex/components/{layout → core}/cond.py +1 -1
- reflex/components/{forms → core}/debounce.py +1 -1
- reflex/components/{forms → core}/debounce.pyi +2 -2
- reflex/components/{layout → core}/foreach.py +18 -2
- reflex/components/core/match.py +257 -0
- reflex/components/{layout → core}/responsive.py +1 -1
- reflex/components/{forms → core}/upload.py +2 -2
- reflex/components/{forms → core}/upload.pyi +3 -3
- reflex/components/datadisplay/__init__.py +4 -13
- reflex/components/el/elements/inline.py +4 -0
- reflex/components/el/elements/inline.pyi +3 -0
- reflex/components/gridjs/__init__.py +5 -0
- reflex/components/{datadisplay → gridjs}/datatable.pyi +1 -1
- reflex/components/literals.py +27 -0
- reflex/components/markdown/__init__.py +5 -0
- reflex/components/{typography → markdown}/markdown.py +16 -6
- reflex/components/{typography → markdown}/markdown.pyi +10 -5
- reflex/components/media/__init__.py +1 -8
- reflex/components/media/icon.py +2 -110
- reflex/components/moment/__init__.py +5 -0
- reflex/components/{datadisplay → moment}/moment.pyi +1 -1
- reflex/components/next/__init__.py +2 -0
- reflex/components/{navigation/nextlink.pyi → next/link.pyi} +1 -1
- reflex/components/plotly/__init__.py +5 -0
- reflex/components/{graphing → plotly}/plotly.pyi +1 -1
- reflex/components/radix/primitives/__init__.py +12 -1
- reflex/components/radix/primitives/accordion.py +33 -68
- reflex/components/radix/primitives/accordion.pyi +6 -89
- reflex/components/radix/primitives/base.py +27 -0
- reflex/components/radix/primitives/base.pyi +95 -0
- reflex/components/radix/primitives/form.py +267 -0
- reflex/components/radix/primitives/form.pyi +740 -0
- reflex/components/radix/primitives/progress.py +84 -0
- reflex/components/radix/primitives/progress.pyi +268 -0
- reflex/components/radix/primitives/slider.py +179 -0
- reflex/components/radix/primitives/slider.pyi +452 -0
- reflex/components/radix/themes/base.py +43 -31
- reflex/components/radix/themes/base.pyi +223 -29
- reflex/components/radix/themes/components/__init__.py +18 -3
- reflex/components/radix/themes/components/alertdialog.py +27 -6
- reflex/components/radix/themes/components/alertdialog.pyi +713 -2
- reflex/components/radix/themes/components/aspectratio.py +1 -1
- reflex/components/radix/themes/components/aspectratio.pyi +67 -2
- reflex/components/radix/themes/components/avatar.py +0 -3
- reflex/components/radix/themes/components/avatar.pyi +13 -13
- reflex/components/radix/themes/components/badge.py +1 -4
- reflex/components/radix/themes/components/badge.pyi +11 -11
- reflex/components/radix/themes/components/button.py +1 -1
- reflex/components/radix/themes/components/button.pyi +15 -11
- reflex/components/radix/themes/components/callout.pyi +144 -12
- reflex/components/radix/themes/components/card.py +1 -1
- reflex/components/radix/themes/components/card.pyi +68 -1
- reflex/components/radix/themes/components/checkbox.pyi +14 -12
- reflex/components/radix/themes/components/contextmenu.pyi +402 -8
- reflex/components/radix/themes/components/dialog.py +6 -0
- reflex/components/radix/themes/components/dialog.pyi +518 -0
- reflex/components/radix/themes/components/dropdownmenu.pyi +337 -8
- reflex/components/radix/themes/components/hovercard.pyi +195 -0
- reflex/components/radix/themes/components/iconbutton.pyi +14 -12
- reflex/components/radix/themes/components/icons.py +2 -2
- reflex/components/radix/themes/components/inset.pyi +65 -0
- reflex/components/radix/themes/components/popover.pyi +260 -0
- reflex/components/radix/themes/components/radiogroup.py +1 -1
- reflex/components/radix/themes/components/radiogroup.pyi +78 -9
- reflex/components/radix/themes/components/scrollarea.pyi +65 -0
- reflex/components/radix/themes/components/select.pyi +342 -13
- reflex/components/radix/themes/components/separator.pyi +7 -5
- reflex/components/radix/themes/components/slider.py +4 -4
- reflex/components/radix/themes/components/slider.pyi +17 -13
- reflex/components/radix/themes/components/switch.pyi +20 -18
- reflex/components/radix/themes/components/table.py +1 -1
- reflex/components/radix/themes/components/table.pyi +458 -1
- reflex/components/radix/themes/components/tabs.py +4 -4
- reflex/components/radix/themes/components/tabs.pyi +263 -3
- reflex/components/radix/themes/components/textarea.py +1 -1
- reflex/components/radix/themes/components/textarea.pyi +1 -1
- reflex/components/radix/themes/components/textfield.py +1 -1
- reflex/components/radix/themes/components/textfield.pyi +18 -14
- reflex/components/radix/themes/components/tooltip.py +15 -0
- reflex/components/radix/themes/components/tooltip.pyi +205 -0
- reflex/components/radix/themes/layout/base.pyi +65 -0
- reflex/components/radix/themes/layout/box.pyi +65 -0
- reflex/components/radix/themes/layout/container.pyi +65 -0
- reflex/components/radix/themes/layout/flex.pyi +65 -0
- reflex/components/radix/themes/layout/grid.pyi +65 -0
- reflex/components/radix/themes/layout/section.pyi +65 -0
- reflex/components/radix/themes/typography/blockquote.pyi +16 -14
- reflex/components/radix/themes/typography/code.pyi +22 -20
- reflex/components/radix/themes/typography/em.pyi +65 -0
- reflex/components/radix/themes/typography/heading.pyi +30 -28
- reflex/components/radix/themes/typography/kbd.pyi +65 -0
- reflex/components/radix/themes/typography/link.py +2 -1
- reflex/components/radix/themes/typography/link.pyi +121 -28
- reflex/components/radix/themes/typography/quote.pyi +66 -0
- reflex/components/radix/themes/typography/strong.pyi +65 -0
- reflex/components/radix/themes/typography/text.pyi +30 -28
- reflex/components/react_player/__init__.py +7 -0
- reflex/components/react_player/audio.py +8 -0
- reflex/components/{media → react_player}/audio.pyi +3 -3
- reflex/components/{libs → react_player}/react_player.py +1 -1
- reflex/components/{libs → react_player}/react_player.pyi +3 -3
- reflex/components/react_player/video.py +8 -0
- reflex/components/{media → react_player}/video.pyi +3 -3
- reflex/components/{graphing/recharts → recharts}/cartesian.pyi +1 -1
- reflex/components/{graphing/recharts → recharts}/charts.py +1 -1
- reflex/components/{graphing/recharts → recharts}/charts.pyi +2 -2
- reflex/components/{graphing/recharts → recharts}/general.pyi +1 -1
- reflex/components/{graphing/recharts → recharts}/polar.pyi +1 -1
- reflex/components/{graphing/recharts → recharts}/recharts.pyi +1 -1
- reflex/components/suneditor/__init__.py +5 -0
- reflex/components/{forms → suneditor}/editor.pyi +1 -1
- reflex/components/tags/__init__.py +1 -0
- reflex/components/tags/iter_tag.py +3 -3
- reflex/components/tags/match_tag.py +19 -0
- reflex/constants/base.py +2 -0
- reflex/constants/config.py +1 -1
- reflex/constants/installer.py +1 -0
- reflex/constants/style.py +1 -1
- reflex/event.py +1 -1
- reflex/reflex.py +14 -12
- reflex/state.py +14 -0
- reflex/style.py +1 -1
- reflex/testing.py +59 -9
- reflex/utils/build.py +7 -1
- reflex/utils/exceptions.py +6 -0
- reflex/utils/exec.py +2 -2
- reflex/utils/export.py +1 -1
- reflex/utils/format.py +41 -4
- reflex/utils/prerequisites.py +56 -11
- reflex/utils/processes.py +8 -1
- reflex/utils/types.py +2 -2
- reflex/vars.py +25 -1
- {reflex-0.3.7a1.dist-info → reflex-0.3.8.dist-info}/METADATA +8 -2
- reflex-0.3.8.dist-info/RECORD +492 -0
- reflex/components/graphing/__init__.py +0 -5
- reflex/components/libs/__init__.py +0 -31
- reflex/components/media/audio.py +0 -8
- reflex/components/media/image.pyi +0 -123
- reflex/components/media/video.py +0 -8
- reflex-0.3.7a1.dist-info/RECORD +0 -470
- /reflex/components/{layout → base}/fragment.py +0 -0
- /reflex/components/{libs/chakra.py → chakra/base.py} +0 -0
- /reflex/components/{disclosure → chakra/disclosure}/__init__.py +0 -0
- /reflex/components/{feedback → chakra/feedback}/__init__.py +0 -0
- /reflex/components/{forms → chakra/forms}/multiselect.py +0 -0
- /reflex/components/{datadisplay → gridjs}/datatable.py +0 -0
- /reflex/components/{datadisplay → moment}/moment.py +0 -0
- /reflex/components/{navigation/nextlink.py → next/link.py} +0 -0
- /reflex/components/{graphing → plotly}/plotly.py +0 -0
- /reflex/components/{graphing/recharts → recharts}/__init__.py +0 -0
- /reflex/components/{graphing/recharts → recharts}/cartesian.py +0 -0
- /reflex/components/{graphing/recharts → recharts}/general.py +0 -0
- /reflex/components/{graphing/recharts → recharts}/polar.py +0 -0
- /reflex/components/{graphing/recharts → recharts}/recharts.py +0 -0
- /reflex/components/{forms → suneditor}/editor.py +0 -0
- {reflex-0.3.7a1.dist-info → reflex-0.3.8.dist-info}/LICENSE +0 -0
- {reflex-0.3.7a1.dist-info → reflex-0.3.8.dist-info}/WHEEL +0 -0
- {reflex-0.3.7a1.dist-info → reflex-0.3.8.dist-info}/entry_points.txt +0 -0
reflex/components/media/icon.py
CHANGED
|
@@ -1,110 +1,2 @@
|
|
|
1
|
-
"""
|
|
2
|
-
from
|
|
3
|
-
|
|
4
|
-
from reflex.components.libs.chakra import ChakraComponent
|
|
5
|
-
from reflex.utils import format
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class ChakraIconComponent(ChakraComponent):
|
|
9
|
-
"""A component that wraps a Chakra icon component."""
|
|
10
|
-
|
|
11
|
-
library = "@chakra-ui/icons@2.0.19"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class Icon(ChakraIconComponent):
|
|
15
|
-
"""An image icon."""
|
|
16
|
-
|
|
17
|
-
tag = "None"
|
|
18
|
-
|
|
19
|
-
@classmethod
|
|
20
|
-
def create(cls, *children, **props):
|
|
21
|
-
"""Initialize the Icon component.
|
|
22
|
-
|
|
23
|
-
Run some additional checks on Icon component.
|
|
24
|
-
|
|
25
|
-
Args:
|
|
26
|
-
*children: The positional arguments
|
|
27
|
-
**props: The keyword arguments
|
|
28
|
-
|
|
29
|
-
Raises:
|
|
30
|
-
AttributeError: The errors tied to bad usage of the Icon component.
|
|
31
|
-
ValueError: If the icon tag is invalid.
|
|
32
|
-
|
|
33
|
-
Returns:
|
|
34
|
-
The created component.
|
|
35
|
-
"""
|
|
36
|
-
if children:
|
|
37
|
-
raise AttributeError(
|
|
38
|
-
f"Passing children to Icon component is not allowed: remove positional arguments {children} to fix"
|
|
39
|
-
)
|
|
40
|
-
if "tag" not in props.keys():
|
|
41
|
-
raise AttributeError("Missing 'tag' keyword-argument for Icon")
|
|
42
|
-
if type(props["tag"]) != str or props["tag"].lower() not in ICON_LIST:
|
|
43
|
-
raise ValueError(
|
|
44
|
-
f"Invalid icon tag: {props['tag']}. Please use one of the following: {ICON_LIST}"
|
|
45
|
-
)
|
|
46
|
-
props["tag"] = format.to_title_case(props["tag"]) + "Icon"
|
|
47
|
-
return super().create(*children, **props)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
# List of all icons.
|
|
51
|
-
ICON_LIST: List[str] = [
|
|
52
|
-
"add",
|
|
53
|
-
"arrow_back",
|
|
54
|
-
"arrow_down",
|
|
55
|
-
"arrow_forward",
|
|
56
|
-
"arrow_left",
|
|
57
|
-
"arrow_right",
|
|
58
|
-
"arrow_up",
|
|
59
|
-
"arrow_up_down",
|
|
60
|
-
"at_sign",
|
|
61
|
-
"attachment",
|
|
62
|
-
"bell",
|
|
63
|
-
"calendar",
|
|
64
|
-
"chat",
|
|
65
|
-
"check_circle",
|
|
66
|
-
"check",
|
|
67
|
-
"chevron_down",
|
|
68
|
-
"chevron_left",
|
|
69
|
-
"chevron_right",
|
|
70
|
-
"chevron_up",
|
|
71
|
-
"close",
|
|
72
|
-
"copy",
|
|
73
|
-
"delete",
|
|
74
|
-
"download",
|
|
75
|
-
"drag_handle",
|
|
76
|
-
"edit",
|
|
77
|
-
"email",
|
|
78
|
-
"external_link",
|
|
79
|
-
"hamburger",
|
|
80
|
-
"info",
|
|
81
|
-
"info_outline",
|
|
82
|
-
"link",
|
|
83
|
-
"lock",
|
|
84
|
-
"minus",
|
|
85
|
-
"moon",
|
|
86
|
-
"not_allowed",
|
|
87
|
-
"phone",
|
|
88
|
-
"plus_square",
|
|
89
|
-
"question",
|
|
90
|
-
"question_outline",
|
|
91
|
-
"repeat",
|
|
92
|
-
"repeat_clock",
|
|
93
|
-
"search",
|
|
94
|
-
"search2",
|
|
95
|
-
"settings",
|
|
96
|
-
"small_add",
|
|
97
|
-
"small_close",
|
|
98
|
-
"spinner",
|
|
99
|
-
"star",
|
|
100
|
-
"sun",
|
|
101
|
-
"time",
|
|
102
|
-
"triangle_down",
|
|
103
|
-
"triangle_up",
|
|
104
|
-
"unlock",
|
|
105
|
-
"up_down",
|
|
106
|
-
"view",
|
|
107
|
-
"view_off",
|
|
108
|
-
"warning",
|
|
109
|
-
"warning_two",
|
|
110
|
-
]
|
|
1
|
+
"""Shim for reflex.components.chakra.media.icon."""
|
|
2
|
+
from reflex.components.chakra.media.icon import *
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Stub file for reflex/components/
|
|
1
|
+
"""Stub file for reflex/components/moment/moment.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
3
|
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Stub file for reflex/components/
|
|
1
|
+
"""Stub file for reflex/components/next/link.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
3
|
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Stub file for reflex/components/
|
|
1
|
+
"""Stub file for reflex/components/plotly/plotly.py"""
|
|
2
2
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
3
|
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
4
|
# ------------------------------------------------------
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"""Radix primitive components (https://www.radix-ui.com/primitives)."""
|
|
2
2
|
|
|
3
|
-
from .accordion import accordion
|
|
3
|
+
from .accordion import accordion, accordion_item
|
|
4
|
+
from .form import (
|
|
5
|
+
form_control,
|
|
6
|
+
form_field,
|
|
7
|
+
form_label,
|
|
8
|
+
form_message,
|
|
9
|
+
form_root,
|
|
10
|
+
form_submit,
|
|
11
|
+
form_validity_state,
|
|
12
|
+
)
|
|
13
|
+
from .progress import progress
|
|
14
|
+
from .slider import slider
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
from typing import Literal
|
|
4
4
|
|
|
5
5
|
from reflex.components.component import Component
|
|
6
|
-
from reflex.components.
|
|
6
|
+
from reflex.components.radix.primitives.base import RadixPrimitiveComponent
|
|
7
|
+
from reflex.components.radix.themes.components.icons import Icon
|
|
7
8
|
from reflex.style import Style
|
|
8
|
-
from reflex.utils import
|
|
9
|
+
from reflex.utils import imports
|
|
9
10
|
from reflex.vars import Var
|
|
10
11
|
|
|
11
12
|
LiteralAccordionType = Literal["single", "multiple"]
|
|
@@ -16,25 +17,11 @@ LiteralAccordionOrientation = Literal["vertical", "horizontal"]
|
|
|
16
17
|
DEFAULT_ANIMATION_DURATION = 250
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
class AccordionComponent(
|
|
20
|
+
class AccordionComponent(RadixPrimitiveComponent):
|
|
20
21
|
"""Base class for all @radix-ui/accordion components."""
|
|
21
22
|
|
|
22
23
|
library = "@radix-ui/react-accordion@^1.1.2"
|
|
23
24
|
|
|
24
|
-
# Change the default rendered element for the one passed as a child.
|
|
25
|
-
as_child: Var[bool]
|
|
26
|
-
|
|
27
|
-
def _render(self) -> Tag:
|
|
28
|
-
return (
|
|
29
|
-
super()
|
|
30
|
-
._render()
|
|
31
|
-
.add_props(
|
|
32
|
-
**{
|
|
33
|
-
"class_name": format.to_title_case(self.tag or ""),
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
)
|
|
37
|
-
|
|
38
25
|
|
|
39
26
|
class AccordionRoot(AccordionComponent):
|
|
40
27
|
"""An accordion component."""
|
|
@@ -152,6 +139,10 @@ class AccordionTrigger(AccordionComponent):
|
|
|
152
139
|
"&:hover": {
|
|
153
140
|
"background_color": "var(--gray-2)",
|
|
154
141
|
},
|
|
142
|
+
"& > .AccordionChevron": {
|
|
143
|
+
"color": "var(--accent-10)",
|
|
144
|
+
"transition": f"transform {DEFAULT_ANIMATION_DURATION}ms cubic-bezier(0.87, 0, 0.13, 1)",
|
|
145
|
+
},
|
|
155
146
|
"&[data-state='open'] > .AccordionChevron": {
|
|
156
147
|
"transform": "rotate(180deg)",
|
|
157
148
|
},
|
|
@@ -218,62 +209,36 @@ to {
|
|
|
218
209
|
"""
|
|
219
210
|
|
|
220
211
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"""A chevron down icon."""
|
|
224
|
-
|
|
225
|
-
library = "@radix-ui/react-icons"
|
|
226
|
-
|
|
227
|
-
tag = "ChevronDownIcon"
|
|
228
|
-
|
|
229
|
-
def _apply_theme(self, theme: Component):
|
|
230
|
-
self.style = Style(
|
|
231
|
-
{
|
|
232
|
-
"color": "var(--accent-10)",
|
|
233
|
-
"transition": f"transform {DEFAULT_ANIMATION_DURATION}ms cubic-bezier(0.87, 0, 0.13, 1)",
|
|
234
|
-
**self.style,
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
accordion_root = AccordionRoot.create
|
|
240
|
-
accordion_item = AccordionItem.create
|
|
241
|
-
accordion_trigger = AccordionTrigger.create
|
|
242
|
-
accordion_content = AccordionContent.create
|
|
243
|
-
accordion_header = AccordionHeader.create
|
|
244
|
-
chevron_down_icon = ChevronDownIcon.create
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
def accordion(items: list[tuple[str, str]], **props) -> Component:
|
|
248
|
-
"""High level API for the Radix accordion.
|
|
249
|
-
|
|
250
|
-
#TODO: We need to handle taking in state here. This is just for a POC.
|
|
251
|
-
|
|
212
|
+
def accordion_item(header: Component, content: Component, **props) -> Component:
|
|
213
|
+
"""Create an accordion item.
|
|
252
214
|
|
|
253
215
|
Args:
|
|
254
|
-
|
|
255
|
-
|
|
216
|
+
header: The header of the accordion item.
|
|
217
|
+
content: The content of the accordion item.
|
|
218
|
+
**props: Additional properties to apply to the accordion item.
|
|
256
219
|
|
|
257
220
|
Returns:
|
|
258
|
-
The accordion
|
|
221
|
+
The accordion item.
|
|
259
222
|
"""
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
),
|
|
271
|
-
accordion_content(
|
|
272
|
-
panel,
|
|
223
|
+
# The item requires a value to toggle (use the header as the default value).
|
|
224
|
+
value = props.pop("value", str(header))
|
|
225
|
+
|
|
226
|
+
return AccordionItem.create(
|
|
227
|
+
AccordionHeader.create(
|
|
228
|
+
AccordionTrigger.create(
|
|
229
|
+
header,
|
|
230
|
+
Icon.create(
|
|
231
|
+
tag="chevron_down",
|
|
232
|
+
class_name="AccordionChevron",
|
|
273
233
|
),
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
234
|
+
),
|
|
235
|
+
),
|
|
236
|
+
AccordionContent.create(
|
|
237
|
+
content,
|
|
238
|
+
),
|
|
239
|
+
value=value,
|
|
278
240
|
**props,
|
|
279
241
|
)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
accordion = AccordionRoot.create
|
|
@@ -9,9 +9,10 @@ from reflex.event import EventChain, EventHandler, EventSpec
|
|
|
9
9
|
from reflex.style import Style
|
|
10
10
|
from typing import Literal
|
|
11
11
|
from reflex.components.component import Component
|
|
12
|
-
from reflex.components.
|
|
12
|
+
from reflex.components.radix.primitives.base import RadixPrimitiveComponent
|
|
13
|
+
from reflex.components.radix.themes.components.icons import Icon
|
|
13
14
|
from reflex.style import Style
|
|
14
|
-
from reflex.utils import
|
|
15
|
+
from reflex.utils import imports
|
|
15
16
|
from reflex.vars import Var
|
|
16
17
|
|
|
17
18
|
LiteralAccordionType = Literal["single", "multiple"]
|
|
@@ -19,7 +20,7 @@ LiteralAccordionDir = Literal["ltr", "rtl"]
|
|
|
19
20
|
LiteralAccordionOrientation = Literal["vertical", "horizontal"]
|
|
20
21
|
DEFAULT_ANIMATION_DURATION = 250
|
|
21
22
|
|
|
22
|
-
class AccordionComponent(
|
|
23
|
+
class AccordionComponent(RadixPrimitiveComponent):
|
|
23
24
|
@overload
|
|
24
25
|
@classmethod
|
|
25
26
|
def create( # type: ignore
|
|
@@ -530,90 +531,6 @@ class AccordionContent(AccordionComponent):
|
|
|
530
531
|
"""
|
|
531
532
|
...
|
|
532
533
|
|
|
533
|
-
|
|
534
|
-
@overload
|
|
535
|
-
@classmethod
|
|
536
|
-
def create( # type: ignore
|
|
537
|
-
cls,
|
|
538
|
-
*children,
|
|
539
|
-
style: Optional[Style] = None,
|
|
540
|
-
key: Optional[Any] = None,
|
|
541
|
-
id: Optional[Any] = None,
|
|
542
|
-
class_name: Optional[Any] = None,
|
|
543
|
-
autofocus: Optional[bool] = None,
|
|
544
|
-
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
545
|
-
on_blur: Optional[
|
|
546
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
547
|
-
] = None,
|
|
548
|
-
on_click: Optional[
|
|
549
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
550
|
-
] = None,
|
|
551
|
-
on_context_menu: Optional[
|
|
552
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
553
|
-
] = None,
|
|
554
|
-
on_double_click: Optional[
|
|
555
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
556
|
-
] = None,
|
|
557
|
-
on_focus: Optional[
|
|
558
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
559
|
-
] = None,
|
|
560
|
-
on_mount: Optional[
|
|
561
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
562
|
-
] = None,
|
|
563
|
-
on_mouse_down: Optional[
|
|
564
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
565
|
-
] = None,
|
|
566
|
-
on_mouse_enter: Optional[
|
|
567
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
568
|
-
] = None,
|
|
569
|
-
on_mouse_leave: Optional[
|
|
570
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
571
|
-
] = None,
|
|
572
|
-
on_mouse_move: Optional[
|
|
573
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
574
|
-
] = None,
|
|
575
|
-
on_mouse_out: Optional[
|
|
576
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
577
|
-
] = None,
|
|
578
|
-
on_mouse_over: Optional[
|
|
579
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
580
|
-
] = None,
|
|
581
|
-
on_mouse_up: Optional[
|
|
582
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
583
|
-
] = None,
|
|
584
|
-
on_scroll: Optional[
|
|
585
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
586
|
-
] = None,
|
|
587
|
-
on_unmount: Optional[
|
|
588
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
589
|
-
] = None,
|
|
590
|
-
**props
|
|
591
|
-
) -> "ChevronDownIcon":
|
|
592
|
-
"""Create the component.
|
|
593
|
-
|
|
594
|
-
Args:
|
|
595
|
-
*children: The children of the component.
|
|
596
|
-
style: The style of the component.
|
|
597
|
-
key: A unique key for the component.
|
|
598
|
-
id: The id for the component.
|
|
599
|
-
class_name: The class name for the component.
|
|
600
|
-
autofocus: Whether the component should take the focus once the page is loaded
|
|
601
|
-
custom_attrs: custom attribute
|
|
602
|
-
**props: The props of the component.
|
|
603
|
-
|
|
604
|
-
Returns:
|
|
605
|
-
The component.
|
|
606
|
-
|
|
607
|
-
Raises:
|
|
608
|
-
TypeError: If an invalid child is passed.
|
|
609
|
-
"""
|
|
610
|
-
...
|
|
611
|
-
|
|
612
|
-
accordion_root = AccordionRoot.create
|
|
613
|
-
accordion_item = AccordionItem.create
|
|
614
|
-
accordion_trigger = AccordionTrigger.create
|
|
615
|
-
accordion_content = AccordionContent.create
|
|
616
|
-
accordion_header = AccordionHeader.create
|
|
617
|
-
chevron_down_icon = ChevronDownIcon.create
|
|
534
|
+
def accordion_item(header: Component, content: Component, **props) -> Component: ...
|
|
618
535
|
|
|
619
|
-
|
|
536
|
+
accordion = AccordionRoot.create
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""The base component for Radix primitives."""
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from reflex.components.component import Component
|
|
5
|
+
from reflex.components.tags.tag import Tag
|
|
6
|
+
from reflex.utils import format
|
|
7
|
+
from reflex.vars import Var
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RadixPrimitiveComponent(Component):
|
|
11
|
+
"""Basic component for radix Primitives."""
|
|
12
|
+
|
|
13
|
+
# Change the default rendered element for the one passed as a child.
|
|
14
|
+
as_child: Var[bool]
|
|
15
|
+
|
|
16
|
+
lib_dependencies: List[str] = ["@emotion/react@^11.11.1"]
|
|
17
|
+
|
|
18
|
+
def _render(self) -> Tag:
|
|
19
|
+
return (
|
|
20
|
+
super()
|
|
21
|
+
._render()
|
|
22
|
+
.add_props(
|
|
23
|
+
**{
|
|
24
|
+
"class_name": format.to_title_case(self.tag or ""),
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/primitives/base.py"""
|
|
2
|
+
# ------------------- DO NOT EDIT ----------------------
|
|
3
|
+
# This file was generated by `scripts/pyi_generator.py`!
|
|
4
|
+
# ------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
|
+
from reflex.vars import Var, BaseVar, ComputedVar
|
|
8
|
+
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
|
+
from reflex.style import Style
|
|
10
|
+
from typing import List
|
|
11
|
+
from reflex.components.component import Component
|
|
12
|
+
from reflex.components.tags.tag import Tag
|
|
13
|
+
from reflex.utils import format
|
|
14
|
+
from reflex.vars import Var
|
|
15
|
+
|
|
16
|
+
class RadixPrimitiveComponent(Component):
|
|
17
|
+
@overload
|
|
18
|
+
@classmethod
|
|
19
|
+
def create( # type: ignore
|
|
20
|
+
cls,
|
|
21
|
+
*children,
|
|
22
|
+
as_child: Optional[Union[Var[bool], bool]] = None,
|
|
23
|
+
style: Optional[Style] = None,
|
|
24
|
+
key: Optional[Any] = None,
|
|
25
|
+
id: Optional[Any] = None,
|
|
26
|
+
class_name: Optional[Any] = None,
|
|
27
|
+
autofocus: Optional[bool] = None,
|
|
28
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
29
|
+
on_blur: Optional[
|
|
30
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
31
|
+
] = None,
|
|
32
|
+
on_click: Optional[
|
|
33
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
34
|
+
] = None,
|
|
35
|
+
on_context_menu: Optional[
|
|
36
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
37
|
+
] = None,
|
|
38
|
+
on_double_click: Optional[
|
|
39
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
40
|
+
] = None,
|
|
41
|
+
on_focus: Optional[
|
|
42
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
43
|
+
] = None,
|
|
44
|
+
on_mount: Optional[
|
|
45
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
46
|
+
] = None,
|
|
47
|
+
on_mouse_down: Optional[
|
|
48
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
49
|
+
] = None,
|
|
50
|
+
on_mouse_enter: Optional[
|
|
51
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
52
|
+
] = None,
|
|
53
|
+
on_mouse_leave: Optional[
|
|
54
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
55
|
+
] = None,
|
|
56
|
+
on_mouse_move: Optional[
|
|
57
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
58
|
+
] = None,
|
|
59
|
+
on_mouse_out: Optional[
|
|
60
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
61
|
+
] = None,
|
|
62
|
+
on_mouse_over: Optional[
|
|
63
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
64
|
+
] = None,
|
|
65
|
+
on_mouse_up: Optional[
|
|
66
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
67
|
+
] = None,
|
|
68
|
+
on_scroll: Optional[
|
|
69
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
70
|
+
] = None,
|
|
71
|
+
on_unmount: Optional[
|
|
72
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
73
|
+
] = None,
|
|
74
|
+
**props
|
|
75
|
+
) -> "RadixPrimitiveComponent":
|
|
76
|
+
"""Create the component.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
*children: The children of the component.
|
|
80
|
+
as_child: Change the default rendered element for the one passed as a child.
|
|
81
|
+
style: The style of the component.
|
|
82
|
+
key: A unique key for the component.
|
|
83
|
+
id: The id for the component.
|
|
84
|
+
class_name: The class name for the component.
|
|
85
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
86
|
+
custom_attrs: custom attribute
|
|
87
|
+
**props: The props of the component.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
The component.
|
|
91
|
+
|
|
92
|
+
Raises:
|
|
93
|
+
TypeError: If an invalid child is passed.
|
|
94
|
+
"""
|
|
95
|
+
...
|