banner.pyi 16 KB

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