@spark-web/text
Version:
--- title: Text storybookPath: typography-text--default isExperimentalPackage: false ---
32 lines (31 loc) • 1.15 kB
TypeScript
import type { SparkTextDefinition, SparkTheme } from '@spark-web/theme';
import type { ForegroundTone } from "./use-foreground-tone.js";
export type UseTextProps = {
/** Apply leading-trim styles. */
baseline?: boolean;
/** The size of the text. */
size: keyof SparkTheme['typography']['text'];
/** The tone of the text. */
tone: ForegroundTone;
/** The weight of the text. */
weight?: keyof SparkTheme['typography']['fontWeight'];
};
export declare function useText({ baseline, size, tone, weight }: UseTextProps): (import("@emotion/serialize").CSSObject | undefined)[];
export declare function createTextStyles({ fontSize, fontWeight, lineHeight, trims }: SparkTextDefinition, { includeTrims, includeWeight }?: {
includeTrims?: boolean | undefined;
includeWeight?: boolean | undefined;
}): {
'::before'?: {
marginBottom: string;
content: string;
display: string;
} | undefined;
'::after'?: {
marginTop: string;
content: string;
display: string;
} | undefined;
fontSize: string;
fontWeight: number | undefined;
lineHeight: string;
};