reflex 0.3.6__py3-none-any.whl → 0.3.7__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/base_page.js.jinja2 +2 -0
- reflex/__init__.py +29 -6
- reflex/__init__.pyi +2 -0
- reflex/app.py +3 -0
- reflex/components/__init__.py +2 -0
- reflex/components/chakra/__init__.py +23 -0
- reflex/components/{media → chakra/media}/image.py +1 -28
- reflex/components/chakra/media/image.pyi +120 -0
- reflex/components/component.py +27 -2
- reflex/components/datadisplay/datatable.py +1 -37
- reflex/components/datadisplay/datatable.pyi +1 -11
- reflex/components/el/elements/forms.py +43 -1
- reflex/components/el/elements/forms.pyi +26 -1
- reflex/components/graphing/plotly.py +0 -22
- reflex/components/graphing/plotly.pyi +0 -12
- reflex/components/media/__init__.py +0 -1
- reflex/components/media/image.pyi +0 -9
- reflex/components/next/__init__.py +8 -0
- reflex/components/next/base.py +8 -0
- reflex/components/next/base.pyi +91 -0
- reflex/components/next/image.py +114 -0
- reflex/components/next/image.pyi +122 -0
- reflex/components/next/video.py +33 -0
- reflex/components/next/video.pyi +92 -0
- reflex/components/radix/primitives/__init__.py +3 -0
- reflex/components/radix/primitives/accordion.py +279 -0
- reflex/components/radix/primitives/accordion.pyi +619 -0
- reflex/components/radix/themes/__init__.py +4 -73
- reflex/components/radix/themes/base.py +7 -7
- reflex/components/radix/themes/base.pyi +21 -21
- reflex/components/radix/themes/components/__init__.py +193 -0
- reflex/components/radix/themes/components/alertdialog.py +72 -0
- reflex/components/radix/themes/components/alertdialog.pyi +733 -0
- reflex/components/radix/themes/components/aspectratio.py +20 -0
- reflex/components/radix/themes/components/aspectratio.pyi +144 -0
- reflex/components/radix/themes/components/avatar.py +38 -0
- reflex/components/radix/themes/components/avatar.pyi +233 -0
- reflex/components/radix/themes/components/badge.py +38 -0
- reflex/components/radix/themes/components/badge.pyi +291 -0
- reflex/components/radix/themes/components/button.py +39 -0
- reflex/components/radix/themes/components/button.pyi +330 -0
- reflex/components/radix/themes/components/callout.py +49 -0
- reflex/components/radix/themes/components/callout.pyi +668 -0
- reflex/components/radix/themes/components/card.py +25 -0
- reflex/components/radix/themes/components/card.pyi +214 -0
- reflex/components/radix/themes/components/checkbox.py +67 -0
- reflex/components/radix/themes/components/checkbox.pyi +249 -0
- reflex/components/radix/themes/components/contextmenu.py +134 -0
- reflex/components/radix/themes/{typography.pyi → components/contextmenu.pyi} +182 -602
- reflex/components/radix/themes/components/dialog.py +75 -0
- reflex/components/radix/themes/components/dialog.pyi +739 -0
- reflex/components/radix/themes/components/dropdownmenu.py +101 -0
- reflex/components/radix/themes/components/dropdownmenu.pyi +1065 -0
- reflex/components/radix/themes/components/hovercard.py +63 -0
- reflex/components/radix/themes/components/hovercard.pyi +487 -0
- reflex/components/radix/themes/components/iconbutton.py +39 -0
- reflex/components/radix/themes/components/iconbutton.pyi +332 -0
- reflex/components/radix/themes/components/icons.py +400 -0
- reflex/components/radix/themes/components/icons.pyi +185 -0
- reflex/components/radix/themes/components/inset.py +44 -0
- reflex/components/radix/themes/components/inset.pyi +230 -0
- reflex/components/radix/themes/components/popover.py +85 -0
- reflex/components/radix/themes/components/popover.pyi +634 -0
- reflex/components/radix/themes/components/radiogroup.py +72 -0
- reflex/components/radix/themes/components/radiogroup.pyi +369 -0
- reflex/components/radix/themes/components/scrollarea.py +31 -0
- reflex/components/radix/themes/components/scrollarea.pyi +165 -0
- reflex/components/radix/themes/components/select.py +137 -0
- reflex/components/radix/themes/{layout.pyi → components/select.pyi} +422 -418
- reflex/components/radix/themes/components/separator.py +30 -0
- reflex/components/radix/themes/components/separator.pyi +218 -0
- reflex/components/radix/themes/components/slider.py +68 -0
- reflex/components/radix/themes/components/slider.pyi +254 -0
- reflex/components/radix/themes/components/switch.py +68 -0
- reflex/components/radix/themes/components/switch.pyi +250 -0
- reflex/components/radix/themes/components/table.py +79 -0
- reflex/components/radix/themes/components/table.pyi +1485 -0
- reflex/components/radix/themes/components/tabs.py +65 -0
- reflex/components/radix/themes/components/tabs.pyi +549 -0
- reflex/components/radix/themes/components/textarea.py +68 -0
- reflex/components/radix/themes/components/textarea.pyi +333 -0
- reflex/components/radix/themes/{components.py → components/textfield.py} +3 -87
- reflex/components/radix/themes/{components.pyi → components/textfield.pyi} +202 -591
- reflex/components/radix/themes/layout/__init__.py +13 -0
- reflex/components/radix/themes/layout/base.py +48 -0
- reflex/components/radix/themes/layout/base.pyi +195 -0
- reflex/components/radix/themes/layout/box.py +12 -0
- reflex/components/radix/themes/layout/box.pyi +252 -0
- reflex/components/radix/themes/layout/container.py +23 -0
- reflex/components/radix/themes/layout/container.pyi +260 -0
- reflex/components/radix/themes/layout/flex.py +45 -0
- reflex/components/radix/themes/layout/flex.pyi +303 -0
- reflex/components/radix/themes/layout/grid.py +53 -0
- reflex/components/radix/themes/layout/grid.pyi +203 -0
- reflex/components/radix/themes/layout/section.py +20 -0
- reflex/components/radix/themes/layout/section.pyi +260 -0
- reflex/components/radix/themes/typography/__init__.py +21 -0
- reflex/components/radix/themes/typography/base.py +12 -0
- reflex/components/radix/themes/typography/blockquote.py +36 -0
- reflex/components/radix/themes/typography/blockquote.pyi +282 -0
- reflex/components/radix/themes/typography/code.py +40 -0
- reflex/components/radix/themes/typography/code.pyi +292 -0
- reflex/components/radix/themes/typography/em.py +18 -0
- reflex/components/radix/themes/typography/em.pyi +199 -0
- reflex/components/radix/themes/typography/heading.py +50 -0
- reflex/components/radix/themes/typography/heading.pyi +298 -0
- reflex/components/radix/themes/typography/kbd.py +25 -0
- reflex/components/radix/themes/typography/kbd.pyi +208 -0
- reflex/components/radix/themes/typography/link.py +49 -0
- reflex/components/radix/themes/typography/link.pyi +238 -0
- reflex/components/radix/themes/typography/quote.py +18 -0
- reflex/components/radix/themes/typography/quote.pyi +200 -0
- reflex/components/radix/themes/typography/strong.py +18 -0
- reflex/components/radix/themes/typography/strong.pyi +199 -0
- reflex/components/radix/themes/typography/text.py +50 -0
- reflex/components/radix/themes/typography/text.pyi +298 -0
- reflex/constants/__init__.py +1 -0
- reflex/constants/base.py +7 -0
- reflex/constants/config.py +1 -1
- reflex/model.py +2 -1
- reflex/reflex.py +5 -0
- reflex/state.py +11 -0
- reflex/style.py +120 -10
- reflex/testing.py +4 -4
- reflex/utils/format.py +9 -5
- reflex/utils/prerequisites.py +49 -6
- reflex/utils/processes.py +8 -1
- reflex/utils/serializers.py +83 -0
- reflex/utils/types.py +22 -1
- reflex/vars.py +24 -1
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/METADATA +3 -2
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/RECORD +135 -42
- reflex/components/radix/themes/layout.py +0 -155
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/LICENSE +0 -0
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/WHEEL +0 -0
- {reflex-0.3.6.dist-info → reflex-0.3.7.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""Stub file for reflex/components/next/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 reflex.components.component import Component
|
|
11
|
+
|
|
12
|
+
class NextComponent(Component):
|
|
13
|
+
...
|
|
14
|
+
|
|
15
|
+
@overload
|
|
16
|
+
@classmethod
|
|
17
|
+
def create( # type: ignore
|
|
18
|
+
cls,
|
|
19
|
+
*children,
|
|
20
|
+
style: Optional[Style] = None,
|
|
21
|
+
key: Optional[Any] = None,
|
|
22
|
+
id: Optional[Any] = None,
|
|
23
|
+
class_name: Optional[Any] = None,
|
|
24
|
+
autofocus: Optional[bool] = None,
|
|
25
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
26
|
+
on_blur: Optional[
|
|
27
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
28
|
+
] = None,
|
|
29
|
+
on_click: Optional[
|
|
30
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
31
|
+
] = None,
|
|
32
|
+
on_context_menu: Optional[
|
|
33
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
34
|
+
] = None,
|
|
35
|
+
on_double_click: Optional[
|
|
36
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
37
|
+
] = None,
|
|
38
|
+
on_focus: Optional[
|
|
39
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
40
|
+
] = None,
|
|
41
|
+
on_mount: Optional[
|
|
42
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
43
|
+
] = None,
|
|
44
|
+
on_mouse_down: Optional[
|
|
45
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
46
|
+
] = None,
|
|
47
|
+
on_mouse_enter: Optional[
|
|
48
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
49
|
+
] = None,
|
|
50
|
+
on_mouse_leave: Optional[
|
|
51
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
52
|
+
] = None,
|
|
53
|
+
on_mouse_move: Optional[
|
|
54
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
55
|
+
] = None,
|
|
56
|
+
on_mouse_out: Optional[
|
|
57
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
58
|
+
] = None,
|
|
59
|
+
on_mouse_over: Optional[
|
|
60
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
61
|
+
] = None,
|
|
62
|
+
on_mouse_up: Optional[
|
|
63
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
64
|
+
] = None,
|
|
65
|
+
on_scroll: Optional[
|
|
66
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
67
|
+
] = None,
|
|
68
|
+
on_unmount: Optional[
|
|
69
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
70
|
+
] = None,
|
|
71
|
+
**props
|
|
72
|
+
) -> "NextComponent":
|
|
73
|
+
"""Create the component.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
*children: The children of the component.
|
|
77
|
+
style: The style of the component.
|
|
78
|
+
key: A unique key for the component.
|
|
79
|
+
id: The id for the component.
|
|
80
|
+
class_name: The class name for the component.
|
|
81
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
82
|
+
custom_attrs: custom attribute
|
|
83
|
+
**props: The props of the component.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
The component.
|
|
87
|
+
|
|
88
|
+
Raises:
|
|
89
|
+
TypeError: If an invalid child is passed.
|
|
90
|
+
"""
|
|
91
|
+
...
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""Image component from next/image."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, Literal, Optional, Union
|
|
4
|
+
|
|
5
|
+
from reflex.utils import types
|
|
6
|
+
from reflex.vars import Var
|
|
7
|
+
|
|
8
|
+
from .base import NextComponent
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Image(NextComponent):
|
|
12
|
+
"""Display an image."""
|
|
13
|
+
|
|
14
|
+
tag = "Image"
|
|
15
|
+
library = "next/image"
|
|
16
|
+
is_default = True
|
|
17
|
+
|
|
18
|
+
# This can be either an absolute external URL, or an internal path
|
|
19
|
+
src: Var[Any]
|
|
20
|
+
|
|
21
|
+
# Represents the rendered width in pixels, so it will affect how large the image appears.
|
|
22
|
+
width: Var[Any]
|
|
23
|
+
|
|
24
|
+
# Represents the rendered height in pixels, so it will affect how large the image appears.
|
|
25
|
+
height: Var[Any]
|
|
26
|
+
|
|
27
|
+
# Used to describe the image for screen readers and search engines.
|
|
28
|
+
alt: Var[str]
|
|
29
|
+
|
|
30
|
+
# A custom function used to resolve image URLs.
|
|
31
|
+
loader: Var[Any]
|
|
32
|
+
|
|
33
|
+
# A boolean that causes the image to fill the parent element, which is useful when the width and height are unknown. Default to True
|
|
34
|
+
fill: Var[bool]
|
|
35
|
+
|
|
36
|
+
# A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
|
|
37
|
+
sizes: Var[str]
|
|
38
|
+
|
|
39
|
+
# The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
|
|
40
|
+
quality: Var[int]
|
|
41
|
+
|
|
42
|
+
# When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
|
|
43
|
+
priority: Var[bool]
|
|
44
|
+
|
|
45
|
+
# A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
|
|
46
|
+
placeholder: Var[str]
|
|
47
|
+
|
|
48
|
+
# Allows passing CSS styles to the underlying image element.
|
|
49
|
+
# style: Var[Any]
|
|
50
|
+
|
|
51
|
+
# The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
|
52
|
+
loading: Var[Literal["lazy", "eager"]]
|
|
53
|
+
|
|
54
|
+
# A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
|
|
55
|
+
blurDataURL: Var[str]
|
|
56
|
+
|
|
57
|
+
def get_event_triggers(self) -> Dict[str, Any]:
|
|
58
|
+
"""The event triggers of the component.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
The dict describing the event triggers.
|
|
62
|
+
"""
|
|
63
|
+
return {
|
|
64
|
+
**super().get_event_triggers(),
|
|
65
|
+
"on_load": lambda: [],
|
|
66
|
+
"on_error": lambda: [],
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def create(
|
|
71
|
+
cls,
|
|
72
|
+
*children,
|
|
73
|
+
width: Optional[Union[int, str]] = None,
|
|
74
|
+
height: Optional[Union[int, str]] = None,
|
|
75
|
+
**props,
|
|
76
|
+
):
|
|
77
|
+
"""Create an Image component from next/image.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
*children: The children of the component.
|
|
81
|
+
width: The width of the image.
|
|
82
|
+
height: The height of the image.
|
|
83
|
+
**props:The props of the component.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
_type_: _description_
|
|
87
|
+
"""
|
|
88
|
+
style = props.get("style", {})
|
|
89
|
+
DEFAULT_W_H = "100%"
|
|
90
|
+
|
|
91
|
+
def check_prop_type(prop_name, prop_value):
|
|
92
|
+
if types.check_prop_in_allowed_types(prop_value, allowed_types=[int]):
|
|
93
|
+
props[prop_name] = prop_value
|
|
94
|
+
|
|
95
|
+
elif types.check_prop_in_allowed_types(prop_value, allowed_types=[str]):
|
|
96
|
+
props[prop_name] = 0
|
|
97
|
+
style[prop_name] = prop_value
|
|
98
|
+
else:
|
|
99
|
+
props[prop_name] = 0
|
|
100
|
+
style[prop_name] = DEFAULT_W_H
|
|
101
|
+
|
|
102
|
+
check_prop_type("width", width)
|
|
103
|
+
check_prop_type("height", height)
|
|
104
|
+
|
|
105
|
+
props["style"] = style
|
|
106
|
+
|
|
107
|
+
# mysteriously, following `sizes` prop is needed to avoid blury images.
|
|
108
|
+
props["sizes"] = "100vw"
|
|
109
|
+
|
|
110
|
+
src = props.get("src", None)
|
|
111
|
+
if src is not None and not isinstance(src, (Var)):
|
|
112
|
+
props["src"] = Var.create(value=src, _var_is_string=True)
|
|
113
|
+
|
|
114
|
+
return super().create(*children, **props)
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"""Stub file for reflex/components/next/image.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 Any, Dict, Literal, Optional, Union
|
|
11
|
+
from reflex.utils import types
|
|
12
|
+
from reflex.vars import Var
|
|
13
|
+
from .base import NextComponent
|
|
14
|
+
|
|
15
|
+
class Image(NextComponent):
|
|
16
|
+
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
17
|
+
@overload
|
|
18
|
+
@classmethod
|
|
19
|
+
def create( # type: ignore
|
|
20
|
+
cls,
|
|
21
|
+
*children,
|
|
22
|
+
width: Optional[Union[str, int]] = None,
|
|
23
|
+
height: Optional[Union[str, int]] = None,
|
|
24
|
+
src: Optional[Union[Var[Any], Any]] = None,
|
|
25
|
+
alt: Optional[Union[Var[str], str]] = None,
|
|
26
|
+
loader: Optional[Union[Var[Any], Any]] = None,
|
|
27
|
+
fill: Optional[Union[Var[bool], bool]] = None,
|
|
28
|
+
sizes: Optional[Union[Var[str], str]] = None,
|
|
29
|
+
quality: Optional[Union[Var[int], int]] = None,
|
|
30
|
+
priority: Optional[Union[Var[bool], bool]] = None,
|
|
31
|
+
placeholder: Optional[Union[Var[str], str]] = None,
|
|
32
|
+
loading: Optional[
|
|
33
|
+
Union[Var[Literal["lazy", "eager"]], Literal["lazy", "eager"]]
|
|
34
|
+
] = None,
|
|
35
|
+
blurDataURL: Optional[Union[Var[str], str]] = None,
|
|
36
|
+
style: Optional[Style] = None,
|
|
37
|
+
key: Optional[Any] = None,
|
|
38
|
+
id: Optional[Any] = None,
|
|
39
|
+
class_name: Optional[Any] = None,
|
|
40
|
+
autofocus: Optional[bool] = None,
|
|
41
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
42
|
+
on_blur: Optional[
|
|
43
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
44
|
+
] = None,
|
|
45
|
+
on_click: Optional[
|
|
46
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
47
|
+
] = None,
|
|
48
|
+
on_context_menu: Optional[
|
|
49
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
50
|
+
] = None,
|
|
51
|
+
on_double_click: Optional[
|
|
52
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
53
|
+
] = None,
|
|
54
|
+
on_error: Optional[
|
|
55
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
56
|
+
] = None,
|
|
57
|
+
on_focus: Optional[
|
|
58
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
59
|
+
] = None,
|
|
60
|
+
on_load: Optional[
|
|
61
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
62
|
+
] = None,
|
|
63
|
+
on_mount: Optional[
|
|
64
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
65
|
+
] = None,
|
|
66
|
+
on_mouse_down: Optional[
|
|
67
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
68
|
+
] = None,
|
|
69
|
+
on_mouse_enter: Optional[
|
|
70
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
71
|
+
] = None,
|
|
72
|
+
on_mouse_leave: Optional[
|
|
73
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
74
|
+
] = None,
|
|
75
|
+
on_mouse_move: Optional[
|
|
76
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
77
|
+
] = None,
|
|
78
|
+
on_mouse_out: Optional[
|
|
79
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
80
|
+
] = None,
|
|
81
|
+
on_mouse_over: Optional[
|
|
82
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
83
|
+
] = None,
|
|
84
|
+
on_mouse_up: Optional[
|
|
85
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
86
|
+
] = None,
|
|
87
|
+
on_scroll: Optional[
|
|
88
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
89
|
+
] = None,
|
|
90
|
+
on_unmount: Optional[
|
|
91
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
92
|
+
] = None,
|
|
93
|
+
**props
|
|
94
|
+
) -> "Image":
|
|
95
|
+
"""Create an Image component from next/image.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
*children: The children of the component.
|
|
99
|
+
width: The width of the image.
|
|
100
|
+
height: The height of the image.
|
|
101
|
+
src: This can be either an absolute external URL, or an internal path
|
|
102
|
+
alt: Used to describe the image for screen readers and search engines.
|
|
103
|
+
loader: A custom function used to resolve image URLs.
|
|
104
|
+
fill: A boolean that causes the image to fill the parent element, which is useful when the width and height are unknown. Default to True
|
|
105
|
+
sizes: A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
|
|
106
|
+
quality: The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
|
|
107
|
+
priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
|
|
108
|
+
placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
|
|
109
|
+
loading: Allows passing CSS styles to the underlying image element. style: Var[Any] The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
|
110
|
+
blurDataURL: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
|
|
111
|
+
style: The style of the component.
|
|
112
|
+
key: A unique key for the component.
|
|
113
|
+
id: The id for the component.
|
|
114
|
+
class_name: The class name for the component.
|
|
115
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
116
|
+
custom_attrs: custom attribute
|
|
117
|
+
**props:The props of the component.
|
|
118
|
+
|
|
119
|
+
Returns:
|
|
120
|
+
_type_: _description_
|
|
121
|
+
"""
|
|
122
|
+
...
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Wrapping of the next-video component."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from reflex.components.component import Component
|
|
6
|
+
from reflex.vars import Var
|
|
7
|
+
|
|
8
|
+
from .base import NextComponent
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Video(NextComponent):
|
|
12
|
+
"""A video component from NextJS."""
|
|
13
|
+
|
|
14
|
+
tag = "Video"
|
|
15
|
+
library = "next-video"
|
|
16
|
+
is_default = True
|
|
17
|
+
# the URL
|
|
18
|
+
src: Var[str]
|
|
19
|
+
|
|
20
|
+
as_: Optional[Component]
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def create(cls, *children, **props) -> NextComponent:
|
|
24
|
+
"""Create a Video component.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
*children: The children of the component.
|
|
28
|
+
**props: The props of the component.
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
The Video component.
|
|
32
|
+
"""
|
|
33
|
+
return super().create(*children, **props)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"""Stub file for reflex/components/next/video.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.vars import Var
|
|
13
|
+
from .base import NextComponent
|
|
14
|
+
|
|
15
|
+
class Video(NextComponent):
|
|
16
|
+
@overload
|
|
17
|
+
@classmethod
|
|
18
|
+
def create( # type: ignore
|
|
19
|
+
cls,
|
|
20
|
+
*children,
|
|
21
|
+
src: Optional[Union[Var[str], str]] = None,
|
|
22
|
+
as_: Optional[Component] = 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
|
+
) -> "Video":
|
|
76
|
+
"""Create a Video component.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
*children: The children of the component.
|
|
80
|
+
src: the URL
|
|
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 Video component.
|
|
91
|
+
"""
|
|
92
|
+
...
|