reflex 0.7.14a4__py3-none-any.whl → 0.7.14a5__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.

@@ -141,17 +141,29 @@ class Bare(Component):
141
141
  custom_code |= component._get_all_custom_code()
142
142
  return custom_code
143
143
 
144
- def _get_all_app_wrap_components(self) -> dict[tuple[int, str], Component]:
144
+ def _get_all_app_wrap_components(
145
+ self, *, ignore_ids: set[int] | None = None
146
+ ) -> dict[tuple[int, str], Component]:
145
147
  """Get the components that should be wrapped in the app.
146
148
 
149
+ Args:
150
+ ignore_ids: The ids to ignore when collecting components.
151
+
147
152
  Returns:
148
153
  The components that should be wrapped in the app.
149
154
  """
150
- app_wrap_components = super()._get_all_app_wrap_components()
155
+ ignore_ids = ignore_ids or set()
156
+ app_wrap_components = super()._get_all_app_wrap_components(
157
+ ignore_ids=ignore_ids
158
+ )
151
159
  if isinstance(self.contents, Var):
152
160
  for component in _components_from_var(self.contents):
153
- if isinstance(component, Component):
154
- app_wrap_components |= component._get_all_app_wrap_components()
161
+ component_id = id(component)
162
+ if isinstance(component, Component) and component_id not in ignore_ids:
163
+ ignore_ids.add(component_id)
164
+ app_wrap_components |= component._get_all_app_wrap_components(
165
+ ignore_ids=ignore_ids
166
+ )
155
167
  return app_wrap_components
156
168
 
157
169
  def _get_all_refs(self) -> set[str]:
@@ -1976,24 +1976,38 @@ class Component(BaseComponent, ABC):
1976
1976
  """
1977
1977
  return {}
1978
1978
 
1979
- def _get_all_app_wrap_components(self) -> dict[tuple[int, str], Component]:
1979
+ def _get_all_app_wrap_components(
1980
+ self, *, ignore_ids: set[int] | None = None
1981
+ ) -> dict[tuple[int, str], Component]:
1980
1982
  """Get the app wrap components for the component and its children.
1981
1983
 
1984
+ Args:
1985
+ ignore_ids: A set of component IDs to ignore. Used to avoid duplicates.
1986
+
1982
1987
  Returns:
1983
1988
  The app wrap components.
1984
1989
  """
1990
+ ignore_ids = ignore_ids or set()
1985
1991
  # Store the components in a set to avoid duplicates.
1986
1992
  components = self._get_app_wrap_components()
1987
1993
 
1988
1994
  for component in tuple(components.values()):
1989
- components.update(component._get_all_app_wrap_components())
1995
+ component_id = id(component)
1996
+ if component_id in ignore_ids:
1997
+ continue
1998
+ ignore_ids.add(component_id)
1999
+ components.update(
2000
+ component._get_all_app_wrap_components(ignore_ids=ignore_ids)
2001
+ )
1990
2002
 
1991
2003
  # Add the app wrap components for the children.
1992
2004
  for child in self.children:
2005
+ child_id = id(child)
1993
2006
  # Skip BaseComponent and StatefulComponent children.
1994
- if not isinstance(child, Component):
2007
+ if not isinstance(child, Component) or child_id in ignore_ids:
1995
2008
  continue
1996
- components.update(child._get_all_app_wrap_components())
2009
+ ignore_ids.add(child_id)
2010
+ components.update(child._get_all_app_wrap_components(ignore_ids=ignore_ids))
1997
2011
 
1998
2012
  # Return the components.
1999
2013
  return components
@@ -2206,13 +2220,23 @@ class CustomComponent(Component):
2206
2220
  component._add_style_recursive(style)
2207
2221
  return component
2208
2222
 
2209
- def _get_all_app_wrap_components(self) -> dict[tuple[int, str], Component]:
2223
+ def _get_all_app_wrap_components(
2224
+ self, *, ignore_ids: set[int] | None = None
2225
+ ) -> dict[tuple[int, str], Component]:
2210
2226
  """Get the app wrap components for the custom component.
2211
2227
 
2228
+ Args:
2229
+ ignore_ids: A set of IDs to ignore to avoid infinite recursion.
2230
+
2212
2231
  Returns:
2213
2232
  The app wrap components.
2214
2233
  """
2215
- return self.get_component()._get_all_app_wrap_components()
2234
+ ignore_ids = ignore_ids or set()
2235
+ component = self.get_component()
2236
+ if id(component) in ignore_ids:
2237
+ return {}
2238
+ ignore_ids.add(id(component))
2239
+ return self.get_component()._get_all_app_wrap_components(ignore_ids=ignore_ids)
2216
2240
 
2217
2241
 
2218
2242
  CUSTOM_COMPONENTS: dict[str, CustomComponent] = {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reflex
3
- Version: 0.7.14a4
3
+ Version: 0.7.14a5
4
4
  Summary: Web apps in pure Python.
5
5
  Project-URL: homepage, https://reflex.dev
6
6
  Project-URL: repository, https://github.com/reflex-dev/reflex
@@ -62,7 +62,7 @@ reflex/compiler/templates.py,sha256=SKFIJtL_ozEvEHhiMj34tBwBN1CWSYy_-VzlojZMG44,
62
62
  reflex/compiler/utils.py,sha256=NYvNedrkqoh8i86QL8tOjFZ60JabOM1wBXNkY1ORtiQ,16549
63
63
  reflex/components/__init__.py,sha256=zbIXThv1WPI0FdIGf9G9RAmGoCRoGy7nHcSZ8K5D5bA,624
64
64
  reflex/components/__init__.pyi,sha256=qoj1zIWaitcZOGcJ6k7wuGJk_GAJCE9Xtx8CeRVrvoE,861
65
- reflex/components/component.py,sha256=5bnI90s6EINL8ls_HlcMLaj-t26ABn01P7QEX_sGaIU,99015
65
+ reflex/components/component.py,sha256=reVBK5rshxXictncMa1krjvLdUd_5mtMQYC_esumtzY,99873
66
66
  reflex/components/dynamic.py,sha256=rDPSyoeAWAe7pxA9ZpuamKfBispOrxR-Y2DP8KfwRq8,7404
67
67
  reflex/components/literals.py,sha256=hogLnwTJxFJODIvqihg-GD9kFZVsEBDoYzaRit56Nuk,501
68
68
  reflex/components/props.py,sha256=pte-hBXbwsvB2fS7vYtiyxbHWlWYcDNg8baCfDaOvBE,2699
@@ -70,7 +70,7 @@ reflex/components/base/__init__.py,sha256=QIOxOPT87WrSE4TSHAsZ-358VzvUXAe1w8vWog
70
70
  reflex/components/base/__init__.pyi,sha256=c-8lUF9MAgAo9OHMjKIrV2ScM5S0fg8gTXp3iYFwVKU,1055
71
71
  reflex/components/base/app_wrap.py,sha256=5K_myvYvHPeAJbm3BdEX17tKvdNEj6SV9RYahbIQBAQ,514
72
72
  reflex/components/base/app_wrap.pyi,sha256=-qdsW5SDxROhV11q4TIgnm_1CHx8_AZHHhsnmkdiv18,1915
73
- reflex/components/base/bare.py,sha256=f9e9cW48mjyf7fh6BgsIUV71vSdbK-Xs-SAjngAufg4,7315
73
+ reflex/components/base/bare.py,sha256=jv6HStlixsBTPR6Q_PQnd7MtQDz3ncktcLYUODqwog0,7733
74
74
  reflex/components/base/body.py,sha256=KLPOhxVsKyjPwrY9AziCOOG_c9ckOqIhI4n2i3_Q3NU,129
75
75
  reflex/components/base/body.pyi,sha256=4gWLicS47-WND25iWoj_oOg7i_0oqb36f26vID7NZH8,8665
76
76
  reflex/components/base/document.py,sha256=L5kRdI1bvPQ9dTpHkeG6kqyDvzqZ4uZG4QSj3GMLBuM,551
@@ -354,7 +354,6 @@ reflex/experimental/__init__.py,sha256=Yi4enE5vry3oHSpCZQX9FKUmchu6t8xL1_ue1ZZz8
354
354
  reflex/experimental/client_state.py,sha256=1VOe6rYhpOBOZi7-tZwfOnSNPPdX3tsXzlfgNs7aDrg,10020
355
355
  reflex/experimental/hooks.py,sha256=CHYGrAE5t8riltrJmDFgJ4D2Vhmhw-y3B3MSGNlOQow,2366
356
356
  reflex/experimental/layout.py,sha256=IzyAu_M121IYsrsnctiXFbeXInVvKKb4GuyFJKXcJnQ,7533
357
- reflex/experimental/layout.pyi,sha256=3v3xo3THcNwKv3IximCSDnItfywzuKNxjrauO2g2Ezw,25049
358
357
  reflex/istate/__init__.py,sha256=LDu_3-31ZI1Jn9NWp4mM0--fDiXI0x8x3gR4-kdrziY,57
359
358
  reflex/istate/data.py,sha256=igpPEXs_ZJvK7J3JJ1mLiKnLmS5iFJiMLesCaQZpgqs,5798
360
359
  reflex/istate/dynamic.py,sha256=xOQ9upZVPf6ngqcLQZ9HdAAYmoWwJ8kRFPH34Q5HTiM,91
@@ -401,8 +400,8 @@ reflex/vars/number.py,sha256=tO7pnvFaBsedq1HWT4skytnSqHWMluGEhUbjAUMx8XQ,28190
401
400
  reflex/vars/object.py,sha256=BDmeiwG8v97s_BnR1Egq3NxOKVjv9TfnREB3cz0zZtk,17322
402
401
  reflex/vars/sequence.py,sha256=1kBrqihspyjyQ1XDqFPC8OpVGtZs_EVkOdIKBro5ilA,55249
403
402
  scripts/hatch_build.py,sha256=-4pxcLSFmirmujGpQX9UUxjhIC03tQ_fIQwVbHu9kc0,1861
404
- reflex-0.7.14a4.dist-info/METADATA,sha256=M0L66VwQh_yM3B_9wIjk2D5S5nMBbq7WEKrzzIf5U7Y,11837
405
- reflex-0.7.14a4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
406
- reflex-0.7.14a4.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
407
- reflex-0.7.14a4.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
408
- reflex-0.7.14a4.dist-info/RECORD,,
403
+ reflex-0.7.14a5.dist-info/METADATA,sha256=1iKl0894brQ0noc4jKZj4TU1M9x5Bh4V37qocHbZ9o4,11837
404
+ reflex-0.7.14a5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
405
+ reflex-0.7.14a5.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
406
+ reflex-0.7.14a5.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
407
+ reflex-0.7.14a5.dist-info/RECORD,,
@@ -1,814 +0,0 @@
1
- """Stub file for reflex/experimental/layout.py"""
2
-
3
- # ------------------- DO NOT EDIT ----------------------
4
- # This file was generated by `reflex/utils/pyi_generator.py`!
5
- # ------------------------------------------------------
6
- from collections.abc import Mapping, Sequence
7
- from typing import Any, Literal, overload
8
-
9
- from reflex import color
10
- from reflex.components.base.fragment import Fragment
11
- from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
12
- from reflex.components.core.breakpoints import Breakpoints
13
- from reflex.components.radix.primitives.drawer import DrawerRoot
14
- from reflex.components.radix.themes.layout.box import Box
15
- from reflex.event import EventType
16
- from reflex.state import ComponentState
17
- from reflex.vars.base import Var
18
-
19
- class Sidebar(Box, MemoizationLeaf):
20
- @overload
21
- @classmethod
22
- def create( # type: ignore
23
- cls,
24
- *children,
25
- access_key: Var[str] | str | None = None,
26
- auto_capitalize: Literal[
27
- "characters", "none", "off", "on", "sentences", "words"
28
- ]
29
- | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
30
- | None = None,
31
- content_editable: Literal["inherit", "plaintext-only", False, True]
32
- | Var[Literal["inherit", "plaintext-only", False, True]]
33
- | None = None,
34
- context_menu: Var[str] | str | None = None,
35
- dir: Var[str] | str | None = None,
36
- draggable: Var[bool] | bool | None = None,
37
- enter_key_hint: Literal[
38
- "done", "enter", "go", "next", "previous", "search", "send"
39
- ]
40
- | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
41
- | None = None,
42
- hidden: Var[bool] | bool | None = None,
43
- input_mode: Literal[
44
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
45
- ]
46
- | Var[
47
- Literal[
48
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
49
- ]
50
- ]
51
- | None = None,
52
- item_prop: Var[str] | str | None = None,
53
- lang: Var[str] | str | None = None,
54
- role: Literal[
55
- "alert",
56
- "alertdialog",
57
- "application",
58
- "article",
59
- "banner",
60
- "button",
61
- "cell",
62
- "checkbox",
63
- "columnheader",
64
- "combobox",
65
- "complementary",
66
- "contentinfo",
67
- "definition",
68
- "dialog",
69
- "directory",
70
- "document",
71
- "feed",
72
- "figure",
73
- "form",
74
- "grid",
75
- "gridcell",
76
- "group",
77
- "heading",
78
- "img",
79
- "link",
80
- "list",
81
- "listbox",
82
- "listitem",
83
- "log",
84
- "main",
85
- "marquee",
86
- "math",
87
- "menu",
88
- "menubar",
89
- "menuitem",
90
- "menuitemcheckbox",
91
- "menuitemradio",
92
- "navigation",
93
- "none",
94
- "note",
95
- "option",
96
- "presentation",
97
- "progressbar",
98
- "radio",
99
- "radiogroup",
100
- "region",
101
- "row",
102
- "rowgroup",
103
- "rowheader",
104
- "scrollbar",
105
- "search",
106
- "searchbox",
107
- "separator",
108
- "slider",
109
- "spinbutton",
110
- "status",
111
- "switch",
112
- "tab",
113
- "table",
114
- "tablist",
115
- "tabpanel",
116
- "term",
117
- "textbox",
118
- "timer",
119
- "toolbar",
120
- "tooltip",
121
- "tree",
122
- "treegrid",
123
- "treeitem",
124
- ]
125
- | Var[
126
- Literal[
127
- "alert",
128
- "alertdialog",
129
- "application",
130
- "article",
131
- "banner",
132
- "button",
133
- "cell",
134
- "checkbox",
135
- "columnheader",
136
- "combobox",
137
- "complementary",
138
- "contentinfo",
139
- "definition",
140
- "dialog",
141
- "directory",
142
- "document",
143
- "feed",
144
- "figure",
145
- "form",
146
- "grid",
147
- "gridcell",
148
- "group",
149
- "heading",
150
- "img",
151
- "link",
152
- "list",
153
- "listbox",
154
- "listitem",
155
- "log",
156
- "main",
157
- "marquee",
158
- "math",
159
- "menu",
160
- "menubar",
161
- "menuitem",
162
- "menuitemcheckbox",
163
- "menuitemradio",
164
- "navigation",
165
- "none",
166
- "note",
167
- "option",
168
- "presentation",
169
- "progressbar",
170
- "radio",
171
- "radiogroup",
172
- "region",
173
- "row",
174
- "rowgroup",
175
- "rowheader",
176
- "scrollbar",
177
- "search",
178
- "searchbox",
179
- "separator",
180
- "slider",
181
- "spinbutton",
182
- "status",
183
- "switch",
184
- "tab",
185
- "table",
186
- "tablist",
187
- "tabpanel",
188
- "term",
189
- "textbox",
190
- "timer",
191
- "toolbar",
192
- "tooltip",
193
- "tree",
194
- "treegrid",
195
- "treeitem",
196
- ]
197
- ]
198
- | None = None,
199
- slot: Var[str] | str | None = None,
200
- spell_check: Var[bool] | bool | None = None,
201
- tab_index: Var[int] | int | None = None,
202
- title: Var[str] | str | None = None,
203
- style: Sequence[Mapping[str, Any]]
204
- | Mapping[str, Any]
205
- | Var[Mapping[str, Any]]
206
- | Breakpoints
207
- | None = None,
208
- key: Any | None = None,
209
- id: Any | None = None,
210
- ref: Var | None = None,
211
- class_name: Any | None = None,
212
- autofocus: bool | None = None,
213
- custom_attrs: dict[str, Var | Any] | None = None,
214
- on_blur: EventType[()] | None = None,
215
- on_click: EventType[()] | None = None,
216
- on_context_menu: EventType[()] | None = None,
217
- on_double_click: EventType[()] | None = None,
218
- on_focus: EventType[()] | None = None,
219
- on_mount: EventType[()] | None = None,
220
- on_mouse_down: EventType[()] | None = None,
221
- on_mouse_enter: EventType[()] | None = None,
222
- on_mouse_leave: EventType[()] | None = None,
223
- on_mouse_move: EventType[()] | None = None,
224
- on_mouse_out: EventType[()] | None = None,
225
- on_mouse_over: EventType[()] | None = None,
226
- on_mouse_up: EventType[()] | None = None,
227
- on_scroll: EventType[()] | None = None,
228
- on_unmount: EventType[()] | None = None,
229
- **props,
230
- ) -> Sidebar:
231
- """Create the sidebar component.
232
-
233
- Args:
234
- children: The children components.
235
- props: The properties of the sidebar.
236
-
237
- Returns:
238
- The sidebar component.
239
- """
240
-
241
- def add_style(self) -> dict[str, Any] | None: ...
242
- def add_hooks(self) -> list[Var]: ...
243
-
244
- class StatefulSidebar(ComponentState):
245
- open: bool
246
-
247
- def toggle(self): ...
248
- @classmethod
249
- def get_component(cls, *children, **props): ...
250
-
251
- class DrawerSidebar(DrawerRoot):
252
- @overload
253
- @classmethod
254
- def create( # type: ignore
255
- cls,
256
- *children,
257
- default_open: Var[bool] | bool | None = None,
258
- open: Var[bool] | bool | None = None,
259
- modal: Var[bool] | bool | None = None,
260
- direction: Literal["bottom", "left", "right", "top"]
261
- | Var[Literal["bottom", "left", "right", "top"]]
262
- | None = None,
263
- dismissible: Var[bool] | bool | None = None,
264
- handle_only: Var[bool] | bool | None = None,
265
- snap_points: Sequence[float | str] | None = None,
266
- fade_from_index: Var[int] | int | None = None,
267
- scroll_lock_timeout: Var[int] | int | None = None,
268
- prevent_scroll_restoration: Var[bool] | bool | None = None,
269
- should_scale_background: Var[bool] | bool | None = None,
270
- close_threshold: Var[float] | float | None = None,
271
- as_child: Var[bool] | bool | None = None,
272
- style: Sequence[Mapping[str, Any]]
273
- | Mapping[str, Any]
274
- | Var[Mapping[str, Any]]
275
- | Breakpoints
276
- | None = None,
277
- key: Any | None = None,
278
- id: Any | None = None,
279
- ref: Var | None = None,
280
- class_name: Any | None = None,
281
- autofocus: bool | None = None,
282
- custom_attrs: dict[str, Var | Any] | None = None,
283
- on_animation_end: EventType[()] | EventType[bool] | None = None,
284
- on_blur: EventType[()] | None = None,
285
- on_click: EventType[()] | None = None,
286
- on_context_menu: EventType[()] | None = None,
287
- on_double_click: EventType[()] | None = None,
288
- on_focus: EventType[()] | None = None,
289
- on_mount: EventType[()] | None = None,
290
- on_mouse_down: EventType[()] | None = None,
291
- on_mouse_enter: EventType[()] | None = None,
292
- on_mouse_leave: EventType[()] | None = None,
293
- on_mouse_move: EventType[()] | None = None,
294
- on_mouse_out: EventType[()] | None = None,
295
- on_mouse_over: EventType[()] | None = None,
296
- on_mouse_up: EventType[()] | None = None,
297
- on_open_change: EventType[()] | EventType[bool] | None = None,
298
- on_scroll: EventType[()] | None = None,
299
- on_unmount: EventType[()] | None = None,
300
- **props,
301
- ) -> DrawerSidebar:
302
- """Create the sidebar component.
303
-
304
- Args:
305
- children: The children components.
306
- props: The properties of the sidebar.
307
-
308
- Returns:
309
- The drawer sidebar component.
310
- """
311
-
312
- sidebar_trigger_style = {
313
- "position": "fixed",
314
- "z_index": "15",
315
- "color": color("accent", 12),
316
- "background_color": "transparent",
317
- "padding": "0",
318
- }
319
-
320
- class SidebarTrigger(Fragment):
321
- @overload
322
- @classmethod
323
- def create( # type: ignore
324
- cls,
325
- *children,
326
- style: Sequence[Mapping[str, Any]]
327
- | Mapping[str, Any]
328
- | Var[Mapping[str, Any]]
329
- | Breakpoints
330
- | None = None,
331
- key: Any | None = None,
332
- id: Any | None = None,
333
- ref: Var | None = None,
334
- class_name: Any | None = None,
335
- autofocus: bool | None = None,
336
- custom_attrs: dict[str, Var | Any] | None = None,
337
- on_blur: EventType[()] | None = None,
338
- on_click: EventType[()] | None = None,
339
- on_context_menu: EventType[()] | None = None,
340
- on_double_click: EventType[()] | None = None,
341
- on_focus: EventType[()] | None = None,
342
- on_mount: EventType[()] | None = None,
343
- on_mouse_down: EventType[()] | None = None,
344
- on_mouse_enter: EventType[()] | None = None,
345
- on_mouse_leave: EventType[()] | None = None,
346
- on_mouse_move: EventType[()] | None = None,
347
- on_mouse_out: EventType[()] | None = None,
348
- on_mouse_over: EventType[()] | None = None,
349
- on_mouse_up: EventType[()] | None = None,
350
- on_scroll: EventType[()] | None = None,
351
- on_unmount: EventType[()] | None = None,
352
- **props,
353
- ) -> SidebarTrigger:
354
- """Create the sidebar trigger component.
355
-
356
- Args:
357
- sidebar: The sidebar component.
358
- props: The properties of the sidebar trigger.
359
-
360
- Returns:
361
- The sidebar trigger component.
362
- """
363
-
364
- class Layout(Box):
365
- @overload
366
- @classmethod
367
- def create( # type: ignore
368
- cls,
369
- *children,
370
- sidebar: Component | None = None,
371
- access_key: Var[str] | str | None = None,
372
- auto_capitalize: Literal[
373
- "characters", "none", "off", "on", "sentences", "words"
374
- ]
375
- | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
376
- | None = None,
377
- content_editable: Literal["inherit", "plaintext-only", False, True]
378
- | Var[Literal["inherit", "plaintext-only", False, True]]
379
- | None = None,
380
- context_menu: Var[str] | str | None = None,
381
- dir: Var[str] | str | None = None,
382
- draggable: Var[bool] | bool | None = None,
383
- enter_key_hint: Literal[
384
- "done", "enter", "go", "next", "previous", "search", "send"
385
- ]
386
- | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
387
- | None = None,
388
- hidden: Var[bool] | bool | None = None,
389
- input_mode: Literal[
390
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
391
- ]
392
- | Var[
393
- Literal[
394
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
395
- ]
396
- ]
397
- | None = None,
398
- item_prop: Var[str] | str | None = None,
399
- lang: Var[str] | str | None = None,
400
- role: Literal[
401
- "alert",
402
- "alertdialog",
403
- "application",
404
- "article",
405
- "banner",
406
- "button",
407
- "cell",
408
- "checkbox",
409
- "columnheader",
410
- "combobox",
411
- "complementary",
412
- "contentinfo",
413
- "definition",
414
- "dialog",
415
- "directory",
416
- "document",
417
- "feed",
418
- "figure",
419
- "form",
420
- "grid",
421
- "gridcell",
422
- "group",
423
- "heading",
424
- "img",
425
- "link",
426
- "list",
427
- "listbox",
428
- "listitem",
429
- "log",
430
- "main",
431
- "marquee",
432
- "math",
433
- "menu",
434
- "menubar",
435
- "menuitem",
436
- "menuitemcheckbox",
437
- "menuitemradio",
438
- "navigation",
439
- "none",
440
- "note",
441
- "option",
442
- "presentation",
443
- "progressbar",
444
- "radio",
445
- "radiogroup",
446
- "region",
447
- "row",
448
- "rowgroup",
449
- "rowheader",
450
- "scrollbar",
451
- "search",
452
- "searchbox",
453
- "separator",
454
- "slider",
455
- "spinbutton",
456
- "status",
457
- "switch",
458
- "tab",
459
- "table",
460
- "tablist",
461
- "tabpanel",
462
- "term",
463
- "textbox",
464
- "timer",
465
- "toolbar",
466
- "tooltip",
467
- "tree",
468
- "treegrid",
469
- "treeitem",
470
- ]
471
- | Var[
472
- Literal[
473
- "alert",
474
- "alertdialog",
475
- "application",
476
- "article",
477
- "banner",
478
- "button",
479
- "cell",
480
- "checkbox",
481
- "columnheader",
482
- "combobox",
483
- "complementary",
484
- "contentinfo",
485
- "definition",
486
- "dialog",
487
- "directory",
488
- "document",
489
- "feed",
490
- "figure",
491
- "form",
492
- "grid",
493
- "gridcell",
494
- "group",
495
- "heading",
496
- "img",
497
- "link",
498
- "list",
499
- "listbox",
500
- "listitem",
501
- "log",
502
- "main",
503
- "marquee",
504
- "math",
505
- "menu",
506
- "menubar",
507
- "menuitem",
508
- "menuitemcheckbox",
509
- "menuitemradio",
510
- "navigation",
511
- "none",
512
- "note",
513
- "option",
514
- "presentation",
515
- "progressbar",
516
- "radio",
517
- "radiogroup",
518
- "region",
519
- "row",
520
- "rowgroup",
521
- "rowheader",
522
- "scrollbar",
523
- "search",
524
- "searchbox",
525
- "separator",
526
- "slider",
527
- "spinbutton",
528
- "status",
529
- "switch",
530
- "tab",
531
- "table",
532
- "tablist",
533
- "tabpanel",
534
- "term",
535
- "textbox",
536
- "timer",
537
- "toolbar",
538
- "tooltip",
539
- "tree",
540
- "treegrid",
541
- "treeitem",
542
- ]
543
- ]
544
- | None = None,
545
- slot: Var[str] | str | None = None,
546
- spell_check: Var[bool] | bool | None = None,
547
- tab_index: Var[int] | int | None = None,
548
- title: Var[str] | str | None = None,
549
- style: Sequence[Mapping[str, Any]]
550
- | Mapping[str, Any]
551
- | Var[Mapping[str, Any]]
552
- | Breakpoints
553
- | None = None,
554
- key: Any | None = None,
555
- id: Any | None = None,
556
- ref: Var | None = None,
557
- class_name: Any | None = None,
558
- autofocus: bool | None = None,
559
- custom_attrs: dict[str, Var | Any] | None = None,
560
- on_blur: EventType[()] | None = None,
561
- on_click: EventType[()] | None = None,
562
- on_context_menu: EventType[()] | None = None,
563
- on_double_click: EventType[()] | None = None,
564
- on_focus: EventType[()] | None = None,
565
- on_mount: EventType[()] | None = None,
566
- on_mouse_down: EventType[()] | None = None,
567
- on_mouse_enter: EventType[()] | None = None,
568
- on_mouse_leave: EventType[()] | None = None,
569
- on_mouse_move: EventType[()] | None = None,
570
- on_mouse_out: EventType[()] | None = None,
571
- on_mouse_over: EventType[()] | None = None,
572
- on_mouse_up: EventType[()] | None = None,
573
- on_scroll: EventType[()] | None = None,
574
- on_unmount: EventType[()] | None = None,
575
- **props,
576
- ) -> Layout:
577
- """Create the layout component.
578
-
579
- Args:
580
- content: The content component.
581
- sidebar: The sidebar component.
582
- props: The properties of the layout.
583
-
584
- Returns:
585
- The layout component.
586
- """
587
-
588
- class LayoutNamespace(ComponentNamespace):
589
- drawer_sidebar = staticmethod(DrawerSidebar.create)
590
- stateful_sidebar = staticmethod(StatefulSidebar.create)
591
- sidebar = staticmethod(Sidebar.create)
592
-
593
- @staticmethod
594
- def __call__(
595
- *children,
596
- sidebar: Component | None = None,
597
- access_key: Var[str] | str | None = None,
598
- auto_capitalize: Literal[
599
- "characters", "none", "off", "on", "sentences", "words"
600
- ]
601
- | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
602
- | None = None,
603
- content_editable: Literal["inherit", "plaintext-only", False, True]
604
- | Var[Literal["inherit", "plaintext-only", False, True]]
605
- | None = None,
606
- context_menu: Var[str] | str | None = None,
607
- dir: Var[str] | str | None = None,
608
- draggable: Var[bool] | bool | None = None,
609
- enter_key_hint: Literal[
610
- "done", "enter", "go", "next", "previous", "search", "send"
611
- ]
612
- | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
613
- | None = None,
614
- hidden: Var[bool] | bool | None = None,
615
- input_mode: Literal[
616
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
617
- ]
618
- | Var[
619
- Literal[
620
- "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
621
- ]
622
- ]
623
- | None = None,
624
- item_prop: Var[str] | str | None = None,
625
- lang: Var[str] | str | None = None,
626
- role: Literal[
627
- "alert",
628
- "alertdialog",
629
- "application",
630
- "article",
631
- "banner",
632
- "button",
633
- "cell",
634
- "checkbox",
635
- "columnheader",
636
- "combobox",
637
- "complementary",
638
- "contentinfo",
639
- "definition",
640
- "dialog",
641
- "directory",
642
- "document",
643
- "feed",
644
- "figure",
645
- "form",
646
- "grid",
647
- "gridcell",
648
- "group",
649
- "heading",
650
- "img",
651
- "link",
652
- "list",
653
- "listbox",
654
- "listitem",
655
- "log",
656
- "main",
657
- "marquee",
658
- "math",
659
- "menu",
660
- "menubar",
661
- "menuitem",
662
- "menuitemcheckbox",
663
- "menuitemradio",
664
- "navigation",
665
- "none",
666
- "note",
667
- "option",
668
- "presentation",
669
- "progressbar",
670
- "radio",
671
- "radiogroup",
672
- "region",
673
- "row",
674
- "rowgroup",
675
- "rowheader",
676
- "scrollbar",
677
- "search",
678
- "searchbox",
679
- "separator",
680
- "slider",
681
- "spinbutton",
682
- "status",
683
- "switch",
684
- "tab",
685
- "table",
686
- "tablist",
687
- "tabpanel",
688
- "term",
689
- "textbox",
690
- "timer",
691
- "toolbar",
692
- "tooltip",
693
- "tree",
694
- "treegrid",
695
- "treeitem",
696
- ]
697
- | Var[
698
- Literal[
699
- "alert",
700
- "alertdialog",
701
- "application",
702
- "article",
703
- "banner",
704
- "button",
705
- "cell",
706
- "checkbox",
707
- "columnheader",
708
- "combobox",
709
- "complementary",
710
- "contentinfo",
711
- "definition",
712
- "dialog",
713
- "directory",
714
- "document",
715
- "feed",
716
- "figure",
717
- "form",
718
- "grid",
719
- "gridcell",
720
- "group",
721
- "heading",
722
- "img",
723
- "link",
724
- "list",
725
- "listbox",
726
- "listitem",
727
- "log",
728
- "main",
729
- "marquee",
730
- "math",
731
- "menu",
732
- "menubar",
733
- "menuitem",
734
- "menuitemcheckbox",
735
- "menuitemradio",
736
- "navigation",
737
- "none",
738
- "note",
739
- "option",
740
- "presentation",
741
- "progressbar",
742
- "radio",
743
- "radiogroup",
744
- "region",
745
- "row",
746
- "rowgroup",
747
- "rowheader",
748
- "scrollbar",
749
- "search",
750
- "searchbox",
751
- "separator",
752
- "slider",
753
- "spinbutton",
754
- "status",
755
- "switch",
756
- "tab",
757
- "table",
758
- "tablist",
759
- "tabpanel",
760
- "term",
761
- "textbox",
762
- "timer",
763
- "toolbar",
764
- "tooltip",
765
- "tree",
766
- "treegrid",
767
- "treeitem",
768
- ]
769
- ]
770
- | None = None,
771
- slot: Var[str] | str | None = None,
772
- spell_check: Var[bool] | bool | None = None,
773
- tab_index: Var[int] | int | None = None,
774
- title: Var[str] | str | None = None,
775
- style: Sequence[Mapping[str, Any]]
776
- | Mapping[str, Any]
777
- | Var[Mapping[str, Any]]
778
- | Breakpoints
779
- | None = None,
780
- key: Any | None = None,
781
- id: Any | None = None,
782
- ref: Var | None = None,
783
- class_name: Any | None = None,
784
- autofocus: bool | None = None,
785
- custom_attrs: dict[str, Var | Any] | None = None,
786
- on_blur: EventType[()] | None = None,
787
- on_click: EventType[()] | None = None,
788
- on_context_menu: EventType[()] | None = None,
789
- on_double_click: EventType[()] | None = None,
790
- on_focus: EventType[()] | None = None,
791
- on_mount: EventType[()] | None = None,
792
- on_mouse_down: EventType[()] | None = None,
793
- on_mouse_enter: EventType[()] | None = None,
794
- on_mouse_leave: EventType[()] | None = None,
795
- on_mouse_move: EventType[()] | None = None,
796
- on_mouse_out: EventType[()] | None = None,
797
- on_mouse_over: EventType[()] | None = None,
798
- on_mouse_up: EventType[()] | None = None,
799
- on_scroll: EventType[()] | None = None,
800
- on_unmount: EventType[()] | None = None,
801
- **props,
802
- ) -> Layout:
803
- """Create the layout component.
804
-
805
- Args:
806
- content: The content component.
807
- sidebar: The sidebar component.
808
- props: The properties of the layout.
809
-
810
- Returns:
811
- The layout component.
812
- """
813
-
814
- layout = LayoutNamespace()