UNPKG

@spark-web/heading

Version:

--- title: Heading storybookPath: typography-heading--default isExperimentalPackage: false ---

43 lines (42 loc) 3.62 kB
import type { BoxProps } from '@spark-web/box'; import type { DataAttributeMap } from '@spark-web/utils/internal'; import type { ReactNode } from 'react'; import type { UseHeadingProps } from "./use-heading.js"; /** * Heading * * @description Constrained, purposeful set of heading styles as a component. */ export declare const Heading: <Comp extends import("react").ElementType = "h1">(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"> & UseHeadingProps & { /** The text content. */ children?: ReactNode; /** Sets data attributes on the component. */ data?: DataAttributeMap; /** An identifier which must be unique in the whole document. */ id?: BoxProps["id"]; /** The tone of the text. */ tone?: "primary" | "primaryActive" | "neutral" | "muted"; /** Truncate text to a single line. */ truncate?: boolean; /** Truncate the text with an ellipsis after computing the text layout, including line wrapping, * such that the total number of lines does not exceed this number. */ numberOfLines?: number; }) => import("react").ReactElement; export type HeadingProps = UseHeadingProps & { /** The text content. */ children?: ReactNode; /** Sets data attributes on the component. */ data?: DataAttributeMap; /** An identifier which must be unique in the whole document. */ id?: BoxProps['id']; /** The tone of the text. */ tone?: 'primary' | 'primaryActive' | 'neutral' | 'muted'; /** Truncate text to a single line. */ truncate?: boolean; /** Truncate the text with an ellipsis after computing the text layout, including line wrapping, * such that the total number of lines does not exceed this number. */ numberOfLines?: number; };