button.pyi 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. """Stub file for reflex/components/forms/button.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `scripts/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.vars import Var, BaseVar, ComputedVar
  7. from reflex.event import EventChain, EventHandler, EventSpec
  8. from reflex.style import Style
  9. from typing import List
  10. from reflex.components.libs.chakra import (
  11. ChakraComponent,
  12. LiteralButtonSize,
  13. LiteralButtonVariant,
  14. LiteralColorScheme,
  15. LiteralSpinnerPlacement,
  16. )
  17. from reflex.vars import Var
  18. class Button(ChakraComponent):
  19. @overload
  20. @classmethod
  21. def create( # type: ignore
  22. cls,
  23. *children,
  24. icon_spacing: Optional[Union[Var[int], int]] = None,
  25. is_active: Optional[Union[Var[bool], bool]] = None,
  26. is_disabled: Optional[Union[Var[bool], bool]] = None,
  27. is_full_width: Optional[Union[Var[bool], bool]] = None,
  28. is_loading: Optional[Union[Var[bool], bool]] = None,
  29. loading_text: Optional[Union[Var[str], str]] = None,
  30. size: Optional[
  31. Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
  32. ] = None,
  33. variant: Optional[
  34. Union[
  35. Var[Literal["ghost", "outline", "solid", "link", "unstyled"]],
  36. Literal["ghost", "outline", "solid", "link", "unstyled"],
  37. ]
  38. ] = None,
  39. color_scheme: Optional[
  40. Union[
  41. Var[
  42. Literal[
  43. "none",
  44. "gray",
  45. "red",
  46. "orange",
  47. "yellow",
  48. "green",
  49. "teal",
  50. "blue",
  51. "cyan",
  52. "purple",
  53. "pink",
  54. "whiteAlpha",
  55. "blackAlpha",
  56. "linkedin",
  57. "facebook",
  58. "messenger",
  59. "whatsapp",
  60. "twitter",
  61. "telegram",
  62. ]
  63. ],
  64. Literal[
  65. "none",
  66. "gray",
  67. "red",
  68. "orange",
  69. "yellow",
  70. "green",
  71. "teal",
  72. "blue",
  73. "cyan",
  74. "purple",
  75. "pink",
  76. "whiteAlpha",
  77. "blackAlpha",
  78. "linkedin",
  79. "facebook",
  80. "messenger",
  81. "whatsapp",
  82. "twitter",
  83. "telegram",
  84. ],
  85. ]
  86. ] = None,
  87. spinner_placement: Optional[
  88. Union[Var[Literal["start", "end"]], Literal["start", "end"]]
  89. ] = None,
  90. type_: Optional[Union[Var[str], str]] = None,
  91. name: Optional[Union[Var[str], str]] = None,
  92. style: Optional[Style] = None,
  93. key: Optional[Any] = None,
  94. id: Optional[Any] = None,
  95. class_name: Optional[Any] = None,
  96. autofocus: Optional[bool] = None,
  97. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  98. on_blur: Optional[
  99. Union[EventHandler, EventSpec, list, function, BaseVar]
  100. ] = None,
  101. on_click: Optional[
  102. Union[EventHandler, EventSpec, list, function, BaseVar]
  103. ] = None,
  104. on_context_menu: Optional[
  105. Union[EventHandler, EventSpec, list, function, BaseVar]
  106. ] = None,
  107. on_double_click: Optional[
  108. Union[EventHandler, EventSpec, list, function, BaseVar]
  109. ] = None,
  110. on_focus: Optional[
  111. Union[EventHandler, EventSpec, list, function, BaseVar]
  112. ] = None,
  113. on_mount: Optional[
  114. Union[EventHandler, EventSpec, list, function, BaseVar]
  115. ] = None,
  116. on_mouse_down: Optional[
  117. Union[EventHandler, EventSpec, list, function, BaseVar]
  118. ] = None,
  119. on_mouse_enter: Optional[
  120. Union[EventHandler, EventSpec, list, function, BaseVar]
  121. ] = None,
  122. on_mouse_leave: Optional[
  123. Union[EventHandler, EventSpec, list, function, BaseVar]
  124. ] = None,
  125. on_mouse_move: Optional[
  126. Union[EventHandler, EventSpec, list, function, BaseVar]
  127. ] = None,
  128. on_mouse_out: Optional[
  129. Union[EventHandler, EventSpec, list, function, BaseVar]
  130. ] = None,
  131. on_mouse_over: Optional[
  132. Union[EventHandler, EventSpec, list, function, BaseVar]
  133. ] = None,
  134. on_mouse_up: Optional[
  135. Union[EventHandler, EventSpec, list, function, BaseVar]
  136. ] = None,
  137. on_scroll: Optional[
  138. Union[EventHandler, EventSpec, list, function, BaseVar]
  139. ] = None,
  140. on_unmount: Optional[
  141. Union[EventHandler, EventSpec, list, function, BaseVar]
  142. ] = None,
  143. **props
  144. ) -> "Button":
  145. """Create the component.
  146. Args:
  147. *children: The children of the component.
  148. icon_spacing: The space between the button icon and label.
  149. is_active: If true, the button will be styled in its active state.
  150. is_disabled: If true, the button will be styled in its disabled state.
  151. is_full_width: If true, the button will take up the full width of its container.
  152. is_loading: If true, the button will show a spinner.
  153. loading_text: The label to show in the button when isLoading is true If no text is passed, it only shows the spinner.
  154. size: "lg" | "md" | "sm" | "xs"
  155. variant: "ghost" | "outline" | "solid" | "link" | "unstyled"
  156. color_scheme: Built in color scheme for ease of use. Options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"
  157. spinner_placement: Position of the loading spinner. Options: "start" | "end"
  158. type_: The type of button.
  159. name: The name of the form field
  160. style: The style of the component.
  161. key: A unique key for the component.
  162. id: The id for the component.
  163. class_name: The class name for the component.
  164. autofocus: Whether the component should take the focus once the page is loaded
  165. custom_attrs: custom attribute
  166. **props: The props of the component.
  167. Returns:
  168. The component.
  169. Raises:
  170. TypeError: If an invalid child is passed.
  171. """
  172. ...
  173. class ButtonGroup(ChakraComponent):
  174. @overload
  175. @classmethod
  176. def create( # type: ignore
  177. cls,
  178. *children,
  179. is_attached: Optional[Union[Var[bool], bool]] = None,
  180. is_disabled: Optional[Union[Var[bool], bool]] = None,
  181. spacing: Optional[Union[Var[int], int]] = None,
  182. size: Optional[
  183. Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
  184. ] = None,
  185. variant: Optional[
  186. Union[
  187. Var[Literal["ghost", "outline", "solid", "link", "unstyled"]],
  188. Literal["ghost", "outline", "solid", "link", "unstyled"],
  189. ]
  190. ] = None,
  191. style: Optional[Style] = None,
  192. key: Optional[Any] = None,
  193. id: Optional[Any] = None,
  194. class_name: Optional[Any] = None,
  195. autofocus: Optional[bool] = None,
  196. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  197. on_blur: Optional[
  198. Union[EventHandler, EventSpec, list, function, BaseVar]
  199. ] = None,
  200. on_click: Optional[
  201. Union[EventHandler, EventSpec, list, function, BaseVar]
  202. ] = None,
  203. on_context_menu: Optional[
  204. Union[EventHandler, EventSpec, list, function, BaseVar]
  205. ] = None,
  206. on_double_click: Optional[
  207. Union[EventHandler, EventSpec, list, function, BaseVar]
  208. ] = None,
  209. on_focus: Optional[
  210. Union[EventHandler, EventSpec, list, function, BaseVar]
  211. ] = None,
  212. on_mount: Optional[
  213. Union[EventHandler, EventSpec, list, function, BaseVar]
  214. ] = None,
  215. on_mouse_down: Optional[
  216. Union[EventHandler, EventSpec, list, function, BaseVar]
  217. ] = None,
  218. on_mouse_enter: Optional[
  219. Union[EventHandler, EventSpec, list, function, BaseVar]
  220. ] = None,
  221. on_mouse_leave: Optional[
  222. Union[EventHandler, EventSpec, list, function, BaseVar]
  223. ] = None,
  224. on_mouse_move: Optional[
  225. Union[EventHandler, EventSpec, list, function, BaseVar]
  226. ] = None,
  227. on_mouse_out: Optional[
  228. Union[EventHandler, EventSpec, list, function, BaseVar]
  229. ] = None,
  230. on_mouse_over: Optional[
  231. Union[EventHandler, EventSpec, list, function, BaseVar]
  232. ] = None,
  233. on_mouse_up: Optional[
  234. Union[EventHandler, EventSpec, list, function, BaseVar]
  235. ] = None,
  236. on_scroll: Optional[
  237. Union[EventHandler, EventSpec, list, function, BaseVar]
  238. ] = None,
  239. on_unmount: Optional[
  240. Union[EventHandler, EventSpec, list, function, BaseVar]
  241. ] = None,
  242. **props
  243. ) -> "ButtonGroup":
  244. """Create the component.
  245. Args:
  246. *children: The children of the component.
  247. is_attached: If true, the borderRadius of button that are direct children will be altered to look flushed together.
  248. is_disabled: If true, all wrapped button will be disabled.
  249. spacing: The spacing between the buttons.
  250. size: "lg" | "md" | "sm" | "xs"
  251. variant: "ghost" | "outline" | "solid" | "link" | "unstyled"
  252. style: The style of the component.
  253. key: A unique key for the component.
  254. id: The id for the component.
  255. class_name: The class name for the component.
  256. autofocus: Whether the component should take the focus once the page is loaded
  257. custom_attrs: custom attribute
  258. **props: The props of the component.
  259. Returns:
  260. The component.
  261. Raises:
  262. TypeError: If an invalid child is passed.
  263. """
  264. ...