drawer.pyi 34 KB

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