drawer.pyi 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  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, Callable, 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 EventHandler, EventSpec
  9. from reflex.ivars.base import ImmutableVar
  10. from reflex.style import Style
  11. from reflex.vars import Var
  12. class DrawerComponent(RadixPrimitiveComponent):
  13. @overload
  14. @classmethod
  15. def create( # type: ignore
  16. cls,
  17. *children,
  18. as_child: Optional[Union[Var[bool], bool]] = None,
  19. style: Optional[Style] = None,
  20. key: Optional[Any] = None,
  21. id: Optional[Any] = None,
  22. class_name: Optional[Any] = None,
  23. autofocus: Optional[bool] = None,
  24. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  25. on_blur: Optional[
  26. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  27. ] = None,
  28. on_click: Optional[
  29. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  30. ] = None,
  31. on_context_menu: Optional[
  32. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  33. ] = None,
  34. on_double_click: Optional[
  35. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  36. ] = None,
  37. on_focus: Optional[
  38. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  39. ] = None,
  40. on_mount: Optional[
  41. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  42. ] = None,
  43. on_mouse_down: Optional[
  44. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  45. ] = None,
  46. on_mouse_enter: Optional[
  47. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  48. ] = None,
  49. on_mouse_leave: Optional[
  50. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  51. ] = None,
  52. on_mouse_move: Optional[
  53. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  54. ] = None,
  55. on_mouse_out: Optional[
  56. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  57. ] = None,
  58. on_mouse_over: Optional[
  59. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  60. ] = None,
  61. on_mouse_up: Optional[
  62. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  63. ] = None,
  64. on_scroll: Optional[
  65. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  66. ] = None,
  67. on_unmount: Optional[
  68. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  69. ] = None,
  70. **props,
  71. ) -> "DrawerComponent":
  72. """Create the component.
  73. Args:
  74. *children: The children of the component.
  75. as_child: Change the default rendered element for the one passed as a child.
  76. style: The style of the component.
  77. key: A unique key for the component.
  78. id: The id for the component.
  79. class_name: The class name for the component.
  80. autofocus: Whether the component should take the focus once the page is loaded
  81. custom_attrs: custom attribute
  82. **props: The props of the component.
  83. Returns:
  84. The component.
  85. """
  86. ...
  87. LiteralDirectionType = Literal["top", "bottom", "left", "right"]
  88. class DrawerRoot(DrawerComponent):
  89. @overload
  90. @classmethod
  91. def create( # type: ignore
  92. cls,
  93. *children,
  94. open: Optional[Union[Var[bool], bool]] = None,
  95. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  96. close_threshold: Optional[Union[Var[float], float]] = None,
  97. snap_points: Optional[List[Union[float, str]]] = None,
  98. fade_from_index: Optional[Union[Var[int], int]] = None,
  99. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  100. modal: Optional[Union[Var[bool], bool]] = None,
  101. direction: Optional[
  102. Union[
  103. Var[Literal["top", "bottom", "left", "right"]],
  104. Literal["top", "bottom", "left", "right"],
  105. ]
  106. ] = None,
  107. preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
  108. as_child: Optional[Union[Var[bool], bool]] = None,
  109. style: Optional[Style] = None,
  110. key: Optional[Any] = None,
  111. id: Optional[Any] = None,
  112. class_name: Optional[Any] = None,
  113. autofocus: Optional[bool] = None,
  114. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  115. on_blur: Optional[
  116. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  117. ] = None,
  118. on_click: Optional[
  119. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  120. ] = None,
  121. on_context_menu: Optional[
  122. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  123. ] = None,
  124. on_double_click: Optional[
  125. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  126. ] = None,
  127. on_focus: Optional[
  128. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  129. ] = None,
  130. on_mount: Optional[
  131. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  132. ] = None,
  133. on_mouse_down: Optional[
  134. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  135. ] = None,
  136. on_mouse_enter: Optional[
  137. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  138. ] = None,
  139. on_mouse_leave: Optional[
  140. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  141. ] = None,
  142. on_mouse_move: Optional[
  143. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  144. ] = None,
  145. on_mouse_out: Optional[
  146. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  147. ] = None,
  148. on_mouse_over: Optional[
  149. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  150. ] = None,
  151. on_mouse_up: Optional[
  152. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  153. ] = None,
  154. on_open_change: Optional[
  155. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  156. ] = None,
  157. on_scroll: Optional[
  158. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  159. ] = None,
  160. on_unmount: Optional[
  161. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  162. ] = None,
  163. **props,
  164. ) -> "DrawerRoot":
  165. """Create the component.
  166. Args:
  167. *children: The children of the component.
  168. open: Whether the drawer is open or not.
  169. should_scale_background: Enable background scaling, it requires an element with [vaul-drawer-wrapper] data attribute to scale its background.
  170. close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
  171. 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.
  172. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
  173. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
  174. modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
  175. direction: Direction of the drawer. Defaults to `"bottom"`
  176. preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
  177. as_child: Change the default rendered element for the one passed as a child.
  178. style: The style of the component.
  179. key: A unique key for the component.
  180. id: The id for the component.
  181. class_name: The class name for the component.
  182. autofocus: Whether the component should take the focus once the page is loaded
  183. custom_attrs: custom attribute
  184. **props: The props of the component.
  185. Returns:
  186. The component.
  187. """
  188. ...
  189. class DrawerTrigger(DrawerComponent):
  190. @overload
  191. @classmethod
  192. def create( # type: ignore
  193. cls,
  194. *children,
  195. as_child: Optional[Union[Var[bool], bool]] = None,
  196. style: Optional[Style] = None,
  197. key: Optional[Any] = None,
  198. id: Optional[Any] = None,
  199. class_name: Optional[Any] = None,
  200. autofocus: Optional[bool] = None,
  201. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  202. on_blur: Optional[
  203. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  204. ] = None,
  205. on_click: Optional[
  206. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  207. ] = None,
  208. on_context_menu: Optional[
  209. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  210. ] = None,
  211. on_double_click: Optional[
  212. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  213. ] = None,
  214. on_focus: Optional[
  215. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  216. ] = None,
  217. on_mount: Optional[
  218. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  219. ] = None,
  220. on_mouse_down: Optional[
  221. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  222. ] = None,
  223. on_mouse_enter: Optional[
  224. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  225. ] = None,
  226. on_mouse_leave: Optional[
  227. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  228. ] = None,
  229. on_mouse_move: Optional[
  230. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  231. ] = None,
  232. on_mouse_out: Optional[
  233. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  234. ] = None,
  235. on_mouse_over: Optional[
  236. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  237. ] = None,
  238. on_mouse_up: Optional[
  239. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  240. ] = None,
  241. on_scroll: Optional[
  242. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  243. ] = None,
  244. on_unmount: Optional[
  245. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  246. ] = None,
  247. **props,
  248. ) -> "DrawerTrigger":
  249. """Create a new DrawerTrigger instance.
  250. Args:
  251. children: The children of the element.
  252. props: The properties of the element.
  253. Returns:
  254. The new DrawerTrigger instance.
  255. """
  256. ...
  257. class DrawerPortal(DrawerComponent):
  258. @overload
  259. @classmethod
  260. def create( # type: ignore
  261. cls,
  262. *children,
  263. as_child: Optional[Union[Var[bool], bool]] = None,
  264. style: Optional[Style] = None,
  265. key: Optional[Any] = None,
  266. id: Optional[Any] = None,
  267. class_name: Optional[Any] = None,
  268. autofocus: Optional[bool] = None,
  269. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  270. on_blur: Optional[
  271. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  272. ] = None,
  273. on_click: Optional[
  274. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  275. ] = None,
  276. on_context_menu: Optional[
  277. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  278. ] = None,
  279. on_double_click: Optional[
  280. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  281. ] = None,
  282. on_focus: Optional[
  283. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  284. ] = None,
  285. on_mount: Optional[
  286. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  287. ] = None,
  288. on_mouse_down: Optional[
  289. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  290. ] = None,
  291. on_mouse_enter: Optional[
  292. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  293. ] = None,
  294. on_mouse_leave: Optional[
  295. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  296. ] = None,
  297. on_mouse_move: Optional[
  298. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  299. ] = None,
  300. on_mouse_out: Optional[
  301. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  302. ] = None,
  303. on_mouse_over: Optional[
  304. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  305. ] = None,
  306. on_mouse_up: Optional[
  307. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  308. ] = None,
  309. on_scroll: Optional[
  310. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  311. ] = None,
  312. on_unmount: Optional[
  313. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  314. ] = None,
  315. **props,
  316. ) -> "DrawerPortal":
  317. """Create the component.
  318. Args:
  319. *children: The children of the component.
  320. as_child: Change the default rendered element for the one passed as a child.
  321. style: The style of the component.
  322. key: A unique key for the component.
  323. id: The id for the component.
  324. class_name: The class name for the component.
  325. autofocus: Whether the component should take the focus once the page is loaded
  326. custom_attrs: custom attribute
  327. **props: The props of the component.
  328. Returns:
  329. The component.
  330. """
  331. ...
  332. class DrawerContent(DrawerComponent):
  333. @overload
  334. @classmethod
  335. def create( # type: ignore
  336. cls,
  337. *children,
  338. as_child: Optional[Union[Var[bool], bool]] = None,
  339. style: Optional[Style] = None,
  340. key: Optional[Any] = None,
  341. id: Optional[Any] = None,
  342. class_name: Optional[Any] = None,
  343. autofocus: Optional[bool] = None,
  344. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  345. on_blur: Optional[
  346. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  347. ] = None,
  348. on_click: Optional[
  349. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  350. ] = None,
  351. on_close_auto_focus: Optional[
  352. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  353. ] = None,
  354. on_context_menu: Optional[
  355. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  356. ] = None,
  357. on_double_click: Optional[
  358. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  359. ] = None,
  360. on_escape_key_down: Optional[
  361. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  362. ] = None,
  363. on_focus: Optional[
  364. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  365. ] = None,
  366. on_interact_outside: Optional[
  367. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  368. ] = None,
  369. on_mount: Optional[
  370. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  371. ] = None,
  372. on_mouse_down: Optional[
  373. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  374. ] = None,
  375. on_mouse_enter: Optional[
  376. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  377. ] = None,
  378. on_mouse_leave: Optional[
  379. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  380. ] = None,
  381. on_mouse_move: Optional[
  382. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  383. ] = None,
  384. on_mouse_out: Optional[
  385. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  386. ] = None,
  387. on_mouse_over: Optional[
  388. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  389. ] = None,
  390. on_mouse_up: Optional[
  391. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  392. ] = None,
  393. on_open_auto_focus: Optional[
  394. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  395. ] = None,
  396. on_pointer_down_outside: Optional[
  397. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  398. ] = None,
  399. on_scroll: Optional[
  400. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  401. ] = None,
  402. on_unmount: Optional[
  403. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  404. ] = None,
  405. **props,
  406. ) -> "DrawerContent":
  407. """Create a Drawer Content.
  408. We wrap the Drawer content in an `rx.theme` to make radix themes definitions available to
  409. rendered div in the DOM. This is because Vaul Drawer injects the Drawer overlay content in a sibling
  410. div to the root div rendered by radix which contains styling definitions. Wrapping in `rx.theme`
  411. makes the styling available to the overlay.
  412. Args:
  413. *children: The list of children to use.
  414. as_child: Change the default rendered element for the one passed as a child.
  415. style: The style of the component.
  416. key: A unique key for the component.
  417. id: The id for the component.
  418. class_name: The class name for the component.
  419. autofocus: Whether the component should take the focus once the page is loaded
  420. custom_attrs: custom attribute
  421. **props: Additional properties to apply to the drawer content.
  422. Returns:
  423. The drawer content.
  424. """
  425. ...
  426. class DrawerOverlay(DrawerComponent):
  427. @overload
  428. @classmethod
  429. def create( # type: ignore
  430. cls,
  431. *children,
  432. as_child: Optional[Union[Var[bool], bool]] = None,
  433. style: Optional[Style] = None,
  434. key: Optional[Any] = None,
  435. id: Optional[Any] = None,
  436. class_name: Optional[Any] = None,
  437. autofocus: Optional[bool] = None,
  438. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  439. on_blur: Optional[
  440. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  441. ] = None,
  442. on_click: Optional[
  443. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  444. ] = None,
  445. on_context_menu: Optional[
  446. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  447. ] = None,
  448. on_double_click: Optional[
  449. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  450. ] = None,
  451. on_focus: Optional[
  452. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  453. ] = None,
  454. on_mount: Optional[
  455. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  456. ] = None,
  457. on_mouse_down: Optional[
  458. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  459. ] = None,
  460. on_mouse_enter: Optional[
  461. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  462. ] = None,
  463. on_mouse_leave: Optional[
  464. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  465. ] = None,
  466. on_mouse_move: Optional[
  467. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  468. ] = None,
  469. on_mouse_out: Optional[
  470. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  471. ] = None,
  472. on_mouse_over: Optional[
  473. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  474. ] = None,
  475. on_mouse_up: Optional[
  476. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  477. ] = None,
  478. on_scroll: Optional[
  479. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  480. ] = None,
  481. on_unmount: Optional[
  482. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  483. ] = None,
  484. **props,
  485. ) -> "DrawerOverlay":
  486. """Create the component.
  487. Args:
  488. *children: The children of the component.
  489. as_child: Change the default rendered element for the one passed as a child.
  490. style: The style of the component.
  491. key: A unique key for the component.
  492. id: The id for the component.
  493. class_name: The class name for the component.
  494. autofocus: Whether the component should take the focus once the page is loaded
  495. custom_attrs: custom attribute
  496. **props: The props of the component.
  497. Returns:
  498. The component.
  499. """
  500. ...
  501. class DrawerClose(DrawerTrigger):
  502. @overload
  503. @classmethod
  504. def create( # type: ignore
  505. cls,
  506. *children,
  507. as_child: Optional[Union[Var[bool], bool]] = None,
  508. style: Optional[Style] = None,
  509. key: Optional[Any] = None,
  510. id: Optional[Any] = None,
  511. class_name: Optional[Any] = None,
  512. autofocus: Optional[bool] = None,
  513. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  514. on_blur: Optional[
  515. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  516. ] = None,
  517. on_click: Optional[
  518. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  519. ] = None,
  520. on_context_menu: Optional[
  521. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  522. ] = None,
  523. on_double_click: Optional[
  524. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  525. ] = None,
  526. on_focus: Optional[
  527. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  528. ] = None,
  529. on_mount: Optional[
  530. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  531. ] = None,
  532. on_mouse_down: Optional[
  533. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  534. ] = None,
  535. on_mouse_enter: Optional[
  536. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  537. ] = None,
  538. on_mouse_leave: Optional[
  539. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  540. ] = None,
  541. on_mouse_move: Optional[
  542. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  543. ] = None,
  544. on_mouse_out: Optional[
  545. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  546. ] = None,
  547. on_mouse_over: Optional[
  548. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  549. ] = None,
  550. on_mouse_up: Optional[
  551. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  552. ] = None,
  553. on_scroll: Optional[
  554. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  555. ] = None,
  556. on_unmount: Optional[
  557. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  558. ] = None,
  559. **props,
  560. ) -> "DrawerClose":
  561. """Create a new DrawerTrigger instance.
  562. Args:
  563. children: The children of the element.
  564. props: The properties of the element.
  565. Returns:
  566. The new DrawerTrigger instance.
  567. """
  568. ...
  569. class DrawerTitle(DrawerComponent):
  570. @overload
  571. @classmethod
  572. def create( # type: ignore
  573. cls,
  574. *children,
  575. as_child: Optional[Union[Var[bool], bool]] = None,
  576. style: Optional[Style] = None,
  577. key: Optional[Any] = None,
  578. id: Optional[Any] = None,
  579. class_name: Optional[Any] = None,
  580. autofocus: Optional[bool] = None,
  581. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  582. on_blur: Optional[
  583. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  584. ] = None,
  585. on_click: Optional[
  586. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  587. ] = None,
  588. on_context_menu: Optional[
  589. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  590. ] = None,
  591. on_double_click: Optional[
  592. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  593. ] = None,
  594. on_focus: Optional[
  595. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  596. ] = None,
  597. on_mount: Optional[
  598. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  599. ] = None,
  600. on_mouse_down: Optional[
  601. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  602. ] = None,
  603. on_mouse_enter: Optional[
  604. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  605. ] = None,
  606. on_mouse_leave: Optional[
  607. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  608. ] = None,
  609. on_mouse_move: Optional[
  610. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  611. ] = None,
  612. on_mouse_out: Optional[
  613. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  614. ] = None,
  615. on_mouse_over: Optional[
  616. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  617. ] = None,
  618. on_mouse_up: Optional[
  619. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  620. ] = None,
  621. on_scroll: Optional[
  622. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  623. ] = None,
  624. on_unmount: Optional[
  625. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  626. ] = None,
  627. **props,
  628. ) -> "DrawerTitle":
  629. """Create the component.
  630. Args:
  631. *children: The children of the component.
  632. as_child: Change the default rendered element for the one passed as a child.
  633. style: The style of the component.
  634. key: A unique key for the component.
  635. id: The id for the component.
  636. class_name: The class name for the component.
  637. autofocus: Whether the component should take the focus once the page is loaded
  638. custom_attrs: custom attribute
  639. **props: The props of the component.
  640. Returns:
  641. The component.
  642. """
  643. ...
  644. class DrawerDescription(DrawerComponent):
  645. @overload
  646. @classmethod
  647. def create( # type: ignore
  648. cls,
  649. *children,
  650. as_child: Optional[Union[Var[bool], bool]] = None,
  651. style: Optional[Style] = None,
  652. key: Optional[Any] = None,
  653. id: Optional[Any] = None,
  654. class_name: Optional[Any] = None,
  655. autofocus: Optional[bool] = None,
  656. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  657. on_blur: Optional[
  658. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  659. ] = None,
  660. on_click: Optional[
  661. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  662. ] = None,
  663. on_context_menu: Optional[
  664. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  665. ] = None,
  666. on_double_click: Optional[
  667. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  668. ] = None,
  669. on_focus: Optional[
  670. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  671. ] = None,
  672. on_mount: Optional[
  673. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  674. ] = None,
  675. on_mouse_down: Optional[
  676. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  677. ] = None,
  678. on_mouse_enter: Optional[
  679. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  680. ] = None,
  681. on_mouse_leave: Optional[
  682. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  683. ] = None,
  684. on_mouse_move: Optional[
  685. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  686. ] = None,
  687. on_mouse_out: Optional[
  688. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  689. ] = None,
  690. on_mouse_over: Optional[
  691. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  692. ] = None,
  693. on_mouse_up: Optional[
  694. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  695. ] = None,
  696. on_scroll: Optional[
  697. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  698. ] = None,
  699. on_unmount: Optional[
  700. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  701. ] = None,
  702. **props,
  703. ) -> "DrawerDescription":
  704. """Create the component.
  705. Args:
  706. *children: The children of the component.
  707. as_child: Change the default rendered element for the one passed as a child.
  708. style: The style of the component.
  709. key: A unique key for the component.
  710. id: The id for the component.
  711. class_name: The class name for the component.
  712. autofocus: Whether the component should take the focus once the page is loaded
  713. custom_attrs: custom attribute
  714. **props: The props of the component.
  715. Returns:
  716. The component.
  717. """
  718. ...
  719. class Drawer(ComponentNamespace):
  720. root = staticmethod(DrawerRoot.create)
  721. trigger = staticmethod(DrawerTrigger.create)
  722. portal = staticmethod(DrawerPortal.create)
  723. content = staticmethod(DrawerContent.create)
  724. overlay = staticmethod(DrawerOverlay.create)
  725. close = staticmethod(DrawerClose.create)
  726. title = staticmethod(DrawerTitle.create)
  727. description = staticmethod(DrawerDescription.create)
  728. @staticmethod
  729. def __call__(
  730. *children,
  731. open: Optional[Union[Var[bool], bool]] = None,
  732. should_scale_background: Optional[Union[Var[bool], bool]] = None,
  733. close_threshold: Optional[Union[Var[float], float]] = None,
  734. snap_points: Optional[List[Union[float, str]]] = None,
  735. fade_from_index: Optional[Union[Var[int], int]] = None,
  736. scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
  737. modal: Optional[Union[Var[bool], bool]] = None,
  738. direction: Optional[
  739. Union[
  740. Var[Literal["top", "bottom", "left", "right"]],
  741. Literal["top", "bottom", "left", "right"],
  742. ]
  743. ] = None,
  744. preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
  745. as_child: Optional[Union[Var[bool], bool]] = None,
  746. style: Optional[Style] = None,
  747. key: Optional[Any] = None,
  748. id: Optional[Any] = None,
  749. class_name: Optional[Any] = None,
  750. autofocus: Optional[bool] = None,
  751. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  752. on_blur: Optional[
  753. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  754. ] = None,
  755. on_click: Optional[
  756. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  757. ] = None,
  758. on_context_menu: Optional[
  759. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  760. ] = None,
  761. on_double_click: Optional[
  762. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  763. ] = None,
  764. on_focus: Optional[
  765. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  766. ] = None,
  767. on_mount: Optional[
  768. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  769. ] = None,
  770. on_mouse_down: Optional[
  771. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  772. ] = None,
  773. on_mouse_enter: Optional[
  774. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  775. ] = None,
  776. on_mouse_leave: Optional[
  777. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  778. ] = None,
  779. on_mouse_move: Optional[
  780. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  781. ] = None,
  782. on_mouse_out: Optional[
  783. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  784. ] = None,
  785. on_mouse_over: Optional[
  786. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  787. ] = None,
  788. on_mouse_up: Optional[
  789. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  790. ] = None,
  791. on_open_change: Optional[
  792. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  793. ] = None,
  794. on_scroll: Optional[
  795. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  796. ] = None,
  797. on_unmount: Optional[
  798. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  799. ] = None,
  800. **props,
  801. ) -> "DrawerRoot":
  802. """Create the component.
  803. Args:
  804. *children: The children of the component.
  805. open: Whether the drawer is open or not.
  806. should_scale_background: Enable background scaling, it requires an element with [vaul-drawer-wrapper] data attribute to scale its background.
  807. close_threshold: Number between 0 and 1 that determines when the drawer should be closed.
  808. 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.
  809. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
  810. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
  811. modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
  812. direction: Direction of the drawer. Defaults to `"bottom"`
  813. preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
  814. as_child: Change the default rendered element for the one passed as a child.
  815. style: The style of the component.
  816. key: A unique key for the component.
  817. id: The id for the component.
  818. class_name: The class name for the component.
  819. autofocus: Whether the component should take the focus once the page is loaded
  820. custom_attrs: custom attribute
  821. **props: The props of the component.
  822. Returns:
  823. The component.
  824. """
  825. ...
  826. drawer = Drawer()