drawer.pyi 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. """Stub file for reflex/components/radix/primitives/drawer.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.components.component import ComponentNamespace
  7. from reflex.components.radix.primitives.base import RadixPrimitiveComponent
  8. from reflex.event import BASE_STATE, EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. class DrawerComponent(RadixPrimitiveComponent):
  12. @overload
  13. @classmethod
  14. def create( # type: ignore
  15. cls,
  16. *children,
  17. as_child: Optional[Union[Var[bool], bool]] = None,
  18. style: Optional[Style] = None,
  19. key: Optional[Any] = None,
  20. id: Optional[Any] = None,
  21. class_name: Optional[Any] = None,
  22. autofocus: Optional[bool] = None,
  23. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  24. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  25. on_click: Optional[EventType[[], BASE_STATE]] = None,
  26. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  27. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  28. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  29. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  30. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  31. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  32. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  33. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  34. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  35. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  36. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  37. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  38. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  39. **props,
  40. ) -> "DrawerComponent":
  41. """Create the component.
  42. Args:
  43. *children: The children of the component.
  44. as_child: Change the default rendered element for the one passed as a child.
  45. style: The style of the component.
  46. key: A unique key for the component.
  47. id: The id for the component.
  48. class_name: The class name for the component.
  49. autofocus: Whether the component should take the focus once the page is loaded
  50. custom_attrs: custom attribute
  51. **props: The props of the component.
  52. Returns:
  53. The component.
  54. """
  55. ...
  56. LiteralDirectionType = Literal["top", "bottom", "left", "right"]
  57. class DrawerRoot(DrawerComponent):
  58. @overload
  59. @classmethod
  60. def create( # type: ignore
  61. cls,
  62. *children,
  63. default_open: Optional[Union[Var[bool], bool]] = None,
  64. open: Optional[Union[Var[bool], bool]] = None,
  65. modal: Optional[Union[Var[bool], bool]] = None,
  66. direction: Optional[
  67. Union[
  68. Literal["bottom", "left", "right", "top"],
  69. Var[Literal["bottom", "left", "right", "top"]],
  70. ]
  71. ] = None,
  72. dismissible: Optional[Union[Var[bool], bool]] = None,
  73. handle_only: Optional[Union[Var[bool], bool]] = None,
  74. snap_points: Optional[List[Union[float, str]]] = None,
  75. fade_from_index: Optional[Union[Var[int], int]] = None,
  76. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  77. preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
  78. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  79. close_threshold: Optional[Union[Var[float], float]] = None,
  80. as_child: Optional[Union[Var[bool], bool]] = None,
  81. style: Optional[Style] = None,
  82. key: Optional[Any] = None,
  83. id: Optional[Any] = None,
  84. class_name: Optional[Any] = None,
  85. autofocus: Optional[bool] = None,
  86. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  87. on_animation_end: Optional[
  88. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  89. ] = None,
  90. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  91. on_click: Optional[EventType[[], BASE_STATE]] = None,
  92. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  93. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  94. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  95. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  96. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  97. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  98. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  99. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  100. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  101. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  102. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  103. on_open_change: Optional[
  104. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  105. ] = None,
  106. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  107. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  108. **props,
  109. ) -> "DrawerRoot":
  110. """Create the component.
  111. Args:
  112. *children: The children of the component.
  113. default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state.
  114. open: Whether the drawer is open or not.
  115. on_open_change: Fires when the drawer is opened or closed.
  116. modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`.
  117. direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"`
  118. on_animation_end: Gets triggered after the open or close animation ends, it receives an open argument with the open state of the drawer by the time the function was triggered.
  119. dismissible: When `False`, dragging, clicking outside, pressing esc, etc. will not close the drawer. Use this in combination with the open prop, otherwise you won't be able to open/close the drawer.
  120. handle_only: When `True`, dragging will only be possible by the handle.
  121. snap_points: Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account.
  122. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
  123. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
  124. preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
  125. should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background.
  126. close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
  127. as_child: Change the default rendered element for the one passed as a child.
  128. style: The style of the component.
  129. key: A unique key for the component.
  130. id: The id for the component.
  131. class_name: The class name for the component.
  132. autofocus: Whether the component should take the focus once the page is loaded
  133. custom_attrs: custom attribute
  134. **props: The props of the component.
  135. Returns:
  136. The component.
  137. """
  138. ...
  139. class DrawerTrigger(DrawerComponent):
  140. @overload
  141. @classmethod
  142. def create( # type: ignore
  143. cls,
  144. *children,
  145. as_child: Optional[Union[Var[bool], bool]] = None,
  146. style: Optional[Style] = None,
  147. key: Optional[Any] = None,
  148. id: Optional[Any] = None,
  149. class_name: Optional[Any] = None,
  150. autofocus: Optional[bool] = None,
  151. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  152. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  153. on_click: Optional[EventType[[], BASE_STATE]] = None,
  154. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  155. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  156. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  157. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  158. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  159. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  160. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  161. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  162. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  163. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  164. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  165. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  166. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  167. **props,
  168. ) -> "DrawerTrigger":
  169. """Create a new DrawerTrigger instance.
  170. Args:
  171. *children: The children of the element.
  172. as_child: Change the default rendered element for the one passed as a child.
  173. style: The style of the component.
  174. key: A unique key for the component.
  175. id: The id for the component.
  176. class_name: The class name for the component.
  177. autofocus: Whether the component should take the focus once the page is loaded
  178. custom_attrs: custom attribute
  179. **props: The properties of the element.
  180. Returns:
  181. The new DrawerTrigger instance.
  182. """
  183. ...
  184. class DrawerPortal(DrawerComponent):
  185. @overload
  186. @classmethod
  187. def create( # type: ignore
  188. cls,
  189. *children,
  190. as_child: Optional[Union[Var[bool], bool]] = None,
  191. style: Optional[Style] = None,
  192. key: Optional[Any] = None,
  193. id: Optional[Any] = None,
  194. class_name: Optional[Any] = None,
  195. autofocus: Optional[bool] = None,
  196. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  197. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  198. on_click: Optional[EventType[[], BASE_STATE]] = None,
  199. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  200. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  201. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  202. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  203. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  204. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  205. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  206. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  207. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  208. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  209. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  210. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  211. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  212. **props,
  213. ) -> "DrawerPortal":
  214. """Create the component.
  215. Args:
  216. *children: The children of the component.
  217. as_child: Change the default rendered element for the one passed as a child.
  218. style: The style of the component.
  219. key: A unique key for the component.
  220. id: The id for the component.
  221. class_name: The class name for the component.
  222. autofocus: Whether the component should take the focus once the page is loaded
  223. custom_attrs: custom attribute
  224. **props: The props of the component.
  225. Returns:
  226. The component.
  227. """
  228. ...
  229. class DrawerContent(DrawerComponent):
  230. @overload
  231. @classmethod
  232. def create( # type: ignore
  233. cls,
  234. *children,
  235. as_child: Optional[Union[Var[bool], bool]] = None,
  236. style: Optional[Style] = None,
  237. key: Optional[Any] = None,
  238. id: Optional[Any] = None,
  239. class_name: Optional[Any] = None,
  240. autofocus: Optional[bool] = None,
  241. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  242. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  243. on_click: Optional[EventType[[], BASE_STATE]] = None,
  244. on_close_auto_focus: Optional[EventType[[], BASE_STATE]] = None,
  245. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  246. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  247. on_escape_key_down: Optional[EventType[[], BASE_STATE]] = None,
  248. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  249. on_interact_outside: Optional[EventType[[], BASE_STATE]] = None,
  250. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  251. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  252. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  253. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  254. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  255. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  256. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  257. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  258. on_open_auto_focus: Optional[EventType[[], BASE_STATE]] = None,
  259. on_pointer_down_outside: Optional[EventType[[], BASE_STATE]] = None,
  260. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  261. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  262. **props,
  263. ) -> "DrawerContent":
  264. """Create a Drawer Content.
  265. We wrap the Drawer content in an `rx.theme` to make radix themes definitions available to
  266. rendered div in the DOM. This is because Vaul Drawer injects the Drawer overlay content in a sibling
  267. div to the root div rendered by radix which contains styling definitions. Wrapping in `rx.theme`
  268. makes the styling available to the overlay.
  269. Args:
  270. *children: The list of children to use.
  271. as_child: Change the default rendered element for the one passed as a child.
  272. style: The style of the component.
  273. key: A unique key for the component.
  274. id: The id for the component.
  275. class_name: The class name for the component.
  276. autofocus: Whether the component should take the focus once the page is loaded
  277. custom_attrs: custom attribute
  278. **props: Additional properties to apply to the drawer content.
  279. Returns:
  280. The drawer content.
  281. """
  282. ...
  283. class DrawerOverlay(DrawerComponent):
  284. @overload
  285. @classmethod
  286. def create( # type: ignore
  287. cls,
  288. *children,
  289. as_child: Optional[Union[Var[bool], bool]] = None,
  290. style: Optional[Style] = None,
  291. key: Optional[Any] = None,
  292. id: Optional[Any] = None,
  293. class_name: Optional[Any] = None,
  294. autofocus: Optional[bool] = None,
  295. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  296. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  297. on_click: Optional[EventType[[], BASE_STATE]] = None,
  298. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  299. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  300. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  301. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  302. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  303. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  304. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  305. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  306. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  307. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  308. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  309. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  310. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  311. **props,
  312. ) -> "DrawerOverlay":
  313. """Create the component.
  314. Args:
  315. *children: The children of the component.
  316. as_child: Change the default rendered element for the one passed as a child.
  317. style: The style of the component.
  318. key: A unique key for the component.
  319. id: The id for the component.
  320. class_name: The class name for the component.
  321. autofocus: Whether the component should take the focus once the page is loaded
  322. custom_attrs: custom attribute
  323. **props: The props of the component.
  324. Returns:
  325. The component.
  326. """
  327. ...
  328. class DrawerClose(DrawerTrigger):
  329. @overload
  330. @classmethod
  331. def create( # type: ignore
  332. cls,
  333. *children,
  334. as_child: Optional[Union[Var[bool], bool]] = None,
  335. style: Optional[Style] = None,
  336. key: Optional[Any] = None,
  337. id: Optional[Any] = None,
  338. class_name: Optional[Any] = None,
  339. autofocus: Optional[bool] = None,
  340. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  341. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  342. on_click: Optional[EventType[[], BASE_STATE]] = None,
  343. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  344. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  345. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  346. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  347. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  348. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  349. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  350. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  351. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  352. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  353. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  354. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  355. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  356. **props,
  357. ) -> "DrawerClose":
  358. """Create a new DrawerTrigger instance.
  359. Args:
  360. *children: The children of the element.
  361. as_child: Change the default rendered element for the one passed as a child.
  362. style: The style of the component.
  363. key: A unique key for the component.
  364. id: The id for the component.
  365. class_name: The class name for the component.
  366. autofocus: Whether the component should take the focus once the page is loaded
  367. custom_attrs: custom attribute
  368. **props: The properties of the element.
  369. Returns:
  370. The new DrawerTrigger instance.
  371. """
  372. ...
  373. class DrawerTitle(DrawerComponent):
  374. @overload
  375. @classmethod
  376. def create( # type: ignore
  377. cls,
  378. *children,
  379. as_child: Optional[Union[Var[bool], bool]] = None,
  380. style: Optional[Style] = None,
  381. key: Optional[Any] = None,
  382. id: Optional[Any] = None,
  383. class_name: Optional[Any] = None,
  384. autofocus: Optional[bool] = None,
  385. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  386. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  387. on_click: Optional[EventType[[], BASE_STATE]] = None,
  388. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  389. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  390. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  391. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  392. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  393. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  394. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  395. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  396. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  397. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  398. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  399. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  400. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  401. **props,
  402. ) -> "DrawerTitle":
  403. """Create the component.
  404. Args:
  405. *children: The children of the component.
  406. as_child: Change the default rendered element for the one passed as a child.
  407. style: The style of the component.
  408. key: A unique key for the component.
  409. id: The id for the component.
  410. class_name: The class name for the component.
  411. autofocus: Whether the component should take the focus once the page is loaded
  412. custom_attrs: custom attribute
  413. **props: The props of the component.
  414. Returns:
  415. The component.
  416. """
  417. ...
  418. class DrawerDescription(DrawerComponent):
  419. @overload
  420. @classmethod
  421. def create( # type: ignore
  422. cls,
  423. *children,
  424. as_child: Optional[Union[Var[bool], bool]] = None,
  425. style: Optional[Style] = None,
  426. key: Optional[Any] = None,
  427. id: Optional[Any] = None,
  428. class_name: Optional[Any] = None,
  429. autofocus: Optional[bool] = None,
  430. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  431. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  432. on_click: Optional[EventType[[], BASE_STATE]] = None,
  433. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  434. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  435. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  436. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  437. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  438. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  439. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  440. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  441. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  442. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  443. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  444. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  445. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  446. **props,
  447. ) -> "DrawerDescription":
  448. """Create the component.
  449. Args:
  450. *children: The children of the component.
  451. as_child: Change the default rendered element for the one passed as a child.
  452. style: The style of the component.
  453. key: A unique key for the component.
  454. id: The id for the component.
  455. class_name: The class name for the component.
  456. autofocus: Whether the component should take the focus once the page is loaded
  457. custom_attrs: custom attribute
  458. **props: The props of the component.
  459. Returns:
  460. The component.
  461. """
  462. ...
  463. class DrawerHandle(DrawerComponent):
  464. @overload
  465. @classmethod
  466. def create( # type: ignore
  467. cls,
  468. *children,
  469. as_child: Optional[Union[Var[bool], bool]] = None,
  470. style: Optional[Style] = None,
  471. key: Optional[Any] = None,
  472. id: Optional[Any] = None,
  473. class_name: Optional[Any] = None,
  474. autofocus: Optional[bool] = None,
  475. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  476. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  477. on_click: Optional[EventType[[], BASE_STATE]] = None,
  478. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  479. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  480. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  481. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  482. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  483. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  484. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  485. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  486. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  487. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  488. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  489. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  490. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  491. **props,
  492. ) -> "DrawerHandle":
  493. """Create the component.
  494. Args:
  495. *children: The children of the component.
  496. as_child: Change the default rendered element for the one passed as a child.
  497. style: The style of the component.
  498. key: A unique key for the component.
  499. id: The id for the component.
  500. class_name: The class name for the component.
  501. autofocus: Whether the component should take the focus once the page is loaded
  502. custom_attrs: custom attribute
  503. **props: The props of the component.
  504. Returns:
  505. The component.
  506. """
  507. ...
  508. class Drawer(ComponentNamespace):
  509. root = staticmethod(DrawerRoot.create)
  510. trigger = staticmethod(DrawerTrigger.create)
  511. portal = staticmethod(DrawerPortal.create)
  512. content = staticmethod(DrawerContent.create)
  513. overlay = staticmethod(DrawerOverlay.create)
  514. close = staticmethod(DrawerClose.create)
  515. title = staticmethod(DrawerTitle.create)
  516. description = staticmethod(DrawerDescription.create)
  517. handle = staticmethod(DrawerHandle.create)
  518. @staticmethod
  519. def __call__(
  520. *children,
  521. default_open: Optional[Union[Var[bool], bool]] = None,
  522. open: Optional[Union[Var[bool], bool]] = None,
  523. modal: Optional[Union[Var[bool], bool]] = None,
  524. direction: Optional[
  525. Union[
  526. Literal["bottom", "left", "right", "top"],
  527. Var[Literal["bottom", "left", "right", "top"]],
  528. ]
  529. ] = None,
  530. dismissible: Optional[Union[Var[bool], bool]] = None,
  531. handle_only: Optional[Union[Var[bool], bool]] = None,
  532. snap_points: Optional[List[Union[float, str]]] = None,
  533. fade_from_index: Optional[Union[Var[int], int]] = None,
  534. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  535. preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
  536. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  537. close_threshold: Optional[Union[Var[float], float]] = None,
  538. as_child: Optional[Union[Var[bool], bool]] = None,
  539. style: Optional[Style] = None,
  540. key: Optional[Any] = None,
  541. id: Optional[Any] = None,
  542. class_name: Optional[Any] = None,
  543. autofocus: Optional[bool] = None,
  544. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  545. on_animation_end: Optional[
  546. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  547. ] = None,
  548. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  549. on_click: Optional[EventType[[], BASE_STATE]] = None,
  550. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  551. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  552. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  553. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  554. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  555. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  556. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  557. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  558. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  559. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  560. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  561. on_open_change: Optional[
  562. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  563. ] = None,
  564. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  565. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  566. **props,
  567. ) -> "DrawerRoot":
  568. """Create the component.
  569. Args:
  570. *children: The children of the component.
  571. default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state.
  572. open: Whether the drawer is open or not.
  573. on_open_change: Fires when the drawer is opened or closed.
  574. modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`.
  575. direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"`
  576. on_animation_end: Gets triggered after the open or close animation ends, it receives an open argument with the open state of the drawer by the time the function was triggered.
  577. dismissible: When `False`, dragging, clicking outside, pressing esc, etc. will not close the drawer. Use this in combination with the open prop, otherwise you won't be able to open/close the drawer.
  578. handle_only: When `True`, dragging will only be possible by the handle.
  579. snap_points: Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account.
  580. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
  581. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
  582. preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
  583. should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background.
  584. close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
  585. as_child: Change the default rendered element for the one passed as a child.
  586. style: The style of the component.
  587. key: A unique key for the component.
  588. id: The id for the component.
  589. class_name: The class name for the component.
  590. autofocus: Whether the component should take the focus once the page is loaded
  591. custom_attrs: custom attribute
  592. **props: The props of the component.
  593. Returns:
  594. The component.
  595. """
  596. ...
  597. drawer = Drawer()