accordion.pyi 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. """Stub file for reflex/components/radix/primitives/accordion.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 types import SimpleNamespace
  10. from typing import Any, Dict, Literal
  11. from reflex.components.component import Component
  12. from reflex.components.core import cond, match
  13. from reflex.components.lucide.icon import Icon
  14. from reflex.components.radix.primitives.base import RadixPrimitiveComponent
  15. from reflex.style import (
  16. Style,
  17. convert_dict_to_style_and_format_emotion,
  18. format_as_emotion,
  19. )
  20. from reflex.utils import imports
  21. from reflex.vars import BaseVar, Var, VarData
  22. LiteralAccordionType = Literal["single", "multiple"]
  23. LiteralAccordionDir = Literal["ltr", "rtl"]
  24. LiteralAccordionOrientation = Literal["vertical", "horizontal"]
  25. LiteralAccordionRootVariant = Literal["classic", "soft", "surface", "outline", "ghost"]
  26. LiteralAccordionRootColorScheme = Literal["primary", "accent"]
  27. DEFAULT_ANIMATION_DURATION = 250
  28. def get_theme_accordion_root(variant: Var[str], color_scheme: Var[str]) -> BaseVar: ...
  29. def get_theme_accordion_item(): ...
  30. def get_theme_accordion_header() -> dict[str, str]: ...
  31. def get_theme_accordion_trigger(
  32. variant: str | Var, color_scheme: str | Var
  33. ) -> BaseVar: ...
  34. def get_theme_accordion_content(
  35. variant: str | Var, color_scheme: str | Var
  36. ) -> BaseVar: ...
  37. class AccordionComponent(RadixPrimitiveComponent):
  38. @overload
  39. @classmethod
  40. def create( # type: ignore
  41. cls,
  42. *children,
  43. as_child: Optional[Union[Var[bool], bool]] = None,
  44. style: Optional[Style] = None,
  45. key: Optional[Any] = None,
  46. id: Optional[Any] = None,
  47. class_name: Optional[Any] = None,
  48. autofocus: Optional[bool] = None,
  49. _rename_props: Optional[Dict[str, str]] = None,
  50. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  51. on_blur: Optional[
  52. Union[EventHandler, EventSpec, list, function, BaseVar]
  53. ] = None,
  54. on_click: Optional[
  55. Union[EventHandler, EventSpec, list, function, BaseVar]
  56. ] = None,
  57. on_context_menu: Optional[
  58. Union[EventHandler, EventSpec, list, function, BaseVar]
  59. ] = None,
  60. on_double_click: Optional[
  61. Union[EventHandler, EventSpec, list, function, BaseVar]
  62. ] = None,
  63. on_focus: Optional[
  64. Union[EventHandler, EventSpec, list, function, BaseVar]
  65. ] = None,
  66. on_mount: Optional[
  67. Union[EventHandler, EventSpec, list, function, BaseVar]
  68. ] = None,
  69. on_mouse_down: Optional[
  70. Union[EventHandler, EventSpec, list, function, BaseVar]
  71. ] = None,
  72. on_mouse_enter: Optional[
  73. Union[EventHandler, EventSpec, list, function, BaseVar]
  74. ] = None,
  75. on_mouse_leave: Optional[
  76. Union[EventHandler, EventSpec, list, function, BaseVar]
  77. ] = None,
  78. on_mouse_move: Optional[
  79. Union[EventHandler, EventSpec, list, function, BaseVar]
  80. ] = None,
  81. on_mouse_out: Optional[
  82. Union[EventHandler, EventSpec, list, function, BaseVar]
  83. ] = None,
  84. on_mouse_over: Optional[
  85. Union[EventHandler, EventSpec, list, function, BaseVar]
  86. ] = None,
  87. on_mouse_up: Optional[
  88. Union[EventHandler, EventSpec, list, function, BaseVar]
  89. ] = None,
  90. on_scroll: Optional[
  91. Union[EventHandler, EventSpec, list, function, BaseVar]
  92. ] = None,
  93. on_unmount: Optional[
  94. Union[EventHandler, EventSpec, list, function, BaseVar]
  95. ] = None,
  96. **props
  97. ) -> "AccordionComponent":
  98. """Create the component.
  99. Args:
  100. *children: The children of the component.
  101. as_child: Change the default rendered element for the one passed as a child.
  102. style: The style of the component.
  103. key: A unique key for the component.
  104. id: The id for the component.
  105. class_name: The class name for the component.
  106. autofocus: Whether the component should take the focus once the page is loaded
  107. _rename_props: props to change the name of
  108. custom_attrs: custom attribute
  109. **props: The props of the component.
  110. Returns:
  111. The component.
  112. Raises:
  113. TypeError: If an invalid child is passed.
  114. """
  115. ...
  116. class AccordionRoot(AccordionComponent):
  117. @overload
  118. @classmethod
  119. def create( # type: ignore
  120. cls,
  121. *children,
  122. type_: Optional[
  123. Union[Var[Literal["single", "multiple"]], Literal["single", "multiple"]]
  124. ] = None,
  125. value: Optional[Union[Var[str], str]] = None,
  126. default_value: Optional[Union[Var[str], str]] = None,
  127. collapsible: Optional[Union[Var[bool], bool]] = None,
  128. disabled: Optional[Union[Var[bool], bool]] = None,
  129. dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None,
  130. orientation: Optional[
  131. Union[
  132. Var[Literal["vertical", "horizontal"]],
  133. Literal["vertical", "horizontal"],
  134. ]
  135. ] = None,
  136. variant: Optional[
  137. Union[
  138. Var[Literal["classic", "soft", "surface", "outline", "ghost"]],
  139. Literal["classic", "soft", "surface", "outline", "ghost"],
  140. ]
  141. ] = None,
  142. color_scheme: Optional[
  143. Union[Var[Literal["primary", "accent"]], Literal["primary", "accent"]]
  144. ] = None,
  145. _dynamic_themes: Optional[Union[Var[dict], dict]] = None,
  146. _var_data: Optional[VarData] = None,
  147. as_child: Optional[Union[Var[bool], bool]] = None,
  148. style: Optional[Style] = None,
  149. key: Optional[Any] = None,
  150. id: Optional[Any] = None,
  151. class_name: Optional[Any] = None,
  152. autofocus: Optional[bool] = None,
  153. _rename_props: Optional[Dict[str, str]] = None,
  154. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  155. on_blur: Optional[
  156. Union[EventHandler, EventSpec, list, function, BaseVar]
  157. ] = None,
  158. on_click: Optional[
  159. Union[EventHandler, EventSpec, list, function, BaseVar]
  160. ] = None,
  161. on_context_menu: Optional[
  162. Union[EventHandler, EventSpec, list, function, BaseVar]
  163. ] = None,
  164. on_double_click: Optional[
  165. Union[EventHandler, EventSpec, list, function, BaseVar]
  166. ] = None,
  167. on_focus: Optional[
  168. Union[EventHandler, EventSpec, list, function, BaseVar]
  169. ] = None,
  170. on_mount: Optional[
  171. Union[EventHandler, EventSpec, list, function, BaseVar]
  172. ] = None,
  173. on_mouse_down: Optional[
  174. Union[EventHandler, EventSpec, list, function, BaseVar]
  175. ] = None,
  176. on_mouse_enter: Optional[
  177. Union[EventHandler, EventSpec, list, function, BaseVar]
  178. ] = None,
  179. on_mouse_leave: Optional[
  180. Union[EventHandler, EventSpec, list, function, BaseVar]
  181. ] = None,
  182. on_mouse_move: Optional[
  183. Union[EventHandler, EventSpec, list, function, BaseVar]
  184. ] = None,
  185. on_mouse_out: Optional[
  186. Union[EventHandler, EventSpec, list, function, BaseVar]
  187. ] = None,
  188. on_mouse_over: Optional[
  189. Union[EventHandler, EventSpec, list, function, BaseVar]
  190. ] = None,
  191. on_mouse_up: Optional[
  192. Union[EventHandler, EventSpec, list, function, BaseVar]
  193. ] = None,
  194. on_scroll: Optional[
  195. Union[EventHandler, EventSpec, list, function, BaseVar]
  196. ] = None,
  197. on_unmount: Optional[
  198. Union[EventHandler, EventSpec, list, function, BaseVar]
  199. ] = None,
  200. on_value_change: Optional[
  201. Union[EventHandler, EventSpec, list, function, BaseVar]
  202. ] = None,
  203. **props
  204. ) -> "AccordionRoot":
  205. """Create the Accordion root component.
  206. Args:
  207. *children: The children of the component.
  208. type_: The type of accordion (single or multiple).
  209. value: The value of the item to expand.
  210. default_value: The default value of the item to expand.
  211. collapsible: Whether or not the accordion is collapsible.
  212. disabled: Whether or not the accordion is disabled.
  213. dir: The reading direction of the accordion when applicable.
  214. orientation: The orientation of the accordion.
  215. variant: The variant of the accordion.
  216. color_scheme: The color scheme of the accordion.
  217. _dynamic_themes: dynamic themes of the accordion generated at compile time.
  218. _var_data: The var_data associated with the component.
  219. as_child: Change the default rendered element for the one passed as a child.
  220. style: The style of the component.
  221. key: A unique key for the component.
  222. id: The id for the component.
  223. class_name: The class name for the component.
  224. autofocus: Whether the component should take the focus once the page is loaded
  225. _rename_props: props to change the name of
  226. custom_attrs: custom attribute
  227. **props: The properties of the component.
  228. Returns:
  229. The Accordion root Component.
  230. """
  231. ...
  232. def get_event_triggers(self) -> Dict[str, Any]: ...
  233. class AccordionItem(AccordionComponent):
  234. @overload
  235. @classmethod
  236. def create( # type: ignore
  237. cls,
  238. *children,
  239. value: Optional[Union[Var[str], str]] = None,
  240. disabled: Optional[Union[Var[bool], bool]] = None,
  241. as_child: Optional[Union[Var[bool], bool]] = None,
  242. style: Optional[Style] = None,
  243. key: Optional[Any] = None,
  244. id: Optional[Any] = None,
  245. class_name: Optional[Any] = None,
  246. autofocus: Optional[bool] = None,
  247. _rename_props: Optional[Dict[str, str]] = None,
  248. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  249. on_blur: Optional[
  250. Union[EventHandler, EventSpec, list, function, BaseVar]
  251. ] = None,
  252. on_click: Optional[
  253. Union[EventHandler, EventSpec, list, function, BaseVar]
  254. ] = None,
  255. on_context_menu: Optional[
  256. Union[EventHandler, EventSpec, list, function, BaseVar]
  257. ] = None,
  258. on_double_click: Optional[
  259. Union[EventHandler, EventSpec, list, function, BaseVar]
  260. ] = None,
  261. on_focus: Optional[
  262. Union[EventHandler, EventSpec, list, function, BaseVar]
  263. ] = None,
  264. on_mount: Optional[
  265. Union[EventHandler, EventSpec, list, function, BaseVar]
  266. ] = None,
  267. on_mouse_down: Optional[
  268. Union[EventHandler, EventSpec, list, function, BaseVar]
  269. ] = None,
  270. on_mouse_enter: Optional[
  271. Union[EventHandler, EventSpec, list, function, BaseVar]
  272. ] = None,
  273. on_mouse_leave: Optional[
  274. Union[EventHandler, EventSpec, list, function, BaseVar]
  275. ] = None,
  276. on_mouse_move: Optional[
  277. Union[EventHandler, EventSpec, list, function, BaseVar]
  278. ] = None,
  279. on_mouse_out: Optional[
  280. Union[EventHandler, EventSpec, list, function, BaseVar]
  281. ] = None,
  282. on_mouse_over: Optional[
  283. Union[EventHandler, EventSpec, list, function, BaseVar]
  284. ] = None,
  285. on_mouse_up: Optional[
  286. Union[EventHandler, EventSpec, list, function, BaseVar]
  287. ] = None,
  288. on_scroll: Optional[
  289. Union[EventHandler, EventSpec, list, function, BaseVar]
  290. ] = None,
  291. on_unmount: Optional[
  292. Union[EventHandler, EventSpec, list, function, BaseVar]
  293. ] = None,
  294. **props
  295. ) -> "AccordionItem":
  296. """Create the component.
  297. Args:
  298. *children: The children of the component.
  299. value: A unique identifier for the item.
  300. disabled: When true, prevents the user from interacting with the item.
  301. as_child: Change the default rendered element for the one passed as a child.
  302. style: The style of the component.
  303. key: A unique key for the component.
  304. id: The id for the component.
  305. class_name: The class name for the component.
  306. autofocus: Whether the component should take the focus once the page is loaded
  307. _rename_props: props to change the name of
  308. custom_attrs: custom attribute
  309. **props: The props of the component.
  310. Returns:
  311. The component.
  312. Raises:
  313. TypeError: If an invalid child is passed.
  314. """
  315. ...
  316. class AccordionHeader(AccordionComponent):
  317. @overload
  318. @classmethod
  319. def create( # type: ignore
  320. cls,
  321. *children,
  322. as_child: Optional[Union[Var[bool], bool]] = None,
  323. style: Optional[Style] = None,
  324. key: Optional[Any] = None,
  325. id: Optional[Any] = None,
  326. class_name: Optional[Any] = None,
  327. autofocus: Optional[bool] = None,
  328. _rename_props: Optional[Dict[str, str]] = None,
  329. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  330. on_blur: Optional[
  331. Union[EventHandler, EventSpec, list, function, BaseVar]
  332. ] = None,
  333. on_click: Optional[
  334. Union[EventHandler, EventSpec, list, function, BaseVar]
  335. ] = None,
  336. on_context_menu: Optional[
  337. Union[EventHandler, EventSpec, list, function, BaseVar]
  338. ] = None,
  339. on_double_click: Optional[
  340. Union[EventHandler, EventSpec, list, function, BaseVar]
  341. ] = None,
  342. on_focus: Optional[
  343. Union[EventHandler, EventSpec, list, function, BaseVar]
  344. ] = None,
  345. on_mount: Optional[
  346. Union[EventHandler, EventSpec, list, function, BaseVar]
  347. ] = None,
  348. on_mouse_down: Optional[
  349. Union[EventHandler, EventSpec, list, function, BaseVar]
  350. ] = None,
  351. on_mouse_enter: Optional[
  352. Union[EventHandler, EventSpec, list, function, BaseVar]
  353. ] = None,
  354. on_mouse_leave: Optional[
  355. Union[EventHandler, EventSpec, list, function, BaseVar]
  356. ] = None,
  357. on_mouse_move: Optional[
  358. Union[EventHandler, EventSpec, list, function, BaseVar]
  359. ] = None,
  360. on_mouse_out: Optional[
  361. Union[EventHandler, EventSpec, list, function, BaseVar]
  362. ] = None,
  363. on_mouse_over: Optional[
  364. Union[EventHandler, EventSpec, list, function, BaseVar]
  365. ] = None,
  366. on_mouse_up: Optional[
  367. Union[EventHandler, EventSpec, list, function, BaseVar]
  368. ] = None,
  369. on_scroll: Optional[
  370. Union[EventHandler, EventSpec, list, function, BaseVar]
  371. ] = None,
  372. on_unmount: Optional[
  373. Union[EventHandler, EventSpec, list, function, BaseVar]
  374. ] = None,
  375. **props
  376. ) -> "AccordionHeader":
  377. """Create the component.
  378. Args:
  379. *children: The children of the component.
  380. as_child: Change the default rendered element for the one passed as a child.
  381. style: The style of the component.
  382. key: A unique key for the component.
  383. id: The id for the component.
  384. class_name: The class name for the component.
  385. autofocus: Whether the component should take the focus once the page is loaded
  386. _rename_props: props to change the name of
  387. custom_attrs: custom attribute
  388. **props: The props of the component.
  389. Returns:
  390. The component.
  391. Raises:
  392. TypeError: If an invalid child is passed.
  393. """
  394. ...
  395. class AccordionTrigger(AccordionComponent):
  396. @overload
  397. @classmethod
  398. def create( # type: ignore
  399. cls,
  400. *children,
  401. as_child: Optional[Union[Var[bool], bool]] = None,
  402. style: Optional[Style] = None,
  403. key: Optional[Any] = None,
  404. id: Optional[Any] = None,
  405. class_name: Optional[Any] = None,
  406. autofocus: Optional[bool] = None,
  407. _rename_props: Optional[Dict[str, str]] = None,
  408. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  409. on_blur: Optional[
  410. Union[EventHandler, EventSpec, list, function, BaseVar]
  411. ] = None,
  412. on_click: Optional[
  413. Union[EventHandler, EventSpec, list, function, BaseVar]
  414. ] = None,
  415. on_context_menu: Optional[
  416. Union[EventHandler, EventSpec, list, function, BaseVar]
  417. ] = None,
  418. on_double_click: Optional[
  419. Union[EventHandler, EventSpec, list, function, BaseVar]
  420. ] = None,
  421. on_focus: Optional[
  422. Union[EventHandler, EventSpec, list, function, BaseVar]
  423. ] = None,
  424. on_mount: Optional[
  425. Union[EventHandler, EventSpec, list, function, BaseVar]
  426. ] = None,
  427. on_mouse_down: Optional[
  428. Union[EventHandler, EventSpec, list, function, BaseVar]
  429. ] = None,
  430. on_mouse_enter: Optional[
  431. Union[EventHandler, EventSpec, list, function, BaseVar]
  432. ] = None,
  433. on_mouse_leave: Optional[
  434. Union[EventHandler, EventSpec, list, function, BaseVar]
  435. ] = None,
  436. on_mouse_move: Optional[
  437. Union[EventHandler, EventSpec, list, function, BaseVar]
  438. ] = None,
  439. on_mouse_out: Optional[
  440. Union[EventHandler, EventSpec, list, function, BaseVar]
  441. ] = None,
  442. on_mouse_over: Optional[
  443. Union[EventHandler, EventSpec, list, function, BaseVar]
  444. ] = None,
  445. on_mouse_up: Optional[
  446. Union[EventHandler, EventSpec, list, function, BaseVar]
  447. ] = None,
  448. on_scroll: Optional[
  449. Union[EventHandler, EventSpec, list, function, BaseVar]
  450. ] = None,
  451. on_unmount: Optional[
  452. Union[EventHandler, EventSpec, list, function, BaseVar]
  453. ] = None,
  454. **props
  455. ) -> "AccordionTrigger":
  456. """Create the component.
  457. Args:
  458. *children: The children of the component.
  459. as_child: Change the default rendered element for the one passed as a child.
  460. style: The style of the component.
  461. key: A unique key for the component.
  462. id: The id for the component.
  463. class_name: The class name for the component.
  464. autofocus: Whether the component should take the focus once the page is loaded
  465. _rename_props: props to change the name of
  466. custom_attrs: custom attribute
  467. **props: The props of the component.
  468. Returns:
  469. The component.
  470. Raises:
  471. TypeError: If an invalid child is passed.
  472. """
  473. ...
  474. class AccordionContent(AccordionComponent):
  475. @overload
  476. @classmethod
  477. def create( # type: ignore
  478. cls,
  479. *children,
  480. as_child: Optional[Union[Var[bool], bool]] = None,
  481. style: Optional[Style] = None,
  482. key: Optional[Any] = None,
  483. id: Optional[Any] = None,
  484. class_name: Optional[Any] = None,
  485. autofocus: Optional[bool] = None,
  486. _rename_props: Optional[Dict[str, str]] = None,
  487. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  488. on_blur: Optional[
  489. Union[EventHandler, EventSpec, list, function, BaseVar]
  490. ] = None,
  491. on_click: Optional[
  492. Union[EventHandler, EventSpec, list, function, BaseVar]
  493. ] = None,
  494. on_context_menu: Optional[
  495. Union[EventHandler, EventSpec, list, function, BaseVar]
  496. ] = None,
  497. on_double_click: Optional[
  498. Union[EventHandler, EventSpec, list, function, BaseVar]
  499. ] = None,
  500. on_focus: Optional[
  501. Union[EventHandler, EventSpec, list, function, BaseVar]
  502. ] = None,
  503. on_mount: Optional[
  504. Union[EventHandler, EventSpec, list, function, BaseVar]
  505. ] = None,
  506. on_mouse_down: Optional[
  507. Union[EventHandler, EventSpec, list, function, BaseVar]
  508. ] = None,
  509. on_mouse_enter: Optional[
  510. Union[EventHandler, EventSpec, list, function, BaseVar]
  511. ] = None,
  512. on_mouse_leave: Optional[
  513. Union[EventHandler, EventSpec, list, function, BaseVar]
  514. ] = None,
  515. on_mouse_move: Optional[
  516. Union[EventHandler, EventSpec, list, function, BaseVar]
  517. ] = None,
  518. on_mouse_out: Optional[
  519. Union[EventHandler, EventSpec, list, function, BaseVar]
  520. ] = None,
  521. on_mouse_over: Optional[
  522. Union[EventHandler, EventSpec, list, function, BaseVar]
  523. ] = None,
  524. on_mouse_up: Optional[
  525. Union[EventHandler, EventSpec, list, function, BaseVar]
  526. ] = None,
  527. on_scroll: Optional[
  528. Union[EventHandler, EventSpec, list, function, BaseVar]
  529. ] = None,
  530. on_unmount: Optional[
  531. Union[EventHandler, EventSpec, list, function, BaseVar]
  532. ] = None,
  533. **props
  534. ) -> "AccordionContent":
  535. """Create the component.
  536. Args:
  537. *children: The children of the component.
  538. as_child: Change the default rendered element for the one passed as a child.
  539. style: The style of the component.
  540. key: A unique key for the component.
  541. id: The id for the component.
  542. class_name: The class name for the component.
  543. autofocus: Whether the component should take the focus once the page is loaded
  544. _rename_props: props to change the name of
  545. custom_attrs: custom attribute
  546. **props: The props of the component.
  547. Returns:
  548. The component.
  549. Raises:
  550. TypeError: If an invalid child is passed.
  551. """
  552. ...
  553. def accordion_item(header: Component, content: Component, **props) -> Component: ...
  554. class Accordion(SimpleNamespace):
  555. content = staticmethod(AccordionContent.create)
  556. header = staticmethod(AccordionHeader.create)
  557. item = staticmethod(accordion_item)
  558. root = staticmethod(AccordionRoot.create)
  559. trigger = staticmethod(AccordionTrigger.create)
  560. accordion = Accordion()