checkbox.pyi 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. """Stub file for reflex/components/radix/themes/components/checkbox.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 ComponentNamespace
  7. from reflex.components.core.breakpoints import Breakpoints
  8. from reflex.event import BASE_STATE, EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. from ..base import RadixThemesComponent
  12. LiteralCheckboxSize = Literal["1", "2", "3"]
  13. LiteralCheckboxVariant = Literal["classic", "surface", "soft"]
  14. class Checkbox(RadixThemesComponent):
  15. @overload
  16. @classmethod
  17. def create( # type: ignore
  18. cls,
  19. *children,
  20. as_child: Optional[Union[Var[bool], bool]] = None,
  21. size: Optional[
  22. Union[
  23. Breakpoints[str, Literal["1", "2", "3"]],
  24. Literal["1", "2", "3"],
  25. Var[
  26. Union[
  27. Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"]
  28. ]
  29. ],
  30. ]
  31. ] = None,
  32. variant: Optional[
  33. Union[
  34. Literal["classic", "soft", "surface"],
  35. Var[Literal["classic", "soft", "surface"]],
  36. ]
  37. ] = None,
  38. color_scheme: Optional[
  39. Union[
  40. Literal[
  41. "amber",
  42. "blue",
  43. "bronze",
  44. "brown",
  45. "crimson",
  46. "cyan",
  47. "gold",
  48. "grass",
  49. "gray",
  50. "green",
  51. "indigo",
  52. "iris",
  53. "jade",
  54. "lime",
  55. "mint",
  56. "orange",
  57. "pink",
  58. "plum",
  59. "purple",
  60. "red",
  61. "ruby",
  62. "sky",
  63. "teal",
  64. "tomato",
  65. "violet",
  66. "yellow",
  67. ],
  68. Var[
  69. Literal[
  70. "amber",
  71. "blue",
  72. "bronze",
  73. "brown",
  74. "crimson",
  75. "cyan",
  76. "gold",
  77. "grass",
  78. "gray",
  79. "green",
  80. "indigo",
  81. "iris",
  82. "jade",
  83. "lime",
  84. "mint",
  85. "orange",
  86. "pink",
  87. "plum",
  88. "purple",
  89. "red",
  90. "ruby",
  91. "sky",
  92. "teal",
  93. "tomato",
  94. "violet",
  95. "yellow",
  96. ]
  97. ],
  98. ]
  99. ] = None,
  100. high_contrast: Optional[Union[Var[bool], bool]] = None,
  101. default_checked: Optional[Union[Var[bool], bool]] = None,
  102. checked: Optional[Union[Var[bool], bool]] = None,
  103. disabled: Optional[Union[Var[bool], bool]] = None,
  104. required: Optional[Union[Var[bool], bool]] = None,
  105. name: Optional[Union[Var[str], str]] = None,
  106. value: Optional[Union[Var[str], str]] = None,
  107. style: Optional[Style] = None,
  108. key: Optional[Any] = None,
  109. id: Optional[Any] = None,
  110. class_name: Optional[Any] = None,
  111. autofocus: Optional[bool] = None,
  112. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  113. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  114. on_change: Optional[
  115. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  116. ] = None,
  117. on_click: Optional[EventType[[], BASE_STATE]] = None,
  118. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  119. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  120. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  121. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  122. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  123. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  124. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  125. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  126. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  127. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  128. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  129. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  130. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  131. **props,
  132. ) -> "Checkbox":
  133. """Create a new component instance.
  134. Will prepend "RadixThemes" to the component tag to avoid conflicts with
  135. other UI libraries for common names, like Text and Button.
  136. Args:
  137. *children: Child components.
  138. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
  139. size: Checkbox size "1" - "3"
  140. variant: Variant of checkbox: "classic" | "surface" | "soft"
  141. color_scheme: Override theme color for checkbox
  142. high_contrast: Whether to render the checkbox with higher contrast color against background
  143. default_checked: Whether the checkbox is checked by default
  144. checked: Whether the checkbox is checked
  145. disabled: Whether the checkbox is disabled
  146. required: Whether the checkbox is required
  147. name: The name of the checkbox control when submitting the form.
  148. value: The value of the checkbox control when submitting the form.
  149. on_change: Fired when the checkbox is checked or unchecked.
  150. style: The style of the component.
  151. key: A unique key for the component.
  152. id: The id for the component.
  153. class_name: The class name for the component.
  154. autofocus: Whether the component should take the focus once the page is loaded
  155. custom_attrs: custom attribute
  156. **props: Component properties.
  157. Returns:
  158. A new component instance.
  159. """
  160. ...
  161. class HighLevelCheckbox(RadixThemesComponent):
  162. @overload
  163. @classmethod
  164. def create( # type: ignore
  165. cls,
  166. *children,
  167. text: Optional[Union[Var[str], str]] = None,
  168. spacing: Optional[
  169. Union[
  170. Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
  171. Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
  172. ]
  173. ] = None,
  174. size: Optional[
  175. Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]]
  176. ] = None,
  177. as_child: Optional[Union[Var[bool], bool]] = None,
  178. variant: Optional[
  179. Union[
  180. Literal["classic", "soft", "surface"],
  181. Var[Literal["classic", "soft", "surface"]],
  182. ]
  183. ] = None,
  184. color_scheme: Optional[
  185. Union[
  186. Literal[
  187. "amber",
  188. "blue",
  189. "bronze",
  190. "brown",
  191. "crimson",
  192. "cyan",
  193. "gold",
  194. "grass",
  195. "gray",
  196. "green",
  197. "indigo",
  198. "iris",
  199. "jade",
  200. "lime",
  201. "mint",
  202. "orange",
  203. "pink",
  204. "plum",
  205. "purple",
  206. "red",
  207. "ruby",
  208. "sky",
  209. "teal",
  210. "tomato",
  211. "violet",
  212. "yellow",
  213. ],
  214. Var[
  215. Literal[
  216. "amber",
  217. "blue",
  218. "bronze",
  219. "brown",
  220. "crimson",
  221. "cyan",
  222. "gold",
  223. "grass",
  224. "gray",
  225. "green",
  226. "indigo",
  227. "iris",
  228. "jade",
  229. "lime",
  230. "mint",
  231. "orange",
  232. "pink",
  233. "plum",
  234. "purple",
  235. "red",
  236. "ruby",
  237. "sky",
  238. "teal",
  239. "tomato",
  240. "violet",
  241. "yellow",
  242. ]
  243. ],
  244. ]
  245. ] = None,
  246. high_contrast: Optional[Union[Var[bool], bool]] = None,
  247. default_checked: Optional[Union[Var[bool], bool]] = None,
  248. checked: Optional[Union[Var[bool], bool]] = None,
  249. disabled: Optional[Union[Var[bool], bool]] = None,
  250. required: Optional[Union[Var[bool], bool]] = None,
  251. name: Optional[Union[Var[str], str]] = None,
  252. value: Optional[Union[Var[str], str]] = None,
  253. style: Optional[Style] = None,
  254. key: Optional[Any] = None,
  255. id: Optional[Any] = None,
  256. class_name: Optional[Any] = None,
  257. autofocus: Optional[bool] = None,
  258. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  259. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  260. on_change: Optional[
  261. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  262. ] = None,
  263. on_click: Optional[EventType[[], BASE_STATE]] = None,
  264. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  265. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  266. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  267. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  268. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  269. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  270. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  271. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  272. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  273. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  274. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  275. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  276. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  277. **props,
  278. ) -> "HighLevelCheckbox":
  279. """Create a checkbox with a label.
  280. Args:
  281. text: The text of the label.
  282. text: The text label for the checkbox.
  283. spacing: The gap between the checkbox and the label.
  284. size: The size of the checkbox "1" - "3".
  285. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
  286. variant: Variant of checkbox: "classic" | "surface" | "soft"
  287. color_scheme: Override theme color for checkbox
  288. high_contrast: Whether to render the checkbox with higher contrast color against background
  289. default_checked: Whether the checkbox is checked by default
  290. checked: Whether the checkbox is checked
  291. disabled: Whether the checkbox is disabled
  292. required: Whether the checkbox is required
  293. name: The name of the checkbox control when submitting the form.
  294. value: The value of the checkbox control when submitting the form.
  295. on_change: Fired when the checkbox is checked or unchecked.
  296. style: The style of the component.
  297. key: A unique key for the component.
  298. id: The id for the component.
  299. class_name: The class name for the component.
  300. autofocus: Whether the component should take the focus once the page is loaded
  301. custom_attrs: custom attribute
  302. **props: Additional properties to apply to the checkbox item.
  303. Returns:
  304. The checkbox component with a label.
  305. """
  306. ...
  307. class CheckboxNamespace(ComponentNamespace):
  308. @staticmethod
  309. def __call__(
  310. *children,
  311. text: Optional[Union[Var[str], str]] = None,
  312. spacing: Optional[
  313. Union[
  314. Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
  315. Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
  316. ]
  317. ] = None,
  318. size: Optional[
  319. Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]]
  320. ] = None,
  321. as_child: Optional[Union[Var[bool], bool]] = None,
  322. variant: Optional[
  323. Union[
  324. Literal["classic", "soft", "surface"],
  325. Var[Literal["classic", "soft", "surface"]],
  326. ]
  327. ] = None,
  328. color_scheme: Optional[
  329. Union[
  330. Literal[
  331. "amber",
  332. "blue",
  333. "bronze",
  334. "brown",
  335. "crimson",
  336. "cyan",
  337. "gold",
  338. "grass",
  339. "gray",
  340. "green",
  341. "indigo",
  342. "iris",
  343. "jade",
  344. "lime",
  345. "mint",
  346. "orange",
  347. "pink",
  348. "plum",
  349. "purple",
  350. "red",
  351. "ruby",
  352. "sky",
  353. "teal",
  354. "tomato",
  355. "violet",
  356. "yellow",
  357. ],
  358. Var[
  359. Literal[
  360. "amber",
  361. "blue",
  362. "bronze",
  363. "brown",
  364. "crimson",
  365. "cyan",
  366. "gold",
  367. "grass",
  368. "gray",
  369. "green",
  370. "indigo",
  371. "iris",
  372. "jade",
  373. "lime",
  374. "mint",
  375. "orange",
  376. "pink",
  377. "plum",
  378. "purple",
  379. "red",
  380. "ruby",
  381. "sky",
  382. "teal",
  383. "tomato",
  384. "violet",
  385. "yellow",
  386. ]
  387. ],
  388. ]
  389. ] = None,
  390. high_contrast: Optional[Union[Var[bool], bool]] = None,
  391. default_checked: Optional[Union[Var[bool], bool]] = None,
  392. checked: Optional[Union[Var[bool], bool]] = None,
  393. disabled: Optional[Union[Var[bool], bool]] = None,
  394. required: Optional[Union[Var[bool], bool]] = None,
  395. name: Optional[Union[Var[str], str]] = None,
  396. value: Optional[Union[Var[str], str]] = None,
  397. style: Optional[Style] = None,
  398. key: Optional[Any] = None,
  399. id: Optional[Any] = None,
  400. class_name: Optional[Any] = None,
  401. autofocus: Optional[bool] = None,
  402. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  403. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  404. on_change: Optional[
  405. Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
  406. ] = None,
  407. on_click: Optional[EventType[[], BASE_STATE]] = None,
  408. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  409. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  410. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  411. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  412. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  413. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  414. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  415. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  416. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  417. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  418. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  419. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  420. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  421. **props,
  422. ) -> "HighLevelCheckbox":
  423. """Create a checkbox with a label.
  424. Args:
  425. text: The text of the label.
  426. text: The text label for the checkbox.
  427. spacing: The gap between the checkbox and the label.
  428. size: The size of the checkbox "1" - "3".
  429. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
  430. variant: Variant of checkbox: "classic" | "surface" | "soft"
  431. color_scheme: Override theme color for checkbox
  432. high_contrast: Whether to render the checkbox with higher contrast color against background
  433. default_checked: Whether the checkbox is checked by default
  434. checked: Whether the checkbox is checked
  435. disabled: Whether the checkbox is disabled
  436. required: Whether the checkbox is required
  437. name: The name of the checkbox control when submitting the form.
  438. value: The value of the checkbox control when submitting the form.
  439. on_change: Fired when the checkbox is checked or unchecked.
  440. style: The style of the component.
  441. key: A unique key for the component.
  442. id: The id for the component.
  443. class_name: The class name for the component.
  444. autofocus: Whether the component should take the focus once the page is loaded
  445. custom_attrs: custom attribute
  446. **props: Additional properties to apply to the checkbox item.
  447. Returns:
  448. The checkbox component with a label.
  449. """
  450. ...
  451. checkbox = CheckboxNamespace()