import { type ReactNode } from "react"; import { type ColorTokens, type LayoutStyle, type TextStyle } from "../../style/index.js"; export type Tone = "accent" | "default" | "contrast" | "secondary" | "outline" | "dashed" | "destructive"; export type Status = "success" | "warning" | "error" | "info" | "neutral"; /** One size step of the pill: its height, side inset and label metrics. */ export interface BadgeSize { height: number; paddingHorizontal: number; fontSize: number; lineHeight: number; } export interface BadgeSkin { /** The pill per size step (`tiny`, `small`, the default, `large`), the anatomy `marker` disc (the legend `disc` shares it), the `tier` pill, the group `band` pill and the `token` chip. */ sizes: Record<"tiny" | "small" | "default" | "large" | "marker" | "tier" | "band" | "tick" | "token" | "step", BadgeSize>; /** * The shadow set under an anatomy `marker`, from the theme's tokens: the hand-off's ring * of the stage's fill and its drop shadow (Component.dc.html line 220). */ markerShadow: (tokens: ColorTokens) => string; /** The pill corner. */ radius: number; /** The `keyCorners` corner: the key cap's, on any size. */ keyRadius: number; /** The numbered `step` mark's corner. */ stepRadius: number; /** The shadow under a solid `step` mark: the accent's glow, from the theme's tokens. */ stepGlow: (tokens: ColorTokens) => string; /** The reference key's corner. */ referenceRadius: number; /** Space between the dot, the label and a reference's glyph. */ gap: number; referenceGap: number; /** Label weight, and the solid pill's and a count's heavier one. */ weight: TextStyle["fontWeight"]; strongWeight: TextStyle["fontWeight"]; /** Uppercase tracking, in ems. */ uppercaseTracking: number; /** The toned pill's leading dot. */ dotSize: number; /** The status family's dot and the ring of wash around it. */ statusDot: number; statusRing: number; } export interface BadgeProps { children?: ReactNode; status?: boolean; /** Soft intent fill with matching ink (every toned pill is soft; kept for the intent grammar). */ soft?: boolean; solid?: boolean; action?: boolean; primary?: boolean; inverse?: boolean; /** Neutral border-colored fill. */ neutralFill?: boolean; /** Foreground ink on the quiet surface. */ foreground?: boolean; /** The small pill: 18 px tall, 11 px label. */ small?: boolean; /** * The tiny pill: 18 px tall under a 10 px label on the pill's own 18 px line, at the * regular weight even when solid (a navigation row's "New" tag beside its count). */ tiny?: boolean; /** A count at the small size with the heavier label. */ count?: boolean; /** Solid count used in navigation. */ navigationCount?: boolean; /** Compact counter carried by a notification control. */ notification?: boolean; /** A linked reference key at the key corner, in the code face. */ reference?: boolean; /** * A code token chip: the 22 px pill with its 8 px inset under the small 11 px label in * the code face, for a role, a state or an attribute name beside its term. */ token?: boolean; /** The large pill: 26 px tall. */ large?: boolean; /** * An anatomy figure's numbered marker: a 22 px disc on the accent with its number in * the code face, set off from the stage by a ring of the stage's fill and a shadow * (Component.dc.html line 220). */ marker?: boolean; /** * A legend's numbered disc: the marker's 22 px disc with its number in the code face, * in the tone axis's fill (the solid accent as `default`, the quiet surface as * `secondary`) with no ring and no shadow (Component.dc.html line 222, the anatomy * legend's part numbers). */ disc?: boolean; /** * A tier pill (Atom, Molecule, Organism beside a page title): 24 px tall with a 10 px * inset and a 500 11 px label on its own line (Component.dc.html line 139), tracked in * caps with `uppercase` and in the code face with `mono`, as the page sets it. */ tier?: boolean; /** * A group band's pill (the props table's "pick one" beside an axis's title): 20 px tall * with a 7 px inset and a 500 11 px label (Component.dc.html line 237), in the code face * with `mono` as the page sets it, in the tone axis's fill (the accent's soft pill with * none). It sits between `tier` and `small` in precedence. */ band?: boolean; /** * A ruler tick's pill (the Layout page's "this window" readout under its marker): 20 px * tall with an 8 px inset and a 500 10 px label in the code face on the pill's own 20 px * line, with no border and no tone dot. Usually with `contrast`. After `band` in * precedence. */ tick?: boolean; /** * A numbered step mark (the Layout page's "try in this order" list): a 32 px square at * the step mark's corner with its number 600 13 px in the code face, centred. In the tone * axis's fill: `default` the solid accent with its glow, none the accent's soft wash, * `secondary` the quiet surface inside the `field-border` edge in the second ink. Pass it * as a MediaObject's `icon` with `bareIcon`. After `disc` in precedence. */ step?: boolean; /** * The key cap's corner in place of the round pill's, on any size: the sizing legend's * mode tags and the primitive names under a Grid (Layout.dc.html). The corner axis has * this one member; `reference` and `step` keep their own corners. */ keyCorners?: boolean; /** * Show the intent dot without switching to the status family. With no children it is * the bare 8 px dot in the tone's ink, with no pill (a marker beside text that names it). */ dot?: boolean; /** Standalone 10px signal marker, retaining its status label. */ signal?: boolean; /** Pin to the start when embedded in an unmeasured host layout. */ start?: boolean; /** Keep the label on one line and let the pill shrink in a tight row, ending the label with * an ellipsis instead of overflowing its host. */ truncate?: boolean; uppercase?: boolean; /** A reference can open its source in the system browser. */ href?: string; default?: boolean; secondary?: boolean; outline?: boolean; /** * The placeholder outline: no fill inside a dashed `field-border` edge, the label in the * second ink (the Layout page's primitive names). On the tone axis after `outline`. */ dashed?: boolean; /** * The contrast pill: the scheme's ink (`foreground`) as the fill under the page colour * (`background`) as the label, the most prominent neutral (the Layout ruler's "this * window" readout). On the tone axis after `default`; under glass the ink at the dense * alpha, as the Tooltip bubble's, so its label keeps its contrast. */ contrast?: boolean; destructive?: boolean; mono?: boolean; success?: boolean; warning?: boolean; error?: boolean; info?: boolean; neutral?: boolean; /** * The fixed cyan series hue (the hand-off's `--cyan`, `chart-2`) as a soft pill, whatever * the palette: its 16% wash under its ink, solved to 4.5:1 on the wash. No dot. On the * intent axis, after the status tones. */ cyan?: boolean; /** The fixed mint series hue (the hand-off's `--mint`, `chart-3`) as a soft pill, like `cyan`. */ mint?: boolean; /** * Accessible name for the badge. Most useful for the status family: the bare-dot status * form (`` with no children) is otherwise color-only and silent to * screen readers. When omitted on a childless status badge, the status tone word (e.g. * "error") is announced as a fallback. Mirrors the Spinner/Progress `accessibilityLabel` * contract. */ accessibilityLabel?: string; /** E2E hook forwarded to the root element. */ testID?: string; /** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */ style?: LayoutStyle; } export declare function toneOf(p: BadgeProps): Tone; export declare function statusOf(p: BadgeProps): Status; /** Dense metadata axes, with explicit precedence shared by appearance and docs. */ export declare function badgeIntentOf(p: BadgeProps): "cyan" | "mint" | "primary" | "action" | "info" | "success" | "warning" | "error" | "muted"; export declare function badgeMetricOf(p: BadgeProps): "small" | "marker" | "default" | "tiny" | "reference" | "tier" | "band" | "tick" | "token" | "step" | "notification" | "disc" | "navigationCount" | "count"; export declare function badgeSurfaceOf(p: BadgeProps): "solid" | "neutral" | "surface" | "soft" | "inverse"; export declare function badgeInkOf(p: BadgeProps): "solid" | "foreground" | "inverse" | "intent"; export declare function badgeTrackingOf(p: BadgeProps): "normal" | "uppercase" | "reference"; /** The corner axis: the key cap's corner, or the pill's (the default). */ export declare function badgeCornerOf(p: BadgeProps): "keyCorners" | "pill"; export declare function createBadge(skin: BadgeSkin): (props: BadgeProps) => import("react").JSX.Element; export type BadgeGap = "tight" | "compact" | "snug" | "cozy"; export interface BadgeGroupProps { /** The Badge elements to lay out in a wrapping row. */ children?: ReactNode; tight?: boolean; compact?: boolean; snug?: boolean; cozy?: boolean; /** Accessible name for the whole group (e.g. "Rachel Chen's roles"). */ accessibilityLabel?: string; /** E2E hook forwarded to the root element. */ testID?: string; /** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */ style?: LayoutStyle; } export declare function badgeGapOf(p: BadgeGroupProps): BadgeGap; /** A wrapping row of badges. */ export declare function BadgeGroup(props: BadgeGroupProps): import("react").JSX.Element; //# sourceMappingURL=badge.shared.d.ts.map