|
@@ -8,7 +8,8 @@ from reflex.vars import Var, BaseVar, ComputedVar
|
|
from reflex.event import EventChain, EventHandler, EventSpec
|
|
from reflex.event import EventChain, EventHandler, EventSpec
|
|
from reflex.style import Style
|
|
from reflex.style import Style
|
|
from typing import Literal
|
|
from typing import Literal
|
|
-from reflex.components.component import Component
|
|
|
|
|
|
+from reflex.components.component import Component, MemoizationLeaf
|
|
|
|
+from reflex.components.core.cond import cond
|
|
from reflex.components.el.elements.inline import A
|
|
from reflex.components.el.elements.inline import A
|
|
from reflex.components.next.link import NextLink
|
|
from reflex.components.next.link import NextLink
|
|
from reflex.utils import imports
|
|
from reflex.utils import imports
|
|
@@ -19,7 +20,7 @@ from .base import LiteralTextSize, LiteralTextTrim, LiteralTextWeight
|
|
LiteralLinkUnderline = Literal["auto", "hover", "always"]
|
|
LiteralLinkUnderline = Literal["auto", "hover", "always"]
|
|
next_link = NextLink.create()
|
|
next_link = NextLink.create()
|
|
|
|
|
|
-class Link(RadixThemesComponent, A):
|
|
|
|
|
|
+class Link(RadixThemesComponent, A, MemoizationLeaf):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
@@ -113,6 +114,7 @@ class Link(RadixThemesComponent, A):
|
|
]
|
|
]
|
|
] = None,
|
|
] = None,
|
|
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
+ is_external: Optional[Union[Var[bool], bool]] = None,
|
|
download: Optional[
|
|
download: Optional[
|
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
] = None,
|
|
] = None,
|
|
@@ -238,6 +240,7 @@ class Link(RadixThemesComponent, A):
|
|
underline: Sets the visibility of the underline affordance: "auto" | "hover" | "always"
|
|
underline: Sets the visibility of the underline affordance: "auto" | "hover" | "always"
|
|
color_scheme: Overrides the accent color inherited from the Theme.
|
|
color_scheme: Overrides the accent color inherited from the Theme.
|
|
high_contrast: Whether to render the text with higher contrast color
|
|
high_contrast: Whether to render the text with higher contrast color
|
|
|
|
+ is_external: If True, the link will open in a new tab
|
|
download: Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
|
|
download: Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
|
|
href: Specifies the URL of the page the link goes to
|
|
href: Specifies the URL of the page the link goes to
|
|
href_lang: Specifies the language of the linked document
|
|
href_lang: Specifies the language of the linked document
|