import { type ReactNode } from "react"; import { type AccessibilityRole, type GestureResponderEvent, type TextLayoutEventData, type NativeSyntheticEvent } from "react-native"; import { type StyleProp, type TextStyle } from "../../style/index.js"; import { type Role, type Tone, type Weight, type Leading, type Decoration, type Numerals } from "./typography.styles.js"; export interface TypographyProps { /** Use the system terminal face while retaining the selected reading role and size. */ terminal?: boolean; /** A section heading owning its count, metadata and trailing actions. */ section?: boolean; count?: number | string; description?: string; actions?: ReactNode; /** Exact Argus reading roles; these preserve the original dense web type. */ subheading?: boolean; label?: boolean; micro?: boolean; tag?: boolean; eyebrow?: boolean; eyebrowLg?: boolean; stageLabel?: boolean; statValue?: boolean; metricValue?: boolean; formValue?: boolean; extraBold?: boolean; uppercase?: boolean; foreground?: boolean; inverse?: boolean; action?: boolean; actionForeground?: boolean; info?: boolean; /** Hue-keyed stage text; deep in light schemes, pastel in dark. */ hue?: number; /** De-emphasized white ink over branded surfaces. */ inverseHint?: boolean; inverseSubtle?: boolean; inverseMuted?: boolean; inverseSoft?: boolean; inverseFaint?: boolean; right?: boolean; center?: boolean; numberOfLines?: number; /** * The text's laid-out lines, as React Native reports them (each line's `y`, `height`, * `ascender` and `descender`, so its baseline is `y + height - descender`): for drawing * something on the text's own lines, such as an illustration over a word. Fired by the * native platforms; the web does not report it. */ onTextLayout?: (event: NativeSyntheticEvent) => void; accessibilityRole?: AccessibilityRole; accessibilityLabel?: string; /** * The heading level assistive tech hears, independent of the visual role: a heading * role exposes its own level (display and h1 at 1, h2 to h5 at 2 to 5) unless this * overrides it, so `` draws the h3 size and is announced as * a level-2 heading (a real `

` on the web). On a non-heading role it makes the * text a heading at that level. Semantics only: it never changes the look. `href` * still wins (a link is not a heading). */ level?: HeadingLevel; displayLeading?: boolean; singleLeading?: boolean; lockupLeading?: boolean; denseLeading?: boolean; compactLeading?: boolean; labelLeading?: boolean; captionLeading?: boolean; smallLeading?: boolean; strongLeading?: boolean; bodyLeading?: boolean; relaxedLeading?: boolean; displayTracking?: boolean; tightTracking?: boolean; referenceTracking?: boolean; labelTracking?: boolean; eyebrowTracking?: boolean; wideTracking?: boolean; expandedTracking?: boolean; children?: ReactNode; /** * The hand-off's hero headline: the display face sized by the window, * `clamp(56px, 7.2vw, 112px)` at a .94 line and -.045em tracking (56 px on a phone, 103.68 * at a 1440 window, 112 from 1556 up). One per page, its lead line. A level-1 heading. */ hero?: boolean; /** * The hand-off's page title (a component page's name): the display face sized by the * window, `clamp(40px, 5vw, 64px)` at a 1.0 line and -.04em tracking. A level-1 heading. */ pageTitle?: boolean; /** A page section's heading (a component page's Playground, Variants...): the display face, 500 28/1.1, -.02em. A level-2 heading. */ sectionTitle?: boolean; /** A feature card's title: the display face, 500 22/1.15, -.02em. A level-3 heading. */ cardTitle?: boolean; /** A panel's or dialog's title: the display face, 500 20/1.2, -.02em. */ panelTitle?: boolean; /** The one-line tagline under a section's title: the display face, 400 22/1.3, -.015em, in the foreground ink. */ tagline?: boolean; /** A page's summary under its title: 400 18/1.55 in the secondary ink. */ pageLead?: boolean; /** A section's introductory paragraph: 400 17/1.55 in the secondary ink. */ sectionLead?: boolean; /** A feature card's description: 400 14/1.55 in the secondary ink. */ cardBody?: boolean; /** The note under a page section's heading: 400 14/1.5 in the secondary ink. */ sectionNote?: boolean; /** A page's body paragraph (a component page's usage line): 400 15/1.6 in the secondary ink, held to an 80ch measure. */ pageBody?: boolean; /** A page's note paragraph (a component page's overview and docs notes): 400 14/1.6 in the secondary ink, held to an 80ch measure. */ pageNote?: boolean; /** * A page's label (a panel's "Props", a rail's group header, a table's header cell, a * previous/next eyebrow): 500 11/1 tracked .08em in caps, in the subtle ink. Pass `mono` * for the mono face, as the other page roles do. Not the `eyebrow`, which is the type * table's accent-ink label tracked .1em. */ pageLabel?: boolean; /** * A knob panel's label row (a knob's name, and the type hint beside it with `muted`, the * third ink): 500 12/1 in the secondary ink. Pass `mono` for the mono face, as the * hand-off's page does. */ knobLabel?: boolean; /** A guidance card's title: 600 16/1.3 in the interface face. A level-3 heading. */ guideTitle?: boolean; /** A guidance card's paragraph: 400 13.5/1.6 in the secondary ink. */ guideBody?: boolean; /** A pager card's name (the previous or next page under its label): the display face, 500 18 on the face's own 22 line, in the foreground ink. */ pagerName?: boolean; /** * A reference sheet's meta cell (a props table's type or default): 400 12/1.55 in the * foreground ink. Pass `mono` for the mono face and `subtle` or `muted` for the ink, as * the sheet's cells take them. */ specMeta?: boolean; /** A reference sheet's text cell (a props table's description, an inherited-props note): 400 13/1.55 in the secondary ink. */ specText?: boolean; /** * A pager card's label (Previous, Next): the page label's 500 11 tracked .08em in caps * and subtle ink on the face's own 14 line (the hand-off sets no ratio there). Pass * `mono` for the mono face, as the page label takes it. */ pagerLabel?: boolean; /** A legend row's label (an anatomy part's name beside its numbered disc): 500 14 on the face's own 18 line, in the foreground ink. */ legendLabel?: boolean; /** A specimen tile's caption strip (a size or state name under its well): 500 12 on the face's own 16 line, in the secondary ink. Pass `mono` for the mono face. */ tileCaption?: boolean; /** A variant card's title (an example's label over its note and snippet): 500 14/1.3 in the interface face and the foreground ink. */ variantTitle?: boolean; /** A link tile's name (a related component beside its arrow): 600 14 on the face's own 18 line, in the foreground ink. */ linkName?: boolean; /** A page section's own sub-heading (the "Related components" title over its tiles): 600 16 on the face's own 20 line in the interface face. A level-3 heading. */ subsectionTitle?: boolean; /** * A section card's foot caption, or a note inside the card: 400 12/1.6 (19.2) in the * subtle ink. Pass `mono` for the mono face, as the hand-off sets it. */ cardNote?: boolean; /** * A code name on its own line (a variant row's label, a token's name): 400 12 on the mono * face's 16 line, in the secondary ink. Pass `mono` for the mono face. */ codeLabel?: boolean; /** A short note beside a specimen: 400 12 on the interface face's 15 line, in the subtle ink. */ inlineNote?: boolean; /** A tile's title: the display face, 500 15/1.3 (19.5), in the foreground ink. */ tileTitle?: boolean; /** A grid widget's label: 500 10 mono tracked .08em in caps on a 13 line, in the subtle ink. */ gridLabel?: boolean; /** A scale's tick label: 500 10 mono on a 13 line, in the secondary ink. */ tick?: boolean; /** A stat row's label: 500 11/1 mono tracked .06em in caps, in the subtle ink. */ rowLabel?: boolean; /** A stat row's value beside its label: the display face, 500 22/1, -.02em, in the foreground ink. */ rowValue?: boolean; /** A card's headline figure: the display face, 500 26/1, -.02em, in the foreground ink. */ headlineValue?: boolean; /** A card's big number: the display face, 500 40/1, -.03em, in the foreground ink. */ bigNumber?: boolean; /** * The unit after a figure: 400 16 on the interface face's 20 line, in the subtle ink. Nest * it inside the figure's Typography so it shares the figure's baseline (`107 components`). */ unit?: boolean; /** A pane's title: the display face, 500 16/1.2, -.01em, in the foreground ink. Pass `level` to announce it as a heading. */ paneTitle?: boolean; /** A sample's caption (a hue number, a series name): 400 11 on the mono face's 14 line, in the subtle ink. Pass `mono`. */ sampleLabel?: boolean; /** A sample's meta line (a hex value, a size): 400 10 on the mono face's 13 line, in the subtle ink. Pass `mono`. */ sampleMeta?: boolean; /** The 14 px body in the foreground ink: 400 14 on the interface face's 18 line (a description list's value). */ base?: boolean; display?: boolean; h1?: boolean; h2?: boolean; h3?: boolean; h4?: boolean; h5?: boolean; lead?: boolean; body?: boolean; small?: boolean; tiny?: boolean; muted?: boolean; caption?: boolean; code?: boolean; mono?: boolean; /** * With `code`: the prose code chip, a word of code inside a sentence. Regular weight at * .88 of the surrounding reading role's size (pass that role beside it, `lead`, `small`, * `pageBody`, `pageNote`, `pageLead` or `sectionLead`; body when none), the chip's own * small corner, 1 by 5 padding, the surface fill and a hairline rim. Natively a Text nested in a Text draws * the fill and horizontal padding only. Without `code` it does nothing. */ inline?: boolean; subtle?: boolean; primary?: boolean; destructive?: boolean; success?: boolean; warning?: boolean; /** * The fixed cyan series hue (the hand-off's `--cyan`, `chart-2`) as an ink, whatever the * palette, solved to 4.5:1 on the scheme's surfaces. */ cyan?: boolean; /** The fixed mint series hue (the hand-off's `--mint`, `chart-3`) as an ink, whatever the palette, solved like `cyan`. */ mint?: boolean; regular?: boolean; medium?: boolean; semibold?: boolean; bold?: boolean; /** * Leading (orthogonal to role). Pulls the line box in to 1.25x the font size for a * STACKED LOCKUP, where two lines read as one unit (a wordmark over its tagline, a * title over its subtitle) and the roles reading leading would leave dead air between * them. Only ever tightens, so it is safe on every role. Omit for prose: the role's * own line height is the reading value. */ tightLeading?: boolean; /** * Leading: the face's own normal line at the role's size, the line the hand-off's text * takes where it sets a size with no ratio (JetBrains Mono 10, 11 and 12 px on 13, 14 and * 16; Instrument Sans 12, 13 and 14 on 15, 16 and 18; Bricolage Grotesque 14 and 15 on 17 * and 18). The face is the one the text is set in (`mono`, a display role, or the * interface face). A size off the measured table (10 to 28 px) keeps the role's line. */ natural?: boolean; /** * Decoration (orthogonal to role / tone / weight). Underlines the text so an inline * text link reads as a link, replacing the banned raw `textDecorationLine` style * shim. Combines freely with every role, tone, and weight; omit for undecorated text. */ underline?: boolean; /** * Slant (orthogonal to role / tone / weight / decoration). Sets the text in the face's * italic, for a word set off in prose or the italic mark of a formatting toolbar. Omit * for upright text. */ italic?: boolean; /** * Numerals (orthogonal to role / tone / weight). Tabular figures: every digit the same * width, for numbers read down a column or updated in place (a table's figures, a live * metric, a counter), so the column lines up and a changing value holds still. Never * for prose, which keeps the face's own proportional figures. */ tabular?: boolean; /** * Renders this text as a REAL inline link on the web: react-native-web * gives the root element a browser link with this destination, so * middle-click, cmd-click, and open-in-new-tab work and assistive tech * hears a link. Native platforms have no browser links and ignore it, so * pair `href` with an `onPress` running the same navigation through the * host's router. Combine with `underline` for the conventional link look. * When a heading role and `href` are both set, the link role wins. */ href?: string; /** Attributes forwarded with `href` on the web: `target`, `rel`, `download`. */ hrefAttrs?: { target?: "_blank" | "_self"; rel?: string; download?: boolean | string; }; /** Press handler; the native navigation path for `href` (fires on web too). */ onPress?: (event: GestureResponderEvent) => void; /** E2E hook forwarded to the root element. */ testID?: string; /** * For layout/positioning composition only (margins handled by Row/Column). Not a * styling escape hatch: size, color, and weight come from the props above. */ style?: StyleProp; } export interface TypographySkin { roleType: Record; } export declare function textAlignOf(p: TypographyProps): "center" | "right" | null; /** A heading level, 1 (the page title) to 6, as `aria-level` spells it. */ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6; /** * The heading level a Typography exposes: the explicit `level` when one is passed, else * its heading role's own level, else 6 for a `section` heading, else none (plain text). */ export declare function headingLevelOf(p: TypographyProps, role?: Role): number | undefined; export declare function roleOf(p: TypographyProps): Role; export declare function toneOf(p: TypographyProps): Tone | null; export declare function weightOf(p: TypographyProps): Weight | null; export declare function leadingOf(p: TypographyProps): Leading | null; export declare function decorationOf(p: TypographyProps): Decoration | null; export declare function slantOf(p: TypographyProps): "italic" | null; export declare function numeralsOf(p: TypographyProps): Numerals | null; /** Build a Typography component from a platform skin. */ export declare function createTypography(skin: TypographySkin): (props: TypographyProps) => import("react").JSX.Element; //# sourceMappingURL=typography.shared.d.ts.map