1
0

drawer.pyi 35 KB

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