UNPKG

@spark-web/text-link

Version:

--- title: Text Link storybookPath: navigation-textlink--default isExperimentalPackage: true ---

36 lines (35 loc) 3.64 kB
/// <reference types="react" /> import type { LinkComponentProps } from '@spark-web/link'; import type { ForegroundTone } from '@spark-web/text'; import type { SparkTheme } from '@spark-web/theme'; import type { TextDecoration } from '@spark-web/theme/src/themes/_types/typography'; import type { DataAttributeMap } from '@spark-web/utils/internal'; export declare type TextLinkProps = { /** Sets data attributes on the component. */ data?: DataAttributeMap; /** Overrides the tone of the Text Context */ tone?: ForegroundTone; /** Override the weight of the Text Link */ weight?: keyof SparkTheme['typography']['fontWeight']; /** Override the textDecoration of the Text Link */ textDecoration?: TextDecoration; } & LinkComponentProps; /** * Text links are used as navigational elements. They may appear on their own, * within a sentence or paragraph, or directly following content. * * @note If you are **only** providing "onClick" use `TextLinkButton` instead. */ export declare const TextLink: <Comp extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "a">(props: { as?: Comp | undefined; ref?: import("react").Ref<Comp extends "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined; } & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & { /** Sets data attributes on the component. */ data?: DataAttributeMap | undefined; /** Overrides the tone of the Text Context */ tone?: string | number | undefined; /** Override the weight of the Text Link */ weight?: "bold" | "medium" | "light" | "thin" | "black" | "extralight" | "regular" | "semibold" | "extrabold" | undefined; /** Override the textDecoration of the Text Link */ textDecoration?: TextDecoration | undefined; } & LinkComponentProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;