checkbox.pyi 20 KB

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