@multiplatform.one/theme 7.72.0 → 7.74.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/theme",
3
- "version": "7.72.0",
3
+ "version": "7.74.0",
4
4
  "description": "Tamagui theme system for multiplatform.one",
5
5
  "keywords": [
6
6
  "multiplatform",
@@ -72,8 +72,8 @@
72
72
  "access": "public"
73
73
  },
74
74
  "dependencies": {
75
- "@multiplatform.one/platform": "^7.72.0",
76
- "@multiplatform.one/store": "^7.72.0",
75
+ "@multiplatform.one/platform": "^7.74.0",
76
+ "@multiplatform.one/store": "^7.74.0",
77
77
  "@tamagui/animations-react-native": "2.7.6",
78
78
  "@tamagui/colors": "2.7.6",
79
79
  "@tamagui/config": "2.7.6",
@@ -89,8 +89,8 @@
89
89
  },
90
90
  "devDependencies": {
91
91
  "@expo/prebuild-config": "55.0.18",
92
- "@multiplatform.one/config": "7.72.0",
93
- "@multiplatform.one/test-utils": "7.72.0",
92
+ "@multiplatform.one/config": "7.74.0",
93
+ "@multiplatform.one/test-utils": "7.74.0",
94
94
  "@tamagui/animations-css": "2.7.6",
95
95
  "@tamagui/animations-reanimated": "2.7.6",
96
96
  "@tamagui/font-inter": "2.7.6",
@@ -0,0 +1,53 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { contrastRatio, relativeLuminance } from "./colorRules";
3
+ import {
4
+ GLYPH_CONTRAST_FLOOR,
5
+ glyphTintFallback,
6
+ holdHueToFloor,
7
+ platformSystemTint,
8
+ resolveGlyphTint,
9
+ } from "./glyphTint";
10
+
11
+ const ratio = (a: string, b: string) => contrastRatio(relativeLuminance(a), relativeLuminance(b));
12
+
13
+ describe("LC-176 glyph tint (FZ-8020 r4)", () => {
14
+ const light = { dark: false, surfaces: ["#f7f7f7", "#ffffff"], ink: "#111111" };
15
+ const dark = { dark: true, surfaces: ["#111111", "#191919"], ink: "#eeeeee" };
16
+
17
+ it("ships ink as the house default (Clay, rv_d2757722a7cb0992)", () => {
18
+ expect(glyphTintFallback).toBe("ink");
19
+ });
20
+
21
+ it("a hued theme keeps its own hue whatever the fallback", () => {
22
+ for (const fallback of ["ink", "system", "accent"] as const)
23
+ expect(resolveGlyphTint({ hue: "#cc4e00", fallback, ...light })).toEqual({
24
+ glyph: "#cc4e00",
25
+ label: "#cc4e00",
26
+ });
27
+ });
28
+
29
+ it("ink is the text colour", () => {
30
+ expect(resolveGlyphTint({ hue: undefined, fallback: "ink", ...dark }).glyph).toBe("#eeeeee");
31
+ });
32
+
33
+ it.each([
34
+ ["light", light],
35
+ ["dark", dark],
36
+ ] as const)(
37
+ "%s: the system tint is systemBlue, held to 3:1 for a glyph and AA for a label",
38
+ (_, scheme) => {
39
+ const tint = resolveGlyphTint({ hue: undefined, fallback: "system", ...scheme });
40
+ expect(tint.glyph.toLowerCase()).toBe(platformSystemTint(scheme.dark).toLowerCase());
41
+ for (const surface of scheme.surfaces) {
42
+ expect(ratio(tint.glyph, surface)).toBeGreaterThanOrEqual(GLYPH_CONTRAST_FLOOR);
43
+ expect(ratio(tint.label, surface)).toBeGreaterThanOrEqual(4.5);
44
+ }
45
+ },
46
+ );
47
+
48
+ it("holding a hue to a floor only moves its lightness toward the ink pole", () => {
49
+ const held = holdHueToFloor("#007AFF", ["#ffffff"], false, 4.5);
50
+ expect(ratio(held, "#ffffff")).toBeGreaterThanOrEqual(4.5);
51
+ expect(parseInt(held.slice(5, 7), 16)).toBeGreaterThan(parseInt(held.slice(1, 3), 16));
52
+ });
53
+ });
@@ -0,0 +1,128 @@
1
+ import { createContext, useContext, useMemo } from "react";
2
+ import { useThemeName } from "tamagui";
3
+ import {
4
+ aaTextContrastRatio,
5
+ contrastRatio,
6
+ normalizeToHex,
7
+ relativeLuminance,
8
+ } from "./colorRules";
9
+ import { isDarkThemeName } from "./controlTiers";
10
+ import { useIdentityHue } from "./readableColor";
11
+
12
+ /**
13
+ * LC-176: what tints an icon button (and the label of a bar button beside it)
14
+ * when the theme has no hue of its own. A colour theme always tints with its
15
+ * hue; this only decides the house theme, whose accent is its text colour.
16
+ *
17
+ * - `ink`: the text colour, so the glyph reads as bold mono.
18
+ * - `system`: the platform's system tint, UIKit's default `tintColor`.
19
+ * - `accent`: one MPO house hue, the same on every platform.
20
+ */
21
+ export type GlyphTintFallback = "ink" | "system" | "accent";
22
+
23
+ /**
24
+ * The one line that picks the house theme's icon-button tint. Clay picked ink
25
+ * on compare rv_d2757722a7cb0992 (FZ-8020 r4): "Generally I would say it
26
+ * should be in black-and-white ... I don't know if we wanna color them all
27
+ * the time that might get hard to read."
28
+ */
29
+ export const glyphTintFallback: GlyphTintFallback = "ink";
30
+
31
+ /** UIKit `systemBlue`, light and dark. */
32
+ const SYSTEM_TINT = { light: "#007AFF", dark: "#0A84FF" } as const;
33
+
34
+ /** Radix violet 9, the candidate house hue for `accent`. */
35
+ const HOUSE_ACCENT = { light: "#6E56CF", dark: "#6E56CF" } as const;
36
+
37
+ /** WCAG 1.4.11: a glyph is a graphical object, so 3:1 holds it. */
38
+ export const GLYPH_CONTRAST_FLOOR = 3;
39
+
40
+ /** Android has no system tint of its own, so every platform takes iOS's. */
41
+ export function platformSystemTint(dark: boolean): string {
42
+ return SYSTEM_TINT[dark ? "dark" : "light"];
43
+ }
44
+
45
+ const GlyphTintFallbackContext = createContext<GlyphTintFallback>(glyphTintFallback);
46
+
47
+ /** Renders a subtree under another fallback, so one Storybook build can compare them. */
48
+ export const GlyphTintFallbackProvider = GlyphTintFallbackContext.Provider;
49
+
50
+ function mix(hex: string, pole: number, share: number): string {
51
+ return `#${[1, 3, 5]
52
+ .map((offset) => {
53
+ const channel = parseInt(hex.slice(offset, offset + 2), 16);
54
+ return Math.round(channel + (pole - channel) * share)
55
+ .toString(16)
56
+ .padStart(2, "0");
57
+ })
58
+ .join("")}`;
59
+ }
60
+
61
+ /**
62
+ * `hue` moved toward the scheme's ink pole (black on a light page, white on a
63
+ * dark one) by the least amount that clears `floor` on every surface, so the
64
+ * hue survives and only its lightness gives.
65
+ */
66
+ export function holdHueToFloor(
67
+ hue: string,
68
+ surfaces: readonly (string | undefined)[],
69
+ dark: boolean,
70
+ floor: number,
71
+ ): string {
72
+ const hueHex = normalizeToHex(hue);
73
+ const lums = surfaces
74
+ .map((surface) => (surface ? normalizeToHex(surface) : null))
75
+ .filter((hex): hex is string => hex != null)
76
+ .map(relativeLuminance);
77
+ if (!hueHex || lums.length === 0) return hue;
78
+ const clears = (hex: string) => {
79
+ const lum = relativeLuminance(hex);
80
+ return lums.every((surface) => contrastRatio(lum, surface) >= floor);
81
+ };
82
+ if (clears(hueHex)) return hue;
83
+ const pole = dark ? 255 : 0;
84
+ for (let step = 1; step <= 50; step++) {
85
+ const candidate = mix(hueHex, pole, step * 0.02);
86
+ if (clears(candidate)) return candidate;
87
+ }
88
+ return dark ? "#ffffff" : "#000000";
89
+ }
90
+
91
+ export interface ResolveGlyphTintInput {
92
+ /** The theme's own identity hue on the page, when it has one. */
93
+ hue: string | undefined;
94
+ fallback: GlyphTintFallback;
95
+ dark: boolean;
96
+ surfaces: readonly (string | undefined)[];
97
+ ink: string;
98
+ }
99
+
100
+ /**
101
+ * The glyph tint (held to 3:1) and the label tint (held to AA text) for an
102
+ * icon or bar button. A hued theme keeps its hue; the house theme takes the
103
+ * fallback.
104
+ */
105
+ export function resolveGlyphTint({ hue, fallback, dark, surfaces, ink }: ResolveGlyphTintInput): {
106
+ glyph: string;
107
+ label: string;
108
+ } {
109
+ if (hue) return { glyph: hue, label: hue };
110
+ if (fallback === "ink") return { glyph: ink, label: ink };
111
+ const base =
112
+ fallback === "system" ? platformSystemTint(dark) : HOUSE_ACCENT[dark ? "dark" : "light"];
113
+ return {
114
+ glyph: holdHueToFloor(base, surfaces, dark, GLYPH_CONTRAST_FLOOR),
115
+ label: holdHueToFloor(base, surfaces, dark, aaTextContrastRatio),
116
+ };
117
+ }
118
+
119
+ /** LC-176: the live theme's icon-button tint, glyph and label. */
120
+ export function useGlyphTintOnSurface(): { glyph: string; label: string } {
121
+ const fallback = useContext(GlyphTintFallbackContext);
122
+ const dark = isDarkThemeName(useThemeName() as string | undefined);
123
+ const { hue, c1, c2, ink } = useIdentityHue();
124
+ return useMemo(
125
+ () => resolveGlyphTint({ hue, fallback, dark, surfaces: [c1, c2], ink }),
126
+ [hue, fallback, dark, c1, c2, ink],
127
+ );
128
+ }
@@ -13,6 +13,7 @@ export * from "./dynamicType";
13
13
  export * from "./fieldFocus";
14
14
  export * from "./focusState";
15
15
  export * from "./glyphPaint";
16
+ export * from "./glyphTint";
16
17
  export * from "./fontCategoryMetrics";
17
18
  export * from "./fontCategoryStacks";
18
19
  export * from "./FontKnobStyles";
@@ -250,6 +250,27 @@ export function useIdentityInkOnSurface(): string {
250
250
  );
251
251
  }
252
252
 
253
+ /**
254
+ * The live theme's identity hue on the page (the {@link useIdentityInkOnSurface}
255
+ * pick), `undefined` for a theme with no hue, with the surfaces and ink it
256
+ * was judged on.
257
+ */
258
+ export function useIdentityHue(): {
259
+ hue: string | undefined;
260
+ c1: string | undefined;
261
+ c2: string | undefined;
262
+ ink: string;
263
+ } {
264
+ const { candidates, c1, c2, ink } = useIdentityInputs();
265
+ const candidateKey = candidates.join("|");
266
+ const hue = useMemo(
267
+ () => pickIdentityInk(candidates, [c1, c2]),
268
+ // eslint-disable-next-line react-hooks/exhaustive-deps
269
+ [candidateKey, c1, c2],
270
+ );
271
+ return { hue, c1, c2, ink };
272
+ }
273
+
253
274
  const ACCENT_WASH_RATIO = 1.2;
254
275
 
255
276
  export interface ResolveAccentTintedSurfaceInput {
@@ -0,0 +1,52 @@
1
+ /**
2
+ * LC-176: what tints an icon button (and the label of a bar button beside it)
3
+ * when the theme has no hue of its own. A colour theme always tints with its
4
+ * hue; this only decides the house theme, whose accent is its text colour.
5
+ *
6
+ * - `ink`: the text colour, so the glyph reads as bold mono.
7
+ * - `system`: the platform's system tint, UIKit's default `tintColor`.
8
+ * - `accent`: one MPO house hue, the same on every platform.
9
+ */
10
+ export type GlyphTintFallback = "ink" | "system" | "accent";
11
+ /**
12
+ * The one line that picks the house theme's icon-button tint. Clay picked ink
13
+ * on compare rv_d2757722a7cb0992 (FZ-8020 r4): "Generally I would say it
14
+ * should be in black-and-white ... I don't know if we wanna color them all
15
+ * the time that might get hard to read."
16
+ */
17
+ export declare const glyphTintFallback: GlyphTintFallback;
18
+ /** WCAG 1.4.11: a glyph is a graphical object, so 3:1 holds it. */
19
+ export declare const GLYPH_CONTRAST_FLOOR = 3;
20
+ /** Android has no system tint of its own, so every platform takes iOS's. */
21
+ export declare function platformSystemTint(dark: boolean): string;
22
+ /** Renders a subtree under another fallback, so one Storybook build can compare them. */
23
+ export declare const GlyphTintFallbackProvider: import("react").Provider<GlyphTintFallback>;
24
+ /**
25
+ * `hue` moved toward the scheme's ink pole (black on a light page, white on a
26
+ * dark one) by the least amount that clears `floor` on every surface, so the
27
+ * hue survives and only its lightness gives.
28
+ */
29
+ export declare function holdHueToFloor(hue: string, surfaces: readonly (string | undefined)[], dark: boolean, floor: number): string;
30
+ export interface ResolveGlyphTintInput {
31
+ /** The theme's own identity hue on the page, when it has one. */
32
+ hue: string | undefined;
33
+ fallback: GlyphTintFallback;
34
+ dark: boolean;
35
+ surfaces: readonly (string | undefined)[];
36
+ ink: string;
37
+ }
38
+ /**
39
+ * The glyph tint (held to 3:1) and the label tint (held to AA text) for an
40
+ * icon or bar button. A hued theme keeps its hue; the house theme takes the
41
+ * fallback.
42
+ */
43
+ export declare function resolveGlyphTint({ hue, fallback, dark, surfaces, ink }: ResolveGlyphTintInput): {
44
+ glyph: string;
45
+ label: string;
46
+ };
47
+ /** LC-176: the live theme's icon-button tint, glyph and label. */
48
+ export declare function useGlyphTintOnSurface(): {
49
+ glyph: string;
50
+ label: string;
51
+ };
52
+ //# sourceMappingURL=glyphTint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glyphTint.d.ts","sourceRoot":"","sources":["../../src/theme/glyphTint.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAAyB,CAAC;AAQ1D,mEAAmE;AACnE,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAExD;AAID,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,6CAAoC,CAAC;AAa3E;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,EACzC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,CAkBR;AAED,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAC1C,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,qBAAqB,GAAG;IAC/F,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CASA;AAED,kEAAkE;AAClE,wBAAgB,qBAAqB,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQxE"}
@@ -13,6 +13,7 @@ export * from "./dynamicType";
13
13
  export * from "./fieldFocus";
14
14
  export * from "./focusState";
15
15
  export * from "./glyphPaint";
16
+ export * from "./glyphTint";
16
17
  export * from "./fontCategoryMetrics";
17
18
  export * from "./fontCategoryStacks";
18
19
  export * from "./FontKnobStyles";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,MAAM,IAAI,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjF,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cA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ACzB,OAAO,EACL,eAAe,IAAI,kBAAkB,EACrC,kBAAkB,EAClB,WAAW,EACX,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEpF,cAAc,YAAY,CAAC"}
@@ -67,6 +67,17 @@ export declare function useAccentOnSurface(): string;
67
67
  * {@link useAccentOnSurface} does there.
68
68
  */
69
69
  export declare function useIdentityInkOnSurface(): string;
70
+ /**
71
+ * The live theme's identity hue on the page (the {@link useIdentityInkOnSurface}
72
+ * pick), `undefined` for a theme with no hue, with the surfaces and ink it
73
+ * was judged on.
74
+ */
75
+ export declare function useIdentityHue(): {
76
+ hue: string | undefined;
77
+ c1: string | undefined;
78
+ c2: string | undefined;
79
+ ink: string;
80
+ };
70
81
  export interface ResolveAccentTintedSurfaceInput {
71
82
  solid?: string;
72
83
  paper?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"readableColor.d.ts","sourceRoot":"","sources":["../../src/theme/readableColor.ts"],"names":[],"mappings":"AA2BA;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAU/E;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,SAAS,EACT,KAAK,EACL,GAAG,GACJ,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,GAAG,SAAS,CAarB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAYpF;AA0CD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,QAAQ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