@spark-web/heading
Version:
--- title: Heading storybookPath: typography-heading--default isExperimentalPackage: false ---
37 lines (36 loc) • 3.26 kB
TypeScript
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';
/**
* Heading
*
* @description Constrained, purposeful set of heading styles as a component.
*/
export declare const Heading: <Comp extends import("react").ElementType<any> = "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" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "set" | 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" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "set">)[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 | undefined;
/** An identifier which must be unique in the whole document. */
id?: BoxProps['id'];
/** The tone of the text. */
tone?: "neutral" | "primary" | undefined;
/** Truncate text to a single line. */
truncate?: boolean | undefined;
}) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
export declare 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' | 'neutral';
/** Truncate text to a single line. */
truncate?: boolean;
};