/** A bare CSS HSL channel triplet, `"H S% L%"` — the shape every `@godxjp/ui` colour role uses. */ export type HslTriplet = string; /** WCAG 2.2 SC 1.4.3 Contrast (Minimum) — normal text. */ export declare const AA_NORMAL_TEXT = 4.5; /** WCAG 2.2 SC 1.4.3 Contrast (Minimum) — large text (≥18.66px bold / ≥24px). */ export declare const AA_LARGE_TEXT = 3; /** * L = 0.179, the pivot of the label choice (solve 1.05/(L+0.05) = (L+0.05)/0.05). A surface above it * is one an ink walks DOWN away from, below it one an ink walks UP — and either end of the ramp is * achromatic, since `hsl(h s 0%)` is black and `hsl(h s 100%)` is white at every hue and saturation. * So the walk always reaches at least 4.58:1 and the guarantee is a property of the whole sRGB cube * rather than of the seeds we happened to try. * * EXPORTED because a component that paints its own fill has to make the same choice against it and * must not re-derive the number (gh#884: `Sidebar`'s brand mark). */ export declare const CONTRAST_PIVOT = 0.179; /** * WCAG 2.2 relative luminance of an sRGB colour, per the definition quoted at the top of this file. * Accepts `#abc` / `#aabbcc`; returns null for anything else. */ export declare function relativeLuminance(hex: string): number | null; /** * WCAG 2.2 contrast ratio between two hex colours, `(L_lighter + 0.05) / (L_darker + 0.05)`, in * 1–21. Returns null if either colour is not a hex. Compare against {@link AA_NORMAL_TEXT}. */ export declare function contrastRatio(a: string, b: string): number | null; /** * `#0071bd` → `"204.13 100% 37.06%"` — the direction the package was missing (gh#868: `hslToHex` * appears 9 times in `dist/`, `hexToHsl` zero). The exact inverse of * {@link import("../email/color.js").hslToHex} within one hex step, which `tenant-theme.test.ts` * round-trips over a grid. Returns null for anything that is not a 3- or 6-digit hex, so an * unparseable customer value is ignored rather than breaking the page. */ export declare function hexToHsl(hex: string): HslTriplet | null; export type TenantThemeOptions = { /** * The label to paint ON the seed, as hex. Omit and the contrast-safe choice is made here. Supply * it — Platform stores a server-computed, WCAG-checked pair — and it is used as given, with * `contrast` / `meetsAA` reporting what it achieves and a dev warning under 4.5:1. */ foreground?: string | null; /** * The surface the brand INK sits on, as hex — the DARKEST one it lands on in a light theme, the * LIGHTEST in a dark one, because the guarantee has to hold in the hovered state too. Default: the * package's light `--accent`, `#ebe9e5`. A region inside the dark theme passes `#3c3a34` * (`--accent` there); a themed consumer passes its own. Anything that is not a hex is ignored. */ surface?: string | null; }; export type TenantTheme = { /** The seed, normalized to `#rrggbb`, or null when the input was not a hex colour. */ primary: string | null; /** The label on that seed, `#rrggbb`, or null when there is no seed. */ foreground: string | null; /** WCAG 2.2 ratio of `foreground` on `primary`, 1–21. `0` when there is no seed. */ contrast: number; /** `contrast >= 4.5` — WCAG 2.2 SC 1.4.3, normal text. */ meetsAA: boolean; /** * The custom properties to declare on the scope. Spread straight into a `style` prop, or * serialize into a `