link.pyi 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. """Stub file for reflex/components/radix/themes/typography/link.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Literal, Optional, overload
  6. from reflex.components.component import MemoizationLeaf
  7. from reflex.components.core.breakpoints import Breakpoints
  8. from reflex.components.el.elements.inline import A
  9. from reflex.components.markdown.markdown import MarkdownComponentMap
  10. from reflex.components.next.link import NextLink
  11. from reflex.event import EventType
  12. from reflex.style import Style
  13. from reflex.utils.imports import ImportDict
  14. from reflex.vars.base import Var
  15. from ..base import RadixThemesComponent
  16. LiteralLinkUnderline = Literal["auto", "hover", "always", "none"]
  17. next_link = NextLink.create()
  18. class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap):
  19. def add_imports(self) -> ImportDict: ...
  20. @overload
  21. @classmethod
  22. def create( # type: ignore
  23. cls,
  24. *children,
  25. as_child: Var[bool] | bool | None = None,
  26. size: Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]]
  27. | Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]
  28. | Var[
  29. Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]]
  30. | Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]
  31. ]
  32. | None = None,
  33. weight: Breakpoints[str, Literal["bold", "light", "medium", "regular"]]
  34. | Literal["bold", "light", "medium", "regular"]
  35. | Var[
  36. Breakpoints[str, Literal["bold", "light", "medium", "regular"]]
  37. | Literal["bold", "light", "medium", "regular"]
  38. ]
  39. | None = None,
  40. trim: Breakpoints[str, Literal["both", "end", "normal", "start"]]
  41. | Literal["both", "end", "normal", "start"]
  42. | Var[
  43. Breakpoints[str, Literal["both", "end", "normal", "start"]]
  44. | Literal["both", "end", "normal", "start"]
  45. ]
  46. | None = None,
  47. underline: Literal["always", "auto", "hover", "none"]
  48. | Var[Literal["always", "auto", "hover", "none"]]
  49. | None = None,
  50. color_scheme: Literal[
  51. "amber",
  52. "blue",
  53. "bronze",
  54. "brown",
  55. "crimson",
  56. "cyan",
  57. "gold",
  58. "grass",
  59. "gray",
  60. "green",
  61. "indigo",
  62. "iris",
  63. "jade",
  64. "lime",
  65. "mint",
  66. "orange",
  67. "pink",
  68. "plum",
  69. "purple",
  70. "red",
  71. "ruby",
  72. "sky",
  73. "teal",
  74. "tomato",
  75. "violet",
  76. "yellow",
  77. ]
  78. | Var[
  79. Literal[
  80. "amber",
  81. "blue",
  82. "bronze",
  83. "brown",
  84. "crimson",
  85. "cyan",
  86. "gold",
  87. "grass",
  88. "gray",
  89. "green",
  90. "indigo",
  91. "iris",
  92. "jade",
  93. "lime",
  94. "mint",
  95. "orange",
  96. "pink",
  97. "plum",
  98. "purple",
  99. "red",
  100. "ruby",
  101. "sky",
  102. "teal",
  103. "tomato",
  104. "violet",
  105. "yellow",
  106. ]
  107. ]
  108. | None = None,
  109. high_contrast: Var[bool] | bool | None = None,
  110. is_external: Var[bool] | bool | None = None,
  111. download: Var[bool | str] | bool | str | None = None,
  112. href: Var[str] | str | None = None,
  113. href_lang: Var[str] | str | None = None,
  114. media: Var[str] | str | None = None,
  115. ping: Var[str] | str | None = None,
  116. referrer_policy: Literal[
  117. "",
  118. "no-referrer",
  119. "no-referrer-when-downgrade",
  120. "origin",
  121. "origin-when-cross-origin",
  122. "same-origin",
  123. "strict-origin",
  124. "strict-origin-when-cross-origin",
  125. "unsafe-url",
  126. ]
  127. | Var[
  128. Literal[
  129. "",
  130. "no-referrer",
  131. "no-referrer-when-downgrade",
  132. "origin",
  133. "origin-when-cross-origin",
  134. "same-origin",
  135. "strict-origin",
  136. "strict-origin-when-cross-origin",
  137. "unsafe-url",
  138. ]
  139. ]
  140. | None = None,
  141. rel: Var[str] | str | None = None,
  142. target: Literal["_blank", "_parent", "_self", "_top"]
  143. | Var[Literal["_blank", "_parent", "_self", "_top"] | str]
  144. | str
  145. | None = None,
  146. access_key: Var[str] | str | None = None,
  147. auto_capitalize: Literal[
  148. "characters", "none", "off", "on", "sentences", "words"
  149. ]
  150. | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
  151. | None = None,
  152. content_editable: Literal["inherit", "plaintext-only", False, True]
  153. | Var[Literal["inherit", "plaintext-only", False, True]]
  154. | None = None,
  155. context_menu: Var[str] | str | None = None,
  156. dir: Var[str] | str | None = None,
  157. draggable: Var[bool] | bool | None = None,
  158. enter_key_hint: Literal[
  159. "done", "enter", "go", "next", "previous", "search", "send"
  160. ]
  161. | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
  162. | None = None,
  163. hidden: Var[bool] | bool | None = None,
  164. input_mode: Literal[
  165. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  166. ]
  167. | Var[
  168. Literal[
  169. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  170. ]
  171. ]
  172. | None = None,
  173. item_prop: Var[str] | str | None = None,
  174. lang: Var[str] | str | None = None,
  175. role: Literal[
  176. "alert",
  177. "alertdialog",
  178. "application",
  179. "article",
  180. "banner",
  181. "button",
  182. "cell",
  183. "checkbox",
  184. "columnheader",
  185. "combobox",
  186. "complementary",
  187. "contentinfo",
  188. "definition",
  189. "dialog",
  190. "directory",
  191. "document",
  192. "feed",
  193. "figure",
  194. "form",
  195. "grid",
  196. "gridcell",
  197. "group",
  198. "heading",
  199. "img",
  200. "link",
  201. "list",
  202. "listbox",
  203. "listitem",
  204. "log",
  205. "main",
  206. "marquee",
  207. "math",
  208. "menu",
  209. "menubar",
  210. "menuitem",
  211. "menuitemcheckbox",
  212. "menuitemradio",
  213. "navigation",
  214. "none",
  215. "note",
  216. "option",
  217. "presentation",
  218. "progressbar",
  219. "radio",
  220. "radiogroup",
  221. "region",
  222. "row",
  223. "rowgroup",
  224. "rowheader",
  225. "scrollbar",
  226. "search",
  227. "searchbox",
  228. "separator",
  229. "slider",
  230. "spinbutton",
  231. "status",
  232. "switch",
  233. "tab",
  234. "table",
  235. "tablist",
  236. "tabpanel",
  237. "term",
  238. "textbox",
  239. "timer",
  240. "toolbar",
  241. "tooltip",
  242. "tree",
  243. "treegrid",
  244. "treeitem",
  245. ]
  246. | Var[
  247. Literal[
  248. "alert",
  249. "alertdialog",
  250. "application",
  251. "article",
  252. "banner",
  253. "button",
  254. "cell",
  255. "checkbox",
  256. "columnheader",
  257. "combobox",
  258. "complementary",
  259. "contentinfo",
  260. "definition",
  261. "dialog",
  262. "directory",
  263. "document",
  264. "feed",
  265. "figure",
  266. "form",
  267. "grid",
  268. "gridcell",
  269. "group",
  270. "heading",
  271. "img",
  272. "link",
  273. "list",
  274. "listbox",
  275. "listitem",
  276. "log",
  277. "main",
  278. "marquee",
  279. "math",
  280. "menu",
  281. "menubar",
  282. "menuitem",
  283. "menuitemcheckbox",
  284. "menuitemradio",
  285. "navigation",
  286. "none",
  287. "note",
  288. "option",
  289. "presentation",
  290. "progressbar",
  291. "radio",
  292. "radiogroup",
  293. "region",
  294. "row",
  295. "rowgroup",
  296. "rowheader",
  297. "scrollbar",
  298. "search",
  299. "searchbox",
  300. "separator",
  301. "slider",
  302. "spinbutton",
  303. "status",
  304. "switch",
  305. "tab",
  306. "table",
  307. "tablist",
  308. "tabpanel",
  309. "term",
  310. "textbox",
  311. "timer",
  312. "toolbar",
  313. "tooltip",
  314. "tree",
  315. "treegrid",
  316. "treeitem",
  317. ]
  318. ]
  319. | None = None,
  320. slot: Var[str] | str | None = None,
  321. spell_check: Var[bool] | bool | None = None,
  322. tab_index: Var[int] | int | None = None,
  323. title: Var[str] | str | None = None,
  324. style: Style | None = None,
  325. key: Any | None = None,
  326. id: Any | None = None,
  327. class_name: Any | None = None,
  328. autofocus: bool | None = None,
  329. custom_attrs: dict[str, Var | Any] | None = None,
  330. on_blur: Optional[EventType[()]] = None,
  331. on_click: Optional[EventType[()]] = None,
  332. on_context_menu: Optional[EventType[()]] = None,
  333. on_double_click: Optional[EventType[()]] = None,
  334. on_focus: Optional[EventType[()]] = None,
  335. on_mount: Optional[EventType[()]] = None,
  336. on_mouse_down: Optional[EventType[()]] = None,
  337. on_mouse_enter: Optional[EventType[()]] = None,
  338. on_mouse_leave: Optional[EventType[()]] = None,
  339. on_mouse_move: Optional[EventType[()]] = None,
  340. on_mouse_out: Optional[EventType[()]] = None,
  341. on_mouse_over: Optional[EventType[()]] = None,
  342. on_mouse_up: Optional[EventType[()]] = None,
  343. on_scroll: Optional[EventType[()]] = None,
  344. on_unmount: Optional[EventType[()]] = None,
  345. **props,
  346. ) -> "Link":
  347. """Create a Link component.
  348. Args:
  349. *children: The children of the component.
  350. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
  351. size: Text size: "1" - "9"
  352. weight: Thickness of text: "light" | "regular" | "medium" | "bold"
  353. trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
  354. underline: Sets the visibility of the underline affordance: "auto" | "hover" | "always" | "none"
  355. color_scheme: Overrides the accent color inherited from the Theme.
  356. high_contrast: Whether to render the text with higher contrast color
  357. is_external: If True, the link will open in a new tab
  358. download: Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
  359. href: Specifies the URL of the page the link goes to
  360. href_lang: Specifies the language of the linked document
  361. media: Specifies what media/device the linked document is optimized for
  362. ping: Specifies which referrer is sent when fetching the resource
  363. referrer_policy: Specifies the relationship between the current document and the linked document
  364. rel: Specifies the relationship between the linked document and the current document
  365. target: Specifies where to open the linked document
  366. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  367. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  368. content_editable: Indicates whether the element's content is editable.
  369. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  370. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  371. draggable: Defines whether the element can be dragged.
  372. enter_key_hint: Hints what media types the media element is able to play.
  373. hidden: Defines whether the element is hidden.
  374. input_mode: Defines the type of the element.
  375. item_prop: Defines the name of the element for metadata purposes.
  376. lang: Defines the language used in the element.
  377. role: Defines the role of the element.
  378. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  379. spell_check: Defines whether the element may be checked for spelling errors.
  380. tab_index: Defines the position of the current element in the tabbing order.
  381. title: Defines a tooltip for the element.
  382. style: The style of the component.
  383. key: A unique key for the component.
  384. id: The id for the component.
  385. class_name: The class name for the component.
  386. autofocus: Whether the component should take the focus once the page is loaded
  387. custom_attrs: custom attribute
  388. **props: The props of the component.
  389. Raises:
  390. ValueError: in case of missing children
  391. Returns:
  392. Component: The link component
  393. """
  394. ...
  395. link = Link.create