drawer.pyi 35 KB

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