layout.pyi 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  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, Callable, 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 EventHandler, EventSpec
  12. from reflex.state import ComponentState
  13. from reflex.style import Style
  14. from reflex.vars import BaseVar, 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]], str, int, bool]] = None,
  22. auto_capitalize: Optional[
  23. Union[Var[Union[bool, int, str]], str, int, bool]
  24. ] = None,
  25. content_editable: Optional[
  26. Union[Var[Union[bool, int, str]], str, int, bool]
  27. ] = None,
  28. context_menu: Optional[
  29. Union[Var[Union[bool, int, str]], str, int, bool]
  30. ] = None,
  31. dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  32. draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  33. enter_key_hint: Optional[
  34. Union[Var[Union[bool, int, str]], str, int, bool]
  35. ] = None,
  36. hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  37. input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  38. item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  39. lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  40. role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  41. slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  42. spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  43. tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  44. title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = 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, str]]] = None,
  51. on_blur: Optional[
  52. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  53. ] = None,
  54. on_click: Optional[
  55. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  56. ] = None,
  57. on_context_menu: Optional[
  58. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  59. ] = None,
  60. on_double_click: Optional[
  61. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  62. ] = None,
  63. on_focus: Optional[
  64. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  65. ] = None,
  66. on_mount: Optional[
  67. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  68. ] = None,
  69. on_mouse_down: Optional[
  70. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  71. ] = None,
  72. on_mouse_enter: Optional[
  73. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  74. ] = None,
  75. on_mouse_leave: Optional[
  76. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  77. ] = None,
  78. on_mouse_move: Optional[
  79. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  80. ] = None,
  81. on_mouse_out: Optional[
  82. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  83. ] = None,
  84. on_mouse_over: Optional[
  85. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  86. ] = None,
  87. on_mouse_up: Optional[
  88. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  89. ] = None,
  90. on_scroll: Optional[
  91. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  92. ] = None,
  93. on_unmount: Optional[
  94. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  95. ] = None,
  96. **props,
  97. ) -> "Sidebar":
  98. """Create the sidebar component.
  99. Args:
  100. children: The children components.
  101. props: The properties of the sidebar.
  102. Returns:
  103. The sidebar component.
  104. """
  105. ...
  106. def add_style(self) -> dict[str, Any] | None: ...
  107. def add_hooks(self) -> List[Var]: ...
  108. class StatefulSidebar(ComponentState):
  109. open: bool
  110. def toggle(self): ...
  111. @classmethod
  112. def get_component(cls, *children, **props): ...
  113. class DrawerSidebar(DrawerRoot):
  114. @overload
  115. @classmethod
  116. def create( # type: ignore
  117. cls,
  118. *children,
  119. open: Optional[Union[Var[bool], bool]] = None,
  120. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  121. close_threshold: Optional[Union[Var[float], float]] = None,
  122. snap_points: Optional[List[Union[float, str]]] = None,
  123. fade_from_index: Optional[Union[Var[int], int]] = None,
  124. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  125. modal: Optional[Union[Var[bool], bool]] = None,
  126. direction: Optional[
  127. Union[
  128. Var[Literal["top", "bottom", "left", "right"]],
  129. Literal["top", "bottom", "left", "right"],
  130. ]
  131. ] = None,
  132. preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
  133. as_child: Optional[Union[Var[bool], bool]] = None,
  134. style: Optional[Style] = None,
  135. key: Optional[Any] = None,
  136. id: Optional[Any] = None,
  137. class_name: Optional[Any] = None,
  138. autofocus: Optional[bool] = None,
  139. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  140. on_blur: Optional[
  141. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  142. ] = None,
  143. on_click: Optional[
  144. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  145. ] = None,
  146. on_context_menu: Optional[
  147. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  148. ] = None,
  149. on_double_click: Optional[
  150. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  151. ] = None,
  152. on_focus: Optional[
  153. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  154. ] = None,
  155. on_mount: Optional[
  156. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  157. ] = None,
  158. on_mouse_down: Optional[
  159. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  160. ] = None,
  161. on_mouse_enter: Optional[
  162. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  163. ] = None,
  164. on_mouse_leave: Optional[
  165. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  166. ] = None,
  167. on_mouse_move: Optional[
  168. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  169. ] = None,
  170. on_mouse_out: Optional[
  171. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  172. ] = None,
  173. on_mouse_over: Optional[
  174. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  175. ] = None,
  176. on_mouse_up: Optional[
  177. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  178. ] = None,
  179. on_open_change: Optional[
  180. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  181. ] = None,
  182. on_scroll: Optional[
  183. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  184. ] = None,
  185. on_unmount: Optional[
  186. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  187. ] = None,
  188. **props,
  189. ) -> "DrawerSidebar":
  190. """Create the sidebar component.
  191. Args:
  192. children: The children components.
  193. props: The properties of the sidebar.
  194. Returns:
  195. The drawer sidebar component.
  196. """
  197. ...
  198. sidebar_trigger_style = {
  199. "position": "fixed",
  200. "z_index": "15",
  201. "color": color("accent", 12),
  202. "background_color": "transparent",
  203. "padding": "0",
  204. }
  205. class SidebarTrigger(Fragment):
  206. @overload
  207. @classmethod
  208. def create( # type: ignore
  209. cls,
  210. *children,
  211. style: Optional[Style] = None,
  212. key: Optional[Any] = None,
  213. id: Optional[Any] = None,
  214. class_name: Optional[Any] = None,
  215. autofocus: Optional[bool] = None,
  216. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  217. on_blur: Optional[
  218. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  219. ] = None,
  220. on_click: Optional[
  221. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  222. ] = None,
  223. on_context_menu: Optional[
  224. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  225. ] = None,
  226. on_double_click: Optional[
  227. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  228. ] = None,
  229. on_focus: Optional[
  230. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  231. ] = None,
  232. on_mount: Optional[
  233. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  234. ] = None,
  235. on_mouse_down: Optional[
  236. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  237. ] = None,
  238. on_mouse_enter: Optional[
  239. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  240. ] = None,
  241. on_mouse_leave: Optional[
  242. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  243. ] = None,
  244. on_mouse_move: Optional[
  245. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  246. ] = None,
  247. on_mouse_out: Optional[
  248. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  249. ] = None,
  250. on_mouse_over: Optional[
  251. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  252. ] = None,
  253. on_mouse_up: Optional[
  254. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  255. ] = None,
  256. on_scroll: Optional[
  257. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  258. ] = None,
  259. on_unmount: Optional[
  260. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  261. ] = None,
  262. **props,
  263. ) -> "SidebarTrigger":
  264. """Create the sidebar trigger component.
  265. Args:
  266. sidebar: The sidebar component.
  267. props: The properties of the sidebar trigger.
  268. Returns:
  269. The sidebar trigger component.
  270. """
  271. ...
  272. class Layout(Box):
  273. @overload
  274. @classmethod
  275. def create( # type: ignore
  276. cls,
  277. *children,
  278. sidebar: Optional[Component] = None,
  279. access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  280. auto_capitalize: Optional[
  281. Union[Var[Union[bool, int, str]], str, int, bool]
  282. ] = None,
  283. content_editable: Optional[
  284. Union[Var[Union[bool, int, str]], str, int, bool]
  285. ] = None,
  286. context_menu: Optional[
  287. Union[Var[Union[bool, int, str]], str, int, bool]
  288. ] = None,
  289. dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  290. draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  291. enter_key_hint: Optional[
  292. Union[Var[Union[bool, int, str]], str, int, bool]
  293. ] = None,
  294. hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  295. input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  296. item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  297. lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  298. role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  299. slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  300. spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  301. tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  302. title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  303. style: Optional[Style] = None,
  304. key: Optional[Any] = None,
  305. id: Optional[Any] = None,
  306. class_name: Optional[Any] = None,
  307. autofocus: Optional[bool] = None,
  308. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  309. on_blur: Optional[
  310. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  311. ] = None,
  312. on_click: Optional[
  313. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  314. ] = None,
  315. on_context_menu: Optional[
  316. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  317. ] = None,
  318. on_double_click: Optional[
  319. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  320. ] = None,
  321. on_focus: Optional[
  322. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  323. ] = None,
  324. on_mount: Optional[
  325. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  326. ] = None,
  327. on_mouse_down: Optional[
  328. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  329. ] = None,
  330. on_mouse_enter: Optional[
  331. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  332. ] = None,
  333. on_mouse_leave: Optional[
  334. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  335. ] = None,
  336. on_mouse_move: Optional[
  337. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  338. ] = None,
  339. on_mouse_out: Optional[
  340. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  341. ] = None,
  342. on_mouse_over: Optional[
  343. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  344. ] = None,
  345. on_mouse_up: Optional[
  346. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  347. ] = None,
  348. on_scroll: Optional[
  349. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  350. ] = None,
  351. on_unmount: Optional[
  352. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  353. ] = None,
  354. **props,
  355. ) -> "Layout":
  356. """Create the layout component.
  357. Args:
  358. content: The content component.
  359. sidebar: The sidebar component.
  360. props: The properties of the layout.
  361. Returns:
  362. The layout component.
  363. """
  364. ...
  365. class LayoutNamespace(ComponentNamespace):
  366. drawer_sidebar = staticmethod(DrawerSidebar.create)
  367. stateful_sidebar = staticmethod(StatefulSidebar.create)
  368. sidebar = staticmethod(Sidebar.create)
  369. @staticmethod
  370. def __call__(
  371. *children,
  372. sidebar: Optional[Component] = None,
  373. access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  374. auto_capitalize: Optional[
  375. Union[Var[Union[bool, int, str]], str, int, bool]
  376. ] = None,
  377. content_editable: Optional[
  378. Union[Var[Union[bool, int, str]], str, int, bool]
  379. ] = None,
  380. context_menu: Optional[
  381. Union[Var[Union[bool, int, str]], str, int, bool]
  382. ] = None,
  383. dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  384. draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  385. enter_key_hint: Optional[
  386. Union[Var[Union[bool, int, str]], str, int, bool]
  387. ] = None,
  388. hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  389. input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  390. item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  391. lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  392. role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  393. slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  394. spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  395. tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  396. title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  397. style: Optional[Style] = None,
  398. key: Optional[Any] = None,
  399. id: Optional[Any] = None,
  400. class_name: Optional[Any] = None,
  401. autofocus: Optional[bool] = None,
  402. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  403. on_blur: Optional[
  404. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  405. ] = None,
  406. on_click: Optional[
  407. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  408. ] = None,
  409. on_context_menu: Optional[
  410. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  411. ] = None,
  412. on_double_click: Optional[
  413. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  414. ] = None,
  415. on_focus: Optional[
  416. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  417. ] = None,
  418. on_mount: Optional[
  419. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  420. ] = None,
  421. on_mouse_down: Optional[
  422. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  423. ] = None,
  424. on_mouse_enter: Optional[
  425. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  426. ] = None,
  427. on_mouse_leave: Optional[
  428. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  429. ] = None,
  430. on_mouse_move: Optional[
  431. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  432. ] = None,
  433. on_mouse_out: Optional[
  434. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  435. ] = None,
  436. on_mouse_over: Optional[
  437. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  438. ] = None,
  439. on_mouse_up: Optional[
  440. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  441. ] = None,
  442. on_scroll: Optional[
  443. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  444. ] = None,
  445. on_unmount: Optional[
  446. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  447. ] = None,
  448. **props,
  449. ) -> "Layout":
  450. """Create the layout component.
  451. Args:
  452. content: The content component.
  453. sidebar: The sidebar component.
  454. props: The properties of the layout.
  455. Returns:
  456. The layout component.
  457. """
  458. ...
  459. layout = LayoutNamespace()