layout.pyi 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. """Stub file for reflex/experimental/layout.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, List, Literal, Optional, Union, overload
  6. from reflex import color
  7. from reflex.components.base.fragment import Fragment
  8. from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
  9. from reflex.components.radix.primitives.drawer import DrawerRoot
  10. from reflex.components.radix.themes.layout.box import Box
  11. from reflex.event import BASE_STATE, EventType
  12. from reflex.state import ComponentState
  13. from reflex.style import Style
  14. from reflex.vars.base import Var
  15. class Sidebar(Box, MemoizationLeaf):
  16. @overload
  17. @classmethod
  18. def create( # type: ignore
  19. cls,
  20. *children,
  21. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  22. auto_capitalize: Optional[
  23. Union[Var[Union[bool, int, str]], bool, int, str]
  24. ] = None,
  25. content_editable: Optional[
  26. Union[Var[Union[bool, int, str]], bool, int, str]
  27. ] = None,
  28. context_menu: Optional[
  29. Union[Var[Union[bool, int, str]], bool, int, str]
  30. ] = None,
  31. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  32. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  33. enter_key_hint: Optional[
  34. Union[Var[Union[bool, int, str]], bool, int, str]
  35. ] = None,
  36. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  37. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  38. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  39. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  40. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  41. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  42. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  43. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  44. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  45. style: Optional[Style] = None,
  46. key: Optional[Any] = None,
  47. id: Optional[Any] = None,
  48. class_name: Optional[Any] = None,
  49. autofocus: Optional[bool] = None,
  50. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  51. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  52. on_click: Optional[EventType[[], BASE_STATE]] = None,
  53. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  54. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  55. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  56. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  57. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  58. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  59. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  60. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  61. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  62. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  63. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  64. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  65. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  66. **props,
  67. ) -> "Sidebar":
  68. """Create the sidebar component.
  69. Args:
  70. children: The children components.
  71. props: The properties of the sidebar.
  72. Returns:
  73. The sidebar component.
  74. """
  75. ...
  76. def add_style(self) -> dict[str, Any] | None: ...
  77. def add_hooks(self) -> List[Var]: ...
  78. class StatefulSidebar(ComponentState):
  79. open: bool
  80. def toggle(self): ...
  81. @classmethod
  82. def get_component(cls, *children, **props): ...
  83. class DrawerSidebar(DrawerRoot):
  84. @overload
  85. @classmethod
  86. def create( # type: ignore
  87. cls,
  88. *children,
  89. default_open: Optional[Union[Var[bool], bool]] = None,
  90. open: Optional[Union[Var[bool], bool]] = None,
  91. modal: Optional[Union[Var[bool], bool]] = None,
  92. direction: Optional[
  93. Union[
  94. Literal["bottom", "left", "right", "top"],
  95. Var[Literal["bottom", "left", "right", "top"]],
  96. ]
  97. ] = None,
  98. dismissible: Optional[Union[Var[bool], bool]] = None,
  99. handle_only: Optional[Union[Var[bool], bool]] = None,
  100. snap_points: Optional[List[Union[float, str]]] = None,
  101. fade_from_index: Optional[Union[Var[int], int]] = None,
  102. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  103. prevent_scroll_restoration: Optional[Union[Var[bool], bool]] = None,
  104. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  105. close_threshold: Optional[Union[Var[float], float]] = None,
  106. as_child: Optional[Union[Var[bool], bool]] = None,
  107. style: Optional[Style] = None,
  108. key: Optional[Any] = None,
  109. id: Optional[Any] = None,
  110. class_name: Optional[Any] = None,
  111. autofocus: Optional[bool] = None,
  112. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  113. on_animation_end: Optional[
  114. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  115. ] = None,
  116. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  117. on_click: Optional[EventType[[], BASE_STATE]] = None,
  118. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  119. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  120. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  121. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  122. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  123. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  124. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  125. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  126. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  127. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  128. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  129. on_open_change: Optional[
  130. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  131. ] = None,
  132. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  133. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  134. **props,
  135. ) -> "DrawerSidebar":
  136. """Create the sidebar component.
  137. Args:
  138. children: The children components.
  139. props: The properties of the sidebar.
  140. Returns:
  141. The drawer sidebar component.
  142. """
  143. ...
  144. sidebar_trigger_style = {
  145. "position": "fixed",
  146. "z_index": "15",
  147. "color": color("accent", 12),
  148. "background_color": "transparent",
  149. "padding": "0",
  150. }
  151. class SidebarTrigger(Fragment):
  152. @overload
  153. @classmethod
  154. def create( # type: ignore
  155. cls,
  156. *children,
  157. style: Optional[Style] = None,
  158. key: Optional[Any] = None,
  159. id: Optional[Any] = None,
  160. class_name: Optional[Any] = None,
  161. autofocus: Optional[bool] = None,
  162. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  163. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  164. on_click: Optional[EventType[[], BASE_STATE]] = None,
  165. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  166. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  167. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  168. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  169. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  170. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  171. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  172. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  173. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  174. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  175. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  176. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  177. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  178. **props,
  179. ) -> "SidebarTrigger":
  180. """Create the sidebar trigger component.
  181. Args:
  182. sidebar: The sidebar component.
  183. props: The properties of the sidebar trigger.
  184. Returns:
  185. The sidebar trigger component.
  186. """
  187. ...
  188. class Layout(Box):
  189. @overload
  190. @classmethod
  191. def create( # type: ignore
  192. cls,
  193. *children,
  194. sidebar: Optional[Component] = None,
  195. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  196. auto_capitalize: Optional[
  197. Union[Var[Union[bool, int, str]], bool, int, str]
  198. ] = None,
  199. content_editable: Optional[
  200. Union[Var[Union[bool, int, str]], bool, int, str]
  201. ] = None,
  202. context_menu: Optional[
  203. Union[Var[Union[bool, int, str]], bool, int, str]
  204. ] = None,
  205. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  206. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  207. enter_key_hint: Optional[
  208. Union[Var[Union[bool, int, str]], bool, int, str]
  209. ] = None,
  210. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  211. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  212. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  213. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  214. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  215. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  216. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  217. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  218. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  219. style: Optional[Style] = None,
  220. key: Optional[Any] = None,
  221. id: Optional[Any] = None,
  222. class_name: Optional[Any] = None,
  223. autofocus: Optional[bool] = None,
  224. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  225. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  226. on_click: Optional[EventType[[], BASE_STATE]] = None,
  227. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  228. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  229. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  230. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  231. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  232. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  233. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  234. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  235. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  236. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  237. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  238. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  239. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  240. **props,
  241. ) -> "Layout":
  242. """Create the layout component.
  243. Args:
  244. content: The content component.
  245. sidebar: The sidebar component.
  246. props: The properties of the layout.
  247. Returns:
  248. The layout component.
  249. """
  250. ...
  251. class LayoutNamespace(ComponentNamespace):
  252. drawer_sidebar = staticmethod(DrawerSidebar.create)
  253. stateful_sidebar = staticmethod(StatefulSidebar.create)
  254. sidebar = staticmethod(Sidebar.create)
  255. @staticmethod
  256. def __call__(
  257. *children,
  258. sidebar: Optional[Component] = None,
  259. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  260. auto_capitalize: Optional[
  261. Union[Var[Union[bool, int, str]], bool, int, str]
  262. ] = None,
  263. content_editable: Optional[
  264. Union[Var[Union[bool, int, str]], bool, int, str]
  265. ] = None,
  266. context_menu: Optional[
  267. Union[Var[Union[bool, int, str]], bool, int, str]
  268. ] = None,
  269. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  270. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  271. enter_key_hint: Optional[
  272. Union[Var[Union[bool, int, str]], bool, int, str]
  273. ] = None,
  274. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  275. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  276. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  277. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  278. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  279. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  280. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  281. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  282. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  283. style: Optional[Style] = None,
  284. key: Optional[Any] = None,
  285. id: Optional[Any] = None,
  286. class_name: Optional[Any] = None,
  287. autofocus: Optional[bool] = None,
  288. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  289. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  290. on_click: Optional[EventType[[], BASE_STATE]] = None,
  291. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  292. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  293. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  294. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  295. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  296. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  297. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  298. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  299. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  300. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  301. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  302. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  303. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  304. **props,
  305. ) -> "Layout":
  306. """Create the layout component.
  307. Args:
  308. content: The content component.
  309. sidebar: The sidebar component.
  310. props: The properties of the layout.
  311. Returns:
  312. The layout component.
  313. """
  314. ...
  315. layout = LayoutNamespace()