banner.pyi 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. """Stub file for reflex/components/core/banner.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Callable, Dict, Literal, Optional, Union, overload
  6. from reflex.components.base.bare import Bare
  7. from reflex.components.component import Component
  8. from reflex.components.el.elements.typography import Div
  9. from reflex.components.lucide.icon import Icon
  10. from reflex.components.sonner.toast import Toaster, ToastProps
  11. from reflex.event import EventHandler, EventSpec
  12. from reflex.style import Style
  13. from reflex.utils.imports import ImportDict, ImportVar
  14. from reflex.vars import BaseVar, Var, VarData
  15. connect_error_var_data: VarData
  16. connect_errors: Var
  17. connection_error: Var
  18. connection_errors_count: Var
  19. has_connection_errors: Var
  20. has_too_many_connection_errors: Var
  21. class WebsocketTargetURL(Bare):
  22. def add_imports(self) -> ImportDict: ...
  23. @overload
  24. @classmethod
  25. def create( # type: ignore
  26. cls,
  27. *children,
  28. contents: Optional[Union[Var[str], str]] = None,
  29. style: Optional[Style] = None,
  30. key: Optional[Any] = None,
  31. id: Optional[Any] = None,
  32. class_name: Optional[Any] = None,
  33. autofocus: Optional[bool] = None,
  34. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  35. on_blur: Optional[
  36. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  37. ] = None,
  38. on_click: Optional[
  39. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  40. ] = None,
  41. on_context_menu: Optional[
  42. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  43. ] = None,
  44. on_double_click: Optional[
  45. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  46. ] = None,
  47. on_focus: Optional[
  48. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  49. ] = None,
  50. on_mount: Optional[
  51. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  52. ] = None,
  53. on_mouse_down: Optional[
  54. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  55. ] = None,
  56. on_mouse_enter: Optional[
  57. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  58. ] = None,
  59. on_mouse_leave: Optional[
  60. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  61. ] = None,
  62. on_mouse_move: Optional[
  63. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  64. ] = None,
  65. on_mouse_out: Optional[
  66. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  67. ] = None,
  68. on_mouse_over: Optional[
  69. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  70. ] = None,
  71. on_mouse_up: Optional[
  72. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  73. ] = None,
  74. on_scroll: Optional[
  75. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  76. ] = None,
  77. on_unmount: Optional[
  78. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  79. ] = None,
  80. **props,
  81. ) -> "WebsocketTargetURL":
  82. """Create a websocket target URL component.
  83. Returns:
  84. The websocket target URL component.
  85. """
  86. ...
  87. def default_connection_error() -> list[str | Var | Component]: ...
  88. class ConnectionToaster(Toaster):
  89. def add_hooks(self) -> list[str | Var]: ...
  90. @overload
  91. @classmethod
  92. def create( # type: ignore
  93. cls,
  94. *children,
  95. theme: Optional[Union[Var[str], str]] = None,
  96. rich_colors: Optional[Union[Var[bool], bool]] = None,
  97. expand: Optional[Union[Var[bool], bool]] = None,
  98. visible_toasts: Optional[Union[Var[int], int]] = None,
  99. position: Optional[
  100. Union[
  101. Var[
  102. Literal[
  103. "top-left",
  104. "top-center",
  105. "top-right",
  106. "bottom-left",
  107. "bottom-center",
  108. "bottom-right",
  109. ]
  110. ],
  111. Literal[
  112. "top-left",
  113. "top-center",
  114. "top-right",
  115. "bottom-left",
  116. "bottom-center",
  117. "bottom-right",
  118. ],
  119. ]
  120. ] = None,
  121. close_button: Optional[Union[Var[bool], bool]] = None,
  122. offset: Optional[Union[Var[str], str]] = None,
  123. dir: Optional[Union[Var[str], str]] = None,
  124. hotkey: Optional[Union[Var[str], str]] = None,
  125. invert: Optional[Union[Var[bool], bool]] = None,
  126. toast_options: Optional[Union[Var[ToastProps], ToastProps]] = None,
  127. gap: Optional[Union[Var[int], int]] = None,
  128. loading_icon: Optional[Union[Var[Icon], Icon]] = None,
  129. pause_when_page_is_hidden: Optional[Union[Var[bool], bool]] = None,
  130. style: Optional[Style] = None,
  131. key: Optional[Any] = None,
  132. id: Optional[Any] = None,
  133. class_name: Optional[Any] = None,
  134. autofocus: Optional[bool] = None,
  135. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  136. on_blur: Optional[
  137. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  138. ] = None,
  139. on_click: Optional[
  140. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  141. ] = None,
  142. on_context_menu: Optional[
  143. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  144. ] = None,
  145. on_double_click: Optional[
  146. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  147. ] = None,
  148. on_focus: Optional[
  149. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  150. ] = None,
  151. on_mount: Optional[
  152. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  153. ] = None,
  154. on_mouse_down: Optional[
  155. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  156. ] = None,
  157. on_mouse_enter: Optional[
  158. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  159. ] = None,
  160. on_mouse_leave: Optional[
  161. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  162. ] = None,
  163. on_mouse_move: Optional[
  164. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  165. ] = None,
  166. on_mouse_out: Optional[
  167. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  168. ] = None,
  169. on_mouse_over: Optional[
  170. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  171. ] = None,
  172. on_mouse_up: Optional[
  173. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  174. ] = None,
  175. on_scroll: Optional[
  176. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  177. ] = None,
  178. on_unmount: Optional[
  179. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  180. ] = None,
  181. **props,
  182. ) -> "ConnectionToaster":
  183. """Create a connection toaster component.
  184. Args:
  185. *children: The children of the component.
  186. theme: the theme of the toast
  187. rich_colors: whether to show rich colors
  188. expand: whether to expand the toast
  189. visible_toasts: the number of toasts that are currently visible
  190. position: the position of the toast
  191. close_button: whether to show the close button
  192. offset: offset of the toast
  193. dir: directionality of the toast (default: ltr)
  194. hotkey: Keyboard shortcut that will move focus to the toaster area.
  195. invert: Dark toasts in light mode and vice versa.
  196. toast_options: These will act as default options for all toasts. See toast() for all available options.
  197. gap: Gap between toasts when expanded
  198. loading_icon: Changes the default loading icon
  199. pause_when_page_is_hidden: Pauses toast timers when the page is hidden, e.g., when the tab is backgrounded, the browser is minimized, or the OS is locked.
  200. style: The style of the component.
  201. key: A unique key for the component.
  202. id: The id for the component.
  203. class_name: The class name for the component.
  204. autofocus: Whether the component should take the focus once the page is loaded
  205. custom_attrs: custom attribute
  206. **props: The properties of the component.
  207. Returns:
  208. The connection toaster component.
  209. """
  210. ...
  211. class ConnectionBanner(Component):
  212. @overload
  213. @classmethod
  214. def create( # type: ignore
  215. cls,
  216. *children,
  217. style: Optional[Style] = None,
  218. key: Optional[Any] = None,
  219. id: Optional[Any] = None,
  220. class_name: Optional[Any] = None,
  221. autofocus: Optional[bool] = None,
  222. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  223. on_blur: Optional[
  224. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  225. ] = None,
  226. on_click: Optional[
  227. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  228. ] = None,
  229. on_context_menu: Optional[
  230. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  231. ] = None,
  232. on_double_click: Optional[
  233. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  234. ] = None,
  235. on_focus: Optional[
  236. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  237. ] = None,
  238. on_mount: Optional[
  239. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  240. ] = None,
  241. on_mouse_down: Optional[
  242. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  243. ] = None,
  244. on_mouse_enter: Optional[
  245. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  246. ] = None,
  247. on_mouse_leave: Optional[
  248. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  249. ] = None,
  250. on_mouse_move: Optional[
  251. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  252. ] = None,
  253. on_mouse_out: Optional[
  254. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  255. ] = None,
  256. on_mouse_over: Optional[
  257. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  258. ] = None,
  259. on_mouse_up: Optional[
  260. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  261. ] = None,
  262. on_scroll: Optional[
  263. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  264. ] = None,
  265. on_unmount: Optional[
  266. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  267. ] = None,
  268. **props,
  269. ) -> "ConnectionBanner":
  270. """Create a connection banner component.
  271. Args:
  272. comp: The component to render when there's a server connection error.
  273. Returns:
  274. The connection banner component.
  275. """
  276. ...
  277. class ConnectionModal(Component):
  278. @overload
  279. @classmethod
  280. def create( # type: ignore
  281. cls,
  282. *children,
  283. style: Optional[Style] = None,
  284. key: Optional[Any] = None,
  285. id: Optional[Any] = None,
  286. class_name: Optional[Any] = None,
  287. autofocus: Optional[bool] = None,
  288. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  289. on_blur: Optional[
  290. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  291. ] = None,
  292. on_click: Optional[
  293. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  294. ] = None,
  295. on_context_menu: Optional[
  296. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  297. ] = None,
  298. on_double_click: Optional[
  299. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  300. ] = None,
  301. on_focus: Optional[
  302. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  303. ] = None,
  304. on_mount: Optional[
  305. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  306. ] = None,
  307. on_mouse_down: Optional[
  308. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  309. ] = None,
  310. on_mouse_enter: Optional[
  311. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  312. ] = None,
  313. on_mouse_leave: Optional[
  314. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  315. ] = None,
  316. on_mouse_move: Optional[
  317. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  318. ] = None,
  319. on_mouse_out: Optional[
  320. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  321. ] = None,
  322. on_mouse_over: Optional[
  323. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  324. ] = None,
  325. on_mouse_up: Optional[
  326. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  327. ] = None,
  328. on_scroll: Optional[
  329. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  330. ] = None,
  331. on_unmount: Optional[
  332. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  333. ] = None,
  334. **props,
  335. ) -> "ConnectionModal":
  336. """Create a connection banner component.
  337. Args:
  338. comp: The component to render when there's a server connection error.
  339. Returns:
  340. The connection banner component.
  341. """
  342. ...
  343. class WifiOffPulse(Icon):
  344. @overload
  345. @classmethod
  346. def create( # type: ignore
  347. cls,
  348. *children,
  349. size: Optional[Union[Var[int], int]] = None,
  350. style: Optional[Style] = None,
  351. key: Optional[Any] = None,
  352. id: Optional[Any] = None,
  353. class_name: Optional[Any] = None,
  354. autofocus: Optional[bool] = None,
  355. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  356. on_blur: Optional[
  357. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  358. ] = None,
  359. on_click: Optional[
  360. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  361. ] = None,
  362. on_context_menu: Optional[
  363. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  364. ] = None,
  365. on_double_click: Optional[
  366. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  367. ] = None,
  368. on_focus: Optional[
  369. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  370. ] = None,
  371. on_mount: Optional[
  372. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  373. ] = None,
  374. on_mouse_down: Optional[
  375. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  376. ] = None,
  377. on_mouse_enter: Optional[
  378. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  379. ] = None,
  380. on_mouse_leave: Optional[
  381. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  382. ] = None,
  383. on_mouse_move: Optional[
  384. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  385. ] = None,
  386. on_mouse_out: Optional[
  387. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  388. ] = None,
  389. on_mouse_over: Optional[
  390. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  391. ] = None,
  392. on_mouse_up: Optional[
  393. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  394. ] = None,
  395. on_scroll: Optional[
  396. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  397. ] = None,
  398. on_unmount: Optional[
  399. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  400. ] = None,
  401. **props,
  402. ) -> "WifiOffPulse":
  403. """Create a wifi_off icon with an animated opacity pulse.
  404. Args:
  405. *children: The children of the component.
  406. size: The size of the icon in pixels.
  407. style: The style of the component.
  408. key: A unique key for the component.
  409. id: The id for the component.
  410. class_name: The class name for the component.
  411. autofocus: Whether the component should take the focus once the page is loaded
  412. custom_attrs: custom attribute
  413. **props: The properties of the component.
  414. Returns:
  415. The icon component with default props applied.
  416. """
  417. ...
  418. def add_imports(self) -> dict[str, str | ImportVar | list[str | ImportVar]]: ...
  419. class ConnectionPulser(Div):
  420. @overload
  421. @classmethod
  422. def create( # type: ignore
  423. cls,
  424. *children,
  425. access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  426. auto_capitalize: Optional[
  427. Union[Var[Union[bool, int, str]], str, int, bool]
  428. ] = None,
  429. content_editable: Optional[
  430. Union[Var[Union[bool, int, str]], str, int, bool]
  431. ] = None,
  432. context_menu: Optional[
  433. Union[Var[Union[bool, int, str]], str, int, bool]
  434. ] = None,
  435. dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  436. draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  437. enter_key_hint: Optional[
  438. Union[Var[Union[bool, int, str]], str, int, bool]
  439. ] = None,
  440. hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  441. input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  442. item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  443. lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  444. role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  445. slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  446. spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  447. tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  448. title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
  449. style: Optional[Style] = None,
  450. key: Optional[Any] = None,
  451. id: Optional[Any] = None,
  452. class_name: Optional[Any] = None,
  453. autofocus: Optional[bool] = None,
  454. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  455. on_blur: Optional[
  456. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  457. ] = None,
  458. on_click: Optional[
  459. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  460. ] = None,
  461. on_context_menu: Optional[
  462. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  463. ] = None,
  464. on_double_click: Optional[
  465. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  466. ] = None,
  467. on_focus: Optional[
  468. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  469. ] = None,
  470. on_mount: Optional[
  471. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  472. ] = None,
  473. on_mouse_down: Optional[
  474. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  475. ] = None,
  476. on_mouse_enter: Optional[
  477. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  478. ] = None,
  479. on_mouse_leave: Optional[
  480. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  481. ] = None,
  482. on_mouse_move: Optional[
  483. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  484. ] = None,
  485. on_mouse_out: Optional[
  486. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  487. ] = None,
  488. on_mouse_over: Optional[
  489. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  490. ] = None,
  491. on_mouse_up: Optional[
  492. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  493. ] = None,
  494. on_scroll: Optional[
  495. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  496. ] = None,
  497. on_unmount: Optional[
  498. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  499. ] = None,
  500. **props,
  501. ) -> "ConnectionPulser":
  502. """Create a connection pulser component.
  503. Args:
  504. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  505. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  506. content_editable: Indicates whether the element's content is editable.
  507. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  508. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  509. draggable: Defines whether the element can be dragged.
  510. enter_key_hint: Hints what media types the media element is able to play.
  511. hidden: Defines whether the element is hidden.
  512. input_mode: Defines the type of the element.
  513. item_prop: Defines the name of the element for metadata purposes.
  514. lang: Defines the language used in the element.
  515. role: Defines the role of the element.
  516. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  517. spell_check: Defines whether the element may be checked for spelling errors.
  518. tab_index: Defines the position of the current element in the tabbing order.
  519. title: Defines a tooltip for the element.
  520. style: The style of the component.
  521. key: A unique key for the component.
  522. id: The id for the component.
  523. class_name: The class name for the component.
  524. autofocus: Whether the component should take the focus once the page is loaded
  525. custom_attrs: custom attribute
  526. **props: The properties of the component.
  527. Returns:
  528. The connection pulser component.
  529. """
  530. ...
  531. connection_banner = ConnectionBanner.create
  532. connection_modal = ConnectionModal.create
  533. connection_toaster = ConnectionToaster.create
  534. connection_pulser = ConnectionPulser.create