/** * The colour pairs this library actually puts on screen, as a data table. * * Every row cites the component file that pairs the two tokens, so a reviewer can check the claim * without trusting the table. Tokens are cited by NAME, never by line number — `src/styles/**` is * ASMA-8133's area and its line numbers move. * * Rows with a `finding` are measured failures against master. They are quarantined, not fixed: * changing a token value is a visual (potentially breaking) change to a brand theme and needs * design sign-off, so each one is written up in `docs/a11y-contrast.md` and escalated instead. * * @see docs/a11y-contrast.md — findings register, exemption rationale, measured ratios * @see docs/a11y-allowlist.md — the axe (SC 1.4.3 only) story baseline this cross-references */ /** * The surface the library composites onto when a token is `transparent`, and the surface an * unparented control is assumed to sit on. The library ships no page-background token; every * component that sets its own opaque surface (input, tooltip, chip) uses white or a delta tint. */ export declare const APP_SURFACE = "#ffffff"; export declare const REQUIREMENT_RATIO: { /** SC 1.4.3, body text below 18.66px bold / 24px regular. */ readonly text: 4.5; /** SC 1.4.3, large text at or above that size. */ readonly largeText: 3; /** SC 1.4.11, UI component boundaries, state indicators and focus rings. */ readonly nonText: 3; /** * Pressed (momentary) states: 85 % of 4.5:1 and of 3:1 — an accepted risk, not a WCAG level. * @see asma-modules/_docs/ux/patterns/pattern-pressed-state.md:121 — "Contrast while hovered or pressed" */ readonly momentaryText: 3.83; readonly momentaryNonText: 2.55; }; export type ContrastRequirement = keyof typeof REQUIREMENT_RATIO; /** The success criterion each requirement level is measured against, for test titles and docs. */ export declare const REQUIREMENT_CRITERION: Readonly>; export interface ContrastPair { /** Stable id. Quarantined rows use it to join to `docs/a11y-contrast.md`. */ readonly id: string; /** Custom-property name, or a literal colour for a hard-coded component value. */ readonly foreground: string; readonly background: string; readonly requirement: ContrastRequirement; /** Repo-relative path of the component that pairs these two. */ readonly usedBy: string; /** Findings id in docs/a11y-contrast.md. Present means "measured failing, quarantined". */ readonly finding?: string; } /** * Hand-curated pairs, ending with the pressed looks from `pressedPairs.ts`. The button token family * is generated instead — see the button token matrix in `themeContrast.test.ts`. */ export declare const COMPONENT_PAIRS: readonly ContrastPair[]; /** * `StyledButton.module.scss` builds every button from a single mixin over * `--colors-button-{type}-{color}-{state}-{text|bg|border}-color`, so the button pairs are * generated from the token names rather than transcribed. A new variant or state added to the * token files is contrast-checked the moment it lands, with no edit here. */ export declare const BUTTON_TYPES: readonly ["contained", "outlined", "text", "textGray", "textWhite"]; export declare const BUTTON_COLORS: readonly ["common", "error"]; /** * `disabled` is deliberately absent. SC 1.4.3 exempts "text ... that is part of an inactive user * interface component", and 1.4.11 exempts inactive components in the same words. See the * exemptions section of docs/a11y-contrast.md. */ export declare const BUTTON_STATES: readonly ["base", "hover", "active", "focused"]; export type ButtonType = (typeof BUTTON_TYPES)[number]; export type ButtonState = (typeof BUTTON_STATES)[number]; /** `active` is the pressed look, held to the momentary levels; `hover` and `focused` keep the full ones. */ export declare const MOMENTARY_BUTTON_STATES: readonly ButtonState[]; /** The requirement level a generated button pair is held to in a given state. */ export declare const buttonRequirement: (state: ButtonState, aspect: "text" | "boundary") => ContrastRequirement; /** Inset focus ring (`_focus.scss`): with Space held it sits on the pressed fill. `contained` keeps a white gap. */ export declare const BUTTON_TYPES_WITH_INSET_FOCUS_RING: readonly ButtonType[]; export interface ButtonTokenNames { readonly text: string; readonly background: string; readonly border: string; } export declare const buttonTokenNames: (type: ButtonType, color: (typeof BUTTON_COLORS)[number], state: ButtonState) => ButtonTokenNames; /** * Types whose boundary is a designed, always-present edge. `text` / `textGray` are borderless by * design — the label carries the affordance and is held to 4.5:1, which is what SC 1.4.11's * "visual information required to identify user interface components" asks for. `textWhite` is * excluded from contrast assertions entirely: it is white-on-transparent, meant to be placed on a * consumer-supplied dark surface this package never sees. Documented in docs/a11y-contrast.md. */ export declare const BUTTON_TYPES_WITH_BOUNDARY: readonly ButtonType[]; export declare const BUTTON_TYPES_WITHOUT_KNOWN_SURFACE: readonly ButtonType[]; /** * Button pairs that fail against master, keyed `{type}/{color}/{state}/{aspect}`. * * `text-on-tinted-hover` (F-12): outlined/text/textGray put gama-500 on a gama-50 or gama-100 tint * at hover and focused, which drops the label under 4.5:1 in every theme (pressed passes, see docs). * `boundary-focus` (F-07): the focus border is gama-400 everywhere, which is under 3:1 on white in * default and fretex. * `boundary-outlined-hover` (F-13): outlined's hover/active border is gama-300, under 3:1 in all * three themes — and under the momentary 2.55:1 while pressed, so `active` stays quarantined. * `outlined/error/focused/text` (F-16): white label on a beta-100 tint, 1.27:1 in every theme. * Error/focused boundaries now resolve after ASMA-8133. Default and greenish pass at 8.37:1; * fretex still uses gama-400 at 2.24:1, so these rows remain under F-07. */ export declare const BUTTON_FINDINGS: Readonly>; /** * Regression floors for the quarantined pairs: the ratio each one measures on master, per theme. * * A quarantined pair is asserted against its floor rather than against the WCAG threshold, so the * suite still detects *decay* on an already-failing pair while staying green if ASMA-8133 or a * design fix legitimately *improves* the number. This is a characterization test — the floor is a * record of the status quo, not a standard. The real target stays in docs/a11y-contrast.md against * the finding id, and lifting a quarantine means deleting the pair's `finding` key so the live SC * assertion takes over. * * `null` means the pair has no computed value at all — see F-15, where the `var()` chain is * dangling so the browser drops the declaration outright. A floor is meaningless there, so those * stay skipped. * * Values are produced by `contrastRatio`, which already truncates to two decimals, so the floor and * the measurement are byte-identical and the comparison needs no epsilon. Use * printRegressionFloors.ts to inspect current measurements; review changes before updating floors. */ export declare const REGRESSION_FLOORS: Readonly>>>;