banner.pyi 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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, Dict, Literal, Optional, Union, overload
  6. from reflex.components.base.fragment import Fragment
  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.constants.compiler import CompileVars
  12. from reflex.event import EventType
  13. from reflex.style import Style
  14. from reflex.utils.imports import ImportVar
  15. from reflex.vars import VarData
  16. from reflex.vars.base import Var
  17. from reflex.vars.number import BooleanVar
  18. connect_error_var_data: VarData
  19. connect_errors = Var(
  20. _js_expr=CompileVars.CONNECT_ERROR, _var_data=connect_error_var_data
  21. )
  22. connection_error = Var(
  23. _js_expr="((connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : '')",
  24. _var_data=connect_error_var_data,
  25. )
  26. connection_errors_count = Var(
  27. _js_expr="connectErrors.length", _var_data=connect_error_var_data
  28. )
  29. has_connection_errors = Var(
  30. _js_expr="(connectErrors.length > 0)", _var_data=connect_error_var_data
  31. ).to(BooleanVar)
  32. has_too_many_connection_errors = Var(
  33. _js_expr="(connectErrors.length >= 2)", _var_data=connect_error_var_data
  34. ).to(BooleanVar)
  35. class WebsocketTargetURL(Var):
  36. @classmethod
  37. def create(cls) -> Var: ... # type: ignore
  38. def default_connection_error() -> list[str | Var | Component]: ...
  39. class ConnectionToaster(Toaster):
  40. def add_hooks(self) -> list[str | Var]: ...
  41. @overload
  42. @classmethod
  43. def create( # type: ignore
  44. cls,
  45. *children,
  46. theme: Optional[Union[Var[str], str]] = None,
  47. rich_colors: Optional[Union[Var[bool], bool]] = None,
  48. expand: Optional[Union[Var[bool], bool]] = None,
  49. visible_toasts: Optional[Union[Var[int], int]] = None,
  50. position: Optional[
  51. Union[
  52. Literal[
  53. "bottom-center",
  54. "bottom-left",
  55. "bottom-right",
  56. "top-center",
  57. "top-left",
  58. "top-right",
  59. ],
  60. Var[
  61. Literal[
  62. "bottom-center",
  63. "bottom-left",
  64. "bottom-right",
  65. "top-center",
  66. "top-left",
  67. "top-right",
  68. ]
  69. ],
  70. ]
  71. ] = None,
  72. close_button: Optional[Union[Var[bool], bool]] = None,
  73. offset: Optional[Union[Var[str], str]] = None,
  74. dir: Optional[Union[Var[str], str]] = None,
  75. hotkey: Optional[Union[Var[str], str]] = None,
  76. invert: Optional[Union[Var[bool], bool]] = None,
  77. toast_options: Optional[Union[ToastProps, Var[ToastProps]]] = None,
  78. gap: Optional[Union[Var[int], int]] = None,
  79. loading_icon: Optional[Union[Icon, Var[Icon]]] = None,
  80. pause_when_page_is_hidden: Optional[Union[Var[bool], bool]] = None,
  81. style: Optional[Style] = None,
  82. key: Optional[Any] = None,
  83. id: Optional[Any] = None,
  84. class_name: Optional[Any] = None,
  85. autofocus: Optional[bool] = None,
  86. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  87. on_blur: Optional[EventType[()]] = None,
  88. on_click: Optional[EventType[()]] = None,
  89. on_context_menu: Optional[EventType[()]] = None,
  90. on_double_click: Optional[EventType[()]] = None,
  91. on_focus: Optional[EventType[()]] = None,
  92. on_mount: Optional[EventType[()]] = None,
  93. on_mouse_down: Optional[EventType[()]] = None,
  94. on_mouse_enter: Optional[EventType[()]] = None,
  95. on_mouse_leave: Optional[EventType[()]] = None,
  96. on_mouse_move: Optional[EventType[()]] = None,
  97. on_mouse_out: Optional[EventType[()]] = None,
  98. on_mouse_over: Optional[EventType[()]] = None,
  99. on_mouse_up: Optional[EventType[()]] = None,
  100. on_scroll: Optional[EventType[()]] = None,
  101. on_unmount: Optional[EventType[()]] = None,
  102. **props,
  103. ) -> "ConnectionToaster":
  104. """Create a connection toaster component.
  105. Args:
  106. *children: The children of the component.
  107. theme: the theme of the toast
  108. rich_colors: whether to show rich colors
  109. expand: whether to expand the toast
  110. visible_toasts: the number of toasts that are currently visible
  111. position: the position of the toast
  112. close_button: whether to show the close button
  113. offset: offset of the toast
  114. dir: directionality of the toast (default: ltr)
  115. hotkey: Keyboard shortcut that will move focus to the toaster area.
  116. invert: Dark toasts in light mode and vice versa.
  117. toast_options: These will act as default options for all toasts. See toast() for all available options.
  118. gap: Gap between toasts when expanded
  119. loading_icon: Changes the default loading icon
  120. 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.
  121. style: The style of the component.
  122. key: A unique key for the component.
  123. id: The id for the component.
  124. class_name: The class name for the component.
  125. autofocus: Whether the component should take the focus once the page is loaded
  126. custom_attrs: custom attribute
  127. **props: The properties of the component.
  128. Returns:
  129. The connection toaster component.
  130. """
  131. ...
  132. class ConnectionBanner(Fragment):
  133. @overload
  134. @classmethod
  135. def create( # type: ignore
  136. cls,
  137. *children,
  138. style: Optional[Style] = None,
  139. key: Optional[Any] = None,
  140. id: Optional[Any] = None,
  141. class_name: Optional[Any] = None,
  142. autofocus: Optional[bool] = None,
  143. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  144. on_blur: Optional[EventType[()]] = None,
  145. on_click: Optional[EventType[()]] = None,
  146. on_context_menu: Optional[EventType[()]] = None,
  147. on_double_click: Optional[EventType[()]] = None,
  148. on_focus: Optional[EventType[()]] = None,
  149. on_mount: Optional[EventType[()]] = None,
  150. on_mouse_down: Optional[EventType[()]] = None,
  151. on_mouse_enter: Optional[EventType[()]] = None,
  152. on_mouse_leave: Optional[EventType[()]] = None,
  153. on_mouse_move: Optional[EventType[()]] = None,
  154. on_mouse_out: Optional[EventType[()]] = None,
  155. on_mouse_over: Optional[EventType[()]] = None,
  156. on_mouse_up: Optional[EventType[()]] = None,
  157. on_scroll: Optional[EventType[()]] = None,
  158. on_unmount: Optional[EventType[()]] = None,
  159. **props,
  160. ) -> "ConnectionBanner":
  161. """Create a connection banner component.
  162. Args:
  163. comp: The component to render when there's a server connection error.
  164. Returns:
  165. The connection banner component.
  166. """
  167. ...
  168. class ConnectionModal(Fragment):
  169. @overload
  170. @classmethod
  171. def create( # type: ignore
  172. cls,
  173. *children,
  174. style: Optional[Style] = None,
  175. key: Optional[Any] = None,
  176. id: Optional[Any] = None,
  177. class_name: Optional[Any] = None,
  178. autofocus: Optional[bool] = None,
  179. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  180. on_blur: Optional[EventType[()]] = None,
  181. on_click: Optional[EventType[()]] = None,
  182. on_context_menu: Optional[EventType[()]] = None,
  183. on_double_click: Optional[EventType[()]] = None,
  184. on_focus: Optional[EventType[()]] = None,
  185. on_mount: Optional[EventType[()]] = None,
  186. on_mouse_down: Optional[EventType[()]] = None,
  187. on_mouse_enter: Optional[EventType[()]] = None,
  188. on_mouse_leave: Optional[EventType[()]] = None,
  189. on_mouse_move: Optional[EventType[()]] = None,
  190. on_mouse_out: Optional[EventType[()]] = None,
  191. on_mouse_over: Optional[EventType[()]] = None,
  192. on_mouse_up: Optional[EventType[()]] = None,
  193. on_scroll: Optional[EventType[()]] = None,
  194. on_unmount: Optional[EventType[()]] = None,
  195. **props,
  196. ) -> "ConnectionModal":
  197. """Create a connection banner component.
  198. Args:
  199. comp: The component to render when there's a server connection error.
  200. Returns:
  201. The connection banner component.
  202. """
  203. ...
  204. class WifiOffPulse(Icon):
  205. @overload
  206. @classmethod
  207. def create( # type: ignore
  208. cls,
  209. *children,
  210. size: Optional[Union[Var[int], int]] = None,
  211. style: Optional[Style] = None,
  212. key: Optional[Any] = None,
  213. id: Optional[Any] = None,
  214. class_name: Optional[Any] = None,
  215. autofocus: Optional[bool] = None,
  216. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  217. on_blur: Optional[EventType[()]] = None,
  218. on_click: Optional[EventType[()]] = None,
  219. on_context_menu: Optional[EventType[()]] = None,
  220. on_double_click: Optional[EventType[()]] = None,
  221. on_focus: Optional[EventType[()]] = None,
  222. on_mount: Optional[EventType[()]] = None,
  223. on_mouse_down: Optional[EventType[()]] = None,
  224. on_mouse_enter: Optional[EventType[()]] = None,
  225. on_mouse_leave: Optional[EventType[()]] = None,
  226. on_mouse_move: Optional[EventType[()]] = None,
  227. on_mouse_out: Optional[EventType[()]] = None,
  228. on_mouse_over: Optional[EventType[()]] = None,
  229. on_mouse_up: Optional[EventType[()]] = None,
  230. on_scroll: Optional[EventType[()]] = None,
  231. on_unmount: Optional[EventType[()]] = None,
  232. **props,
  233. ) -> "WifiOffPulse":
  234. """Create a wifi_off icon with an animated opacity pulse.
  235. Args:
  236. *children: The children of the component.
  237. size: The size of the icon in pixels.
  238. style: The style of the component.
  239. key: A unique key for the component.
  240. id: The id for the component.
  241. class_name: The class name for the component.
  242. autofocus: Whether the component should take the focus once the page is loaded
  243. custom_attrs: custom attribute
  244. **props: The properties of the component.
  245. Returns:
  246. The icon component with default props applied.
  247. """
  248. ...
  249. def add_imports(self) -> dict[str, str | ImportVar | list[str | ImportVar]]: ...
  250. class ConnectionPulser(Div):
  251. @overload
  252. @classmethod
  253. def create( # type: ignore
  254. cls,
  255. *children,
  256. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  257. auto_capitalize: Optional[
  258. Union[Var[Union[bool, int, str]], bool, int, str]
  259. ] = None,
  260. content_editable: Optional[
  261. Union[Var[Union[bool, int, str]], bool, int, str]
  262. ] = None,
  263. context_menu: Optional[
  264. Union[Var[Union[bool, int, str]], bool, int, str]
  265. ] = None,
  266. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  267. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  268. enter_key_hint: Optional[
  269. Union[Var[Union[bool, int, str]], bool, int, str]
  270. ] = None,
  271. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  272. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  273. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  274. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  275. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  276. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  277. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  278. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  279. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = 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, Any]]] = None,
  286. on_blur: Optional[EventType[()]] = None,
  287. on_click: Optional[EventType[()]] = None,
  288. on_context_menu: Optional[EventType[()]] = None,
  289. on_double_click: Optional[EventType[()]] = None,
  290. on_focus: Optional[EventType[()]] = None,
  291. on_mount: Optional[EventType[()]] = None,
  292. on_mouse_down: Optional[EventType[()]] = None,
  293. on_mouse_enter: Optional[EventType[()]] = None,
  294. on_mouse_leave: Optional[EventType[()]] = None,
  295. on_mouse_move: Optional[EventType[()]] = None,
  296. on_mouse_out: Optional[EventType[()]] = None,
  297. on_mouse_over: Optional[EventType[()]] = None,
  298. on_mouse_up: Optional[EventType[()]] = None,
  299. on_scroll: Optional[EventType[()]] = None,
  300. on_unmount: Optional[EventType[()]] = None,
  301. **props,
  302. ) -> "ConnectionPulser":
  303. """Create a connection pulser component.
  304. Args:
  305. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  306. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  307. content_editable: Indicates whether the element's content is editable.
  308. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  309. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  310. draggable: Defines whether the element can be dragged.
  311. enter_key_hint: Hints what media types the media element is able to play.
  312. hidden: Defines whether the element is hidden.
  313. input_mode: Defines the type of the element.
  314. item_prop: Defines the name of the element for metadata purposes.
  315. lang: Defines the language used in the element.
  316. role: Defines the role of the element.
  317. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  318. spell_check: Defines whether the element may be checked for spelling errors.
  319. tab_index: Defines the position of the current element in the tabbing order.
  320. title: Defines a tooltip for the element.
  321. style: The style of the component.
  322. key: A unique key for the component.
  323. id: The id for the component.
  324. class_name: The class name for the component.
  325. autofocus: Whether the component should take the focus once the page is loaded
  326. custom_attrs: custom attribute
  327. **props: The properties of the component.
  328. Returns:
  329. The connection pulser component.
  330. """
  331. ...
  332. class BackendDisabled(Div):
  333. @overload
  334. @classmethod
  335. def create( # type: ignore
  336. cls,
  337. *children,
  338. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  339. auto_capitalize: Optional[
  340. Union[Var[Union[bool, int, str]], bool, int, str]
  341. ] = None,
  342. content_editable: Optional[
  343. Union[Var[Union[bool, int, str]], bool, int, str]
  344. ] = None,
  345. context_menu: Optional[
  346. Union[Var[Union[bool, int, str]], bool, int, str]
  347. ] = None,
  348. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  349. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  350. enter_key_hint: Optional[
  351. Union[Var[Union[bool, int, str]], bool, int, str]
  352. ] = None,
  353. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  354. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  355. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  356. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  357. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  358. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  359. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  360. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  361. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  362. style: Optional[Style] = None,
  363. key: Optional[Any] = None,
  364. id: Optional[Any] = None,
  365. class_name: Optional[Any] = None,
  366. autofocus: Optional[bool] = None,
  367. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  368. on_blur: Optional[EventType[()]] = None,
  369. on_click: Optional[EventType[()]] = None,
  370. on_context_menu: Optional[EventType[()]] = None,
  371. on_double_click: Optional[EventType[()]] = None,
  372. on_focus: Optional[EventType[()]] = None,
  373. on_mount: Optional[EventType[()]] = None,
  374. on_mouse_down: Optional[EventType[()]] = None,
  375. on_mouse_enter: Optional[EventType[()]] = None,
  376. on_mouse_leave: Optional[EventType[()]] = None,
  377. on_mouse_move: Optional[EventType[()]] = None,
  378. on_mouse_out: Optional[EventType[()]] = None,
  379. on_mouse_over: Optional[EventType[()]] = None,
  380. on_mouse_up: Optional[EventType[()]] = None,
  381. on_scroll: Optional[EventType[()]] = None,
  382. on_unmount: Optional[EventType[()]] = None,
  383. **props,
  384. ) -> "BackendDisabled":
  385. """Create a backend disabled component.
  386. Args:
  387. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  388. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  389. content_editable: Indicates whether the element's content is editable.
  390. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  391. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  392. draggable: Defines whether the element can be dragged.
  393. enter_key_hint: Hints what media types the media element is able to play.
  394. hidden: Defines whether the element is hidden.
  395. input_mode: Defines the type of the element.
  396. item_prop: Defines the name of the element for metadata purposes.
  397. lang: Defines the language used in the element.
  398. role: Defines the role of the element.
  399. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  400. spell_check: Defines whether the element may be checked for spelling errors.
  401. tab_index: Defines the position of the current element in the tabbing order.
  402. title: Defines a tooltip for the element.
  403. style: The style of the component.
  404. key: A unique key for the component.
  405. id: The id for the component.
  406. class_name: The class name for the component.
  407. autofocus: Whether the component should take the focus once the page is loaded
  408. custom_attrs: custom attribute
  409. **props: The properties of the component.
  410. Returns:
  411. The backend disabled component.
  412. """
  413. ...
  414. connection_banner = ConnectionBanner.create
  415. connection_modal = ConnectionModal.create
  416. connection_toaster = ConnectionToaster.create
  417. connection_pulser = ConnectionPulser.create
  418. backend_disabled = BackendDisabled.create