@multiplatform.one/theme 7.69.2 → 7.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +5 -5
  2. package/src/audit/constraintAudit.ts +2 -0
  3. package/src/expo.spec.ts +4 -4
  4. package/src/expo.ts +11 -1
  5. package/src/theme/colorRules.ts +87 -0
  6. package/src/theme/createDefaultThemeConfig.spec.ts +8 -4
  7. package/src/theme/createDefaultThemeConfig.ts +27 -3
  8. package/src/theme/createThemes.ts +221 -56
  9. package/src/theme/dedupeInherited.spec.ts +160 -0
  10. package/src/theme/dedupeInherited.ts +117 -0
  11. package/src/theme/defaults/builderOptions.ts +1 -1
  12. package/src/theme/fillContrast.spec.ts +204 -0
  13. package/src/theme/fillContrast.ts +163 -0
  14. package/src/theme/index.ts +2 -0
  15. package/src/theme/oneThemeEngine.spec.ts +192 -0
  16. package/src/theme/presets.ts +37 -2
  17. package/src/theme/selectedState.spec.ts +19 -1
  18. package/src/theme/switchThumb.spec.ts +25 -14
  19. package/src/theme/v3TokenRoles.ts +51 -0
  20. package/types/audit/constraintAudit.d.ts.map +1 -1
  21. package/types/expo.d.ts.map +1 -1
  22. package/types/theme/colorRules.d.ts +39 -0
  23. package/types/theme/colorRules.d.ts.map +1 -1
  24. package/types/theme/createDefaultThemeConfig.d.ts +13 -2
  25. package/types/theme/createDefaultThemeConfig.d.ts.map +1 -1
  26. package/types/theme/createThemes.d.ts.map +1 -1
  27. package/types/theme/dedupeInherited.d.ts +54 -0
  28. package/types/theme/dedupeInherited.d.ts.map +1 -0
  29. package/types/theme/fillContrast.d.ts +41 -0
  30. package/types/theme/fillContrast.d.ts.map +1 -0
  31. package/types/theme/index.d.ts +2 -0
  32. package/types/theme/index.d.ts.map +1 -1
  33. package/types/theme/presets.d.ts +24 -0
  34. package/types/theme/presets.d.ts.map +1 -1
  35. package/types/theme/v3TokenRoles.d.ts +51 -0
  36. package/types/theme/v3TokenRoles.d.ts.map +1 -0
@@ -0,0 +1,192 @@
1
+ /**
2
+ * LC-160 ONE-THEME-ENGINE. Every MPO app builds its themes through
3
+ * `createDefaultThemeConfig`; it adds tokens through `builderOptions`,
4
+ * palettes through `additionalThemes` and looks through presets, never by
5
+ * handing Tamagui prebuilt themes.
6
+ */
7
+ import { readdirSync, readFileSync, statSync } from "node:fs";
8
+ import { dirname, join, relative } from "node:path";
9
+ import { fileURLToPath } from "node:url";
10
+ import { describe, expect, it, vi } from "vitest";
11
+
12
+ vi.mock("tamagui", () => ({
13
+ createTamagui: vi.fn((config: Record<string, unknown>) => config),
14
+ }));
15
+ vi.mock("./animations/index", () => ({ animations: {} }));
16
+
17
+ import {
18
+ assertNoPrebuiltThemes,
19
+ createDefaultThemeConfig,
20
+ type CreateDefaultThemeConfigOptions,
21
+ } from "./createDefaultThemeConfig";
22
+ import { createThemesBuilder } from "./createThemes";
23
+ import { contrastRatio, normalizeToHex, relativeLuminance } from "./colorRules";
24
+ import { resolveAllThemes } from "./dedupeInherited";
25
+ import { defaultAccentTheme, defaultBaseTheme, defaultBuilderOptions } from "./defaults";
26
+ import { consolePreset, defaultPreset, storefrontPreset } from "./presets";
27
+ import { v5ScaleInputs } from "./scale/scaleInputs";
28
+ import { v3TokenRoles } from "./v3TokenRoles";
29
+
30
+ type Themes = Record<string, Record<string, unknown>>;
31
+
32
+ const repoRoot = join(dirname(fileURLToPath(import.meta.url)), "../../../..");
33
+
34
+ describe("LC-160 the engine refuses prebuilt themes", () => {
35
+ it("throws when a consumer passes tamagui.themes", () => {
36
+ const { light, dark } = createThemesBuilder(
37
+ defaultBaseTheme,
38
+ defaultAccentTheme,
39
+ defaultBuilderOptions,
40
+ ).themes();
41
+ const prebuilt = { tamagui: { themes: { light, dark } } } as CreateDefaultThemeConfigOptions;
42
+ expect(() => createDefaultThemeConfig(prebuilt)).toThrow(/LC-160/);
43
+ expect(() => assertNoPrebuiltThemes(prebuilt)).toThrow(/builderOptions/);
44
+ });
45
+
46
+ it("accepts every supported way to add to the matrix", () => {
47
+ expect(() =>
48
+ createDefaultThemeConfig({
49
+ additionalThemes: { brand: defaultAccentTheme },
50
+ builderOptions: { getTheme: () => ({ brandInk: "#123456" }) },
51
+ presets: { console: consolePreset },
52
+ subset: { components: ["Button"], tints: ["accent"] },
53
+ tamagui: { settings: {} },
54
+ }),
55
+ ).not.toThrow();
56
+ });
57
+
58
+ // The repo half: an app config that bypasses the builder fails here with
59
+ // its path, before it ships a matrix without the holds.
60
+ it("no MPO app or package hands Tamagui prebuilt themes", () => {
61
+ const skip = new Set([
62
+ "node_modules",
63
+ "dist",
64
+ "types",
65
+ "ios",
66
+ "android",
67
+ "build",
68
+ "target",
69
+ ".git",
70
+ ".tamagui",
71
+ ".turbo",
72
+ ".expo",
73
+ ".lostpixel",
74
+ "storybook-static",
75
+ ]);
76
+ const offenders: string[] = [];
77
+ const walk = (dir: string) => {
78
+ for (const entry of readdirSync(dir)) {
79
+ if (skip.has(entry)) continue;
80
+ const path = join(dir, entry);
81
+ if (statSync(path).isDirectory()) {
82
+ walk(path);
83
+ continue;
84
+ }
85
+ if (!/\.(ts|tsx|mts|js|mjs|cjs)$/.test(entry) || /\.(spec|test)\./.test(entry)) continue;
86
+ const source = readFileSync(path, "utf8");
87
+ const rel = relative(repoRoot, path);
88
+ if (/createDefaultThemeConfig\([\s\S]*?tamagui\s*:\s*\{[^}]*\bthemes\b/.test(source)) {
89
+ offenders.push(`${rel}: tamagui.themes`);
90
+ }
91
+ if (/\bcreateThemesBuilder\s*\(/.test(source) && !rel.startsWith("public/theme/")) {
92
+ offenders.push(`${rel}: createThemesBuilder`);
93
+ }
94
+ }
95
+ };
96
+ for (const top of ["apps", "packages", "public"]) walk(join(repoRoot, top));
97
+ expect(offenders).toEqual([]);
98
+ });
99
+ });
100
+
101
+ describe("LC-160 additive tokens ride builderOptions", () => {
102
+ // The SHC springboard palette's shape: keys MPO has no role for, written
103
+ // on the two root schemes only.
104
+ const springboard = { light: "#f2f0ff", dark: "#1c1830" };
105
+ const config = createDefaultThemeConfig({
106
+ builderOptions: {
107
+ getTheme: ({ name }) =>
108
+ name === "light" || name === "dark" ? { springboardTile: springboard[name] } : {},
109
+ },
110
+ });
111
+ const themes = config.tamagui.themes as unknown as Themes;
112
+
113
+ it("declares the key once per scheme and every theme resolves it", () => {
114
+ const declaring = Object.entries(themes)
115
+ .filter(([, theme]) => "springboardTile" in theme)
116
+ .map(([name]) => name);
117
+ expect(declaring.sort()).toEqual(["dark", "light"]);
118
+ for (const [name, theme] of Object.entries(resolveAllThemes(themes))) {
119
+ expect(theme.springboardTile, name).toBe(springboard[name.split("_")[0] as "light" | "dark"]);
120
+ }
121
+ });
122
+
123
+ it("keeps the house derivations beside it", () => {
124
+ const resolved = resolveAllThemes(themes);
125
+ expect(resolved.light?.outlineColor).toBeTruthy();
126
+ expect(resolved.dark_Button?.textMuted).toBeTruthy();
127
+ });
128
+ });
129
+
130
+ describe("LC-160 the SHC v3 tokens map to MPO roles", () => {
131
+ const resolved = resolveAllThemes(createDefaultThemeConfig().tamagui.themes as unknown as Themes);
132
+
133
+ it("names a role for every v3 key the console writes", () => {
134
+ expect(Object.keys(v3TokenRoles)).toHaveLength(35);
135
+ });
136
+
137
+ it("resolves every non-springboard role in every root and component theme", () => {
138
+ const missing: string[] = [];
139
+ for (const [token, role] of Object.entries(v3TokenRoles)) {
140
+ if (role === "springboard") continue;
141
+ for (const name of ["light", "dark", "light_Button", "dark_Card", "light_accent"]) {
142
+ if (typeof resolved[name]?.[role] !== "string") missing.push(`${token} -> ${name}.${role}`);
143
+ }
144
+ }
145
+ expect(missing).toEqual([]);
146
+ });
147
+ });
148
+
149
+ describe("LC-160 $textSubtle is an ink, as the console's v3 roles need", () => {
150
+ const resolved = resolveAllThemes(createDefaultThemeConfig().tamagui.themes as unknown as Themes);
151
+ const hex = (raw: unknown) => {
152
+ const value = normalizeToHex(String(raw));
153
+ if (!value) throw new Error(`not an opaque colour: ${String(raw)}`);
154
+ return value;
155
+ };
156
+ for (const scheme of ["light", "dark"] as const) {
157
+ for (const surface of ["color1", "color2"] as const) {
158
+ it(`${scheme} $textSubtle clears AA on $${surface}`, () => {
159
+ const theme = resolved[scheme] ?? {};
160
+ const ratio = contrastRatio(
161
+ relativeLuminance(hex(theme.textSubtle)),
162
+ relativeLuminance(hex(theme[surface])),
163
+ );
164
+ expect(ratio).toBeGreaterThanOrEqual(4.5);
165
+ });
166
+ }
167
+ }
168
+ });
169
+
170
+ describe("LC-160 console and storefront presets", () => {
171
+ it("console: the house knobs on v5's scale, fills on the console's violet (purple)", () => {
172
+ expect(consolePreset.theme).toBe("purple");
173
+ expect(consolePreset.knobs).toEqual(defaultPreset.knobs);
174
+ expect(consolePreset.tints).toEqual(defaultPreset.tints);
175
+ expect(consolePreset.scale).toEqual(v5ScaleInputs);
176
+ });
177
+
178
+ it("storefront: v5's scale, HIG blue fills, no decorative tints", () => {
179
+ expect(storefrontPreset.theme).toBe("blue");
180
+ expect(storefrontPreset.scale).toEqual(v5ScaleInputs);
181
+ expect(storefrontPreset.tints).toEqual([]);
182
+ expect(storefrontPreset.knobs).toEqual(defaultPreset.knobs);
183
+ });
184
+
185
+ it("paints both from a theme the default matrix builds", () => {
186
+ const themes = createDefaultThemeConfig().tamagui.themes as unknown as Themes;
187
+ for (const scheme of ["light", "dark"]) {
188
+ expect(themes).toHaveProperty(`${scheme}_${consolePreset.theme}`);
189
+ expect(themes).toHaveProperty(`${scheme}_${storefrontPreset.theme}`);
190
+ }
191
+ });
192
+ });
@@ -1,10 +1,16 @@
1
1
  import type { ThemeName } from "@tamagui/web";
2
2
  import { defaultIntents } from "./intents";
3
3
  import type { Preset } from "./preset.types";
4
- import { defaultScaleInputs } from "./scale/scaleInputs";
4
+ import { defaultScaleInputs, v5ScaleInputs } from "./scale/scaleInputs";
5
5
 
6
+ /**
7
+ * The house look. Its accent is Apple's system tint, MPO's `blue` scope, held
8
+ * by the engine to a white label that clears APCA Lc 60: the neutral inverse
9
+ * painted black fills in light and white in dark (LC-172), and every filled
10
+ * or selected control takes its colour from the theme's accent.
11
+ */
6
12
  export const defaultPreset: Preset = {
7
- theme: "" as ThemeName,
13
+ theme: "blue" as ThemeName,
8
14
  knobs: {
9
15
  fillStyle: "filled",
10
16
  borderRadius: "medium",
@@ -100,3 +106,32 @@ export const roomyPreset: Preset = {
100
106
  ...defaultPreset,
101
107
  scale: { control: 48, type: 16 },
102
108
  };
109
+
110
+ /**
111
+ * The SHC console's look on the house engine (LC-160, FZ-7970). The console
112
+ * paints MPO's house ramp and knobs (SHC-953) on Tamagui's own 44/18/9 tokens
113
+ * (`shc/packages/themes/buildMatrix.ts` `houseTokens`), so the preset sits on
114
+ * v5's 44/15 scale. Its fills take the console's one interaction accent, the
115
+ * springboard violet (`SPRINGBOARD_ACCENT`), as MPO's `purple` scope: a black
116
+ * filled control or chart series on the white ground breaks LC-172.
117
+ * Identifiers on a console page set `fontFamily="$mono"`, IBM Plex Mono.
118
+ */
119
+ export const consolePreset: Preset = {
120
+ ...defaultPreset,
121
+ theme: "purple" as ThemeName,
122
+ scale: v5ScaleInputs,
123
+ };
124
+
125
+ /**
126
+ * The SHC storefront's look (LC-160, FZ-7970): Tamagui v5's own scale
127
+ * (44 px controls, 15 px body) and no decorative hue tints, so nested regions
128
+ * stay on the neutral ramp. The SHC storefront has no accent of its own and a
129
+ * grey fill breaks LC-172, so its fills take Apple's system tint, MPO's `blue`
130
+ * scope, held by the engine to a white label that clears APCA Lc 60.
131
+ */
132
+ export const storefrontPreset: Preset = {
133
+ ...defaultPreset,
134
+ theme: "blue" as ThemeName,
135
+ tints: [],
136
+ scale: v5ScaleInputs,
137
+ };
@@ -105,7 +105,7 @@ describe("LC-131 SELECTED-STATE: one selected recipe in the theme", () => {
105
105
  cells.push(`${presetName}/${name}`);
106
106
  }
107
107
  }
108
- expect(cells).toHaveLength(Object.keys(presets).length * 9 + 1);
108
+ expect(cells).toHaveLength(Object.keys(presets).length * 10);
109
109
  });
110
110
  }
111
111
 
@@ -137,3 +137,21 @@ describe("LC-131 SELECTED-STATE: one selected recipe in the theme", () => {
137
137
  });
138
138
  }
139
139
  });
140
+
141
+ describe("LC-05 ONE-EMPHASIS: the selected row separates from its page", () => {
142
+ for (const scheme of ["light", "dark"] as const)
143
+ it(`${scheme}: $color4 clears 1.15:1 on $background in the scheme and every colour theme`, () => {
144
+ for (const name of [scheme, ...colourThemes.map((colour) => `${scheme}_${colour}`)]) {
145
+ const surface = paint(scheme, name, "$color4");
146
+ const page = paint(scheme, name, "$background");
147
+ expect(ratio(surface, page), name).toBeGreaterThanOrEqual(1.15);
148
+ expect(ratio(surface, page), name).toBeLessThanOrEqual(1.7);
149
+ }
150
+ });
151
+
152
+ it("repaints the list row and card under the house blue page", () => {
153
+ const scope = paint("light", "light_blue", "$color4");
154
+ for (const child of ["light_blue_ListItem", "light_blue_Card"])
155
+ expect(paint("light", child, "$color4"), child).toBe(scope);
156
+ });
157
+ });
@@ -1,7 +1,14 @@
1
1
  import { configWithoutAnimations } from "@tamagui/config";
2
2
  import { createTamagui } from "tamagui";
3
3
  import { describe, expect, it } from "vitest";
4
- import { contrastRatio, minContrastRatio, normalizeToHex, relativeLuminance } from "./colorRules";
4
+ import {
5
+ contrastRatio,
6
+ inSwitchOffBand,
7
+ isLightGround,
8
+ normalizeToHex,
9
+ plateContrastRatio,
10
+ relativeLuminance,
11
+ } from "./colorRules";
5
12
  import { createThemesBuilder } from "./createThemes";
6
13
  import { defaultAccentTheme } from "./defaults/accent";
7
14
  import { defaultBaseTheme } from "./defaults/base";
@@ -41,25 +48,29 @@ describe("switch thumb", () => {
41
48
  });
42
49
 
43
50
  it.each(tintedSchemes)(
44
- "%s: the off track holds 3:1 under the thumb and stays apart from the on track",
51
+ "%s: the off track is HIG's light system fill, holds the plate floor on dark's raised ground and stays apart from the on track",
45
52
  (name) => {
46
53
  const theme = config.themes[name] as Record<string, { val: string }>;
47
54
  const scheme = name.split("_")[0] as "light" | "dark";
48
55
  const off = theme.switchTrackOff.val;
49
- // FZ-7715: a hue scope's own fill can move its off track off the root's step.
50
- const step = Array.from({ length: 10 }, (_, i) => i + 3).find(
51
- (n) => theme[`gray${n}`].val === off,
52
- )!;
53
- if (name === scheme) expect(step).toBe(scheme === "light" ? 10 : 7);
54
- expect(theme.switchTrackOffHover.val).toBe(theme[`gray${step - 1}`].val);
55
- expect(theme.switchTrackOffPress.val).toBe(theme[`gray${Math.min(step + 1, 12)}`].val);
56
- expect(ratio(off, theme.switchThumb.val)).toBeGreaterThanOrEqual(minContrastRatio);
57
- expect(ratio(off, theme.accentBackground.val)).toBeGreaterThanOrEqual(1.5);
56
+ expect(isLightGround(theme.background.val)).toBe(scheme === "light");
57
+ expect(inSwitchOffBand(off, theme.background.val)).toBe(true);
58
58
  if (scheme === "light") {
59
- for (const against of [theme.background.val, theme.color3.val]) {
60
- expect(ratio(off, against)).toBeGreaterThanOrEqual(minContrastRatio);
61
- }
59
+ const step = Array.from({ length: 12 }, (_, i) => i + 1).find(
60
+ (n) => theme[`gray${n}`].val === off,
61
+ )!;
62
+ expect(step).toBeDefined();
63
+ if (name === scheme) expect(step).toBe(5);
64
+ expect(step).toBeLessThanOrEqual(5);
65
+ expect(theme.switchTrackOffHover.val).toBe(theme[`gray${Math.max(step - 1, 1)}`].val);
66
+ expect(theme.switchTrackOffPress.val).toBe(theme[`gray${Math.min(step + 1, 12)}`].val);
67
+ } else {
68
+ expect(ratio(off, theme.color4.val)).toBeGreaterThanOrEqual(plateContrastRatio);
69
+ const lum = (color: string) => relativeLuminance(normalizeToHex(color) as string);
70
+ expect(lum(theme.switchTrackOffHover.val)).toBeLessThan(lum(off));
71
+ expect(lum(theme.switchTrackOffPress.val)).toBeGreaterThan(lum(off));
62
72
  }
73
+ expect(ratio(off, theme.accentBackground.val)).toBeGreaterThanOrEqual(1.5);
63
74
  },
64
75
  );
65
76
 
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The SHC console's v3 named tokens (`shc/packages/themes/
3
+ * consoleBuilderOptions.ts`) and the MPO role each one becomes (LC-160,
4
+ * FZ-7970). A role is a key every MPO theme carries. The console switch
5
+ * (FZ-7970 lane 9) rewrites each `$good` read as `$green9` and so on, so the
6
+ * value comes from whatever theme the screen sits in and the holds (accent
7
+ * floor, named ink, hairline) reach it.
8
+ *
9
+ * `springboard` marks the keys with no MPO role: the home-screen wall and
10
+ * plate colours. They stay console-only, written as additive
11
+ * `builderOptions.getTheme` keys on the two root schemes.
12
+ */
13
+ export const v3TokenRoles = {
14
+ backgroundChrome: "background",
15
+ backgroundStrong: "color3",
16
+ backgroundSunk: "color3",
17
+ backgroundScrim: "shadow6",
18
+ hairline: "borderColorHairline",
19
+ hairlineStrong: "borderColor",
20
+ colorSubtle: "textMuted",
21
+ colorMuted: "textMuted",
22
+ colorInverse: "color1",
23
+ grabColor: "color8",
24
+ good: "green9",
25
+ goodSoft: "green3",
26
+ warning: "yellow9",
27
+ warningSoft: "yellow3",
28
+ critical: "red9",
29
+ criticalSoft: "red3",
30
+ info: "blue9",
31
+ idle: "textMuted",
32
+ accentSoft: "selectedBackground",
33
+ accentOn: "accentColor",
34
+ accentText: "selectedColor",
35
+ accentBorder: "accentBackground",
36
+ spark: "accentBackground",
37
+ wall1: "springboard",
38
+ wall2: "springboard",
39
+ wall3: "springboard",
40
+ wall4: "springboard",
41
+ plate: "springboard",
42
+ plateBorder: "springboard",
43
+ plateInk: "springboard",
44
+ platePaper: "springboard",
45
+ platePewter: "springboard",
46
+ plateRingHi: "springboard",
47
+ plateRingLo: "springboard",
48
+ stoppedWash: "springboard",
49
+ } as const;
50
+
51
+ export type V3Token = keyof typeof v3TokenRoles;
@@ -1 +1 @@
1
- {"version":3,"file":"constraintAudit.d.ts","sourceRoot":"","sources":["../../src/audit/constraintAudit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IA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,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACvC;AAUD,wBAAgB,qBAAqB,CAAC,EACpC,MAAkB,EAClB,OAAwB,EACxB,MAIU,EACV,kBAA4B,GAC7B,GAAE,qBAA0B;;;;;;;;;;EAuB5B"}
1
+ {"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../src/expo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAWxE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AAE5F,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,GAAG;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,CAAC;IACnE,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACvC;AAYD,wBAAgB,qBAAqB,CAAC,EACpC,MAAkB,EAClB,OAAwB,EACxB,MAIU,EACV,kBAA4B,GAC7B,GAAE,qBAA0B;;;;;;;;;;EAuB5B"}
@@ -20,6 +20,45 @@ export declare function normalizeToHex(raw: string): string | null;
20
20
  export declare function relativeLuminance(hex: string): number;
21
21
  /** WCAG contrast ratio (always >= 1). */
22
22
  export declare function contrastRatio(l1: number, l2: number): number;
23
+ /**
24
+ * APCA lightness contrast (SAPC 0.0.98G-4g) of `text` on `background`, as
25
+ * signed Lc: positive for dark text on a light fill, negative for light on
26
+ * dark. Callers compare the magnitude.
27
+ */
28
+ export declare function apcaContrast(text: string, background: string): number;
29
+ /** APCA |Lc| a label on a filled control must reach (LC-172). */
30
+ export declare const fillLabelLc = 60;
31
+ /**
32
+ * LC-172 / Apple HIG: the off Switch track is a system fill, rgb(120,120,128)
33
+ * laid over the ground at 0.16 alpha on a light ground and 0.32 on a dark one
34
+ * (what UISwitch paints). A ramp step may land anywhere from tertiary to
35
+ * systemFill on either side of that, the band below.
36
+ */
37
+ export declare const switchOffFillAlpha: {
38
+ readonly light: 0.16;
39
+ readonly dark: 0.32;
40
+ };
41
+ export declare const switchOffFillBand: {
42
+ readonly light: readonly [0.08, 0.24];
43
+ readonly dark: readonly [0.18, 0.4];
44
+ };
45
+ /** A ground is light when its relative luminance is past the midpoint. */
46
+ export declare function isLightGround(ground: string): boolean;
47
+ /** HIG's system fill at `alpha` composited over `ground`, as an opaque hex colour. */
48
+ export declare function systemFillHex(ground: string, alpha: number): string | null;
49
+ /** HIG's system fill at `alpha` composited over `ground`, as relative luminance. */
50
+ export declare function systemFillLuminance(ground: string, alpha: number): number | null;
51
+ /**
52
+ * FZ-7944: a control's plate stays this far off the raised ground an overlay
53
+ * paints ($color4 in dark), so it never dissolves into a sheet or card.
54
+ */
55
+ export declare const plateContrastRatio = 1.1;
56
+ /**
57
+ * Whether `track` sits in the HIG system-fill band over `ground`: never
58
+ * darker than systemFill on a light ground (a dark off track reads as on),
59
+ * and on a dark ground lifted off it without passing systemFill.
60
+ */
61
+ export declare function inSwitchOffBand(track: string, ground: string): boolean;
23
62
  export declare const minContrastRatio = 3;
24
63
  /** WCAG AA contrast floor for normal-size body/label text. */
25
64
  export declare const aaTextContrastRatio = 4.5;
@@ -1 +1 @@
1
- {"version":3,"file":"colorRules.d.ts","sourceRoot":"","sources":["../../src/theme/colorRules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAYH,2FAA2F;AAC3F,wBAAgB,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;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,cAAc,EAAE,aAAa,EAMzC,CAAC;AAEF,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CASlE"}
@@ -37,8 +37,12 @@ export interface CreateDefaultThemeConfigOptions {
37
37
  builderOptions?: CreateThemesBuilderOptions;
38
38
  /** Override tamagui settings */
39
39
  settings?: Partial<NonNullable<CreateTamaguiProps["settings"]>>;
40
- /** Override any top-level tamagui config property */
41
- tamagui?: Partial<CreateTamaguiProps>;
40
+ /**
41
+ * Override any top-level tamagui config property except `themes` (LC-160:
42
+ * an app adds tokens through `builderOptions`, `additionalThemes` and
43
+ * presets, never prebuilt themes).
44
+ */
45
+ tamagui?: Partial<Omit<CreateTamaguiProps, "themes">>;
42
46
  /** Named theme presets for the preset system */
43
47
  presets?: Record<string, Preset>;
44
48
  /** Default preset name to use when no `mp.preset` cookie is set */
@@ -59,6 +63,13 @@ export interface CreateDefaultThemeConfigOptions {
59
63
  */
60
64
  subset?: ThemeSubset;
61
65
  }
66
+ /**
67
+ * LC-160 ONE-THEME-ENGINE. Every theme an app paints comes out of this
68
+ * builder, so the holds (accent floor, selected state, named ink, hairline)
69
+ * reach it. A prebuilt `tamagui.themes` skips all of them, which is how the
70
+ * SHC console drifted onto its own matrix.
71
+ */
72
+ export declare function assertNoPrebuiltThemes(options: CreateDefaultThemeConfigOptions): void;
62
73
  /**
63
74
  * Builds Tamagui's v5 grey ramp, inverted-base accent and colour themes,
64
75
  * with the house accessibility floors. Fonts include Inter heading/body
@@ -1 +1 @@
1
- {"version":3,"file":"createDefaultThemeConfig.d.ts","sourceRoot":"","sources":["../../src/theme/createDefaultThemeConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EA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U,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC/E,mBAAmB,CAAC,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;IACvF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACzF;AA8BD,eAAO,MAAM,YAAY,aA6BvB,CAAC;AAouBH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,0BAA0B,EACrC,WAAW,EAAE,sBAAsB,EACnC,OAAO,CAAC,EAAE,0BAA0B;;aAqFzB,CAAC,SAAS,MAAM,QAAQ,CAAC,SAAS,sBAAsB,GAuB1D,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE;;+BAAkC;EAG7E"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Drop theme values that another rule already puts on the element (LC-160).
3
+ *
4
+ * Ported from SHC (`shc/packages/themes/dedupeInherited.ts`), which measured
5
+ * every theme rule restating keys its parent chain carries. MPO's builder
6
+ * restates fewer of them, and SHC's rule is not safe on web as written, so
7
+ * this keeps the subset that cannot change a resolved value.
8
+ *
9
+ * JS and native are never at risk: `createTamagui` runs
10
+ * `proxyThemesToParents`, which `Object.assign`s every ancestor onto each
11
+ * theme before anything reads it. CSS is the consumer that needs care. A
12
+ * themed element carries its theme's whole hierarchy as classes
13
+ * (`light_blue_Button` puts `t_blue t_blue_Button` on the Button), so a key
14
+ * dropped from `light_blue_Button` and kept by `light_blue` is still declared
15
+ * on that same element. A key every non-root rule drops is different: it
16
+ * reaches the element by inheritance from the nearest ANCESTOR element that
17
+ * declares it, and that ancestor need not be in the theme's name chain. A
18
+ * Button inside a Card resolves `light_Button`, but its nearest ancestor is
19
+ * the Card's `light_Card`; nested schemes add `dark_*` rules that match the
20
+ * element through `.t_dark .t_X` selectors. SHC's parent-chain rule drops
21
+ * those keys anyway, which repaints a Button's root-valued key with its
22
+ * Card's.
23
+ *
24
+ * So a key is dropped from a non-root theme only when:
25
+ *
26
+ * - the nearest non-root theme in its own chain keeps the key with the same
27
+ * value (declared on the same element), or
28
+ * - no non-root theme in either scheme gives the key a value other than its
29
+ * scheme root's, so whatever ancestor the element inherits from, it reads
30
+ * the root value, and no other rule declares it.
31
+ *
32
+ * Resolution reads the input and the already-pruned shallower themes, so the
33
+ * result does not depend on the record's iteration order.
34
+ */
35
+ type ThemeValues = Record<string, unknown>;
36
+ /**
37
+ * Ancestor names of `dark_blue_alt1_Button`, nearest last:
38
+ * `["dark", "dark_blue", "dark_blue_alt1"]`. The same walk as Tamagui's
39
+ * `proxyThemeToParents`; the two must agree or a dropped key would not come
40
+ * back on the JS side.
41
+ */
42
+ export declare function parentThemeNames(name: string): string[];
43
+ /** Each non-root theme without the values another rule already puts on its element. */
44
+ export declare function dedupeInheritedThemeValues<T extends ThemeValues>(themes: Record<string, T>): Record<string, T>;
45
+ /**
46
+ * One theme as Tamagui resolves it: every ancestor, then the theme itself.
47
+ * Use it to read a key off a deduped record; `getConfig().themes` and
48
+ * `themeConfig.tamagui.themes` come out of `createTamagui` already resolved.
49
+ */
50
+ export declare function resolveThemeThroughParents<T extends ThemeValues>(themes: Record<string, T>, name: string): T;
51
+ /** Every theme of a deduped record resolved through its parents. */
52
+ export declare function resolveAllThemes<T extends ThemeValues>(themes: Record<string, T>): Record<string, T>;
53
+ export {};
54
+ //# sourceMappingURL=dedupeInherited.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dedupeInherited.d.ts","sourceRoot":"","sources":["../../src/theme/dedupeInherited.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKvD;AAeD,uFAAuF;AACvF,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,WAAW,EAC9D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GACxB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CA0BnB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,WAAW,EAC9D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACzB,IAAI,EAAE,MAAM,GACX,CAAC,CAKH;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,EACpD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GACxB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAInB"}
@@ -0,0 +1,41 @@
1
+ import { apcaContrast } from "./colorRules";
2
+ export { apcaContrast };
3
+ /**
4
+ * LC-172 FILL-CONTRAST. A preset's fills carry a hue: the filled accent
5
+ * control, the active toggle track and the first chart series are never grey
6
+ * or black on the grey and white grounds, and the label on the filled
7
+ * control passes APCA Lc 60. The off toggle track is HIG's light system fill,
8
+ * never a grey darker than systemFill on a light ground (`inSwitchOffBand`),
9
+ * and the on and off tracks sit at least `toggleStateFloor` apart in OKLab.
10
+ */
11
+ /** sRGB chroma (max channel minus min channel, 0..1) under which a fill reads as grey or black. */
12
+ export declare const fillChromaFloor = 0.1;
13
+ /** APCA |Lc| the label on a filled control must reach. */
14
+ export declare const fillLabelLcFloor = 60;
15
+ /**
16
+ * OKLab distance the on and off toggle tracks must keep, so a Switch's state
17
+ * reads from its track and not only from the thumb's side. UIKit's least
18
+ * distinct pair, systemYellow on the light off fill, measures 0.19; the
19
+ * FZ-8117 default dark pair (an rgb 115 grey on an rgb 121 grey) measured 0.02.
20
+ */
21
+ export declare const toggleStateFloor = 0.15;
22
+ /** Björn Ottosson's OKLab of an opaque colour, or null when it does not parse. */
23
+ export declare function oklab(color: string): [number, number, number] | null;
24
+ /** Euclidean OKLab distance between two colours, 0 when either does not parse. */
25
+ export declare function oklabDistance(a: string, b: string): number;
26
+ /** sRGB chroma of an opaque colour, 0 for any grey. */
27
+ export declare function srgbChroma(color: string): number;
28
+ export interface FillContrastFinding {
29
+ preset: string;
30
+ scheme: "light" | "dark";
31
+ part: "accent fill" | "toggle" | "toggle off" | "toggle state" | "chart series" | "fill label";
32
+ detail: string;
33
+ }
34
+ type ResolvedThemes = Record<string, Record<string, unknown> | undefined>;
35
+ /**
36
+ * Every LC-172 breach of one preset colour theme in `resolved` (themes run
37
+ * through `resolveAllThemes`). `theme` is the preset's colour theme, `""`
38
+ * for the house accent.
39
+ */
40
+ export declare function auditPresetFills(preset: string, theme: string, resolved: ResolvedThemes): FillContrastFinding[];
41
+ //# sourceMappingURL=fillContrast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fillContrast.d.ts","sourceRoot":"","sources":["../../src/theme/fillContrast.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAgD,MAAM,cAAc,CAAC;AAG1F,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;;;;;;GAOG;AAEH,mGAAmG;AACnG,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,KAAc,CAAC;AAU5C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAKrC,kFAAkF;AAClF,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAYpE;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,IAAI,EAAE,aAAa,GAAG,QAAQ,GAAG,YAAY,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC;IAC/F,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;AAI1E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,cAAc,GACvB,mBAAmB,EAAE,CAuEvB"}
@@ -6,6 +6,7 @@ export * from "./cookies";
6
6
  export * from "./cornerSmoothing";
7
7
  export * from "./createDefaultThemeConfig";
8
8
  export * from "./createThemes";
9
+ export * from "./dedupeInherited";
9
10
  export * from "./defaults/index";
10
11
  export * from "./devtools/ThemeDevtoolsPanel";
11
12
  export * from "./dynamicType";
@@ -49,6 +50,7 @@ export * from "./tileSizes";
49
50
  export * from "./transitionProps";
50
51
  export * from "./theme";
51
52
  export * from "./Tint";
53
+ export * from "./v3TokenRoles";
52
54
  export * from "./useResolvedKnobs";
53
55
  export * from "./useTheme";
54
56
  export * from "./usePresetSwitch";