button.pyi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. """Stub file for reflex/components/chakra/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.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. _rename_props: Optional[Dict[str, str]] = None,
  98. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  99. on_blur: Optional[
  100. Union[EventHandler, EventSpec, list, function, BaseVar]
  101. ] = None,
  102. on_click: Optional[
  103. Union[EventHandler, EventSpec, list, function, BaseVar]
  104. ] = None,
  105. on_context_menu: Optional[
  106. Union[EventHandler, EventSpec, list, function, BaseVar]
  107. ] = None,
  108. on_double_click: Optional[
  109. Union[EventHandler, EventSpec, list, function, BaseVar]
  110. ] = None,
  111. on_focus: Optional[
  112. Union[EventHandler, EventSpec, list, function, BaseVar]
  113. ] = None,
  114. on_mount: Optional[
  115. Union[EventHandler, EventSpec, list, function, BaseVar]
  116. ] = None,
  117. on_mouse_down: Optional[
  118. Union[EventHandler, EventSpec, list, function, BaseVar]
  119. ] = None,
  120. on_mouse_enter: Optional[
  121. Union[EventHandler, EventSpec, list, function, BaseVar]
  122. ] = None,
  123. on_mouse_leave: Optional[
  124. Union[EventHandler, EventSpec, list, function, BaseVar]
  125. ] = None,
  126. on_mouse_move: Optional[
  127. Union[EventHandler, EventSpec, list, function, BaseVar]
  128. ] = None,
  129. on_mouse_out: Optional[
  130. Union[EventHandler, EventSpec, list, function, BaseVar]
  131. ] = None,
  132. on_mouse_over: Optional[
  133. Union[EventHandler, EventSpec, list, function, BaseVar]
  134. ] = None,
  135. on_mouse_up: Optional[
  136. Union[EventHandler, EventSpec, list, function, BaseVar]
  137. ] = None,
  138. on_scroll: Optional[
  139. Union[EventHandler, EventSpec, list, function, BaseVar]
  140. ] = None,
  141. on_unmount: Optional[
  142. Union[EventHandler, EventSpec, list, function, BaseVar]
  143. ] = None,
  144. **props
  145. ) -> "Button":
  146. """Create the component.
  147. Args:
  148. *children: The children of the component.
  149. icon_spacing: The space between the button icon and label.
  150. is_active: If true, the button will be styled in its active state.
  151. is_disabled: If true, the button will be styled in its disabled state.
  152. is_full_width: If true, the button will take up the full width of its container.
  153. is_loading: If true, the button will show a spinner.
  154. loading_text: The label to show in the button when isLoading is true If no text is passed, it only shows the spinner.
  155. size: "lg" | "md" | "sm" | "xs"
  156. variant: "ghost" | "outline" | "solid" | "link" | "unstyled"
  157. 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"
  158. spinner_placement: Position of the loading spinner. Options: "start" | "end"
  159. type_: The type of button.
  160. name: The name of the form field
  161. style: The style of the component.
  162. key: A unique key for the component.
  163. id: The id for the component.
  164. class_name: The class name for the component.
  165. autofocus: Whether the component should take the focus once the page is loaded
  166. _rename_props: props to change the name of
  167. custom_attrs: custom attribute
  168. **props: The props of the component.
  169. Returns:
  170. The component.
  171. Raises:
  172. TypeError: If an invalid child is passed.
  173. """
  174. ...
  175. class ButtonGroup(ChakraComponent):
  176. @overload
  177. @classmethod
  178. def create( # type: ignore
  179. cls,
  180. *children,
  181. is_attached: Optional[Union[Var[bool], bool]] = None,
  182. is_disabled: Optional[Union[Var[bool], bool]] = None,
  183. spacing: Optional[Union[Var[int], int]] = None,
  184. size: Optional[
  185. Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
  186. ] = None,
  187. variant: Optional[
  188. Union[
  189. Var[Literal["ghost", "outline", "solid", "link", "unstyled"]],
  190. Literal["ghost", "outline", "solid", "link", "unstyled"],
  191. ]
  192. ] = None,
  193. style: Optional[Style] = None,
  194. key: Optional[Any] = None,
  195. id: Optional[Any] = None,
  196. class_name: Optional[Any] = None,
  197. autofocus: Optional[bool] = None,
  198. _rename_props: Optional[Dict[str, str]] = None,
  199. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  200. on_blur: Optional[
  201. Union[EventHandler, EventSpec, list, function, BaseVar]
  202. ] = None,
  203. on_click: Optional[
  204. Union[EventHandler, EventSpec, list, function, BaseVar]
  205. ] = None,
  206. on_context_menu: Optional[
  207. Union[EventHandler, EventSpec, list, function, BaseVar]
  208. ] = None,
  209. on_double_click: Optional[
  210. Union[EventHandler, EventSpec, list, function, BaseVar]
  211. ] = None,
  212. on_focus: Optional[
  213. Union[EventHandler, EventSpec, list, function, BaseVar]
  214. ] = None,
  215. on_mount: Optional[
  216. Union[EventHandler, EventSpec, list, function, BaseVar]
  217. ] = None,
  218. on_mouse_down: Optional[
  219. Union[EventHandler, EventSpec, list, function, BaseVar]
  220. ] = None,
  221. on_mouse_enter: Optional[
  222. Union[EventHandler, EventSpec, list, function, BaseVar]
  223. ] = None,
  224. on_mouse_leave: Optional[
  225. Union[EventHandler, EventSpec, list, function, BaseVar]
  226. ] = None,
  227. on_mouse_move: Optional[
  228. Union[EventHandler, EventSpec, list, function, BaseVar]
  229. ] = None,
  230. on_mouse_out: Optional[
  231. Union[EventHandler, EventSpec, list, function, BaseVar]
  232. ] = None,
  233. on_mouse_over: Optional[
  234. Union[EventHandler, EventSpec, list, function, BaseVar]
  235. ] = None,
  236. on_mouse_up: Optional[
  237. Union[EventHandler, EventSpec, list, function, BaseVar]
  238. ] = None,
  239. on_scroll: Optional[
  240. Union[EventHandler, EventSpec, list, function, BaseVar]
  241. ] = None,
  242. on_unmount: Optional[
  243. Union[EventHandler, EventSpec, list, function, BaseVar]
  244. ] = None,
  245. **props
  246. ) -> "ButtonGroup":
  247. """Create the component.
  248. Args:
  249. *children: The children of the component.
  250. is_attached: If true, the borderRadius of button that are direct children will be altered to look flushed together.
  251. is_disabled: If true, all wrapped button will be disabled.
  252. spacing: The spacing between the buttons.
  253. size: "lg" | "md" | "sm" | "xs"
  254. variant: "ghost" | "outline" | "solid" | "link" | "unstyled"
  255. style: The style of the component.
  256. key: A unique key for the component.
  257. id: The id for the component.
  258. class_name: The class name for the component.
  259. autofocus: Whether the component should take the focus once the page is loaded
  260. _rename_props: props to change the name of
  261. custom_attrs: custom attribute
  262. **props: The props of the component.
  263. Returns:
  264. The component.
  265. Raises:
  266. TypeError: If an invalid child is passed.
  267. """
  268. ...