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
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""Progress."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from reflex.components.component import Component
|
|
6
|
+
from reflex.components.radix.primitives.base import RadixPrimitiveComponent
|
|
7
|
+
from reflex.style import Style
|
|
8
|
+
from reflex.vars import Var
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ProgressComponent(RadixPrimitiveComponent):
|
|
12
|
+
"""A Progress component."""
|
|
13
|
+
|
|
14
|
+
library = "@radix-ui/react-progress@^1.0.3"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ProgressRoot(ProgressComponent):
|
|
18
|
+
"""The Progress Root component."""
|
|
19
|
+
|
|
20
|
+
tag = "Root"
|
|
21
|
+
alias = "RadixProgressRoot"
|
|
22
|
+
|
|
23
|
+
# The current progress value.
|
|
24
|
+
value: Var[Optional[int]]
|
|
25
|
+
|
|
26
|
+
# The maximum progress value.
|
|
27
|
+
max: Var[int]
|
|
28
|
+
|
|
29
|
+
def _apply_theme(self, theme: Component | None):
|
|
30
|
+
self.style = Style(
|
|
31
|
+
{
|
|
32
|
+
"position": "relative",
|
|
33
|
+
"overflow": "hidden",
|
|
34
|
+
"background": "black",
|
|
35
|
+
"border_radius": "99999px",
|
|
36
|
+
"width": "300px",
|
|
37
|
+
"height": "25px",
|
|
38
|
+
**self.style,
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class ProgressIndicator(ProgressComponent):
|
|
44
|
+
"""The Progress bar indicator."""
|
|
45
|
+
|
|
46
|
+
tag = "Indicator"
|
|
47
|
+
|
|
48
|
+
alias = "RadixProgressIndicator"
|
|
49
|
+
|
|
50
|
+
# The current progress value.
|
|
51
|
+
value: Var[Optional[int]]
|
|
52
|
+
|
|
53
|
+
def _apply_theme(self, theme: Component | None):
|
|
54
|
+
self.style = Style(
|
|
55
|
+
{
|
|
56
|
+
"background-color": "white",
|
|
57
|
+
"width": "100%",
|
|
58
|
+
"height": "100%",
|
|
59
|
+
"transition": f"transform 660ms linear",
|
|
60
|
+
"&[data_state='loading']": {
|
|
61
|
+
"transition": f"transform 660ms linear",
|
|
62
|
+
},
|
|
63
|
+
"transform": f"translateX(-{100 - self.value}%)", # type: ignore
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
progress_root = ProgressRoot.create
|
|
69
|
+
progress_indicator = ProgressIndicator.create
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def progress(**props):
|
|
73
|
+
"""High level API for progress bar.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
**props: The props of the progress bar
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
The progress bar.
|
|
80
|
+
"""
|
|
81
|
+
return progress_root(
|
|
82
|
+
progress_indicator(value=props.get("value")),
|
|
83
|
+
**props,
|
|
84
|
+
)
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"""Stub file for reflex/components/radix/primitives/progress.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 Optional
|
|
11
|
+
from reflex.components.component import Component
|
|
12
|
+
from reflex.components.radix.primitives.base import RadixPrimitiveComponent
|
|
13
|
+
from reflex.style import Style
|
|
14
|
+
from reflex.vars import Var
|
|
15
|
+
|
|
16
|
+
class ProgressComponent(RadixPrimitiveComponent):
|
|
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
|
+
) -> "ProgressComponent":
|
|
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
|
+
...
|
|
96
|
+
|
|
97
|
+
class ProgressRoot(ProgressComponent):
|
|
98
|
+
@overload
|
|
99
|
+
@classmethod
|
|
100
|
+
def create( # type: ignore
|
|
101
|
+
cls,
|
|
102
|
+
*children,
|
|
103
|
+
value: Optional[Union[Var[Optional[int]], Optional[int]]] = None,
|
|
104
|
+
max: Optional[Union[Var[int], int]] = None,
|
|
105
|
+
as_child: Optional[Union[Var[bool], bool]] = None,
|
|
106
|
+
style: Optional[Style] = None,
|
|
107
|
+
key: Optional[Any] = None,
|
|
108
|
+
id: Optional[Any] = None,
|
|
109
|
+
class_name: Optional[Any] = None,
|
|
110
|
+
autofocus: Optional[bool] = None,
|
|
111
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
112
|
+
on_blur: Optional[
|
|
113
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
114
|
+
] = None,
|
|
115
|
+
on_click: Optional[
|
|
116
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
117
|
+
] = None,
|
|
118
|
+
on_context_menu: Optional[
|
|
119
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
120
|
+
] = None,
|
|
121
|
+
on_double_click: Optional[
|
|
122
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
123
|
+
] = None,
|
|
124
|
+
on_focus: Optional[
|
|
125
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
126
|
+
] = None,
|
|
127
|
+
on_mount: Optional[
|
|
128
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
129
|
+
] = None,
|
|
130
|
+
on_mouse_down: Optional[
|
|
131
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
132
|
+
] = None,
|
|
133
|
+
on_mouse_enter: Optional[
|
|
134
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
135
|
+
] = None,
|
|
136
|
+
on_mouse_leave: Optional[
|
|
137
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
138
|
+
] = None,
|
|
139
|
+
on_mouse_move: Optional[
|
|
140
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
141
|
+
] = None,
|
|
142
|
+
on_mouse_out: Optional[
|
|
143
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
144
|
+
] = None,
|
|
145
|
+
on_mouse_over: Optional[
|
|
146
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
147
|
+
] = None,
|
|
148
|
+
on_mouse_up: Optional[
|
|
149
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
150
|
+
] = None,
|
|
151
|
+
on_scroll: Optional[
|
|
152
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
153
|
+
] = None,
|
|
154
|
+
on_unmount: Optional[
|
|
155
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
156
|
+
] = None,
|
|
157
|
+
**props
|
|
158
|
+
) -> "ProgressRoot":
|
|
159
|
+
"""Create the component.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
*children: The children of the component.
|
|
163
|
+
value: The current progress value.
|
|
164
|
+
max: The maximum progress value.
|
|
165
|
+
as_child: Change the default rendered element for the one passed as a child.
|
|
166
|
+
style: The style of the component.
|
|
167
|
+
key: A unique key for the component.
|
|
168
|
+
id: The id for the component.
|
|
169
|
+
class_name: The class name for the component.
|
|
170
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
171
|
+
custom_attrs: custom attribute
|
|
172
|
+
**props: The props of the component.
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
The component.
|
|
176
|
+
|
|
177
|
+
Raises:
|
|
178
|
+
TypeError: If an invalid child is passed.
|
|
179
|
+
"""
|
|
180
|
+
...
|
|
181
|
+
|
|
182
|
+
class ProgressIndicator(ProgressComponent):
|
|
183
|
+
@overload
|
|
184
|
+
@classmethod
|
|
185
|
+
def create( # type: ignore
|
|
186
|
+
cls,
|
|
187
|
+
*children,
|
|
188
|
+
value: Optional[Union[Var[Optional[int]], Optional[int]]] = None,
|
|
189
|
+
as_child: Optional[Union[Var[bool], bool]] = None,
|
|
190
|
+
style: Optional[Style] = None,
|
|
191
|
+
key: Optional[Any] = None,
|
|
192
|
+
id: Optional[Any] = None,
|
|
193
|
+
class_name: Optional[Any] = None,
|
|
194
|
+
autofocus: Optional[bool] = None,
|
|
195
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
196
|
+
on_blur: Optional[
|
|
197
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
198
|
+
] = None,
|
|
199
|
+
on_click: Optional[
|
|
200
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
201
|
+
] = None,
|
|
202
|
+
on_context_menu: Optional[
|
|
203
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
204
|
+
] = None,
|
|
205
|
+
on_double_click: Optional[
|
|
206
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
207
|
+
] = None,
|
|
208
|
+
on_focus: Optional[
|
|
209
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
210
|
+
] = None,
|
|
211
|
+
on_mount: Optional[
|
|
212
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
213
|
+
] = None,
|
|
214
|
+
on_mouse_down: Optional[
|
|
215
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
216
|
+
] = None,
|
|
217
|
+
on_mouse_enter: Optional[
|
|
218
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
219
|
+
] = None,
|
|
220
|
+
on_mouse_leave: Optional[
|
|
221
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
222
|
+
] = None,
|
|
223
|
+
on_mouse_move: Optional[
|
|
224
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
225
|
+
] = None,
|
|
226
|
+
on_mouse_out: Optional[
|
|
227
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
228
|
+
] = None,
|
|
229
|
+
on_mouse_over: Optional[
|
|
230
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
231
|
+
] = None,
|
|
232
|
+
on_mouse_up: Optional[
|
|
233
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
234
|
+
] = None,
|
|
235
|
+
on_scroll: Optional[
|
|
236
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
237
|
+
] = None,
|
|
238
|
+
on_unmount: Optional[
|
|
239
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
240
|
+
] = None,
|
|
241
|
+
**props
|
|
242
|
+
) -> "ProgressIndicator":
|
|
243
|
+
"""Create the component.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
*children: The children of the component.
|
|
247
|
+
value: The current progress value.
|
|
248
|
+
as_child: Change the default rendered element for the one passed as a child.
|
|
249
|
+
style: The style of the component.
|
|
250
|
+
key: A unique key for the component.
|
|
251
|
+
id: The id for the component.
|
|
252
|
+
class_name: The class name for the component.
|
|
253
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
254
|
+
custom_attrs: custom attribute
|
|
255
|
+
**props: The props of the component.
|
|
256
|
+
|
|
257
|
+
Returns:
|
|
258
|
+
The component.
|
|
259
|
+
|
|
260
|
+
Raises:
|
|
261
|
+
TypeError: If an invalid child is passed.
|
|
262
|
+
"""
|
|
263
|
+
...
|
|
264
|
+
|
|
265
|
+
progress_root = ProgressRoot.create
|
|
266
|
+
progress_indicator = ProgressIndicator.create
|
|
267
|
+
|
|
268
|
+
def progress(**props): ...
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"""Radix slider components."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, Literal
|
|
4
|
+
|
|
5
|
+
from reflex.components.component import Component
|
|
6
|
+
from reflex.components.radix.primitives.base import RadixPrimitiveComponent
|
|
7
|
+
from reflex.style import Style
|
|
8
|
+
from reflex.vars import Var
|
|
9
|
+
|
|
10
|
+
LiteralSliderOrientation = Literal["horizontal", "vertical"]
|
|
11
|
+
LiteralSliderDir = Literal["ltr", "rtl"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SliderComponent(RadixPrimitiveComponent):
|
|
15
|
+
"""Base class for all @radix-ui/react-slider components."""
|
|
16
|
+
|
|
17
|
+
library = "@radix-ui/react-slider@^1.1.2"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SliderRoot(SliderComponent):
|
|
21
|
+
"""The Slider component comtaining all slider parts."""
|
|
22
|
+
|
|
23
|
+
tag = "Root"
|
|
24
|
+
alias = "RadixSliderRoot"
|
|
25
|
+
|
|
26
|
+
default_value: Var[list[int]]
|
|
27
|
+
|
|
28
|
+
value: Var[list[int]]
|
|
29
|
+
|
|
30
|
+
name: Var[str]
|
|
31
|
+
|
|
32
|
+
disabled: Var[bool]
|
|
33
|
+
|
|
34
|
+
orientation: Var[LiteralSliderOrientation]
|
|
35
|
+
|
|
36
|
+
dir: Var[LiteralSliderDir]
|
|
37
|
+
|
|
38
|
+
inverted: Var[bool]
|
|
39
|
+
|
|
40
|
+
min: Var[int]
|
|
41
|
+
|
|
42
|
+
max: Var[int]
|
|
43
|
+
|
|
44
|
+
step: Var[int]
|
|
45
|
+
|
|
46
|
+
min_steps_between_thumbs: Var[int]
|
|
47
|
+
|
|
48
|
+
def get_event_triggers(self) -> Dict[str, Any]:
|
|
49
|
+
"""Event triggers for radix slider primitive.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
The triggers for event supported by radix primitives.
|
|
53
|
+
"""
|
|
54
|
+
return {
|
|
55
|
+
**super().get_event_triggers(),
|
|
56
|
+
"on_value_change": lambda e0: [e0], # trigger for all change of a thumb
|
|
57
|
+
"on_value_commit": lambda e0: [e0], # trigger when thumb is released
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
def _apply_theme(self, theme: Component):
|
|
61
|
+
self.style = Style(
|
|
62
|
+
{
|
|
63
|
+
"position": "relative",
|
|
64
|
+
"display": "flex",
|
|
65
|
+
"align_items": "center",
|
|
66
|
+
"user_select": "none",
|
|
67
|
+
"touch_action": "none",
|
|
68
|
+
"width": "200px",
|
|
69
|
+
"height": "20px",
|
|
70
|
+
"&[data-orientation='vertical']": {
|
|
71
|
+
"flex_direction": "column",
|
|
72
|
+
"width": "20px",
|
|
73
|
+
"height": "100px",
|
|
74
|
+
},
|
|
75
|
+
**self.style,
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class SliderTrack(SliderComponent):
|
|
81
|
+
"""A Slider Track component."""
|
|
82
|
+
|
|
83
|
+
tag = "Track"
|
|
84
|
+
alias = "RadixSliderTrack"
|
|
85
|
+
|
|
86
|
+
def _apply_theme(self, theme: Component):
|
|
87
|
+
self.style = Style(
|
|
88
|
+
{
|
|
89
|
+
"position": "relative",
|
|
90
|
+
"flex_grow": "1",
|
|
91
|
+
"background_color": "black",
|
|
92
|
+
"border_radius": "9999px",
|
|
93
|
+
"height": "3px",
|
|
94
|
+
"&[data-orientation='vertical']": {
|
|
95
|
+
"width": "3px",
|
|
96
|
+
},
|
|
97
|
+
**self.style,
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class SliderRange(SliderComponent):
|
|
103
|
+
"""A SliderRange component."""
|
|
104
|
+
|
|
105
|
+
tag = "Range"
|
|
106
|
+
alias = "RadixSliderRange"
|
|
107
|
+
|
|
108
|
+
def _apply_theme(self, theme: Component):
|
|
109
|
+
self.style = Style(
|
|
110
|
+
{
|
|
111
|
+
"position": "absolute",
|
|
112
|
+
"background_color": "white",
|
|
113
|
+
"height": "100%",
|
|
114
|
+
"&[data-orientation='vertical']": {
|
|
115
|
+
"width": "100%",
|
|
116
|
+
},
|
|
117
|
+
**self.style,
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class SliderThumb(SliderComponent):
|
|
123
|
+
"""A SliderThumb component."""
|
|
124
|
+
|
|
125
|
+
tag = "Thumb"
|
|
126
|
+
alias = "RadixSliderThumb"
|
|
127
|
+
|
|
128
|
+
def _apply_theme(self, theme: Component):
|
|
129
|
+
self.style = Style(
|
|
130
|
+
{
|
|
131
|
+
"display": "block",
|
|
132
|
+
"width": "20px",
|
|
133
|
+
"height": "20px",
|
|
134
|
+
"background_color": "black",
|
|
135
|
+
"box_shadow": "0 2px 10px black",
|
|
136
|
+
"border_radius": "10px",
|
|
137
|
+
"&:hover": {
|
|
138
|
+
"background_color": "gray",
|
|
139
|
+
},
|
|
140
|
+
"&:focus": {
|
|
141
|
+
"outline": "none",
|
|
142
|
+
"box_shadow": "0 0 0 4px gray",
|
|
143
|
+
},
|
|
144
|
+
**self.style,
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
slider_root = SliderRoot.create
|
|
150
|
+
slider_track = SliderTrack.create
|
|
151
|
+
slider_range = SliderRange.create
|
|
152
|
+
slider_thumb = SliderThumb.create
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def slider(
|
|
156
|
+
**props,
|
|
157
|
+
) -> Component:
|
|
158
|
+
"""High level API for slider.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
**props: The props of the slider.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
A slider component.
|
|
165
|
+
"""
|
|
166
|
+
track = SliderTrack.create(SliderRange.create())
|
|
167
|
+
# if default_value is not set, the thumbs will not render properly but the slider will still work
|
|
168
|
+
if "default_value" in props:
|
|
169
|
+
children = [
|
|
170
|
+
track,
|
|
171
|
+
*[SliderThumb.create() for _ in props.get("default_value", [])],
|
|
172
|
+
]
|
|
173
|
+
else:
|
|
174
|
+
children = [
|
|
175
|
+
track,
|
|
176
|
+
# Foreach.create(props.get("value"), lambda e: SliderThumb.create()), # foreach doesn't render Thumbs properly
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
return slider_root(*children, **props)
|