reflex 0.5.5a1__py3-none-any.whl → 0.5.6__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/_app.js.jinja2 +0 -1
- reflex/.templates/jinja/web/utils/context.js.jinja2 +2 -0
- reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +20 -2
- reflex/.templates/web/utils/helpers/paste.js +59 -0
- reflex/__init__.py +9 -1
- reflex/__init__.pyi +89 -87
- reflex/app.py +64 -126
- reflex/app_mixins/__init__.py +5 -0
- reflex/app_mixins/lifespan.py +57 -0
- reflex/app_mixins/middleware.py +93 -0
- reflex/app_mixins/mixin.py +14 -0
- reflex/compiler/compiler.py +6 -1
- reflex/components/__init__.pyi +0 -2
- reflex/components/base/__init__.pyi +1 -3
- reflex/components/base/app_wrap.pyi +21 -22
- reflex/components/base/body.pyi +21 -20
- reflex/components/base/document.pyi +85 -85
- reflex/components/base/fragment.pyi +21 -20
- reflex/components/base/head.pyi +37 -36
- reflex/components/base/link.pyi +37 -37
- reflex/components/base/meta.pyi +69 -70
- reflex/components/base/script.py +6 -2
- reflex/components/base/script.pyi +31 -27
- reflex/components/chakra/base.pyi +54 -56
- reflex/components/chakra/datadisplay/badge.pyi +21 -21
- reflex/components/chakra/datadisplay/code.pyi +21 -20
- reflex/components/chakra/datadisplay/divider.pyi +21 -22
- reflex/components/chakra/datadisplay/keyboard_key.pyi +21 -20
- reflex/components/chakra/datadisplay/list.pyi +69 -71
- reflex/components/chakra/datadisplay/stat.pyi +101 -102
- reflex/components/chakra/datadisplay/table.pyi +149 -153
- reflex/components/chakra/datadisplay/tag.pyi +85 -89
- reflex/components/chakra/disclosure/accordion.pyi +87 -93
- reflex/components/chakra/disclosure/tabs.pyi +85 -90
- reflex/components/chakra/disclosure/transition.pyi +104 -105
- reflex/components/chakra/disclosure/visuallyhidden.pyi +21 -20
- reflex/components/chakra/feedback/alert.pyi +69 -70
- reflex/components/chakra/feedback/circularprogress.pyi +38 -40
- reflex/components/chakra/feedback/progress.pyi +22 -23
- reflex/components/chakra/feedback/skeleton.pyi +53 -53
- reflex/components/chakra/feedback/spinner.pyi +21 -21
- reflex/components/chakra/forms/button.pyi +37 -42
- reflex/components/chakra/forms/checkbox.pyi +38 -39
- reflex/components/chakra/forms/colormodeswitch.pyi +72 -71
- reflex/components/chakra/forms/date_picker.pyi +24 -24
- reflex/components/chakra/forms/date_time_picker.pyi +24 -24
- reflex/components/chakra/forms/editable.pyi +73 -74
- reflex/components/chakra/forms/email.pyi +24 -24
- reflex/components/chakra/forms/form.pyi +112 -141
- reflex/components/chakra/forms/iconbutton.pyi +21 -22
- reflex/components/chakra/forms/input.pyi +104 -111
- reflex/components/chakra/forms/numberinput.pyi +87 -91
- reflex/components/chakra/forms/password.pyi +24 -24
- reflex/components/chakra/forms/pininput.pyi +39 -45
- reflex/components/chakra/forms/radio.pyi +38 -43
- reflex/components/chakra/forms/rangeslider.pyi +72 -76
- reflex/components/chakra/forms/select.pyi +39 -44
- reflex/components/chakra/forms/slider.pyi +88 -91
- reflex/components/chakra/forms/switch.pyi +22 -23
- reflex/components/chakra/forms/textarea.pyi +24 -27
- reflex/components/chakra/forms/time_picker.pyi +24 -24
- reflex/components/chakra/layout/aspect_ratio.pyi +21 -21
- reflex/components/chakra/layout/box.pyi +21 -22
- reflex/components/chakra/layout/card.pyi +69 -73
- reflex/components/chakra/layout/center.pyi +53 -52
- reflex/components/chakra/layout/container.pyi +21 -21
- reflex/components/chakra/layout/flex.pyi +23 -26
- reflex/components/chakra/layout/grid.pyi +53 -54
- reflex/components/chakra/layout/spacer.pyi +21 -20
- reflex/components/chakra/layout/stack.pyi +62 -60
- reflex/components/chakra/layout/wrap.pyi +37 -38
- reflex/components/chakra/media/avatar.pyi +54 -55
- reflex/components/chakra/media/icon.pyi +37 -38
- reflex/components/chakra/media/image.pyi +24 -26
- reflex/components/chakra/navigation/breadcrumb.pyi +69 -71
- reflex/components/chakra/navigation/link.pyi +20 -21
- reflex/components/chakra/navigation/linkoverlay.pyi +37 -37
- reflex/components/chakra/navigation/stepper.pyi +149 -151
- reflex/components/chakra/overlay/alertdialog.pyi +121 -124
- reflex/components/chakra/overlay/drawer.pyi +121 -126
- reflex/components/chakra/overlay/menu.pyi +135 -141
- reflex/components/chakra/overlay/modal.pyi +121 -124
- reflex/components/chakra/overlay/popover.pyi +151 -156
- reflex/components/chakra/overlay/tooltip.pyi +23 -24
- reflex/components/chakra/typography/heading.pyi +21 -21
- reflex/components/chakra/typography/highlight.pyi +21 -23
- reflex/components/chakra/typography/span.pyi +21 -21
- reflex/components/chakra/typography/text.pyi +21 -21
- reflex/components/component.py +6 -2
- reflex/components/core/__init__.py +2 -0
- reflex/components/core/__init__.pyi +9 -7
- reflex/components/core/banner.pyi +118 -146
- reflex/components/core/breakpoints.py +95 -0
- reflex/components/core/client_side_routing.pyi +37 -39
- reflex/components/core/clipboard.py +95 -0
- reflex/components/core/clipboard.pyi +102 -0
- reflex/components/core/debounce.pyi +23 -28
- reflex/components/core/foreach.py +3 -2
- reflex/components/core/html.pyi +38 -55
- reflex/components/core/upload.py +1 -1
- reflex/components/core/upload.pyi +74 -91
- reflex/components/datadisplay/__init__.pyi +2 -3
- reflex/components/datadisplay/code.py +3 -3
- reflex/components/datadisplay/code.pyi +22 -31
- reflex/components/datadisplay/dataeditor.pyi +41 -45
- reflex/components/el/__init__.pyi +131 -135
- reflex/components/el/element.pyi +21 -20
- reflex/components/el/elements/__init__.pyi +131 -132
- reflex/components/el/elements/base.pyi +38 -55
- reflex/components/el/elements/forms.pyi +558 -878
- reflex/components/el/elements/inline.pyi +941 -1403
- reflex/components/el/elements/media.pyi +645 -994
- reflex/components/el/elements/metadata.pyi +186 -268
- reflex/components/el/elements/other.pyi +239 -353
- reflex/components/el/elements/scripts.pyi +113 -171
- reflex/components/el/elements/sectioning.pyi +500 -739
- reflex/components/el/elements/tables.pyi +355 -551
- reflex/components/el/elements/typography.pyi +510 -760
- reflex/components/gridjs/datatable.pyi +38 -42
- reflex/components/lucide/icon.pyi +37 -38
- reflex/components/markdown/markdown.pyi +23 -36
- reflex/components/moment/moment.pyi +23 -25
- reflex/components/next/base.pyi +21 -20
- reflex/components/next/image.pyi +25 -27
- reflex/components/next/link.pyi +21 -21
- reflex/components/next/video.pyi +22 -22
- reflex/components/plotly/plotly.pyi +42 -45
- reflex/components/radix/__init__.pyi +26 -30
- reflex/components/radix/primitives/__init__.pyi +0 -2
- reflex/components/radix/primitives/accordion.pyi +119 -127
- reflex/components/radix/primitives/base.pyi +37 -40
- reflex/components/radix/primitives/drawer.pyi +175 -179
- reflex/components/radix/primitives/form.pyi +250 -336
- reflex/components/radix/primitives/progress.pyi +92 -96
- reflex/components/radix/primitives/slider.pyi +87 -89
- reflex/components/radix/themes/__init__.pyi +0 -2
- reflex/components/radix/themes/base.pyi +118 -121
- reflex/components/radix/themes/color_mode.pyi +103 -117
- reflex/components/radix/themes/components/__init__.pyi +12 -14
- reflex/components/radix/themes/components/alert_dialog.py +2 -1
- reflex/components/radix/themes/components/alert_dialog.pyi +150 -157
- reflex/components/radix/themes/components/aspect_ratio.pyi +22 -22
- reflex/components/radix/themes/components/avatar.py +2 -1
- reflex/components/radix/themes/components/avatar.pyi +32 -23
- reflex/components/radix/themes/components/badge.py +2 -1
- reflex/components/radix/themes/components/badge.pyi +50 -57
- reflex/components/radix/themes/components/button.py +2 -1
- reflex/components/radix/themes/components/button.pyi +60 -79
- reflex/components/radix/themes/components/callout.py +2 -1
- reflex/components/radix/themes/components/callout.pyi +201 -258
- reflex/components/radix/themes/components/card.py +2 -1
- reflex/components/radix/themes/components/card.pyi +48 -56
- reflex/components/radix/themes/components/checkbox.py +2 -1
- reflex/components/radix/themes/components/checkbox.pyi +68 -62
- reflex/components/radix/themes/components/checkbox_cards.py +8 -3
- reflex/components/radix/themes/components/checkbox_cards.pyi +87 -44
- reflex/components/radix/themes/components/checkbox_group.py +2 -1
- reflex/components/radix/themes/components/checkbox_group.pyi +49 -40
- reflex/components/radix/themes/components/context_menu.py +2 -1
- reflex/components/radix/themes/components/context_menu.pyi +153 -147
- reflex/components/radix/themes/components/data_list.py +8 -7
- reflex/components/radix/themes/components/data_list.pyi +116 -78
- reflex/components/radix/themes/components/dialog.py +2 -1
- reflex/components/radix/themes/components/dialog.pyi +154 -161
- reflex/components/radix/themes/components/dropdown_menu.py +2 -1
- reflex/components/radix/themes/components/dropdown_menu.pyi +169 -163
- reflex/components/radix/themes/components/hover_card.py +2 -1
- reflex/components/radix/themes/components/hover_card.pyi +97 -107
- reflex/components/radix/themes/components/icon_button.py +2 -1
- reflex/components/radix/themes/components/icon_button.pyi +59 -82
- reflex/components/radix/themes/components/inset.py +10 -9
- reflex/components/radix/themes/components/inset.pyi +109 -61
- reflex/components/radix/themes/components/popover.py +2 -1
- reflex/components/radix/themes/components/popover.pyi +105 -112
- reflex/components/radix/themes/components/progress.py +2 -1
- reflex/components/radix/themes/components/progress.pyi +32 -24
- reflex/components/radix/themes/components/radio.py +2 -1
- reflex/components/radix/themes/components/radio.pyi +32 -23
- reflex/components/radix/themes/components/radio_cards.py +51 -3
- reflex/components/radix/themes/components/radio_cards.pyi +120 -44
- reflex/components/radix/themes/components/radio_group.py +5 -2
- reflex/components/radix/themes/components/radio_group.pyi +82 -77
- reflex/components/radix/themes/components/scroll_area.pyi +21 -21
- reflex/components/radix/themes/components/segmented_control.py +2 -1
- reflex/components/radix/themes/components/segmented_control.pyi +52 -46
- reflex/components/radix/themes/components/select.py +2 -1
- reflex/components/radix/themes/components/select.pyi +188 -164
- reflex/components/radix/themes/components/separator.py +5 -2
- reflex/components/radix/themes/components/separator.pyi +40 -24
- reflex/components/radix/themes/components/skeleton.py +7 -6
- reflex/components/radix/themes/components/skeleton.pyi +40 -26
- reflex/components/radix/themes/components/slider.py +2 -1
- reflex/components/radix/themes/components/slider.pyi +40 -31
- reflex/components/radix/themes/components/spinner.py +2 -1
- reflex/components/radix/themes/components/spinner.pyi +31 -22
- reflex/components/radix/themes/components/switch.py +2 -1
- reflex/components/radix/themes/components/switch.pyi +33 -25
- reflex/components/radix/themes/components/table.py +2 -1
- reflex/components/radix/themes/components/table.pyi +265 -404
- reflex/components/radix/themes/components/tabs.py +14 -1
- reflex/components/radix/themes/components/tabs.pyi +113 -92
- reflex/components/radix/themes/components/text_area.py +3 -2
- reflex/components/radix/themes/components/text_area.pyi +64 -66
- reflex/components/radix/themes/components/text_field.py +2 -1
- reflex/components/radix/themes/components/text_field.pyi +116 -140
- reflex/components/radix/themes/components/tooltip.pyi +32 -37
- reflex/components/radix/themes/layout/__init__.pyi +4 -7
- reflex/components/radix/themes/layout/base.py +10 -9
- reflex/components/radix/themes/layout/base.pyi +121 -31
- reflex/components/radix/themes/layout/box.pyi +39 -53
- reflex/components/radix/themes/layout/center.pyi +89 -58
- reflex/components/radix/themes/layout/container.py +4 -1
- reflex/components/radix/themes/layout/container.pyi +51 -58
- reflex/components/radix/themes/layout/flex.py +6 -5
- reflex/components/radix/themes/layout/flex.pyi +91 -61
- reflex/components/radix/themes/layout/grid.py +9 -8
- reflex/components/radix/themes/layout/grid.pyi +116 -64
- reflex/components/radix/themes/layout/list.pyi +173 -233
- reflex/components/radix/themes/layout/section.py +4 -1
- reflex/components/radix/themes/layout/section.pyi +50 -57
- reflex/components/radix/themes/layout/spacer.pyi +89 -58
- reflex/components/radix/themes/layout/stack.pyi +160 -160
- reflex/components/radix/themes/typography/__init__.pyi +0 -2
- reflex/components/radix/themes/typography/blockquote.py +3 -2
- reflex/components/radix/themes/typography/blockquote.pyi +58 -59
- reflex/components/radix/themes/typography/code.py +3 -2
- reflex/components/radix/themes/typography/code.pyi +57 -58
- reflex/components/radix/themes/typography/heading.py +5 -4
- reflex/components/radix/themes/typography/heading.pyi +71 -60
- reflex/components/radix/themes/typography/link.py +4 -3
- reflex/components/radix/themes/typography/link.pyi +74 -82
- reflex/components/radix/themes/typography/text.py +5 -4
- reflex/components/radix/themes/typography/text.pyi +330 -364
- reflex/components/react_player/audio.pyi +37 -36
- reflex/components/react_player/react_player.pyi +37 -38
- reflex/components/react_player/video.pyi +37 -36
- reflex/components/recharts/__init__.pyi +41 -42
- reflex/components/recharts/cartesian.pyi +384 -400
- reflex/components/recharts/charts.pyi +224 -231
- reflex/components/recharts/general.pyi +89 -96
- reflex/components/recharts/polar.pyi +97 -104
- reflex/components/recharts/recharts.pyi +37 -37
- reflex/components/sonner/toast.pyi +22 -27
- reflex/components/suneditor/editor.pyi +53 -58
- reflex/config.py +6 -0
- reflex/constants/event.py +1 -0
- reflex/experimental/layout.pyi +140 -194
- reflex/model.py +14 -2
- reflex/state.py +55 -45
- reflex/style.py +24 -13
- reflex/utils/codespaces.py +94 -0
- reflex/utils/compat.py +21 -0
- reflex/utils/exceptions.py +4 -0
- reflex/utils/format.py +25 -4
- reflex/utils/prerequisites.py +0 -12
- reflex/utils/pyi_generator.py +88 -61
- reflex/utils/types.py +83 -5
- reflex/vars.py +62 -5
- reflex/vars.pyi +23 -11
- {reflex-0.5.5a1.dist-info → reflex-0.5.6.dist-info}/METADATA +5 -6
- {reflex-0.5.5a1.dist-info → reflex-0.5.6.dist-info}/RECORD +264 -255
- {reflex-0.5.5a1.dist-info → reflex-0.5.6.dist-info}/LICENSE +0 -0
- {reflex-0.5.5a1.dist-info → reflex-0.5.6.dist-info}/WHEEL +0 -0
- {reflex-0.5.5a1.dist-info → reflex-0.5.6.dist-info}/entry_points.txt +0 -0
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
"""Stub file for reflex/components/core/banner.py"""
|
|
2
|
+
|
|
2
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
3
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
4
5
|
# ------------------------------------------------------
|
|
6
|
+
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
|
5
7
|
|
|
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
8
|
from reflex.components.base.bare import Bare
|
|
12
9
|
from reflex.components.component import Component
|
|
13
|
-
from reflex.components.core.cond import cond
|
|
14
10
|
from reflex.components.el.elements.typography import Div
|
|
15
11
|
from reflex.components.lucide.icon import Icon
|
|
16
|
-
from reflex.components.radix.themes.components.dialog import (
|
|
17
|
-
DialogContent,
|
|
18
|
-
DialogRoot,
|
|
19
|
-
DialogTitle,
|
|
20
|
-
)
|
|
21
|
-
from reflex.components.radix.themes.layout.flex import Flex
|
|
22
|
-
from reflex.components.radix.themes.typography.text import Text
|
|
23
12
|
from reflex.components.sonner.toast import Toaster, ToastProps
|
|
24
|
-
from reflex.
|
|
25
|
-
from reflex.
|
|
13
|
+
from reflex.event import EventHandler, EventSpec
|
|
14
|
+
from reflex.style import Style
|
|
26
15
|
from reflex.utils.imports import ImportDict, ImportVar
|
|
27
|
-
from reflex.
|
|
28
|
-
from reflex.vars import Var, VarData
|
|
16
|
+
from reflex.vars import BaseVar, Var, VarData
|
|
29
17
|
|
|
30
18
|
connect_error_var_data: VarData
|
|
31
19
|
connect_errors: Var
|
|
@@ -49,51 +37,51 @@ class WebsocketTargetURL(Bare):
|
|
|
49
37
|
autofocus: Optional[bool] = None,
|
|
50
38
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
51
39
|
on_blur: Optional[
|
|
52
|
-
Union[EventHandler, EventSpec, list,
|
|
40
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
53
41
|
] = None,
|
|
54
42
|
on_click: Optional[
|
|
55
|
-
Union[EventHandler, EventSpec, list,
|
|
43
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
56
44
|
] = None,
|
|
57
45
|
on_context_menu: Optional[
|
|
58
|
-
Union[EventHandler, EventSpec, list,
|
|
46
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
59
47
|
] = None,
|
|
60
48
|
on_double_click: Optional[
|
|
61
|
-
Union[EventHandler, EventSpec, list,
|
|
49
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
62
50
|
] = None,
|
|
63
51
|
on_focus: Optional[
|
|
64
|
-
Union[EventHandler, EventSpec, list,
|
|
52
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
65
53
|
] = None,
|
|
66
54
|
on_mount: Optional[
|
|
67
|
-
Union[EventHandler, EventSpec, list,
|
|
55
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
68
56
|
] = None,
|
|
69
57
|
on_mouse_down: Optional[
|
|
70
|
-
Union[EventHandler, EventSpec, list,
|
|
58
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
71
59
|
] = None,
|
|
72
60
|
on_mouse_enter: Optional[
|
|
73
|
-
Union[EventHandler, EventSpec, list,
|
|
61
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
74
62
|
] = None,
|
|
75
63
|
on_mouse_leave: Optional[
|
|
76
|
-
Union[EventHandler, EventSpec, list,
|
|
64
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
77
65
|
] = None,
|
|
78
66
|
on_mouse_move: Optional[
|
|
79
|
-
Union[EventHandler, EventSpec, list,
|
|
67
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
80
68
|
] = None,
|
|
81
69
|
on_mouse_out: Optional[
|
|
82
|
-
Union[EventHandler, EventSpec, list,
|
|
70
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
83
71
|
] = None,
|
|
84
72
|
on_mouse_over: Optional[
|
|
85
|
-
Union[EventHandler, EventSpec, list,
|
|
73
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
86
74
|
] = None,
|
|
87
75
|
on_mouse_up: Optional[
|
|
88
|
-
Union[EventHandler, EventSpec, list,
|
|
76
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
89
77
|
] = None,
|
|
90
78
|
on_scroll: Optional[
|
|
91
|
-
Union[EventHandler, EventSpec, list,
|
|
79
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
92
80
|
] = None,
|
|
93
81
|
on_unmount: Optional[
|
|
94
|
-
Union[EventHandler, EventSpec, list,
|
|
82
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
95
83
|
] = None,
|
|
96
|
-
**props
|
|
84
|
+
**props,
|
|
97
85
|
) -> "WebsocketTargetURL":
|
|
98
86
|
"""Create a websocket target URL component.
|
|
99
87
|
|
|
@@ -153,51 +141,51 @@ class ConnectionToaster(Toaster):
|
|
|
153
141
|
autofocus: Optional[bool] = None,
|
|
154
142
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
155
143
|
on_blur: Optional[
|
|
156
|
-
Union[EventHandler, EventSpec, list,
|
|
144
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
157
145
|
] = None,
|
|
158
146
|
on_click: Optional[
|
|
159
|
-
Union[EventHandler, EventSpec, list,
|
|
147
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
160
148
|
] = None,
|
|
161
149
|
on_context_menu: Optional[
|
|
162
|
-
Union[EventHandler, EventSpec, list,
|
|
150
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
163
151
|
] = None,
|
|
164
152
|
on_double_click: Optional[
|
|
165
|
-
Union[EventHandler, EventSpec, list,
|
|
153
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
166
154
|
] = None,
|
|
167
155
|
on_focus: Optional[
|
|
168
|
-
Union[EventHandler, EventSpec, list,
|
|
156
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
169
157
|
] = None,
|
|
170
158
|
on_mount: Optional[
|
|
171
|
-
Union[EventHandler, EventSpec, list,
|
|
159
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
172
160
|
] = None,
|
|
173
161
|
on_mouse_down: Optional[
|
|
174
|
-
Union[EventHandler, EventSpec, list,
|
|
162
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
175
163
|
] = None,
|
|
176
164
|
on_mouse_enter: Optional[
|
|
177
|
-
Union[EventHandler, EventSpec, list,
|
|
165
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
178
166
|
] = None,
|
|
179
167
|
on_mouse_leave: Optional[
|
|
180
|
-
Union[EventHandler, EventSpec, list,
|
|
168
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
181
169
|
] = None,
|
|
182
170
|
on_mouse_move: Optional[
|
|
183
|
-
Union[EventHandler, EventSpec, list,
|
|
171
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
184
172
|
] = None,
|
|
185
173
|
on_mouse_out: Optional[
|
|
186
|
-
Union[EventHandler, EventSpec, list,
|
|
174
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
187
175
|
] = None,
|
|
188
176
|
on_mouse_over: Optional[
|
|
189
|
-
Union[EventHandler, EventSpec, list,
|
|
177
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
190
178
|
] = None,
|
|
191
179
|
on_mouse_up: Optional[
|
|
192
|
-
Union[EventHandler, EventSpec, list,
|
|
180
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
193
181
|
] = None,
|
|
194
182
|
on_scroll: Optional[
|
|
195
|
-
Union[EventHandler, EventSpec, list,
|
|
183
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
196
184
|
] = None,
|
|
197
185
|
on_unmount: Optional[
|
|
198
|
-
Union[EventHandler, EventSpec, list,
|
|
186
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
199
187
|
] = None,
|
|
200
|
-
**props
|
|
188
|
+
**props,
|
|
201
189
|
) -> "ConnectionToaster":
|
|
202
190
|
"""Create the component.
|
|
203
191
|
|
|
@@ -243,51 +231,51 @@ class ConnectionBanner(Component):
|
|
|
243
231
|
autofocus: Optional[bool] = None,
|
|
244
232
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
245
233
|
on_blur: Optional[
|
|
246
|
-
Union[EventHandler, EventSpec, list,
|
|
234
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
247
235
|
] = None,
|
|
248
236
|
on_click: Optional[
|
|
249
|
-
Union[EventHandler, EventSpec, list,
|
|
237
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
250
238
|
] = None,
|
|
251
239
|
on_context_menu: Optional[
|
|
252
|
-
Union[EventHandler, EventSpec, list,
|
|
240
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
253
241
|
] = None,
|
|
254
242
|
on_double_click: Optional[
|
|
255
|
-
Union[EventHandler, EventSpec, list,
|
|
243
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
256
244
|
] = None,
|
|
257
245
|
on_focus: Optional[
|
|
258
|
-
Union[EventHandler, EventSpec, list,
|
|
246
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
259
247
|
] = None,
|
|
260
248
|
on_mount: Optional[
|
|
261
|
-
Union[EventHandler, EventSpec, list,
|
|
249
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
262
250
|
] = None,
|
|
263
251
|
on_mouse_down: Optional[
|
|
264
|
-
Union[EventHandler, EventSpec, list,
|
|
252
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
265
253
|
] = None,
|
|
266
254
|
on_mouse_enter: Optional[
|
|
267
|
-
Union[EventHandler, EventSpec, list,
|
|
255
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
268
256
|
] = None,
|
|
269
257
|
on_mouse_leave: Optional[
|
|
270
|
-
Union[EventHandler, EventSpec, list,
|
|
258
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
271
259
|
] = None,
|
|
272
260
|
on_mouse_move: Optional[
|
|
273
|
-
Union[EventHandler, EventSpec, list,
|
|
261
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
274
262
|
] = None,
|
|
275
263
|
on_mouse_out: Optional[
|
|
276
|
-
Union[EventHandler, EventSpec, list,
|
|
264
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
277
265
|
] = None,
|
|
278
266
|
on_mouse_over: Optional[
|
|
279
|
-
Union[EventHandler, EventSpec, list,
|
|
267
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
280
268
|
] = None,
|
|
281
269
|
on_mouse_up: Optional[
|
|
282
|
-
Union[EventHandler, EventSpec, list,
|
|
270
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
283
271
|
] = None,
|
|
284
272
|
on_scroll: Optional[
|
|
285
|
-
Union[EventHandler, EventSpec, list,
|
|
273
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
286
274
|
] = None,
|
|
287
275
|
on_unmount: Optional[
|
|
288
|
-
Union[EventHandler, EventSpec, list,
|
|
276
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
289
277
|
] = None,
|
|
290
|
-
**props
|
|
278
|
+
**props,
|
|
291
279
|
) -> "ConnectionBanner":
|
|
292
280
|
"""Create a connection banner component.
|
|
293
281
|
|
|
@@ -312,51 +300,51 @@ class ConnectionModal(Component):
|
|
|
312
300
|
autofocus: Optional[bool] = None,
|
|
313
301
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
314
302
|
on_blur: Optional[
|
|
315
|
-
Union[EventHandler, EventSpec, list,
|
|
303
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
316
304
|
] = None,
|
|
317
305
|
on_click: Optional[
|
|
318
|
-
Union[EventHandler, EventSpec, list,
|
|
306
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
319
307
|
] = None,
|
|
320
308
|
on_context_menu: Optional[
|
|
321
|
-
Union[EventHandler, EventSpec, list,
|
|
309
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
322
310
|
] = None,
|
|
323
311
|
on_double_click: Optional[
|
|
324
|
-
Union[EventHandler, EventSpec, list,
|
|
312
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
325
313
|
] = None,
|
|
326
314
|
on_focus: Optional[
|
|
327
|
-
Union[EventHandler, EventSpec, list,
|
|
315
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
328
316
|
] = None,
|
|
329
317
|
on_mount: Optional[
|
|
330
|
-
Union[EventHandler, EventSpec, list,
|
|
318
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
331
319
|
] = None,
|
|
332
320
|
on_mouse_down: Optional[
|
|
333
|
-
Union[EventHandler, EventSpec, list,
|
|
321
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
334
322
|
] = None,
|
|
335
323
|
on_mouse_enter: Optional[
|
|
336
|
-
Union[EventHandler, EventSpec, list,
|
|
324
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
337
325
|
] = None,
|
|
338
326
|
on_mouse_leave: Optional[
|
|
339
|
-
Union[EventHandler, EventSpec, list,
|
|
327
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
340
328
|
] = None,
|
|
341
329
|
on_mouse_move: Optional[
|
|
342
|
-
Union[EventHandler, EventSpec, list,
|
|
330
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
343
331
|
] = None,
|
|
344
332
|
on_mouse_out: Optional[
|
|
345
|
-
Union[EventHandler, EventSpec, list,
|
|
333
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
346
334
|
] = None,
|
|
347
335
|
on_mouse_over: Optional[
|
|
348
|
-
Union[EventHandler, EventSpec, list,
|
|
336
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
349
337
|
] = None,
|
|
350
338
|
on_mouse_up: Optional[
|
|
351
|
-
Union[EventHandler, EventSpec, list,
|
|
339
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
352
340
|
] = None,
|
|
353
341
|
on_scroll: Optional[
|
|
354
|
-
Union[EventHandler, EventSpec, list,
|
|
342
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
355
343
|
] = None,
|
|
356
344
|
on_unmount: Optional[
|
|
357
|
-
Union[EventHandler, EventSpec, list,
|
|
345
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
358
346
|
] = None,
|
|
359
|
-
**props
|
|
347
|
+
**props,
|
|
360
348
|
) -> "ConnectionModal":
|
|
361
349
|
"""Create a connection banner component.
|
|
362
350
|
|
|
@@ -382,51 +370,51 @@ class WifiOffPulse(Icon):
|
|
|
382
370
|
autofocus: Optional[bool] = None,
|
|
383
371
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
384
372
|
on_blur: Optional[
|
|
385
|
-
Union[EventHandler, EventSpec, list,
|
|
373
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
386
374
|
] = None,
|
|
387
375
|
on_click: Optional[
|
|
388
|
-
Union[EventHandler, EventSpec, list,
|
|
376
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
389
377
|
] = None,
|
|
390
378
|
on_context_menu: Optional[
|
|
391
|
-
Union[EventHandler, EventSpec, list,
|
|
379
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
392
380
|
] = None,
|
|
393
381
|
on_double_click: Optional[
|
|
394
|
-
Union[EventHandler, EventSpec, list,
|
|
382
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
395
383
|
] = None,
|
|
396
384
|
on_focus: Optional[
|
|
397
|
-
Union[EventHandler, EventSpec, list,
|
|
385
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
398
386
|
] = None,
|
|
399
387
|
on_mount: Optional[
|
|
400
|
-
Union[EventHandler, EventSpec, list,
|
|
388
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
401
389
|
] = None,
|
|
402
390
|
on_mouse_down: Optional[
|
|
403
|
-
Union[EventHandler, EventSpec, list,
|
|
391
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
404
392
|
] = None,
|
|
405
393
|
on_mouse_enter: Optional[
|
|
406
|
-
Union[EventHandler, EventSpec, list,
|
|
394
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
407
395
|
] = None,
|
|
408
396
|
on_mouse_leave: Optional[
|
|
409
|
-
Union[EventHandler, EventSpec, list,
|
|
397
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
410
398
|
] = None,
|
|
411
399
|
on_mouse_move: Optional[
|
|
412
|
-
Union[EventHandler, EventSpec, list,
|
|
400
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
413
401
|
] = None,
|
|
414
402
|
on_mouse_out: Optional[
|
|
415
|
-
Union[EventHandler, EventSpec, list,
|
|
403
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
416
404
|
] = None,
|
|
417
405
|
on_mouse_over: Optional[
|
|
418
|
-
Union[EventHandler, EventSpec, list,
|
|
406
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
419
407
|
] = None,
|
|
420
408
|
on_mouse_up: Optional[
|
|
421
|
-
Union[EventHandler, EventSpec, list,
|
|
409
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
422
410
|
] = None,
|
|
423
411
|
on_scroll: Optional[
|
|
424
|
-
Union[EventHandler, EventSpec, list,
|
|
412
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
425
413
|
] = None,
|
|
426
414
|
on_unmount: Optional[
|
|
427
|
-
Union[EventHandler, EventSpec, list,
|
|
415
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
428
416
|
] = None,
|
|
429
|
-
**props
|
|
417
|
+
**props,
|
|
430
418
|
) -> "WifiOffPulse":
|
|
431
419
|
"""Create a wifi_off icon with an animated opacity pulse.
|
|
432
420
|
|
|
@@ -454,46 +442,30 @@ class ConnectionPulser(Div):
|
|
|
454
442
|
def create( # type: ignore
|
|
455
443
|
cls,
|
|
456
444
|
*children,
|
|
457
|
-
access_key: Optional[
|
|
458
|
-
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
459
|
-
] = None,
|
|
445
|
+
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
460
446
|
auto_capitalize: Optional[
|
|
461
|
-
Union[Var[Union[
|
|
447
|
+
Union[Var[Union[bool, int, str]], str, int, bool]
|
|
462
448
|
] = None,
|
|
463
449
|
content_editable: Optional[
|
|
464
|
-
Union[Var[Union[
|
|
450
|
+
Union[Var[Union[bool, int, str]], str, int, bool]
|
|
465
451
|
] = None,
|
|
466
452
|
context_menu: Optional[
|
|
467
|
-
Union[Var[Union[
|
|
468
|
-
] = None,
|
|
469
|
-
dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
470
|
-
draggable: Optional[
|
|
471
|
-
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
453
|
+
Union[Var[Union[bool, int, str]], str, int, bool]
|
|
472
454
|
] = None,
|
|
455
|
+
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
456
|
+
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
473
457
|
enter_key_hint: Optional[
|
|
474
|
-
Union[Var[Union[
|
|
475
|
-
] = None,
|
|
476
|
-
hidden: Optional[
|
|
477
|
-
|
|
478
|
-
] = None,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
] = None,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
] = None,
|
|
485
|
-
lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
486
|
-
role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
487
|
-
slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
488
|
-
spell_check: Optional[
|
|
489
|
-
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
490
|
-
] = None,
|
|
491
|
-
tab_index: Optional[
|
|
492
|
-
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
493
|
-
] = None,
|
|
494
|
-
title: Optional[
|
|
495
|
-
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
496
|
-
] = None,
|
|
458
|
+
Union[Var[Union[bool, int, str]], str, int, bool]
|
|
459
|
+
] = None,
|
|
460
|
+
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
461
|
+
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
462
|
+
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
463
|
+
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
464
|
+
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
465
|
+
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
466
|
+
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
467
|
+
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
468
|
+
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
|
497
469
|
style: Optional[Style] = None,
|
|
498
470
|
key: Optional[Any] = None,
|
|
499
471
|
id: Optional[Any] = None,
|
|
@@ -501,51 +473,51 @@ class ConnectionPulser(Div):
|
|
|
501
473
|
autofocus: Optional[bool] = None,
|
|
502
474
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
503
475
|
on_blur: Optional[
|
|
504
|
-
Union[EventHandler, EventSpec, list,
|
|
476
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
505
477
|
] = None,
|
|
506
478
|
on_click: Optional[
|
|
507
|
-
Union[EventHandler, EventSpec, list,
|
|
479
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
508
480
|
] = None,
|
|
509
481
|
on_context_menu: Optional[
|
|
510
|
-
Union[EventHandler, EventSpec, list,
|
|
482
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
511
483
|
] = None,
|
|
512
484
|
on_double_click: Optional[
|
|
513
|
-
Union[EventHandler, EventSpec, list,
|
|
485
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
514
486
|
] = None,
|
|
515
487
|
on_focus: Optional[
|
|
516
|
-
Union[EventHandler, EventSpec, list,
|
|
488
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
517
489
|
] = None,
|
|
518
490
|
on_mount: Optional[
|
|
519
|
-
Union[EventHandler, EventSpec, list,
|
|
491
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
520
492
|
] = None,
|
|
521
493
|
on_mouse_down: Optional[
|
|
522
|
-
Union[EventHandler, EventSpec, list,
|
|
494
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
523
495
|
] = None,
|
|
524
496
|
on_mouse_enter: Optional[
|
|
525
|
-
Union[EventHandler, EventSpec, list,
|
|
497
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
526
498
|
] = None,
|
|
527
499
|
on_mouse_leave: Optional[
|
|
528
|
-
Union[EventHandler, EventSpec, list,
|
|
500
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
529
501
|
] = None,
|
|
530
502
|
on_mouse_move: Optional[
|
|
531
|
-
Union[EventHandler, EventSpec, list,
|
|
503
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
532
504
|
] = None,
|
|
533
505
|
on_mouse_out: Optional[
|
|
534
|
-
Union[EventHandler, EventSpec, list,
|
|
506
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
535
507
|
] = None,
|
|
536
508
|
on_mouse_over: Optional[
|
|
537
|
-
Union[EventHandler, EventSpec, list,
|
|
509
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
538
510
|
] = None,
|
|
539
511
|
on_mouse_up: Optional[
|
|
540
|
-
Union[EventHandler, EventSpec, list,
|
|
512
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
541
513
|
] = None,
|
|
542
514
|
on_scroll: Optional[
|
|
543
|
-
Union[EventHandler, EventSpec, list,
|
|
515
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
544
516
|
] = None,
|
|
545
517
|
on_unmount: Optional[
|
|
546
|
-
Union[EventHandler, EventSpec, list,
|
|
518
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
547
519
|
] = None,
|
|
548
|
-
**props
|
|
520
|
+
**props,
|
|
549
521
|
) -> "ConnectionPulser":
|
|
550
522
|
"""Create a connection pulser component.
|
|
551
523
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""Breakpoints utility."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Tuple, TypeVar, Union
|
|
6
|
+
|
|
7
|
+
breakpoints_values = ["30em", "48em", "62em", "80em", "96em"]
|
|
8
|
+
breakpoint_names = ["xs", "sm", "md", "lg", "xl"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def set_breakpoints(values: Tuple[str, str, str, str, str]):
|
|
12
|
+
"""Overwrite default breakpoint values.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
values: CSS values in order defining the breakpoints of responsive layouts
|
|
16
|
+
"""
|
|
17
|
+
breakpoints_values.clear()
|
|
18
|
+
breakpoints_values.extend(values)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
K = TypeVar("K")
|
|
22
|
+
V = TypeVar("V")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Breakpoints(Dict[K, V]):
|
|
26
|
+
"""A responsive styling helper."""
|
|
27
|
+
|
|
28
|
+
def factorize(self):
|
|
29
|
+
"""Removes references to breakpoints names and instead replaces them with their corresponding values.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
The factorized breakpoints.
|
|
33
|
+
"""
|
|
34
|
+
return Breakpoints(
|
|
35
|
+
{
|
|
36
|
+
(
|
|
37
|
+
breakpoints_values[breakpoint_names.index(k)]
|
|
38
|
+
if k in breakpoint_names
|
|
39
|
+
else ("0px" if k == "initial" else k)
|
|
40
|
+
): v
|
|
41
|
+
for k, v in self.items()
|
|
42
|
+
if v is not None
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def create(
|
|
48
|
+
cls,
|
|
49
|
+
custom: Dict[K, V] | None = None,
|
|
50
|
+
initial: V | None = None,
|
|
51
|
+
xs: V | None = None,
|
|
52
|
+
sm: V | None = None,
|
|
53
|
+
md: V | None = None,
|
|
54
|
+
lg: V | None = None,
|
|
55
|
+
xl: V | None = None,
|
|
56
|
+
):
|
|
57
|
+
"""Create a new instance of the helper. Only provide a custom component OR use named props.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
custom: Custom mapping using CSS values or variables.
|
|
61
|
+
initial: Styling when in the inital width
|
|
62
|
+
xs: Styling when in the extra-small width
|
|
63
|
+
sm: Styling when in the small width
|
|
64
|
+
md: Styling when in the medium width
|
|
65
|
+
lg: Styling when in the large width
|
|
66
|
+
xl: Styling when in the extra-large width
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
ValueError: If both custom and any other named parameters are provided.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
The responsive mapping.
|
|
73
|
+
"""
|
|
74
|
+
thresholds = [initial, xs, sm, md, lg, xl]
|
|
75
|
+
|
|
76
|
+
if custom is not None:
|
|
77
|
+
if any((threshold is not None for threshold in thresholds)):
|
|
78
|
+
raise ValueError("Named props cannot be used with custom thresholds")
|
|
79
|
+
|
|
80
|
+
return Breakpoints(custom)
|
|
81
|
+
else:
|
|
82
|
+
return Breakpoints(
|
|
83
|
+
{
|
|
84
|
+
k: v
|
|
85
|
+
for k, v in zip(["initial", *breakpoint_names], thresholds)
|
|
86
|
+
if v is not None
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
breakpoints = Breakpoints.create
|
|
92
|
+
|
|
93
|
+
T = TypeVar("T")
|
|
94
|
+
|
|
95
|
+
Responsive = Union[T, Breakpoints[str, T]]
|